Commit Graph

6503 Commits

Author SHA1 Message Date
Kris Maglione
4f10d70a3d Bug 1442737: Use shared JSM global for compilation and privileged junk scopes. r=bholley
MozReview-Commit-ID: 3rLgxQVtc0X

--HG--
extra : rebase_source : 77afa66ef4fcdf8ac0ce1e2cae99d7a0992bc421
extra : amend_source : c97299a71b9b20370ae79ce4dd33c1833ca3f22f
extra : source : 8477472996e06d06a21d8e602e4a92d0ec130ea3
2018-06-24 19:16:33 -07:00
Margareta Eliza Balazs
616a3ce82b Backed out changeset 8477472996e0 (bug 1442737) for frequent mochitest failures e.g.: toolkit/components/alerts/test/test_principal.html 2018-06-26 11:28:50 +03:00
Kris Maglione
a81efd6ad5 Bug 1442737: Use shared JSM global for compillation and privileged junk scopes. r=bholley
MozReview-Commit-ID: 3rLgxQVtc0X

--HG--
extra : rebase_source : bc15130d4db2f449569dbefe1a11c39b2ba1ad10
2018-06-24 19:16:33 -07:00
Andi-Bogdan Postelnicu
f0ebe92a4a Bug 1453795 - XPConnect - Initialize member fields in classes/ structures. r=peterv
--HG--
extra : rebase_source : 656f79f07e30e4d1f410ff3c72d71650c8498812
2018-06-15 14:25:49 +03:00
Brindusan Cristian
f321a9bf6d Backed out changeset 32d9328cab02 (bug 1453795) as requested by Andi. CLOSED TREE 2018-06-21 13:30:07 +03:00
Andi-Bogdan Postelnicu
b5f08ab328 Bug 1453795 - XPConnect - Initialize member fields in classes/ structures. r=peterv
--HG--
extra : rebase_source : b996be8c8e2a7fea85f12c986644948360b47821
2018-06-15 14:25:49 +03:00
Jan de Mooij
cf5e1222da Bug 1469217 part 6 - Remove JSPROP_SHADOWABLE, address review comments. r=anba 2018-06-21 11:05:42 +02:00
Jan de Mooij
b47f1cb4ba Bug 1469217 part 3 - Clean up TryResolvePropertyFromSpecs; remove a bunch of macros. r=anba 2018-06-21 11:05:42 +02:00
Jan de Mooij
45a7ade57e Bug 1469217 part 2 - Add APIs taking getter/setter objects instead of JSNatives. r=anba 2018-06-21 11:05:42 +02:00
Jan de Mooij
539de0ae06 Bug 1469217 part 1 - Remove JSPROP_PROPOP_ACCESSORS. r=anba 2018-06-21 11:05:41 +02:00
Tom Schuster
7c01dffca0 Bug 1469540 - Remove option to disable Array.prototype.values. r=jandem
--HG--
extra : rebase_source : 5b935db0e58c076b289a7b5a3a8a43fe6e9446b3
2018-06-05 14:57:13 +02:00
Jan Beich
f2740b785d Bug 1468928 - Unbreak build without GeckoProfiler after bug 1405374. r=mstange
In file included from objdir/js/xpconnect/src/Unified_cpp_js_xpconnect_src1.cpp:110:
js/xpconnect/src/nsXPConnect.cpp:76:37: error: use of undeclared identifier
      'profiler_register_thread'
    JS::SetProfilingThreadCallbacks(profiler_register_thread, profiler_unregister_thread);
                                    ^
js/xpconnect/src/nsXPConnect.cpp:76:63: error: use of undeclared identifier
      'profiler_unregister_thread'
    JS::SetProfilingThreadCallbacks(profiler_register_thread, profiler_unregister_thread);
                                                              ^

MozReview-Commit-ID: HrBGEkByEum

--HG--
extra : rebase_source : b588e8f04d44d07c348120efc6008e6c24b8949e
2018-06-15 10:12:23 +00:00
Boris Zbarsky
9b13c30592 Bug 1467870. When cloning Xray expando chains for an adopt into the Xray compartment, don't lose expandos. r=mrbkap
This does mean that if the node is adopted back into the original document the
expandos would end up on the reflector at that point.  I think that's OK;
people shouldn't be adopting things in that direction.  Futhermore, if they
adopt, then set expandos, then adopt back they already get this behaviorl

So if we decide we don't want that, we should probably just avoid copying own
props when reparenting into a global whose principals don't subsume the old
global.
2018-06-14 19:06:43 -04:00
Jan de Mooij
a2548dc268 Bug 1468252 part 2 - Rename GetOriginalEval to GetRealmOriginalEval, remove scope argument. r=evilpie
--HG--
extra : rebase_source : f1aa3fc12fc775bf64318d16246555badbe83e78
2018-06-14 09:07:30 -07:00
Tom Schuster
f7c7d0f881 Bug 1435813 - Enable Array.prototype.flat and Array.prototype.flatMap in release builds. r=till
--HG--
extra : rebase_source : adc7e839e4d241857a89df6c6669c241a14466da
2018-06-05 14:41:41 +02:00
Jan de Mooij
2b3ff5c90a Bug 1468219 - Rename JS_InitStandardClasses to JS::InitRealmStandardClasses, remove obj argument. r=anba
--HG--
extra : rebase_source : 5c092c37298e89096b85524e92d143ff2447f31f
2018-06-13 12:47:47 -07:00
Jan de Mooij
de211d96a6 Bug 1468137 - Remove JS_Get*Prototype APIs; use JS::GetRealm*Prototype instead. r=evilpie
--HG--
extra : rebase_source : 9d5e815b83b3a71ab3e74fc2c0e2feb1009f2af9
2018-06-13 12:47:40 -07:00
Joel Maher
1ef32bf5c6 Bug 1405428 - skip-if = verify on xpcshell tests which do not pass test-verify. r=gbrown 2018-06-13 11:34:40 -04:00
Mike Conley
bf614c6737 Bug 1458375 - Make ScriptPreloader wait until browser-idle-startup-tasks-finished before writing cache. r=kmag
Originally, the ScriptPreloader stopped recording and wrote its cache when the
browser-delayed-startup-finished notification fired for the first window, but there
are other scripts (both in the content and WebExtension processes) that might run
soon after that we also want to cache.

This patch still makes the parent process stop recording scripts after
browser-delayed-startup-finished, but only prepares and writes the cache
once browser-idle-startup-tasks-finished fires, when it is much more likely
that the content and WebExtension caches are ready to go.

MozReview-Commit-ID: KiBEVvuqQkA

--HG--
extra : rebase_source : 6f0fde65cdafdecf72242a06416fef10304637b8
2018-06-11 12:19:02 -07:00
Steve Fink
bc2be79d2a Bug 1405374 - Register JS threads with the profiler, r=jonco
--HG--
extra : rebase_source : c29dffb341bff5e3f020ad0be6d48c045e178a5c
2018-06-07 15:37:08 -07:00
Kris Maglione
a4973ad0d6 Bug 1464548: Part 1b - Don't delete properties before redefining them, because deleting properties kills JIT performance. r=mccr8
MozReview-Commit-ID: IUMg59xRoIu

--HG--
extra : rebase_source : 6be1c84601ff868835cad53116ab920d2f2db317
2018-05-25 19:17:58 -07:00
Kris Maglione
bbbb42012f Bug 1464548: Part 1a - Add defineLazyGlobalGetters helper. r=mccr8
This allows us to lazily import global properties using
Cu.importGlobalProperties. Aside from making it easier to avoid lazily
importing these properties, it also defines them all in the shared JSM global
so that we don't risk re-creating them in Sandboxes or frameloader globals.

MozReview-Commit-ID: GV6shguUlIG

--HG--
extra : rebase_source : 6b9269f3b33fe085c5ed63ee16e5b4ce9e5343a4
2018-05-25 22:28:27 -07:00
Tom Schuster
731eb0bfab Bug 1451017 - Remove Xray resolveNativeProperty. r=bz
--HG--
extra : rebase_source : 3fca06866110b912478448b06f12dc2158f560c7
2018-05-08 22:09:05 +02:00
Jan de Mooij
f7fb3be6ec Bug 1466121 part 1 - Rename JSCompartment to JS::Compartment. r=luke
--HG--
extra : rebase_source : cd7140ecda54f0caa02a96f562167b3c9a107450
2018-06-07 16:44:40 +02:00
Peter Van der Beken
b986ba77dd Bug 1053271 - Remove some unused XRayWrapper code. r=bz.
--HG--
extra : rebase_source : 62e659d4b70872997b62185b2f634d87e9242d9d
2018-06-04 16:37:04 +02:00
Peter Van der Beken
f4270dc255 Bug 1053271 - Move Sandbox proxy handlers out of XrayWrapper.h. r=bz.
--HG--
extra : rebase_source : 6172fcbc5782ec3e800b034ca5fdba354f0797e2
2018-06-06 11:42:12 +02:00
Peter Van der Beken
a47cb53336 Bug 1053271 - Remove XrayTraits' HasPrototype. r=bz.
XPCWN Xrays were the only Xrays that set HasPrototype to 0.

--HG--
extra : rebase_source : c10654e4eb6eb39b3cfe8884009cd1a47dcad807
2018-06-04 14:26:37 +02:00
Peter Van der Beken
c02d68395d Bug 1053271 - Remove XPCWN Xrays. r=bz.
--HG--
extra : rebase_source : 4da59c56ffc6eab4af0bf59d3d3861bbc18a33ba
2018-06-04 12:56:38 +02:00
Jan de Mooij
56ca3c9524 Bug 1466501 part 1 - Refactor ZoneSpecifier and add a sameCompartmentAs option to newGlobal in the shell. r=luke 2018-06-07 10:02:10 +02:00
Narcis Beleuzu
cf464eabfe Merge inbound to mozilla-central. a=merge 2018-06-06 20:00:09 +03:00
Jan de Mooij
156284156a Bug 1363214 - Remove JS::Realm/JSCompartment inheritance. r=jonco
--HG--
extra : rebase_source : ad63de7c6676532640659d1fccced7f83798e06d
2018-06-06 14:30:52 +02:00
Karl Tomlinson
9e0c1c7c2b bug 1442776 make CycleCollectedJSContext accessible from JSContext private r=peterv
Inheriting PerThreadAtomCache on CycleCollectedJSContext permits use of
static_cast, avoiding one level of indirection compared to adding a
CycleCollectedJSContext* to PerThreadAtomCache.

PerThreadAtomCache is over 18kB, and so WorkerJSContext and WorkletJSContext
are moved from the stack to the heap.

MozReview-Commit-ID: 6jdJeZcviK4

--HG--
extra : rebase_source : 3c2accb71faf3f017a44c405ae0484e57aaf039c
2018-05-10 17:04:12 +12:00
Jan de Mooij
4ded85aeda Bug 1466083 part 9 - Introduce JS::IterateRealmsInCompartment and use it in NukeAllWrappersForCompartment. r=jonco 2018-06-06 12:55:50 +02:00
Jan de Mooij
615ecff147 Bug 1466083 part 8 - Various minor API changes. r=luke
* GetScriptCompartment => GetScriptRealm
* Adds IsSystemRealm in addition to IsSystemCompartment and uses it where we can.
* JS_GetCompartmentPrincipals and IsSystemCompartment now release-assert they have a single realm. This is temporary until we know what Gecko will do/need exactly.
2018-06-06 12:55:50 +02:00
Jan de Mooij
9389383f2c Bug 1466083 part 7 - Replace GetCompartmentZone with GetRealmZone. r=luke 2018-06-06 12:55:50 +02:00
Jan de Mooij
7f38cbf185 Bug 1465728 part 3 - Rename Cu.getCompartmentLocation to Cu.getRealmLocation. r=bz 2018-06-06 11:44:17 +02:00
Jan de Mooij
3d013f2eef Bug 1465728 part 2 - Remove the compartment name callback. r=luke 2018-06-06 11:44:17 +02:00
Jan de Mooij
71d86bded9 Bug 1465728 part 1 - Move location and locationURI fields from CompartmentPrivate to RealmPrivate. r=bz
The xpcprivate.h changes are just code motion, except I changed the order of the GetLocationURI methods to get a much more readable diff.
2018-06-06 11:44:17 +02:00
Miko Mynttinen
4c85ef17cc Bug 1465060 - Part 1: Fix warnings for std::move() use r=froydnj
MozReview-Commit-ID: HpdFXqQdIOO

--HG--
extra : rebase_source : 1e7eea4f2d4ec16ec0c559a8afb26976ddbf4d07
2018-06-01 17:59:07 +02:00
shindli
936dd8d764 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-06-04 01:07:15 +03:00
arthur.iakab
7e765f798b Backed out 2 changesets (bug 1465060) for build bustages on security/sandbox/linux/reporter/SandboxReporter.cpp
Backed out changeset 7c8905b6b226 (bug 1465060)
Backed out changeset 10446073eca8 (bug 1465060)
2018-06-03 19:25:41 +03:00
Miko Mynttinen
8d9dc85cd4 Bug 1465060 - Part 1: Fix warnings for std::move() use r=froydnj
MozReview-Commit-ID: HpdFXqQdIOO

--HG--
extra : rebase_source : 619d0e0ff63a2453c80f0c4d9beb906d43fa9b01
2018-06-01 17:59:07 +02:00
Andreea Pavel
4ced6e8b2d Merge mozilla-central to autoland. a=merge 2018-06-03 07:27:01 +03:00
Jan de Mooij
403ba762c8 Bug 1466083 part 6 - Add xpc::GetRealmPrincipal and use it in a few places. r=bz
Not strictly necessary, but this lets us remove some JS::GetCompartmentForRealm and JS_GetCompartmentPrincipals calls.
2018-06-02 11:58:29 +02:00
Jan de Mooij
14752d0042 Bug 1464772 part 2 - Remove RealmBehaviorsRef(obj), change RealmBehaviorsRef(compartment) to take a realm. r=luke
At some point I'll audit the obj->realm() calls for CCWs; removing RealmBehaviorsRef(obj) prepares for that.

Also, RealmBehaviorsRef(realm) could be removed and we could use RealmBehaviorsRef(cx) everywhere, but it seems reasonable to keep it.
2018-06-03 12:22:28 +02:00
Emilio Cobos Álvarez
1e9c395548 Bug 1466168: Remove mozilla::Forward in favor of std::forward. r=froydnj
Same approach as the other bug, mostly replacing automatically by removing
'using mozilla::Forward;' and then:

  s/mozilla::Forward/std::forward/
  s/Forward</std::forward</

The only file that required manual fixup was TestTreeTraversal.cpp, which had
a class called TestNodeForward with template parameters :)

MozReview-Commit-ID: A88qFG5AccP
2018-06-02 09:33:26 +02:00
Emilio Cobos Álvarez
fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Jan de Mooij
f3fe2d13d4 Bug 1465472 - Remove the atoms realm/compartment. r=jonco
Some of the less trivial changes:

* When we allocated a symbol, we used the atom realm's RNG to create a hash code [0]. Instead of this I added a RNG for this to the runtime.

* IsCompilingWasm returned true if the JitContext's realm is nullptr, but that's now also true when we initialize the trampolines stored in the atoms zone. To fix that I added a CompileZone* to JitContext, in addition to the CompileRuntime and CompileRealm, and we now check the zone instead of the realm in IsCompilingWasm.

* JSContext::hasEnteredRealm is only called in DEBUG builds so I made hasEnteredRealm and enterRealmDepth_ #ifdef DEBUG.
2018-05-31 12:53:26 +02:00
Jan de Mooij
37e765587c Bug 1464374 part 7 - Use GetRealmPrincipals in GetCompartmentName. r=luke
This will become GetRealmName at some point.
2018-05-31 11:28:49 +02:00
Jan de Mooij
1edb6a4c17 Bug 1464374 part 6 - Use GetRealmPrincipals in Scriptability constructor. r=bz 2018-05-31 11:28:49 +02:00