Commit Graph

163 Commits

Author SHA1 Message Date
Sylvestre Ledru
68b806d604 Bug 1674637 - Use nested namespaces in dom/ r=sg,andi
Also add some missing namespace qualifications

Done with:
./mach static-analysis check --checks="-*,modernize-concat-nested-namespaces" --fix dom/
./mach clang-format -p $(hg status dom/|grep ^M|awk '{print $2}')

Differential Revision: https://phabricator.services.mozilla.com/D95456
2020-11-04 17:04:01 +00:00
Butkovits Atila
a6e7dcc53f Backed out changeset c0adbf7522dc (bug 1674637) for bustage on GMPParent.cpp. CLOSED TREE 2020-11-04 10:54:36 +02:00
Sylvestre Ledru
8f709b39e8 Bug 1674637 - Use nested namespaces in dom/ r=sg,andi
Also add some missing namespace qualifications

Done with:
./mach static-analysis check --checks="-*,modernize-concat-nested-namespaces" --fix dom/
./mach clang-format -p $(hg status dom/|grep ^M|awk '{print $2}')

Differential Revision: https://phabricator.services.mozilla.com/D95456
2020-11-04 08:29:00 +00:00
Sylvestre Ledru
c4843648f0 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D90793
2020-09-20 10:14:09 +00:00
Jeff Walden
06de8f4ca7 Bug 1663365 - Move DOM proxy-related details (including expand support) to separate headers out of jsfriendapi.h. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D89336
2020-09-08 22:57:14 +00:00
Jeff Walden
1760d6f90a Bug 1663365 - Move various Object-related functions to a new js/public/Object.h header. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D89333
2020-09-08 22:55:38 +00:00
Matthew Gaudet
45fa4a130c Bug 1655443 - Redesign private name proxy support to be more clear and simpler r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D84866
2020-07-27 21:08:42 +00:00
Matthew Gaudet
f0605d3861 Bug 1653567 - Redesign Private Fields implementation to reduce complexity r=jorendorff
Adds CheckPrivateField, and uses it to guard private field access before
calling regular element ops, rather than having custom element ops

CheckPrivateField takes two arguments: A ThrowCondition, a message, then using
the top two elements of the stack determines if a throw is required, and if it
is not, places on top of the stack whether or not the field exists.

This design is nice because it means that we'll be able to easily use this
opcode for implementing private methods and ergonomic brand checks for private
fields.

This patch implements the new opcode, deletes the old PrivateElem ops,
and provides Baseline callVM support. It's future work to provide IC, Ion and
Warp support.

Differential Revision: https://phabricator.services.mozilla.com/D83941
2020-07-27 20:11:25 +00:00
Matthew Gaudet
5f75671b2e Bug 1644160 - Use DOM Proxy Expando to hold private fields, rather than allocating Proxy Expando r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D83556
2020-07-20 13:49:10 +00:00
Butkovits Atila
ce7b9bf861 Backed out 6 changesets (bug 1644160, bug 1652744) for failure at proxy-ccw.js CLOSED TREE
Backed out changeset ce53b1934083 (bug 1644160)
Backed out changeset 36ea51123a56 (bug 1652744)
Backed out changeset bc43898badcd (bug 1644160)
Backed out changeset 09df89442319 (bug 1644160)
Backed out changeset 3c88625982cf (bug 1644160)
Backed out changeset 598d65b8afb5 (bug 1644160)
2020-07-20 16:46:17 +03:00
Matthew Gaudet
da296da3ec Bug 1644160 - Use DOM Proxy Expando to hold private fields, rather than allocating Proxy Expando r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D83556
2020-07-17 21:02:34 +00:00
Tom Schuster
de53fdd6e2 Bug 1170775 - Rename DOM Xray DefineProperty parameter from *defined to *done. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D68721
2020-04-02 05:44:22 +00:00
Steve Fink
44bb6723b1 Bug 1583684 - Fix some rooting hazards in DOM bindings r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D47020
2019-09-26 23:50:14 +00:00
Andrew McCreight
5c13002992 Bug 1510760, part 2 - Add the remote proxy handler to SetDOMProxyInformation. r=peterv,tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D37596
2019-07-18 19:36:13 +00:00
Noemi Erli
4321d3240d Backed out 5 changesets (bug 1510760) for bustages in nsGlobalWindowOuter.cpp
Backed out changeset 19a972ea7855 (bug 1510760)
Backed out changeset 524ac8b3040d (bug 1510760)
Backed out changeset 3bc5442338bc (bug 1510760)
Backed out changeset cb12d4068aca (bug 1510760)
Backed out changeset 75b769608cce (bug 1510760)
2019-07-18 19:18:47 +03:00
Andrew McCreight
201b36467c Bug 1510760, part 2 - Add the remote proxy handler to SetDOMProxyInformation. r=peterv,tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D37596
2019-07-18 15:02:47 +00:00
Sylvestre Ledru
72e7e7d7e7 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D27245
2019-04-12 13:14:25 +00:00
Yoshi Cheng-Hao Huang
a25ab4464c Bug 1534967 - Part 1: use RootedIdVector. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D25042
2019-04-08 10:46:53 +08:00
Jon Coppeard
463540bf43 Bug 1306008 - Remove unnecessary expose call in DOMProxyHandler r=bzbarsky
This call is not necessary now that Heap<T> has a pre-barrier which does this automatically.

Differential Revision: https://phabricator.services.mozilla.com/D25086
2019-03-27 16:26:23 +00:00
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