Commit Graph

144 Commits

Author SHA1 Message Date
Sylvestre Ledru
e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Steve Fink
51b13c2f1f Bug 1487167 - Various DOM rooting issues. r=bz 2018-08-28 21:26:50 -07:00
Jon Coppeard
c8a7c5aaeb Bug 1483487 - Fix static analysis bustage and add missing comments on a CLOSED TREE r=me 2018-08-20 11:13:33 +01:00
Jon Coppeard
b3c11f6b0d Bug 1483487 - Add asertions around creating and retrieving DOM proxy expando objects r=peterv 2018-08-20 10:12:35 +01:00
Adrian Wielgosik
3c7a24d734 Bug 1170771 - Remove now-empty nsDOMClassInfo. r=bz
MozReview-Commit-ID: 7XsiPD1kTt9
2018-04-05 14:20:44 +02:00
Tom Schuster
6ca48501c1 Bug 638054 - Remove watch class-hook and proxy trap r=jorendorff,bz 2017-10-24 20:48:14 +02:00
Jan de Mooij
9e74eb50a5 Bug 1393790 part 2 - Remove JS_PropertyStub and JS_StrictPropertyStub. r=jorendorff 2017-08-28 10:40:19 +02:00
Boris Zbarsky
6b3bf62d10 Bug 1189822 part 5. Remove the now-unnecessary DOMProxyHandler::ClearExternalRefsForWrapperRelease function. r=peterv
All DOMProxyHandler::ClearExternalRefsForWrapperRelease now does is clear a backpointer to the expando, and that's handled during reflector finalization already.
2017-05-17 00:52:53 -04:00
Boris Zbarsky
6b965648bf Bug 1189822 part 1. Switch DOMProxyHandler::EnsureExpandoObject to using normal wrapper preservation instead of RegisterDOMExpandoObject. r=peterv 2017-05-17 00:52:52 -04:00
Jan de Mooij
6ad0a86b42 Bug 1237504 - Refactor proxy slot layout to allow proxies to have more than 2 slots. r=bz,jonco
The patch makes the following proxy changes:

* The number of slots in ProxyValueArray is now dynamic and depends on the number of reserved slots we get from the Class.
* "Extra slots" was renamed to "Reserved slots" to make this clearer.
* All proxy Classes now have 2 reserved slots, but it should be easy to change that for proxy Classes that need more than 2 slots.
* Proxies now store a pointer to these slots and this means GetReservedSlot and SetReservedSlot can be used on proxies as well. We no longer need GetReservedOrProxyPrivateSlot and SetReservedOrProxyPrivateSlot.

And some changes to make DOM Proxies work with this:

* We now store the C++ object in the first reserved slot (DOM_OBJECT_SLOT) instead of in the proxy's private slot. This is pretty nice because it matches what we do for non-proxy DOM objects.
* We now store the expando in the proxy's private slot so I removed GetDOMProxyExpandoSlot and changed the IC code to get the expando from the private slot instead.
2017-04-28 14:12:28 +02:00
Boris Zbarsky
2afabb73c8 Bug 1294747. Make sure we expose the expando of a [OverrideBuiltins] proxy to active JS when it gets cleared from the proxy. r=peterv
This should also fix bug 1296775 and bug 1290359.

There's a very good chance it will also fix bug 1293386, bug 1292855, bug
1289452, and bug 1303340: those would get hit if we happened to start _another_
gc after the expando died but while it was still in the Rooted.  All of them
seem to be dying under the domClass->mGetProto call, which could finish up a GC
that kills the expando and then do _another_ one, causing the Rooted to try to
mark a dead object.
2016-09-15 15:04:56 -04:00
Phil Ringnalda
59419e7203 Backed out changeset a4ef0b5b78cb (bug 1294747) for debug Android jsreftest crashes
CLOSED TREE
2016-09-15 20:47:39 -07:00
Boris Zbarsky
aff6d3ab87 Bug 1294747. Make sure we expose the expando of a [OverrideBuiltins] proxy to active JS when it gets cleared from the proxy. r=terrence
This should also fix bug 1296775 and bug 1290359.

There's a very good chance it will also fix bug 1293386, bug 1292855, and bug
1289452: those would get hit if we happened to start _another_ gc after the
expando died but while it was still in the Rooted.  All of them seem to be
dying under the domClass->mGetProto call, which could finish up a GC that kills
the expando and then do _another_ one, causing the Rooted to try to mark a dead
object.
2016-09-15 15:04:56 -04:00
Boris Zbarsky
2ec6efc698 Bug 1288581 followup. Remove a bogus comment. DONTBUILD. 2016-07-22 17:20:49 -04:00
Boris Zbarsky
537e81d2e2 Bug 1288581 part 1. Start tracing the expando object, if any, inside the ExpandoAndGeneration of a shadowing DOM proxy from that proxy's trace hook. r=smaug 2016-07-22 16:19:52 -04:00
Jeff Walden
73ae0a51ca Bug 888969 - Permit a cyclic [[Prototype]] chain to be created through a Location object. r=bz, r=efaust 2016-04-29 19:59:40 -07:00
Tom Schuster
e02e8c9f95 Bug 1256688 - Change BPH::has to follow [[HasProperty]] for ordinary objects. r=jorendorff 2016-03-19 01:30:03 +01:00
Boris Zbarsky
f99662f676 Bug 1254293. Fix dom::GetArrayIndexFromId to actually follow the spec for large indices (i.e. ones that don't fit in in int32_t). r=peterv 2016-03-08 17:21:40 -05:00
Tom Schuster
079c82b6cc Bug 1246318 - Make the proxy enumerate trap non-standard. r=efaust 2016-02-10 00:12:24 +01:00
Tom Schuster
05bbc0341d Bug 1242214 - Rename JSPropertyDescriptor JS::PropertyDescriptor everywhere else. r=smaug 2016-01-28 11:28:04 +01:00
Terrence Cole
88f9bc5932 Bug 1178581 - Interning does not and should not imply infinite lifetime; r=sfink 2015-06-30 07:58:31 -07:00
Jason Orendorff
3fee1108cd Bug 1125624, part 3 - Remove js::StandardDefineProperty and js::DefineOwnProperty. r=Waldo. 2015-05-29 16:48:26 -05:00
Carsten "Tomcat" Book
7d40d51ca0 Backed out changeset 94f14d6b26d5 (bug 1125624) 2015-06-17 11:02:59 +02:00
Jason Orendorff
0db5332b32 Bug 1125624, part 3 - Remove js::StandardDefineProperty and js::DefineOwnProperty. r=Waldo. 2015-05-29 16:48:26 -05:00
Terrence Cole
3ffd505617 Bug 1164602 - Replace js::NullPtr and JS::NullPtr with nullptr_t; r=sfink 2015-05-13 14:07:34 -07:00
Tom Schuster
eaca072f51 Bug 1161101 - Use JS_GetOwnPropertyDescriptor instead of GetPropertyDescriptor in dom/bindings. r=bz 2015-05-04 20:27:02 +02:00
Andrew McCreight
92010d3e4c Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
Tom Schuster
27867580df Bug 1159347 - Make BaseProxyHandler::getPropertyDescriptor not-pure virtual. r=efaust 2015-04-29 10:47:48 +02:00
Jason Orendorff
a62fc1c850 Bug 1142794 - Change 'receiver' argument to SetProperty functions and ProxyHandler::set methods to be a HandleValue. r=Waldo.
Also: Change signature of these functions and methods to all have the same arguments in the same order: (cx, obj, id, v, receiver). Also change v from MutableHandleValue to HandleValue.

There is no change in behavior.

In fact the new error message `JSMSG_SET_NON_OBJECT_RECEIVER` is
impossible to trigger from scripts for now, I think (after re-reading
the whole patch with this in mind). JS_ForwardSetPropertyTo is the only
way to get a non-object receiver into the engine, but no caller
currently does so.

We're installing new pipes here, and they should work, but for now it's
the same cold water flowing through as before. Actually hooking up the
hot water is left for another bug (one with tests, not to put too fine a
point on it).

Notes:

*   InvokeGetterOrSetter had to be split into two functions:
    InvokeGetter takes a MutableHandleValue out-param,
    InvokeSetter a HandleValue in-param.

*   Watchpoints can still tamper with values being assigned. So can
    JSSetterOps. I'm pleased we can support this craziness in a way that
    doesn't have to spread via the type system to encompass the entire
    codebase.

*   Change in GlobalObject::setIntrinsicValue is not really a change.
    Yes, it asserted before, but an exception thrown during self-hosting
    initialization is not going to go unnoticed either.

*   Since the receiver argument to js::SetProperty() is at the end now, it
    makes sense for it to be optional. Some callers look nicer.
2015-03-01 13:16:19 -06:00
Jason Orendorff
f8862424e5 Bug 1142784, part 2 - Change ProxyHandler::defineProperty() to make the desc argument a non-mutable handle. r=Waldo. 2015-02-17 11:58:43 -06:00
Phil Ringnalda
2b0920d57e Backed out 9 changesets (bug 1142775, bug 1139683, bug 1143810, bug 1142761, bug 1142784, bug 1142794, bug 1144819) for widespread bustage
CLOSED TREE

Backed out changeset 7613fc978d36 (bug 1142794)
Backed out changeset e5f0cb31263d (bug 1142784)
Backed out changeset dcd0af73ac84 (bug 1142784)
Backed out changeset 034f9c8e79ee (bug 1142784)
Backed out changeset ce0ee37e3ca9 (bug 1142775)
Backed out changeset 1519b8f2bbba (bug 1142761)
Backed out changeset 26fd55677841 (bug 1139683)
Backed out changeset 7ebc76a450c3 (bug 1144819)
Backed out changeset 92adb459d519 (bug 1143810)
2015-03-22 09:34:25 -07:00
Jason Orendorff
f3c165da67 Bug 1142794 - Change 'receiver' argument to SetProperty functions and ProxyHandler::set methods to be a HandleValue. r=Waldo.
Also: Change signature of these functions and methods to all have the same arguments in the same order: (cx, obj, id, v, receiver). Also change v from MutableHandleValue to HandleValue.

There is no change in behavior.

In fact the new error message `JSMSG_SET_NON_OBJECT_RECEIVER` is
impossible to trigger from scripts for now, I think (after re-reading
the whole patch with this in mind). JS_ForwardSetPropertyTo is the only
way to get a non-object receiver into the engine, but no caller
currently does so.

We're installing new pipes here, and they should work, but for now it's
the same cold water flowing through as before. Actually hooking up the
hot water is left for another bug (one with tests, not to put too fine a
point on it).

Notes:

*   InvokeGetterOrSetter had to be split into two functions:
    InvokeGetter takes a MutableHandleValue out-param,
    InvokeSetter a HandleValue in-param.

*   Watchpoints can still tamper with values being assigned. So can
    JSSetterOps. I'm pleased we can support this craziness in a way that
    doesn't have to spread via the type system to encompass the entire
    codebase.

*   Change in GlobalObject::setIntrinsicValue is not really a change.
    Yes, it asserted before, but an exception thrown during self-hosting
    initialization is not going to go unnoticed either.

*   Since the receiver argument to js::SetProperty() is at the end now, it
    makes sense for it to be optional. Some callers look nicer.
2015-03-01 13:16:19 -06:00
Jason Orendorff
0c2cf8be27 Bug 1142784, part 2 - Change ProxyHandler::defineProperty() to make the desc argument a non-mutable handle. r=Waldo. 2015-02-17 11:58:43 -06:00
Jason Orendorff
96bd1d579b Bug 1130537 - Reimplement js::SetPropertyIgnoringNamedGetter to follow ES6 draft rev 32 9.1.9 [[Set]]. r=efaust. 2015-02-06 16:55:49 -06:00
Jason Orendorff
6e6ba315a5 Bug 1113369, part 6 - [[PreventExtensions]] ObjectOpResult support. r=Waldo, r=bz in dom, r=dvander in js/ipc, r=bholley in js/xpconnect. 2015-02-04 12:01:01 -06:00
Jason Orendorff
20beb2cc48 Bug 1113369, part 5 - [[Delete]] ObjectOpResult support. r=Waldo, r=bz in dom, r=dvander in js/ipc, r=bholley in js/xpconnect. 2015-02-04 10:20:04 -06:00
Jason Orendorff
b180889659 Bug 1113369, part 4 - [[Set]] ObjectOpResult support. r=Waldo, r=bz in dom, r=dvander in js/ipc, r=bholley in js/xpconnect. 2015-02-03 19:51:40 -06:00
Jason Orendorff
1d3bb8fb3d Bug 1113369, part 3 - [[DefineOwnProperty]] ObjectOpResult support. r=Waldo, r=bz in dom, r=dvander in js/ipc, r=bholley in js/xpconnect.
Add an ObjectOpResult out-param for DefineProperty functions everywhere. We leave a few js::DefineProperty() convenience functions with no *result out-param. These have strict behavior: that is, they automatically check the result and throw if it is false. In bug 1125624 these strict signatures may end up being called DefinePropertyOrThrow, as that is what the spec calls it.
2015-01-30 11:37:07 -06:00
Jan de Mooij
b3f1ff13a2 Bug 1137523 - Unprefix most js_* functions. r=bhackett CLOSED TREE 2015-02-27 16:08:15 +01:00
Boris Zbarsky
edb59add32 Bug 1133746. Allow DOMProxyShadows to communicate to the JIT whether the shadowing is done by the expando object or not. r=efaust,peterv 2015-02-26 12:30:02 -05:00
Boris Zbarsky
6f95b6109f Bug 1131796. Don't parent the DOM proxy expando object to the proxy. r=peterv 2015-02-13 14:34:53 -05:00
Wes Kocher
69de55c668 Backed out changeset 4d03c3ba2969 (bug 1131796) for bustage on a CLOSED TREE 2015-02-13 13:25:45 -08:00
Boris Zbarsky
3b94e5b2c1 Bug 1131796. Don't parent the DOM proxy expando object to the proxy. r=peterv 2015-02-13 14:34:53 -05:00
Tom Schuster
147cbd415a Bug 783829 - Remove getEnumerablePropertyKeys. r=efaust,bholley 2014-12-17 00:28:38 +01:00
Tom Schuster
a3bf7d8937 Bug 783829 - Change from Proxy iterate to enumerate. r=efaust,bholley 2014-12-17 00:28:38 +01:00
Tom Schuster
892aa58156 Bug 783829 - Rename Proxy enumerate trap to getEnumerablePropertyKeys. r=efaust 2014-11-14 16:21:12 +01:00
Boris Zbarsky
faf9c68f5c Bug 1087404. Get rid of XPCQuickStubs.h/cpp. r=bholley 2014-10-23 15:21:46 -04:00
Jeff Walden
33ab4b19be Bug 1052139 - Reorder the preventExtensions trap just after the [[Prototype]]-access traps. r=code-motion 2014-10-21 11:40:04 -07:00
Jeff Walden
7eab2a3226 Bug 1085566 - Make the preventExtensions hook return succeeded/failed rather than always indicate failure by reporting an error. r=efaust 2014-10-19 01:18:43 -07:00
Carsten "Tomcat" Book
77dee816cc Backed out changeset 9e900e87b4bb (bug 1085566) 2014-10-22 08:59:09 +02:00