Commit Graph

511 Commits

Author SHA1 Message Date
Sylvestre Ledru
055d8432e6 Bug 1443080 - Use the static call for static methods (not instance) r=Ehsan
MozReview-Commit-ID: JwHh4bzxuTR
2018-03-16 14:29:15 +01:00
Coroiu Cristina
8c03201dcc Backed out 2 changesets (bug 1443080) for spidermonkey build bustage at build/src/js/src/jit/BaselineCacheIRCompiler.cpp
Backed out changeset 7d509bb8a35d (bug 1443080)
Backed out changeset 53bdcd5937cd (bug 1443080)
2018-03-14 11:13:21 +02:00
Sylvestre Ledru
4a52aab337 Bug 1443080 - Use the static call for static methods (not instance) r=Ehsan
MozReview-Commit-ID: JwHh4bzxuTR
2018-03-05 13:43:54 +01:00
Jason Orendorff
d640df5146 Bug 1439063 - Part 1: Move several public headers from js/src to js/public. r=jandem.
js/src/jsalloc.h -> js/public/AllocPolicy.h
jsalloc.cpp -> js/src/util/AllocPolicy.cpp
jsbytecode.h -> merge into js/public/TypeDecls.h
jsprf.h -> js/public/Printf.h
jsprf.cpp -> js/src/util/Printf.cpp
jsprototypes.h -> public/ProtoKey.h
jswrapper.h -> js/Wrapper.h
2018-02-21 10:30:19 -06:00
Jason Orendorff
e9576b9646 Bug 1409676 - Trivial code cleanup around XrayTraits. r=mrbkap 2017-10-18 11:09:10 +01:00
Nika Layzell
d8c117bc28 Bug 1414974 - Part 2: Switch many consumers to nsGlobalWindow{Inner,Outer}, r=smaug
This is a large patch which tries to switch many of the external consumers of
nsGlobalWindow to instead use the new Inner or Outer variants.

MozReview-Commit-ID: 99648Lm46T5
2017-11-09 10:44:47 -05:00
Boris Zbarsky
27a999ee42 Bug 1414461. Make sure we always null-check the result of XrayTraits::EnsureHolder. r=mccr8
MozReview-Commit-ID: IV2L0f2612D
2017-11-04 00:36:34 -04:00
Boris Zbarsky
1b5503bd8a Bug 1354730. Disable named property object (aka global scope polluter) behavior for all Xrays. r=kmag
MozReview-Commit-ID: KmbXFfSzH0N
2017-10-16 10:58:09 -04:00
Jason Orendorff
4f0e26c407 Bug 1407414 - Crash in js::GetOwnPropertyDescriptor. r=bz 2017-10-17 16:25:40 +01:00
Brian Hackett
c39632b6ad Bug 1355109 - Add IC for property reads on xrays, r=jandem,bz.
MozReview-Commit-ID: 942dk0gNh23
2017-07-21 07:49:53 -07:00
Jason Orendorff
856f756355 Bug 1396466 - Remove Xray expando chains from the weakmap when transplanting nodes. r=bz 2017-10-10 10:42:18 -05:00
Jason Orendorff
20e7462bdc Bug 1404107 - Refactor: Move some reparenting complexity into XPConnect. r=mrbkap,r=bz 2017-10-05 11:49:43 -05:00
Jason Orendorff
e60a978c6c Bug 1404107 - Fix cloning expando chains when reparenting DOM objects. r=bz,r=mrbkap 2017-09-29 10:33:13 -05:00
Wes Kocher
9e21e10ce3 Merge inbound to m-c a=merge
MozReview-Commit-ID: 6viJ4wRxLa8
2017-09-26 15:54:51 -07:00
Brian Hackett
4c16410a4e Backed out changeset 072f8d4a9964 (bug 1355109) for causing crashes with various extensions. a=lizzard 2017-09-26 14:12:25 -04:00
Jan de Mooij
7d8800f84b Bug 1153592 part 2 - Remove JSPROP_SHARED; ensure accessor props don't have slots. r=evilpie 2017-09-26 12:26:50 +02:00
Andrew McCreight
a72d749bab Bug 1377587, part 1 - Always act like __exposedProps__ is missing. r=krizsa
This patch gently removes support for __exposedProps__ by changing
ExposedPropertiesOnly::check() to always return false, while still
failing silently in deny for some kinds of access.

The tests that I changed all involve testing the behavior with
__exposedProps__. I adjusted them to expect it to fail, or to adjust
the error message they get when they fail. That seemed better than
deleting them entirely.

Note that test_bug1065185.html had a bug, so that it never executed
the first case. I fixed that, and then fixed up the test to work when
__exposedProps__ is not supported.

This also removes various bits of the test framework that use
__exposedProps__, but don't actually need to.

MozReview-Commit-ID: 8fvkAmITmXY
2017-08-22 14:24:11 -07:00
Kris Maglione
bfe8a00d02 Bug 1396570: Null check getter/setter when JSPROP_GETTER/JSPROP_SETTER is set. r=bholley f=jandem
These flags don't guarantee that the getter and setter functions are defined.

MozReview-Commit-ID: GBcoRYoKHqL
2017-09-04 17:27:31 -07:00
Jan de Mooij
e0d2ac4cc5 Bug 1394835 part 1 - Spit JS_DefineProperty* APIs in separate data/accessor overloads. r=evilpie,bz 2017-08-30 15:35:06 +02:00
Jan de Mooij
f9f0443c9f Bug 1389510 part 3 - Remove getProperty/setProperty hooks from ClassOps. r=evilpie 2017-08-25 10:12:16 +02:00
Nicholas Nethercote
ccf5bde569 Bug 1381727 (part 1) - Remove JS_smprintf_free(). r=sfink.
Because it's just a wrapper for js_free().

Furthermore, JS_smprintf() and friends return a JS::UniqueChars, which is also
wired up to free with js_free(). So having the indirection via
JS_smprintf_free() obfuscates things.
2017-07-25 09:09:23 +10:00
Brian Hackett
c3ea362000 Bug 1355109 - Add IC for property reads on xrays, r=jandem,bz. 2017-07-21 07:49:53 -07:00
Ting-Yu Chou
d8f71e8466 Bug 1377815 - Remove redundant unwrapping in resolveOwnProperty() of XrayTraits and its subclasses. r=bholley
Removing the redundant unwrapping improves ~15% for the micro benchmark (bug
1348095 comment 3) on my desktop. Replace the parameter jsWrapper of
resolveOwnProperty() because it is not used.

MozReview-Commit-ID: ULHX8vyMrZ
2017-07-03 09:44:46 +08:00
Jan de Mooij
4afba77787 Bug 1375505 part 1 - Change iterator code to return JSObject* instead of returning bool + outparam. r=evilpie 2017-06-28 21:00:43 -07:00
Jan de Mooij
5e5e72f23f Bug 1370608 part 1 - Move newEnumerate hook from ObjectOps to ClassOps. r=evilpie,bz 2017-06-14 10:37:44 +02:00
Ting-Yu Chou
cb3d7ac358 Bug 1363963 - Check whether there are expando object attached before trying to retrieve it. r=bholley
In most cases no expando object has ever been attached, we don't need to do a
lot of things and realize it in the last minute.

MozReview-Commit-ID: 5u9ivZQj5L8
2017-05-26 10:04:40 +08: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
Bill McCloskey
f32234a94e Bug 1359245 - Eliminate nsXPConnect::GetContextInstance() (r=mccr8)
This method assumes there is one global XPCJSContext. This patch eliminates
uses of it.

MozReview-Commit-ID: L2AkBGh5TnC
2017-04-27 15:34:46 -07:00
Boris Zbarsky
a15042e414 Bug 1348095 part 3. Cache the proto of an Xray on its holder, so we don't have to keep re-wrapping it. r=bholley
MozReview-Commit-ID: I78AoSB3TNW
2017-03-23 03:06:25 -04:00
Boris Zbarsky
cdca354d65 Bug 1348095 part 2. Give all the Xray holders a JSClass that has a slot for caching a prototype. r=bholley
MozReview-Commit-ID: ID9vMG3iJfZ
2017-03-23 03:06:25 -04:00
Boris Zbarsky
483138aaef Bug 1348095 part 1. Remove the unused reserved slots from the XPCWN xray holder. r=bholley
MozReview-Commit-ID: 5IRrE8EmL9A
2017-03-23 03:06:25 -04:00
Carsten "Tomcat" Book
35ac4117d3 Backed out changeset 60471d1feaa4 (bug 1348095) for bustage 2017-03-23 08:46:07 +01:00
Carsten "Tomcat" Book
025004111a Backed out changeset 3efe3c6f4e7f (bug 1348095) 2017-03-23 08:45:48 +01:00
Carsten "Tomcat" Book
3dbcd17f6b Backed out changeset 8ba41a1bd062 (bug 1348095) 2017-03-23 08:45:45 +01:00
Boris Zbarsky
71e2201a88 Bug 1348095 part 3. Cache the proto of an Xray on its holder, so we don't have to keep re-wrapping it. r=bholley
MozReview-Commit-ID: I78AoSB3TNW
2017-03-23 03:06:25 -04:00
Boris Zbarsky
7293b20745 Bug 1348095 part 2. Give all the Xray holders a JSClass that has a slot for caching a prototype. r=bholley
MozReview-Commit-ID: ID9vMG3iJfZ
2017-03-23 03:06:25 -04:00
Boris Zbarsky
654fb79c54 Bug 1348095 part 1. Remove the unused reserved slots from the XPCWN xray holder. r=bholley
MozReview-Commit-ID: 5IRrE8EmL9A
2017-03-23 03:06:25 -04:00
Sylvestre Ledru
4c790b3a90 Bug 1338086 - Remove useless else blocks in order to reduce complexity in js/ r=bbouvier
MozReview-Commit-ID: Giwp0K1YoBH
2017-02-14 15:50:56 +01:00
Brian Hackett
6a2580c190 Bug 1324002 - Mark atoms separately in each zone, r=jonco,mccr8,peterv. 2017-01-30 06:31:47 -07:00
Tom Schuster
22c65024d2 Bug 1333073 - Enable DataView Xray. r=bz 2017-01-28 21:52:45 +01:00
Boris Zbarsky
fdbb2d3915 Bug 1332713 part 3. Implement a version of XrayAwareCalleeGlobal that works for specialized getters. r=bholley
The problem is that JSJitGetterInfo doesn't contain a callee.  So we can't use
xpc::XrayAwareCalleeGlobal in a specialized getter, because we don't have our
callee function available.
2017-01-27 18:53:36 -05:00
Nicholas Nethercote
41f100680b Bug 1329846 (part 2) - Remove NATIVE_HAS_FLAG. r=mccr8.
It's only used in three places, and it no longer makes the code more readable.
2017-01-11 07:40:19 +11:00
Nicholas Nethercote
18f63503a5 Bug 1329846 (part 1) - Remove XPCNativeScriptableInfo. r=mccr8.
XPCNativeScriptableInfo is now a very thin wrapper around nsIXPCScriptable, and
it uses manual memory management. Removing it simplifies things quite a bit.

In particular, when setting XPCWrappedNative::mScriptable in
XPCWrappedNative::WrapNewGlobal() and XPCWrappedNative::Init() we no longer
have to worry about sharing the XPCNativeScriptableInfo object with the proto.
And XPCWrappedNative::{Init,Destroy}() have similar simplifications.
2017-01-10 12:47:57 +11:00
Boris Zbarsky
7e873263f0 Bug 1322415. Fix property enumeration on cross-origin windows to include indexed props, and add some tests for the ordering of the indexed, named, and symbol-named props on cross-origin objects (window and location). r=bholley 2016-12-13 13:14:43 -05:00
Tom Schuster
bc9bad94c6 Bug 1192038 - Update RegExp Xray code. r=bholley,arai 2016-11-26 19:17:39 +01:00
Tom Schuster
a047bf22ef Bug 1213341 - Simplify Error Xray code. r=bholley 2016-11-22 20:53:38 +01:00
Tom Schuster
4f7d49c13b Bug 1155700 - Enable Map/Set Xrays. r=bz 2016-11-19 01:17:53 +01:00
Tom Schuster
e7aac3f9e0 Bug 1015798 - Add int32 type to PropertySpec. r=arai 2016-11-08 22:08:28 +01:00
Boris Zbarsky
2a2bf6092c Bug 1021289 part 4. Implement support for WebIDL deleters over Xrays. r=peterv 2016-11-04 12:41:26 -04:00
Boris Zbarsky
6daf80f962 Bug 1021289 part 1. Change XrayWrapper::delete_ to call through to the traits delete_ method if the property doesn't actually exist on the expando. r=peterv 2016-11-04 12:41:26 -04:00