Commit Graph

72129 Commits

Author SHA1 Message Date
Jon Coppeard
8186c345e2 Bug 1572782 - Replace internal use of js::FreeOp with JSFreeOp r=tcampbell?
Sorry for the huge patch.  This is pretty much a search and replace of all uses of js::FreeOp.

Differential Revision: https://phabricator.services.mozilla.com/D41412

--HG--
extra : moz-landing-system : lando
2019-08-12 10:16:02 +00:00
Jon Coppeard
68fef4ffb0 Bug 1572782 - Remove external references to js::FreeOp r=mccr8?
Replace external use of js::FreeOp with JSFreeOp.

Differential Revision: https://phabricator.services.mozilla.com/D41411

--HG--
extra : moz-landing-system : lando
2019-08-12 10:16:00 +00:00
Jon Coppeard
9d51a35e93 Bug 1572782 - Remove js::FreeOp and make JSFreeOp opaque in public API r=tcampbell?
Merge js::FreeOp and JSFreeOp, but alias the former to the latter while we fix uses.

Differential Revision: https://phabricator.services.mozilla.com/D41410

--HG--
extra : moz-landing-system : lando
2019-08-12 10:15:57 +00:00
Henri Sivonen
ed1e9fd632 Bug 1572364 - Make jsrust_shared a non-optional dependency of gkrust-shared. r=bbouvier
Differential Revision: https://phabricator.services.mozilla.com/D41163

--HG--
extra : moz-landing-system : lando
2019-08-09 17:32:29 +00:00
Paul Bone
b7a967139e Bug 1569924 - Run ./mach clang-format -p js/src r=sfink
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D39987

--HG--
extra : moz-landing-system : lando
2019-08-12 03:27:23 +00:00
Jan de Mooij
4d5c0d5eb6 Bug 1570259 part 5 - Remove AutoSetHelperThreadContext from off-thread Ion and Wasm tasks. r=tcampbell,luke
Off-thread tasks now use a pool of JSContexts (for compatibility with the XPCOM thread pool).
Tasks that don't need a JSContext can run without one (nullptr TlsContext). We can now do this
for Ion and Wasm tasks too.

Depends on D41380

Differential Revision: https://phabricator.services.mozilla.com/D41381

--HG--
extra : moz-landing-system : lando
2019-08-09 15:27:10 +00:00
Jan de Mooij
23cbbf5845 Bug 1570259 part 4 - Make AutoUnsafeCallWithABI work without a TlsContext. r=tcampbell
Some functions that are called from the Ion backend use AutoUnsafeCallWithABI.

Initially I wanted to fix this by splitting these functions in two separate
functions, but this doesn't work well for all the Math builtins that are called
by GVN.

Depends on D41379

Differential Revision: https://phabricator.services.mozilla.com/D41380

--HG--
extra : moz-landing-system : lando
2019-08-09 14:41:27 +00:00
Jan de Mooij
3fd18f4434 Bug 1570259 part 3 - Move some fields from JSContext to JitContext. r=tcampbell
This will allow us to run off-thread Ion tasks without a JSContext.

I renamed IonCompiling and IonCompilation to IonBackend to make it
clearer that this doesn't include IonBuilder time.

Differential Revision: https://phabricator.services.mozilla.com/D41379

--HG--
extra : moz-landing-system : lando
2019-08-11 09:05:23 +00:00
Jan de Mooij
93adc5cc85 Bug 1570259 part 2 - Group JitContext fields and use new initializer syntax. r=luke
Depends on D41377

Differential Revision: https://phabricator.services.mozilla.com/D41378

--HG--
extra : moz-landing-system : lando
2019-08-09 15:26:35 +00:00
Jan de Mooij
883264b018 Bug 1570259 part 1 - Document and clean up JitContext constructors. r=luke
The next patch will simplify the constructor code a bit more.

Differential Revision: https://phabricator.services.mozilla.com/D41377

--HG--
extra : moz-landing-system : lando
2019-08-09 15:26:03 +00:00
Jan de Mooij
541cfda7f5 Bug 1552154 part 6 - Remove BaselineScript's pc-to-native map. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D40949

--HG--
extra : moz-landing-system : lando
2019-08-10 10:21:34 +00:00
Jan de Mooij
85db9b40c2 Bug 1552154 part 5 - Stop using pc-to-native map for BaselineScript::toggleDebugTraps. r=tcampbell
Because DebugTrapEntries are only present if the script has debugger instrumentation
it should be fine to store this as a simple list of entries.

Differential Revision: https://phabricator.services.mozilla.com/D40948

--HG--
extra : moz-landing-system : lando
2019-08-10 10:21:20 +00:00
Jan de Mooij
e6fbf15029 Bug 1552154 part 4 - Stop using pc-to-native map for BaselineScript::approximatePcForNativeAddress. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D40947

--HG--
extra : moz-landing-system : lando
2019-08-10 10:21:00 +00:00
Jan de Mooij
99451ccd92 Bug 1552154 part 3 - Stop using pc-to-native map for BaselineScript::computeResumeNativeOffsets. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D40946

--HG--
extra : moz-landing-system : lando
2019-08-10 10:20:41 +00:00
Jan de Mooij
d69bf865df Bug 1552154 part 2 - Stop using pc-to-native map for OSR into Baseline JIT. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D40945

--HG--
extra : moz-landing-system : lando
2019-08-10 10:20:27 +00:00
Jan de Mooij
d870ef9328 Bug 1552154 part 1 - Use mozilla::Span<> in BaselineScript, clean up RetAddrEntry code a bit. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D40944

--HG--
extra : moz-landing-system : lando
2019-08-10 10:20:08 +00:00
Steve Fink
e79384d24c Bug 1572207 - Update AutoStableStringChars comment, r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D41421

--HG--
extra : moz-landing-system : lando
2019-08-09 20:41:12 +00:00
Andrew McCreight
9550144327 Bug 1572781 - Stop doing cross-origin navigation in XPConnect browser tests. r=kmag
These tests both load a page, create some chrome reference to it, then
navigate to another page to cause a window close on the original page,
then check to make sure the references to the original page have gone
away.

With Fission, if the navigation is cross-process, then the message
manager gets torn down in the original process where the browser test
is running, and the sendAsyncMessage call in content-task.js fails
with the cryptic error NS_ERROR_ILLEGAL_VALUE.

This can be fixed by making the navigation not be cross-origin. The
test only wants the original pages to be torn down. The origin of the
new page doesn't matter.

Differential Revision: https://phabricator.services.mozilla.com/D41408

--HG--
extra : moz-landing-system : lando
2019-08-09 20:08:08 +00:00
Jim Blandy
715bf97a70 Bug 1569080: Correct #includes in js/src/debugger. r=jorendorff
These changes were produced using the Include What You Use tool, which uses the
Clang front end to figure out which headers actually declare the identifiers
you're using.

These changes aren't exactly the ones IWYU suggests. The tool has some odd false
positives, even when you use its 'pragmas' to tell it about headers like
jsapi.h, which is supposed to gather up other headers for you. And there are
some cases where I could get away with a forward declaration (say, for Maybe),
but I really just want to #include the full header because it seems better. But
overall this patch has only minor deviations from IWYU's suggestions.

No intended change in execution or visible behavior.

Differential Revision: https://phabricator.services.mozilla.com/D39446

--HG--
extra : moz-landing-system : lando
2019-08-08 23:20:21 +00:00
Jim Blandy
1ff16f50ee Bug 1567245: Have Debugger::wrapVariantReferent obtain the wrapper and referent types from the DebuggerWeakMap. r=jorendorff
Finally, once we know the type of the map we're consulting, that tells us all
the other types we need to know: certainly the referent and wrapper types, but
also the referent variant type, via the wrapper.

DebuggerWeakMap does need new member types to tell us what its Referent and
Wrapper types are. Rename the type parameters to avoid shadowing.

Since the map type can be inferred from the call, we no longer need to pass any
type parameters at all when we call the innermost wrapVariantReferent overload.

Differential Revision: https://phabricator.services.mozilla.com/D38544

--HG--
extra : moz-landing-system : lando
2019-08-08 23:55:29 +00:00
Jim Blandy
a8ab5bb0ed Bug 1567245: Tighten type of Debugger::generatorFrames and Debugger::sources. r=jorendorff
For generatorFrames, this doesn't matter, but for sources, subsequent patches
need a more precise Referent type than simply 'JSObject'.

Any type used as a weak map key needs a MovableCellHasher instantiation, so add
the necessary ones to Barrier.cpp. Since the list is getting long, sort it.

Differential Revision: https://phabricator.services.mozilla.com/D38543

--HG--
extra : moz-landing-system : lando
2019-08-08 23:20:13 +00:00
Jim Blandy
2670cfec30 Bug 1567245: Factor out pointer from DebuggerWeakMap Referent type parameter. r=jorendorff
It's more convenient for a DebuggerWeakMap's Wrapper type parameter to be the
pointed-to type, not the pointer type, since we'll be consulting its member
types. Then, it's a bit more consistent to also use the pointed-to type for
Referent.

Differential Revision: https://phabricator.services.mozilla.com/D38542

--HG--
extra : moz-landing-system : lando
2019-08-08 23:20:09 +00:00
Jim Blandy
6475ea735f Bug 1567245: Let Debugger::wrapVariantReferent consult DebuggerScript and DebuggerSource for their referent variant types. r=jorendorff
Give DebuggerScript and DebuggerSource a member type that spells out the variant
type appropriate for their referents. This allows wrapVariantReferent to simply
consult the wrapper for the referent variant type instead of demanding it as a
type parameter.

No intended change in visible behavior.

Differential Revision: https://phabricator.services.mozilla.com/D38541

--HG--
extra : moz-landing-system : lando
2019-08-08 23:49:40 +00:00
Jim Blandy
301b3b222f Bug 1567245: Rename DebuggerWeakMap type parameter 'UnbarrieredKey' to 'Referent'. r=jorendorff
Technically, DebuggerWeakMap could be used for any sort of cross-compartment
mapping. But we actually only use it for looking up Debugger reflection objects,
so it is more informative to call the key and value types 'referent' and
'wrapper'.

No intended change in visible behavior.

Differential Revision: https://phabricator.services.mozilla.com/D38540

--HG--
extra : moz-landing-system : lando
2019-08-08 23:20:02 +00:00
Jim Blandy
e09dbb9496 Bug 1567245: Tighten value types for DebuggerWeakMap. r=jorendorff
Give DebuggerWeakMap a `Wrapper` type parameter to use as the WeakMap value type
instead of plain JSObject*. Then, supply a specific wrapper class type for each
DebuggerWeakMap instantiation.

No intended change in visible behavior.

Differential Revision: https://phabricator.services.mozilla.com/D38539

--HG--
extra : moz-landing-system : lando
2019-08-08 23:43:41 +00:00
Jim Blandy
299e8fcf1b Bug 1564164: Move DebuggerSource into its own file. r=jorendorff
This adds js/src/dbg/Source.{cpp,h}, and moves DebuggerSource's definition
there. No intended change in implementation or visible behavior.

Differential Revision: https://phabricator.services.mozilla.com/D38538

--HG--
extra : moz-landing-system : lando
2019-08-08 23:37:46 +00:00
Jim Blandy
dd256ecc20 Bug 1564170: Give Debugger.Source instances their own NativeObject subclass, DebuggerSource. r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D38268

--HG--
extra : moz-landing-system : lando
2019-08-08 23:37:54 +00:00
Steve Fink
c48c9c7b7d Bug 1570465 - Postpone switching to gray as long as black is on the mark stack r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D40122

--HG--
extra : moz-landing-system : lando
2019-08-07 09:53:55 +00:00
Will Hawkins
618bfdcbb6 Bug 1571124: Calculate the data size of a JSScript dynamically. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D41325

--HG--
extra : moz-landing-system : lando
2019-08-09 16:38:08 +00:00
Jon Coppeard
d74716c7d8 Bug 1560375 - Share string wrappers between all comparments in a zone r=jandem?
This moves the string wrapper map to the zone where it's shared by all compartments in the zone.

Differential Revision: https://phabricator.services.mozilla.com/D41366

--HG--
extra : moz-landing-system : lando
2019-08-09 14:55:30 +00:00
kellykc72
aa38026df8 Bug 1531480 - Replace uses of jsbytecode* with BytecodeLocation and BytecodeIterator inside RemoveReferenceNames r=nbp
Encapsulate manipulation of bytecode within RemoveReferenceNames method using accessor classes BytecodeLocation and BytecodeIterator

Differential Revision: https://phabricator.services.mozilla.com/D41120

--HG--
extra : moz-landing-system : lando
2019-08-09 14:33:56 +00:00
Benjamin Bouvier
d56c1b818d Bug 1571230: Accept "inf" for infinity in wasmTextToBinary; r=jseward
Differential Revision: https://phabricator.services.mozilla.com/D40624

--HG--
extra : moz-landing-system : lando
2019-08-09 10:35:12 +00:00
Jon Coppeard
9987f93cc0 Bug 1571021 - Change the wrapper value type to that of the key r=jandem?
Differential Revision: https://phabricator.services.mozilla.com/D41186

--HG--
extra : moz-landing-system : lando
2019-08-09 10:05:52 +00:00
Jon Coppeard
3fb04aa631 Bug 1571021 - Key wrapper maps by wrapped type directly and remove CrossCompartmentKey class r=jandem?
Differential Revision: https://phabricator.services.mozilla.com/D41184

--HG--
extra : moz-landing-system : lando
2019-08-09 10:05:45 +00:00
Jon Coppeard
a4a756e0e6 Bug 1571021 - Store string wrappers separately to object wrappers r=jandem?
This splits off string wrappers into a separate table with a different type (because we don't need to keep a separate sub table per compartment).

Differential Revision: https://phabricator.services.mozilla.com/D41183

--HG--
extra : moz-landing-system : lando
2019-08-09 10:05:35 +00:00
Jon Coppeard
c26c40375c Bug 1571021 - Separate out CCW iterators for objects and strings and remove API to iterate all r=jandem?
This removes Compartment::WrapperEnum and renames NonStringWrapperEnum so there's now just ObjectWrapperEnum and StringWrapperEnum.

In js::VisitGrayWrapperTargets, strings can never be marked gray and so needn't be considered.  In JS::TraceIncomingCCWs, strings have no compartment and so can be ignored here too.

Differential Revision: https://phabricator.services.mozilla.com/D41182

--HG--
extra : moz-landing-system : lando
2019-08-09 10:05:24 +00:00
Jon Coppeard
fd6533075c Bug 1571021 - Remove use of CrossCompartmentKey from putWrapper APIs r=jandem?
Differential Revision: https://phabricator.services.mozilla.com/D41181

--HG--
extra : moz-landing-system : lando
2019-08-09 10:05:20 +00:00
Jon Coppeard
ac65366274 Bug 1571021 - Remove Compartment methods to lookup CCWs by CrossCompartmentKey and by Value r=jandem?
The object of this set of patches is to remove CrossCompartmentKey and have the hashtable key be either JSObject* or JSString* as appropriate. Wrappers for strings and objects are already stored in separate tables since currently we use a table per target compartment with strings in the nullptr compartment.

The first patch removes lookup APIs that take CrossCompartmentKeys and Values.

Differential Revision: https://phabricator.services.mozilla.com/D41180

--HG--
extra : moz-landing-system : lando
2019-08-09 10:05:16 +00:00
Jon Coppeard
c8e58b3c8f Bug 1568029 - Make TypeNewScript::rollbackPartiallyInitializedObjects detect when it's finished traversing the new script initializer list correctly r=tcampbell?
My previous change to the format of the new script initializer list broke this because it relies on finding the sentinel value at the end of the list to know that it didn't break out of the loop early. This means we always call NativeObject::rollbackProperties after this loop when we shouldn't.

The symptom of this is that the workspace property of a Blockly.BlockSvg object becomes undefined causing an infinite loop in code that tries to remove it from that workspace. I verified that the patch fixes this problem.

Differential Revision: https://phabricator.services.mozilla.com/D41249

--HG--
extra : moz-landing-system : lando
2019-08-08 17:18:10 +00:00
Jan de Mooij
c4c54c747a Bug 1567920 part 1 - Switch Baseline frames from JIT to Interpreter in the exception handler, remove the override-pc mechanism. r=iain,tcampbell
The exception handler was the last place where we set the frame's override pc.
We can stop doing that if we switch the frame to interpreter mode.

This simplifies BaselineDebugModeOSR because it no longer has to handle the
"triggered from exception handler" case when patching frames.

Differential Revision: https://phabricator.services.mozilla.com/D40210

--HG--
extra : moz-landing-system : lando
2019-08-09 08:12:56 +00:00
Jan de Mooij
088a280438 Bug 1567920 part 0 - Simplify the GeneratorThrowOrReturn callVM code. r=tcampbell
When we remove the override-pc mechanism, the bug1261324.js jit-test failed on
the ARM simulator because the profiler would see the nullptr return address we
push for GeneratorThrowOrReturn.

This patch tries to simplify that code by turning it into a plain callVM in
the interpreter code and jumping to that in the Baseline JIT code.

Differential Revision: https://phabricator.services.mozilla.com/D41195

--HG--
extra : moz-landing-system : lando
2019-08-09 08:14:16 +00:00
Nicholas Nethercote
9bc90adc09 Bug 1570212 - Make security.turn_off_all_security... a non-VarCache pref. r=mccr8
This could be made into a static pref, but then it would be always defined and
thus visible in about:config, which seems undesirable for such a senstive pre.
So this patch uses a callback that makes it work just like the existing
VarCache, i.e. it's not defined by default, in which case it defaults to false.

Differential Revision: https://phabricator.services.mozilla.com/D40343

--HG--
extra : moz-landing-system : lando
2019-08-09 00:58:55 +00:00
Paul Bone
ac145a8bd1 Bug 1571439 - Add new test r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D40807

--HG--
extra : moz-landing-system : lando
2019-08-08 23:30:15 +00:00
Adam Holm
69e41402aa Bug 1538557 - Use BytecodeLocation and BytecodeIterator in JitScript::initICEntriesAndBytecodeTypeMap to replace uses of jsbytecode* and pcToOffset. r=jandem,tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D40230

--HG--
extra : moz-landing-system : lando
2019-08-08 17:46:44 +00:00
Brian Hackett
4aefdac168 Bug 1571169 - Watch for dead object proxies for debugger objects, r=tcampbell.
Differential Revision: https://phabricator.services.mozilla.com/D41235

--HG--
extra : moz-landing-system : lando
2019-08-08 16:09:44 +00:00
Jared Wein
a30e9c1f3c Bug 1571567 - Fix no-fallthrough errors in /js. r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D40875

--HG--
extra : moz-landing-system : lando
2019-08-08 15:18:41 +00:00
Bogdan Tara
844afcfb06 Backed out 10 changesets (bug 1571567) complementary backout after es lint failure on the patch CLOSED TREE
Backed out changeset ce83fa75ae32 (bug 1571567)
Backed out changeset 7aa97ba7cce9 (bug 1571567)
Backed out changeset 777d79076e99 (bug 1571567)
Backed out changeset fbdf6b75a484 (bug 1571567)
Backed out changeset e2ed4620f232 (bug 1571567)
Backed out changeset 2c67015f12c6 (bug 1571567)
Backed out changeset 7ec086bb5bd5 (bug 1571567)
Backed out changeset 42df735c8556 (bug 1571567)
Backed out changeset 7d5fc57b2809 (bug 1571567)
Backed out changeset 606bafb8211c (bug 1571567)
2019-08-08 18:13:54 +03:00
Benjamin Bouvier
358db88461 Bug 1566992: Test; r=jseward
Differential Revision: https://phabricator.services.mozilla.com/D40219

--HG--
extra : moz-landing-system : lando
2019-08-08 13:46:52 +00:00
Jared Wein
e1b246a305 Bug 1571567 - Fix no-fallthrough errors in /js. r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D40875

--HG--
extra : moz-landing-system : lando
2019-08-08 01:38:51 +00:00
Jan de Mooij
c2329d1abb Bug 1525664 follow-up - Fix GDB pretty printer for JSString. r=jonco
I had to use try-except instead of "in" because if the value is a pointer type
(like JSString*) then "in" returned false.

I tested this with both 32-bit and 64-bit builds.

Differential Revision: https://phabricator.services.mozilla.com/D40978

--HG--
extra : moz-landing-system : lando
2019-08-08 11:57:21 +00:00