Commit Graph

24004 Commits

Author SHA1 Message Date
Bobby Holley
bc4863413b Bug 823348 - Tests. r=mrbkap
We tack these onto the tests from bug 812415, adding coverage for
nsExpandedPrincipal and making sure that the waivers are deep.

We also take the opportunity to check the asymmetric security
relationship between a principal and its corresponding nsEP.
2013-01-23 06:04:39 +01:00
Bobby Holley
ded682bc4a Bug 823348 - Stop checking for Xray waivers in the Xray machinery. r=mrbkap
All the casese where we want to waive should now be going through WaiveXrayWrapper.
2013-01-23 06:04:39 +01:00
Bobby Holley
4e3138cf29 Bug 823348 - Replace security wrapper enumeration with a more rule-based approach. r=mrbkap 2013-01-23 06:04:39 +01:00
Bobby Holley
f7f57d1c83 Bug 823348 - Hoist special cases to the top of WrapperFactory::Rewrap. r=mrbkap
This paves the way for more rule-based selection of wrappers in the common case.
2013-01-23 06:04:39 +01:00
Bobby Holley
0d89c821ca Bug 823348 - Move COW prototype remapping out of wrapper selection. r=mrbkap
It's pretty orthogonal, and makes the critical block more complicated than it
needs to be.
2013-01-23 06:04:39 +01:00
Bobby Holley
08c058f711 Bug 823348 - Precompute various parameters in Rewrap. r=mrbkap
This is generally cleaner, and avoids potentially calling these functions
multiple times when we start moving this stuff around.
2013-01-23 06:04:39 +01:00
Bobby Holley
39b3f7c72e Bug 823348 - Use GetXrayType for content->chrome Xray wrappers. r=mrbkap
There's no reason to do this any different than we do for XOWs and such. The
only thing this might conceivably support would be certain chrome XPWNs-as-COWs.
But that would require that they forced a parent in precreate without being
flagged as DOM objects in classinfo. And it's not clear why we'd want to support
that. And we're generally moving away from COWs anyway.
2013-01-23 06:04:39 +01:00
Bobby Holley
69822a012d Bug 823348 - Use EnsureCompartmentPrivate In Rewrap and stop checking for null. r=mrbkap 2013-01-23 06:04:39 +01:00
Bobby Holley
c3882ecf88 Bug 823348 - Flip off the wantXrays for chrome sandboxes. r=mrbkap
wantXrays means that the sandbox wants Xray wrappers even when accessing same-
origin content. The default is true, which Blake says has something to do with
GreaseMonkey and days of old.

This flag never had an effect for chrome, because the chrome->chrome case always
short-circuited to &CrossCompartmentWrapper::singleton. But once we start
respecting the flag as a general-purpose indicator that Xrays should be applied
same-origin, we need to either add a special case in Rewrap or make the flag reflect
reality. The latter seems cleaner and more sane.

However, things are complicated by the fact that there's also a completely different,
orthogonal usage, whereby setting wantXrays to false implicitly waives Xray on the
returned sandbox _and_ on any results returned from evalInSandbox. This is just nuts.
The former can be accomplished by callers manually using .wrappedJSObject, and the
latter by having EvalInSandbox transitively apply waivers from their sandbox arguments.

I've updated the documentation on the MDN page so that it only describes the
reasonable usage. The next step is to get rid of the crazy behavior. I think the
best path of migration is to have wantXrays: false keep implicitly waiving, but
waive return values from EvalInSandbox based on whether the argument was waived. This
patch does that.
2013-01-23 06:04:39 +01:00
Bobby Holley
44a21fc15a Bug 823348 - Make NNXOWs use an explicitly opaque Policy. r=mrbkap
There's no reason to be doing a dynamic check here, given that the JSClasses
will never match. Lets be explicit and safe.
2013-01-23 06:04:38 +01:00
Bobby Holley
ddece7045a Bug 823348 - Do a better job of lying about the holder and make assertions fatal. r=mrbkap
I noticed this nonfatal assertion firing, unrelated to my patches. Leaking
the holder is not so great. Let's fix this for real.
2013-01-23 06:04:38 +01:00
Bobby Holley
d0a9794947 Bug 823348 - Remove broken and unused __scriptOnly__ check. r=mrbkap
__scriptOnly__ is unused on mxr and addons-mxr. Morevoer, the current
implementation is totally broken, because we check for NNXOW, which only
happens when a random content JS object ends up in some other cross-origin
scope (via addons, presumably), whereas chrome objects use ChomeObjectWrapper.

I'm soon going to replace SCRIPT_ACCESS_ONLY with checked unwrapping, and mark
all COWs as unsafe to unwrap (see bug 821573 and bug 658909). So let's just kill
this thing here.
2013-01-23 06:04:38 +01:00
Bobby Holley
c0cc2fa626 Bug 823348 - Don't set universalXPConnectEnabled for chrome compartments. r=mrbkap
There's a browser-chrome test that does this, which means that _all_ subsequent
browser-chrome tests inherit it. So depending on the ordering of cases in
WrapperFactory, we might end up using a CrossCompartmentWrapper rather than an
XrayWrapper, meaning that stuff like nodePrincipal doesn't work anymore.

The semantics of UniversalXPConnect are now entirely dicatated by what makes
our test suite go green. So let's not force ourselves to bend over backwards
during wrapping to handle this case. And let's fix that stupid test while
we're at it.
2013-01-23 06:04:38 +01:00
Bobby Holley
71cfd0816b Bug 823348 - Uninline UniversalXPConnect management. r=mrbkap
Every time the layout of CompartmentPrivate changes, I forget to rebuild in
caps/ and spend half an hour wondering what the heck is going on. :-(
2013-01-23 06:04:38 +01:00
Ehsan Akhgari
94b2981ab9 Bug 833631 - Unprefix mozAudioContext; r=roc
--HG--
extra : rebase_source : 3c477a97ea842a806f6fad6f5c3a81d6e50b27c3
2013-01-22 20:12:21 -05:00
Eddy Bruel
06d31700df Bug 568953 - Fix for build warning; r=Ms2ger 2013-01-21 19:02:41 +01:00
Bill McCloskey
6ffd7450d7 Bug 833163 - Remove bogus scheduledForDestruction assertion (r=luke) 2013-01-22 14:15:25 -08:00
Daniel Holbert
d02182eb9e Bug 833405: Don't treat deprecated-declarations build warnings as errors, in --enable-warnings-as-errors builds. r=ted 2013-01-22 13:28:16 -08:00
Justin Lebar
5aa3188b54 Bug 832620 - Skip the GCC <= 4.4 version check when building with clang. r=glandium 2013-01-22 16:14:27 -05:00
Justin Lebar
505b6cd144 Bug 832623 - Disable -fstrict-aliasing in the JS engine for gcc <= 4.4 on all platforms, not just Linux/Android. r=glandium 2013-01-22 16:14:27 -05:00
Jan de Mooij
33dee1099a Bug 832373 part 2 - Refactor initExecuteFrame to use AbstractFramePtr. r=luke a=nonlibxul 2013-01-22 14:33:43 +01:00
Jan de Mooij
7cad99bba1 Bug 831754 part 2 - Add patchable call instruction, x86/x64 part. r=dvander a=nonlibxul 2013-01-22 14:33:36 +01:00
Jan de Mooij
97406e74ca Bug 831754 part 1 - Add patchable call instruction, ARM part. r=mjrosenb a=nonlibxul 2013-01-22 14:33:07 +01:00
Jon Coppeard
519e8a2061 Bug 831750 - GC: testConservativeGC jsapi test fails with rooting analysis r=terrence a=nonlibxul 2013-01-21 11:00:29 +00:00
Jan de Mooij
cbe560bda6 Bug 830885 - Factor out interpreter/debugger exception unwinding code. r=jorendorff a=nonlibxul 2013-01-22 09:46:52 +01:00
Jan de Mooij
a4913b2eab Bug 832950 - Remove frame annotations from SpiderMonkey. r=luke a=nonlibxul 2013-01-22 09:34:17 +01:00
Brian Hackett
5d34c466fc Bug 832329 - Improve analysis of definite properties for 'new' scripts, r=jandem, a=nonlibxul. 2013-01-21 17:10:21 -07:00
Hannes Verschore
0b94fc1e7a Bug 831087 - IonMonkey: Differential Testing: Getting different output w/without --ion-eager with /= r=mjrosenb a=nonlibxul 2013-01-21 13:26:26 -08:00
Jan de Mooij
6d48ca1b60 Bug 832373 part 1 - Refactor eval-in-frame to use AbstractFramePtr. r=luke 2013-01-21 13:58:50 +01:00
Nicholas Nethercote
0293b60b78 Bug 394311 - Stop building with -pedantic. r=ted,dbaron.
--HG--
rename : content/svg/content/nsISVGPoint.cpp => content/svg/content/src/DOMSVGPoint.cpp
rename : docshell/test/browser/browser_bug234628-9.js => docshell/test/browser/browser_bug134911.js
rename : layout/reftests/w3c-css/submitted/values3/calc-background-image-gradient-1-ref.html => layout/reftests/css-calc/background-image-gradient-1-ref.html
rename : layout/reftests/w3c-css/submitted/values3/calc-background-image-gradient-1.html => layout/reftests/css-calc/background-image-gradient-1.html
rename : layout/reftests/w3c-css/submitted/values3/reftest.list => layout/reftests/css-calc/reftest.list
rename : layout/reftests/text/auto-hyphenation-10-ref.html => layout/reftests/text/auto-hyphenation-10.html
rename : layout/reftests/text/auto-hyphenation-8-ref.html => layout/reftests/text/auto-hyphenation-8.html
rename : layout/reftests/text/auto-hyphenation-9-ref.html => layout/reftests/text/auto-hyphenation-9.html
extra : rebase_source : 012df725d55b031ccc03d9bfcf785056d95a2ebe
2013-01-20 14:12:42 -08:00
Brian Hackett
ecff87a86d Bug 821361 - Optimize type information in closures that only run once, r=luke. 2013-01-20 02:49:21 -07:00
Brian Hackett
cf01f4f12b Bug 832425 - gcPreserveCode() should be defined when not using JS_GC_ZEAL, r=h4writer. 2013-01-19 17:30:05 -07:00
Steve Fink
d3f194fbfb Bug 828753 - jsid rooting, mostly in jsinfer.*. Also switch JSObject from struct to class. r=terrence 2012-12-31 12:40:21 -08:00
Mike Hommey
95364307b9 Bug 831790 - Use the buildconfig python module for expandlibs_config. r=ted
--HG--
rename : config/expandlibs_config.py.in => config/expandlibs_config.py
rename : js/src/config/expandlibs_config.py.in => js/src/config/expandlibs_config.py
2013-01-19 09:45:50 +01:00
Brian Hackett
f390dd132a Bug 832042 - Reduce cost of exact stack rooting during addition operations, r=terrence. 2013-01-18 20:35:08 -07:00
Terrence Cole
6b98628bf0 Bug 803182 - Make the js shell stack limit match the browser's; r=dmandelin
This should help ensure that recursion errors found in the shell actually
represent real errors. This also attempts to account for the difference in size
between debug and optimized builds to the size of js::Interpret's stack frame.
2012-10-29 13:36:41 -07:00
Luke Wagner
9e1aa92b57 Bug 832094 - make the top-level function ParseNode always be a PNK_FUNCTION (r=jorendorff)
--HG--
extra : rebase_source : f6af6da88e185ccc62152ef1013dfeba1418cbc7
2012-11-28 16:33:00 -08:00
Luke Wagner
eddfaf40ed Bug 832085 - Never bail in truncated LModI/LModPowTwoI/LModMaskI (r=hv1989)
--HG--
extra : rebase_source : efa4ec10c37fdec3861ac5097db7c5b5c2ade63b
2012-12-07 18:54:05 -08:00
Luke Wagner
ef48ad6a69 Bug 832085 - Simplify LModI codegen (r=hv1989)
--HG--
extra : rebase_source : a4790f4036478b274f461bcf5052c7f88dd32889
2012-12-07 18:54:05 -08:00
Luke Wagner
9d7870db02 Bug 832085 - Never bail in truncated LDivI (r=hv1989)
--HG--
extra : rebase_source : 1e03a172ddd450a2d63822b2a0522efc6429fa76
2012-12-07 18:54:05 -08:00
Luke Wagner
d4d45622ee Bug 832079 - IonMonkey: common out MDiv lowering (r=dvander)
--HG--
extra : rebase_source : 5afa690efc26a859ceb980dddfeaa27a505cf9d6
2012-12-07 18:54:05 -08:00
Luke Wagner
d87fb1100e Bug 832073 - s/ScaleFromShift/ScaleFromElemWidth/ (r=dvander)
--HG--
extra : rebase_source : 113e5770c8f6c6ad67e55bdd341e79e03bb29ff9
2012-12-14 10:27:15 -08:00
Luke Wagner
d8c9cd65c3 Bug 832071 - Replace custom AutoDestroyAllocator with ScopedJSDeletePtr (and rename ScopedDeletePtr to ScopedJSDeletePtr) (r=dvander)
--HG--
extra : rebase_source : 84229d3a9453d3f4aab8a84583b6e0d1e0e3a0a4
2012-11-01 21:35:21 -07:00
Luke Wagner
a876f5a6c5 Bug 832070 - LTruncateDToInt32 doesn't need a snapshot (r=sstangl)
--HG--
extra : rebase_source : 0c273db1eb30aa2a51571ac31ce7d160792b61a4
2012-12-07 18:54:05 -08:00
Luke Wagner
f1f2f19fb7 Bug 832065 - don't use resume point to iterate over phis (r=sstangl)
--HG--
extra : rebase_source : 0c54df0ad7fb5daba820efaa49a1d8eb7e355104
2012-11-28 15:19:39 -08:00
Luke Wagner
991d6e76f9 Bug 832063 - unify Assembler::flush/finish (r=mrosenberg)
--HG--
extra : rebase_source : baa26470724b55df9b7945fc16f4e697a4ec703e
2012-12-20 19:12:24 -08:00
Luke Wagner
f4a045e99e Bug 832090 - make HashMap/Set movable (r=terrence)
--HG--
extra : rebase_source : 7c6a7a0d03bf361f2ee7c853f7f07bf15841b21b
2012-11-28 15:19:39 -08:00
Benjamin Peterson
967500fe0b Bug 832151 - Make js_ErrorFormatString const. r=jorendorff
--HG--
extra : rebase_source : 4281941f6c31d5e8a5b6af1662e8f67ba722c934
2013-01-18 19:35:37 -05:00
Terrence Cole
4f833cf406 Bug 832489 - Un-bitrot the post barrier verifier; r=billm
--HG--
extra : rebase_source : 2c385bcc55f952dc7795c8770af6faeafb172ee8
2013-01-18 10:04:17 -08:00
Tom Schuster
e389791a45 Bug 830590 - GC: ArrayToIdVector's trapName needs to be a Handle. r=terrence 2013-01-18 22:44:52 +01:00