Commit Graph

78651 Commits

Author SHA1 Message Date
Steve Fink
98eb6c1864 Bug 1661410 - Post-barrier writes to TypedObject string references r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D88466
2020-09-02 19:25:03 +00:00
Nathan Froyd
cfb8fb313f Bug 1662251 - stop assigning from NS_Convert* values, mostly; r=sg
This patch was generated by running:

```
perl -p -i \
     -e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF8toUTF16\((.*)\);/\1CopyUTF8toUTF16(\3, \2);/;' \
     -e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF16toUTF8\((.*)\);/\1CopyUTF16toUTF8(\3, \2);/;' \
     $FILE
```

against every .cpp and .h in mozilla-central, and then fixing up the
inevitable errors that happen as a result of matching C++ expressions with
regexes.  The errors fell into three categories:

1. Calling the convert functions with `std::string::c_str()`; these were
   changed to simply pass the string instead, relying on implicit conversion
   to `mozilla::Span`.
2. Calling the convert functions with raw pointers, which is not permitted
   with the copy functions; these were changed to invoke `MakeStringSpan` first.
3. Other miscellaneous errors resulting from over-eager regexes and/or the
   replacement not being type-aware.  These changes were reverted.

Differential Revision: https://phabricator.services.mozilla.com/D88903
2020-09-02 09:54:37 +00:00
Razvan Maries
eae150a880 Backed out 5 changesets (bug 1661457, bug 1661428, bug 1661497, bug 1661502) for build bustages on Result.h. CLOSED TREE
Backed out changeset fbf42b3b51f3 (bug 1661428)
Backed out changeset 83f3f36d540f (bug 1661457)
Backed out changeset 8a9dce0d08ce (bug 1661502)
Backed out changeset 733df139089a (bug 1661497)
Backed out changeset fca770fc0956 (bug 1661428)
2020-09-02 19:44:47 +03:00
Jon Coppeard
d11d13b94c Bug 1661766 - Simplify representation of slots/element ranges on the mark stack r=sfink. CLOSED TREE
This stores slots/element ranges as object and start index rather than having
two separate representations (one used during marking, one when we yield to the
mutator during marking). It's possible that this could affect marking
performance but we'll catch that by checking the mark rate telemetry. This
should also reduce the size needed for the mark stack a little.

Differential Revision: https://phabricator.services.mozilla.com/D88723
2020-09-02 08:47:52 +00:00
Simon Giesecke
d4179392a0 Bug 1661502 - Make Result move-only. r=froydnj,jandem
Differential Revision: https://phabricator.services.mozilla.com/D88443
2020-09-02 16:23:01 +00:00
Razvan Maries
31e4fc673b Backed out changeset f90f01b99ece (bug 1662260) for build bustages on bug-1662260.js. CLOSED TREE 2020-09-02 18:09:48 +03:00
Kannan Vijayan
46acd070ab Bug 1662260 - OOM check in parser. r=mgaudet DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D89071
2020-09-01 23:50:15 +00:00
Benjamin Bouvier
219501d3c5 Bug 1662705: Add an --help dependency to the JS simulator option; r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D89126
2020-09-02 12:37:33 +00:00
Gurzau Raul
d5ffb485ad Backed out changeset da45331c242c (bug 1661766) for wpt failure on timestamp.html on a CLOSED TREE. 2020-09-02 15:24:53 +03:00
Benjamin Bouvier
557609e365 Bug 1662668: Test for the presence of a simulator when enabling Cranelift; r=lth
Differential Revision: https://phabricator.services.mozilla.com/D89109
2020-09-02 09:02:46 +00:00
Jon Coppeard
f23e218e38 Bug 1661766 - Simplify representation of slots/element ranges on the mark stack r=sfink
This stores slots/element ranges as object and start index rather than having
two separate representations (one used during marking, one when we yield to the
mutator during marking). It's possible that this could affect marking
performance but we'll catch that by checking the mark rate telemetry. This
should also reduce the size needed for the mark stack a little.

Differential Revision: https://phabricator.services.mozilla.com/D88723
2020-09-02 08:47:52 +00:00
Benjamin Bouvier
a976c16222 Bug 1660944: Use Cranelift by default for wasm compilation on aarch64; r=lth
Differential Revision: https://phabricator.services.mozilla.com/D88396
2020-09-02 08:17:36 +00:00
Benjamin Bouvier
e16e5f0a18 Bug 1661016: aarch64: Invalidate icache when compiling on a background thread; r=nbp,lth
On real hardware, when a background thread finishes compilation, it must signal
to the other executing threads that they need to reload a new version of the
code. Ideally, each executing thread would run an ISB instruction to do so. We
hereby use a system call membarrier that interrupts every other running thread,
and will cause the same effect as a local ISB would. It is heavyweight, so we
make sure to only run it in the case where we're on a background thread.

In the simulator, pending icache flushing requests were never satisfied before
this patch, when the request was emitted from a thread other than the main
thread. Similar behavior as above is emulated.

Differential Revision: https://phabricator.services.mozilla.com/D88395
2020-09-02 08:17:33 +00:00
Jan de Mooij
cbc5eb3bd9 Bug 1662366 part 7 - Some MBoxNonStrictThis optimizations. r=anba
This adds an OOL path to handle null/undefined => globalThis without a VM call.
IonBuilder optimizes that case based on TI and this ensures we're not a lot slower
for that.

Also give the MIR instruction an empty AliasSet so we can optimize it better in
inlined functions. We no longer have the thisValue hook mentioned in the comment.

Differential Revision: https://phabricator.services.mozilla.com/D88974
2020-09-02 07:39:37 +00:00
Jan de Mooij
287b183550 Bug 1662366 part 6 - Trace cloned CacheIR stub data. r=iain
Initially the plan was to reuse TraceCacheIRStub but this patch adds the tracing
code for Warp separately because:

* CacheIR stub data in Warp contains nursery indexes. It's nice to keep that out of the IC-tracing code.
* We can use WarpGCPtr similar to other snapshotted GC pointers. It asserts GC things are not moved.

Differential Revision: https://phabricator.services.mozilla.com/D88965
2020-09-02 07:35:15 +00:00
Jan de Mooij
70f4e1f948 Bug 1662366 part 5 - Print CompileInfo pointer in WarpCacheIR::dumpData. r=iain
Longer-term more CompileInfo fields should be moved into WarpSnapshot, we can
then dump these fields.

Depends on D88963

Differential Revision: https://phabricator.services.mozilla.com/D88964
2020-09-01 15:35:38 +00:00
Jan de Mooij
26af3accda Bug 1662366 part 4 - Rename some TODOs to TODO(post-Warp). r=iain
Depends on D88962

Differential Revision: https://phabricator.services.mozilla.com/D88963
2020-09-01 15:35:05 +00:00
Jan de Mooij
61e6f7db24 Bug 1662366 part 3 - Remove/rename some TODOs in WarpBuilder. r=iain
Use TODO(post-Warp) for TODOs that can only be addressed when IonBuilder is gone.

Remove some TODOs that are no longer relevant or don't need to be addressed
short-term.

Depends on D88961

Differential Revision: https://phabricator.services.mozilla.com/D88962
2020-09-02 07:30:34 +00:00
Jan de Mooij
cc3e1eb429 Bug 1662366 part 2 - Call setImplicitlyUsedUnchecked for JSOp::ToString. r=iain
Allowlisting this op in the checker is wrong because we don't want a
MagicValue to show up for JSOp::ToString in Baseline.

Depends on D88960

Differential Revision: https://phabricator.services.mozilla.com/D88961
2020-09-01 15:25:18 +00:00
Jan de Mooij
3f78c1c5fd Bug 1662366 part 1 - Remove some TODOs in WarpOracle. r=iain
The ones in maybeInlineIC have been addressed. The one about extra var environments
isn't really a TODO for Warp specifically.

Also change the stub data copying to just use nullptr if there's no stub data.
This is fairly common for simpler IC stubs.

Differential Revision: https://phabricator.services.mozilla.com/D88960
2020-09-01 15:23:01 +00:00
Tooru Fujisawa
3478b236f8 Bug 1658971 - Part 13: Remove JSContext* field from CompilationInfo. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88613
2020-09-01 23:52:42 +00:00
Tooru Fujisawa
8334256472 Bug 1658971 - Part 12: Add JSContext* parameter to RealmInstrumentation::getInstrumentationKindName. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88612
2020-09-01 23:52:35 +00:00
Tooru Fujisawa
527c5a4c08 Bug 1658971 - Part 11: Add JSContext* parameter to ParserAtomToResumeKind. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88611
2020-09-01 23:52:27 +00:00
Tooru Fujisawa
e82ab62e18 Bug 1658971 - Part 10: Add JSContext* parameter to Int32ToParserAtom and NumberToParserAtom. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88610
2020-09-01 23:52:19 +00:00
Tooru Fujisawa
c0365679aa Bug 1658971 - Part 9: Add JSContext* field to FoldVisitor and FoldInfo. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88609
2020-09-01 23:52:10 +00:00
Tooru Fujisawa
4e8d257ace Bug 1658971 - Part 8: Add JSContext* parameter to liftParserAtomToJSAtom and lowerJSAtomToParserAtom. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88608
2020-09-01 23:52:02 +00:00
Tooru Fujisawa
7b926b0020 Bug 1658971 - Part 7: Use CompilationInput.enclosingScope in GCThingList::getScope. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88607
2020-09-01 23:51:54 +00:00
Tooru Fujisawa
cbf462e163 Bug 1658971 - Part 6: Add JSContext* parameter to Smoosh::compileGlobalScript*. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88606
2020-09-01 23:51:47 +00:00
Tooru Fujisawa
2289962f8e Bug 1658971 - Part 5: Add JSContext* field to TokenStreamAnyChars. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88605
2020-09-01 23:51:44 +00:00
Tooru Fujisawa
0cf72ff50b Bug 1658971 - Part 4: Add JSContext* parameter to SourceAwareCompiler and subclasses methods. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88604
2020-09-01 23:51:37 +00:00
Tooru Fujisawa
e603770e80 Bug 1658971 - Part 3: Add JSContext* parameter to ParseModuleToStencil. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88603
2020-09-01 23:51:29 +00:00
Tooru Fujisawa
038fa9f061 Bug 1658971 - Part 2: Add JSContext* parameter to CompileGlobalScript* and InstantiateStencils. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88602
2020-09-01 23:51:22 +00:00
Tooru Fujisawa
fbd7e031b2 Bug 1658971 - Part 1: Store self-hosting global scope in CompilationInput.enclosingScope. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88601
2020-09-02 01:39:25 +00:00
Tooru Fujisawa
cdda495ffc Bug 1658631 - Part 11: Perform ModuleObject::Freeze in CompilationInfo::instantiateStencils if instantiating on main thread. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88600
2020-09-01 23:51:12 +00:00
Tooru Fujisawa
cb91e5336a Bug 1658631 - Part 10: Do not call fixEnclosingEnvironmentAfterRealmMerge if useOffThreadParseGlobal is false. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88599
2020-09-01 23:51:05 +00:00
Tooru Fujisawa
a725f26f52 Bug 1658631 - Part 9: Rename module functions to align with others. r=tcampbell
Compile{Foo} for public API, and Compile{Foo}Impl for internal template functions.

Differential Revision: https://phabricator.services.mozilla.com/D88598
2020-09-01 23:50:57 +00:00
Tooru Fujisawa
b24bef82b3 Bug 1658631 - Part 8: Simplify CompileEvalScript. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88597
2020-09-01 23:50:49 +00:00
Tooru Fujisawa
6c197b6bd3 Bug 1658631 - Part 7: Simplify main-thread API for CompileGlobalScript. r=tcampbell
Stop exposing CompilationGCOutput where the consumer doesn't need to instantiate stencil in different step.

Differential Revision: https://phabricator.services.mozilla.com/D88596
2020-09-01 23:50:42 +00:00
Tooru Fujisawa
27c25bb079 Bug 1658631 - Part 6: Stop creating parse global if useOffThreadParseGlobal is set to false. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88987
2020-09-01 23:50:40 +00:00
Tooru Fujisawa
03e228caaa Bug 1658631 - Part 5: Make ParseTask.parseGlobal nullable. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88986
2020-09-01 23:50:32 +00:00
Tooru Fujisawa
c85d049532 Bug 1658631 - Part 4: Defer enclosingScope init for modules. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D89075
2020-09-02 00:50:39 +00:00
Tooru Fujisawa
d06cc89e5d Bug 1658631 - Part 3: Support instantiating stencil in main thread for off-thread script/module compilation. r=tcampbell
If useOffThreadParseGlobal option is set to false, ParseTask generates
CompilationInfo, that contains both input and stencil output,
and the main thread grabs it and instantiate it on the main thread, when
finishing the compilation.

Differential Revision: https://phabricator.services.mozilla.com/D88594
2020-09-01 23:50:17 +00:00
Tooru Fujisawa
8d0f9a9d84 Bug 1658631 - Part 2: Add frontend::ParseModuleToStencil. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88593
2020-09-01 23:50:07 +00:00
Tooru Fujisawa
cd2f375040 Bug 1658631 - Part 1: Add frontend::CompileGlobalScriptToStencil and frontend::InstantiateStencils. r=tcampbell
CompileGlobalScriptToStencil returns CompilationStencil in CompilationInfo as the result of compilation,
and the consumer can call InstantiateStencils to instantiate GC objects,
that can be done later and in different thread.

Differential Revision: https://phabricator.services.mozilla.com/D88592
2020-09-01 23:50:00 +00:00
Tooru Fujisawa
24548fca91 Bug 1662374 - Stop using AutoKeepAtoms and remove JS_HAZ_ROOTED in frontend. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88985
2020-09-01 23:49:52 +00:00
Butkovits Atila
0a4e8515f2 Backed out changeset 92ba922e6af8 (bug 1661410) for build bustage at bug1661410-stringpost.js. CLOSED TREE 2020-09-02 04:04:30 +03:00
Ted Campbell
8da62eaaa3 Bug 1662583 - Skip Memory-takeCensus-11.js JS test under code-coverage. r=arai
This test fails when run with `--code-coverage` because that flag keeps the
top-level scripts of each file alive which messes with the census
expectations.

Differential Revision: https://phabricator.services.mozilla.com/D89060
2020-09-01 22:06:36 +00:00
Ted Campbell
644ba8edae Bug 1662583 - Add JS tests for code-coverage / off-thread-parse combination. r=arai
IonMonkey has inconsistent coverage data here, so disable for these tests.

Differential Revision: https://phabricator.services.mozilla.com/D89059
2020-09-01 22:06:29 +00:00
Steve Fink
e615826b0d Bug 1661410 - Post-barrier writes to TypedObject string references r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D88466
2020-08-28 16:00:17 +00:00
yohaan
c74cbf5311 Bug 1586441 Using iterator and BytecodeIterable in for loop instead of jsbytecode* pc r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D88732
2020-09-01 21:11:54 +00:00