Граф коммитов

78794 Коммитов

Автор SHA1 Сообщение Дата
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
Iain Ireland 113e513083 Bug 1661861: Generate arguments rectifier for trial inlining r=jandem
We don't have to store a separate return offset for trial inlining, because the rectifier code after returning from the call is exactly the same. Post-bailout, inline frames will return into the normal non-inline code.

Differential Revision: https://phabricator.services.mozilla.com/D88694
2020-08-31 12:51:14 +00:00
André Bargull 5c6157aab2 Bug 1660409 - Part 4: Transpile ArrayJoin. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D88565
2020-09-01 13:06:06 +00:00
André Bargull 508ed229f6 Bug 1662073 - Part 8: Add `getShared` accessor to RegExp object. r=iain
Add a `getShared` accessor to RegExpObject to retrieve a previously assigned
`RegExpShared` object. And then replace two calls to the fallible
`RegExpObject::getShared()` method with the new accessor. This way we can
avoid calling a fallible method whose return value is ignored.

Depends on D88795

Differential Revision: https://phabricator.services.mozilla.com/D88796
2020-09-01 12:27:29 +00:00
André Bargull 746f0fb53c Bug 1662073 - Part 7: Assert named capturing groups array length is divisible by two. r=iain
It seems nice to also assert the array length is divisible by two, given that
the array is created entirely elsewhere.

Depends on D88794

Differential Revision: https://phabricator.services.mozilla.com/D88795
2020-08-31 17:17:40 +00:00
André Bargull e828875e41 Bug 1662073 - Part 6: Use ranged for-loops in RegExp named capturing code. r=iain
These two loops can be simplified to use ranged for-loops, reducing a bit of
boilerplate code.

Depends on D88793

Differential Revision: https://phabricator.services.mozilla.com/D88794
2020-08-31 17:15:28 +00:00
André Bargull 77e192657b Bug 1662073 - Part 5: Remove unnecessary rooting for RegExp named captures. r=iain
Remove unnecessary rooting and move a rooting variable outside of a loop. Sadly
we still don't have static analysis to catch this (bug 1362038).

Drive-by change:
- Add more blank lines before comments.

Depends on D88792

Differential Revision: https://phabricator.services.mozilla.com/D88793
2020-08-31 17:00:34 +00:00
André Bargull 673d113f49 Bug 1662073 - Part 4: Remove unnecessary assignment to `skip` out-param in InterpretDollar. r=iain
The `skip` out-param is only read when `InterpretDollar` returns `true`, so we
can remove both assignments which are followed by `return false`.

Drive-by change:
- Move another assignment to `skip` to appear directly before `return true`, so
  it's more obvious that `skip` only needs to be set on success.
- Add a blank line before a comment, per our normal style guides.

Depends on D88791

Differential Revision: https://phabricator.services.mozilla.com/D88792
2020-08-31 16:59:02 +00:00
André Bargull 2804d62daf Bug 1662073 - Part 3: Remove irregexp table generation from Unicode script. r=iain
The files generated by these functions were already removed.

Depends on D88790

Differential Revision: https://phabricator.services.mozilla.com/D88791
2020-08-31 16:43:28 +00:00
André Bargull 2f691e947e Bug 1662073 - Part 2: Removed no longer used Unicode case folding macros. r=iain
These macros were used by the local irregexp copy to implement Unicode RegExps.
They have been replaced by calls to ICU.

Depends on D88789

Differential Revision: https://phabricator.services.mozilla.com/D88790
2020-08-31 16:42:50 +00:00
André Bargull bf763971a9 Bug 1662073 - Part 1: Make make_unicode.py Python3.7 compatible (PEP 479). r=iain
`next()` throws StopIteration when the iterator has been exhausted. Before
PEP 479, throwing StopIteration implicitly closes a generator and is not
propagated to the caller. After PEP 479, the StopIteration error is propagated
to the caller.

Differential Revision: https://phabricator.services.mozilla.com/D88789
2020-08-31 16:42:27 +00:00
Tom Schuster 44c4883347 Bug 1662249 - Transpile CallSetArrayLength. r=jandem
Unfortunately we already have MSetArrayLength so introducing MCallSetArrayLength might be confusing.
I am not sure what do instead.

Differential Revision: https://phabricator.services.mozilla.com/D88902
2020-09-01 06:08:54 +00:00
Jan de Mooij b30bc98e22 Bug 1659724 part 5 - Transpile GuardStringToNumber. r=anba
CacheIRCompiler using int32-or-double and MIR always using double makes it annoying
to share more code like in the previous patch. Hopefully we can align this more in
the future.

Differential Revision: https://phabricator.services.mozilla.com/D87708
2020-09-01 06:19:35 +00:00
Jan de Mooij f02c7b1d32 Bug 1659724 part 4 - Transpile GuardStringToInt32. r=anba
Differential Revision: https://phabricator.services.mozilla.com/D87707
2020-09-01 06:19:11 +00:00
Jan de Mooij acbda02290 Bug 1659724 part 3 - Transpile GuardStringToIndex. r=anba
This is useful for example when for-in is used to iterate over an array.

Differential Revision: https://phabricator.services.mozilla.com/D87706
2020-09-01 06:18:48 +00:00
Jan de Mooij cb8840982d Bug 1659724 part 2 - Transpile BooleanToNumber. r=anba
Differential Revision: https://phabricator.services.mozilla.com/D87705
2020-09-01 06:18:23 +00:00
Jan de Mooij 57397f6bfa Bug 1659724 part 1 - Rename some GuardAndGetXFromY CacheIR ops to GuardYToX. r=anba
GuardAndGetNumberFromBoolean is infallible, so that was renamed to BooleanToNumber.
That's consistent with BooleanToString.

Differential Revision: https://phabricator.services.mozilla.com/D87704
2020-09-01 06:18:16 +00:00
Olli Pettay b163d0ab51 Bug 1661812 - Consider to use longer timeout for slow script warning if there isn't any important user input pending r=mccr8,geckoview-reviewers,snorp
The patch converts the relevant prefs to use StaticPrefList and let's content JS in child processes to run longer if there
aren't mousedown/ups or keyevents or such. mousemove or wheel aren't considered as important events.

Differential Revision: https://phabricator.services.mozilla.com/D88668
2020-09-01 07:21:26 +00:00
Paul Bone a7ab41b822 Bug 1661888 - pt 2. Move a field to avoid padding r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D88709
2020-09-01 04:50:52 +00:00
Paul Bone 02f1096277 Bug 1661888 - pt 1. Size the profiling stack in bytes r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D88708
2020-09-01 06:41:55 +00:00
Jan de Mooij 9ca7347e3c Bug 1661894 - Remove --no-ti flag. r=iain
This was useful before Warp existed, but now --warp is the configuration we want
to test, it also disables TI.

Differential Revision: https://phabricator.services.mozilla.com/D88836
2020-08-31 17:29:03 +00:00
Jan de Mooij 46f865b1a5 Bug 1661930 - Add GetScriptTranscodingBuildId and use it for both XDR and bytecode cache MIME type. r=nbp,tcampbell
This lets us include some extra flags in the MIME type that's used by the bytecode
cache. It also simplifies the XDR code a bit.

The approach is similar to Wasm's GetOptimizedEncodingBuildId.

Differential Revision: https://phabricator.services.mozilla.com/D88726
2020-08-31 19:38:31 +00:00
Tooru Fujisawa 6eecdba324 Bug 1662140 - Add javascript.options.off_thread_parse_global pref and --no-off-thread-parse-global shell option. r=tcampbell
This adds the preference, JS shell option, and {ContextOptions,CompileOptions} fields,
but the value isn't read and the code always acts as it's set to true.

Differential Revision: https://phabricator.services.mozilla.com/D88922
2020-08-31 23:32:14 +00:00
Ted Campbell d10b7e7d13 Bug 1662127 - Add ParseTask::runtime field. r=djvj
Instead of relying on the parseGlobal to determine the runtime, store it
directly.

Differential Revision: https://phabricator.services.mozilla.com/D88862
2020-08-31 21:07:49 +00:00
Ted Campbell 50fc073890 Bug 1662127 - Avoid needing active Realm for ScriptSource initialization. r=djvj
The SharedImmutableStrings cache is not tied to gc::Zone so use the JSRuntime
directly from the JSContext instead.

Differential Revision: https://phabricator.services.mozilla.com/D88861
2020-08-31 20:51:30 +00:00
Ted Campbell 63fd40e9dd Bug 1662127 - Remove AutoKeepAtoms argument from TokenStream. r=djvj
After Bug 1660798, the TokenStreamPosition no longer uses JSAtoms and the
AutoKeepAtoms argument is not needed.

Differential Revision: https://phabricator.services.mozilla.com/D88860
2020-08-31 20:52:46 +00:00
Ted Campbell 20f76e64bf Bug 1662113 - The `dumpStencil` shell function must emplace top stencil. r=arai
Since the `dumpStencil` duplicates part of the BytecodeCompiler code, we must
explicitly instantiate the top-level stencil before parse is run. Also add a
test case for this.

Differential Revision: https://phabricator.services.mozilla.com/D88898
2020-08-31 20:30:33 +00:00
Iain Ireland a69d3f2397 Bug 1661352: Transpile spread calls r=jandem
The assertion in emitLoadArgumentSlot was unnecessary. Spread calls always have an argc of 1, so `hasArgumentArray` and `!addArgc` cancel each other out in GetIndexOfArgument.

Depends on D88513

Differential Revision: https://phabricator.services.mozilla.com/D88514
2020-08-28 17:24:47 +00:00
Iain Ireland d32bc4c647 Bug 1661352: Transpile FunApplyArray r=jandem
CallInfo::ArgFormat::Array supports FunApplyArray (in this patch), SpreadCall (in the next patch), and eventually SpreadNew/SpreadSuperCall.

Depends on D88512

Differential Revision: https://phabricator.services.mozilla.com/D88513
2020-08-28 08:21:00 +00:00
Iain Ireland 79d8ceec1b Bug 1661352: Store arg format in CallInfo r=jandem
This makes transpiling nicer, and should also make inlining much easier.

Depends on D88511

Differential Revision: https://phabricator.services.mozilla.com/D88512
2020-08-28 08:11:52 +00:00
Iain Ireland 9ae99bc021 Bug 1661352: Transpile GuardArrayIsPacked r=jandem
It's a bit awkward having both MIsPackedArray and MGuardArrayIsPacked, but I didn't see a nicer approach.

Differential Revision: https://phabricator.services.mozilla.com/D88511
2020-08-28 17:46:14 +00:00
Iain Ireland b3390ba21f Bug 1661352: Split up GuardFunApplyArray r=jandem
Prior to the NON_PACKED flag, we had to iterate over each element of the array to verify that it was packed. It made sense to fold the argc check in with that code. Now that we are using the flag, I moved the argc check inside the call op to match other argument formats.

Differential Revision: https://phabricator.services.mozilla.com/D88510
2020-08-28 08:00:35 +00:00
Benjamin Bouvier 4b04d565e3 Bug 1661723: Add test case; r=lth
Differential Revision: https://phabricator.services.mozilla.com/D88785
2020-08-31 11:24:06 +00:00
Jon Coppeard 1733507c90 Bug 1661718 - Simplify optimised marking for TypeObject trace lists r=sfink
Put the optimised marking path inside the trace hook so that we simplify
calling the trace hook from the marking code.

Differential Revision: https://phabricator.services.mozilla.com/D88632
2020-08-30 17:40:03 +00:00
Matthew Gaudet d231c48c00 Bug 1658070 - Save and restore expando slot on proxies during JSObject::swap r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D88673
2020-08-31 15:00:09 +00:00
André Bargull 2e43581c73 Bug 1645373 - Part 3: Transpile LoadInstanceOfObjectResult. r=jandem
Transpile `LoadInstanceOfObjectResult` through the existing `MInstanceOf` op.
In contrast to the CacheIR implementation, `MInstanceOf` can also handle
proxy objects in the prototype chain via a VM call, whereas the CacheIR
implementation always bails out in that case.

Depends on D88574

Differential Revision: https://phabricator.services.mozilla.com/D88575
2020-08-31 13:34:25 +00:00
André Bargull 0c00fa4b44 Bug 1645373 - Part 2: Change MInstanceOf to use MDefinition for the prototype. r=jandem
Change `MInstanceOf` to use `MDefinition` for the prototype in preparation for
part 3. Lowering uses `useRegisterOrConstant()` to ensure we still bake in the
prototype for constant objects, which is the default in both Ion and Warp.


Drive-by change:
Remove bogus `LInstanceOfV::lhs()` and `LInstanceOfCache::lhs()` methods. The
left-hand side is a boxed operand, so it can't be accessed through `getOperand`.

Depends on D88573

Differential Revision: https://phabricator.services.mozilla.com/D88574
2020-08-31 10:01:00 +00:00
André Bargull 1ba9e2d770 Bug 1645373 - Part 1: Replace InstanceOfPolicy with BoxExceptPolicy. r=jandem
`InstanceOfPolicy` is equivalent with `BoxExceptPolicy`, so let's use the
latter as the off the shelf type policy.

Differential Revision: https://phabricator.services.mozilla.com/D88573
2020-08-31 09:55:11 +00:00
André Bargull a4aae7e318 Bug 1660409 - Part 3: Change CacheIR ArrayJoin to use a VMCall instead of a FailurePath. r=jandem
Use a CallVM instead of a FailurePath to match the Ion optimised path. This
change will allow part 4 to use the existing MArrayJoin call for Warp.

Differential Revision: https://phabricator.services.mozilla.com/D88564
2020-08-31 13:27:41 +00:00
André Bargull faf8e0e16e Bug 1660409 - Part 2: Add LoadConstantString CacheIR op. r=jandem
Add a new CacheIR op to load a constant string in preparation for part 3.

Differential Revision: https://phabricator.services.mozilla.com/D88562
2020-08-31 11:32:57 +00:00
André Bargull c893226625 Bug 1660409 - Part 1: Change ArrayJoin to an unshared op. r=jandem
Change to unshared CacheIR op in preparation for part 3.

Differential Revision: https://phabricator.services.mozilla.com/D88561
2020-08-31 11:32:19 +00:00
Jan de Mooij 8354e47ac5 Bug 1661695 part 1 - Disable optimization levels if Warp is enabled. r=iain
We don't currently use this in Warp and it can cause some weirdness, especially
with lower warmup thresholds and off-thread compilation, where we start a
recompile for no good reason.

Differential Revision: https://phabricator.services.mozilla.com/D88584
2020-08-28 17:47:31 +00:00
Sylvestre Ledru 9c192aa9ca Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D88713
2020-08-31 09:23:02 +00:00
Mihai Alexandru Michis 261d01524b Backed out changeset d0f173a90792 (bug 1519636) for causing bustages.
CLOSED TREE
2020-08-31 10:14:58 +03:00
Sylvestre Ledru 939dd426e6 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D88713
2020-08-31 06:51:21 +00:00
André Bargull 7144bdce89 Bug 1660599: Only StoreDenseElementHole with handleAdd=true guarantees writable array length. r=jandem
We can only assert that the array length is writable for the
`handleTrue = true` case. This also requires to reintroduce the writable array
length check to the Ion IC code.

Added tests to cover multiple scenarios where the StoreDenseElementHole IC is
used.

Differential Revision: https://phabricator.services.mozilla.com/D88031
2020-08-28 09:18:50 +00:00
Matthew Gaudet 08293afb21 Bug 1659595 - Avoid creating atoms for BigInts when parsing r=jorendorff,tcampbell,jandem
This parses BigInt property names as if they were computed, which means we don't end up neeeding to atomize
them.

This does mean that BigInt property names take a slower path on construction, meaning that it is possible
to measure a slowdown on executing the construction of a huge literal with thousands of BigInt properties.

This patch adds one bit to ParseNode.h, but does not change the overall size of parse nodes, as it fits
into padding around pre-existing bitfields.

Differential Revision: https://phabricator.services.mozilla.com/D87627
2020-08-28 20:56:12 +00:00
Adam Vandolder 833163a200 Bug 1658318 - Add Reflect[@@toStringTag]. r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D87874
2020-08-28 16:33:02 +00:00
Iain Ireland 91d7a5c7cc Bug 1661530: Attach FunApply and FunCall before scripted calls r=jandem
Despite looking directly at this code while adding the assertion in bug 1660553, I somehow missed that scripted calls were being attached too early. It's not a problem for Ion, because we only inline `FunCall`/`FunApply` if we're calling the jsnative, but it matters for Warp.

Differential Revision: https://phabricator.services.mozilla.com/D88463
2020-08-28 07:53:09 +00:00
Tooru Fujisawa d5cbb2ceb8 Bug 1660538 - Add SMDOC for async function and async generator. r=jorendorff DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D87896
2020-08-28 16:57:38 +00:00
Jan de Mooij ad64e21c58 Bug 1652732 - Propagate ImplicitlyUsed flag in justReplaceAllUsesWith. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D88566
2020-08-28 10:05:34 +00:00
Tooru Fujisawa fba1cbf525 Bug 1661079 - Part 16: Remove JSContext* parameter from ScriptStencil. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88526
2020-08-28 15:00:11 +00:00
Tooru Fujisawa b13dc2da35 Bug 1661079 - Part 15: Add warning about CompilationInfo.cx. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88353
2020-08-28 14:34:54 +00:00
Tooru Fujisawa 35dc53c431 Bug 1661079 - Part 14: Use JSRuntime* parameter in ParserAtomsTable and CompilationStencil. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88352
2020-08-28 14:34:52 +00:00
Tooru Fujisawa 10e0c8c80f Bug 1661079 - Part 13: Remove JSContext* parameter from WellKnownParserAtoms. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88351
2020-08-28 14:34:49 +00:00
Tooru Fujisawa 7dd156c524 Bug 1661079 - Part 12: Use SystemAllocPolicy in WellKnownParserAtoms.entrySet_ and ParserAtomsTable.entrySet_. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88350
2020-08-28 14:34:47 +00:00
Tooru Fujisawa 7c52b93514 Bug 1661079 - Part 11: Remove JSContext* parameter from StencilModuleMetadata. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88349
2020-08-28 14:34:45 +00:00
Tooru Fujisawa ffb2e44a50 Bug 1661079 - Part 10: Use SystemAllocPolicy in FunctionDeclarationVector. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88348
2020-08-28 14:34:42 +00:00
Tooru Fujisawa 345daf1688 Bug 1661079 - Part 9: Use SystemAllocPolicy in StencilModuleMetadata::EntryVector and ModuleBuilder::RequestedModuleVector. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88347
2020-08-28 14:34:40 +00:00
Tooru Fujisawa 0078ef4b84 Bug 1661079 - Part 8: Use SystemAllocPolicy in CompilationStencil.asmJS. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88346
2020-08-28 14:33:33 +00:00
Tooru Fujisawa 967bb8c1bd Bug 1661079 - Part 7: Use SystemAllocPolicy in CompilationStencil.scopeData. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88345
2020-08-28 14:33:25 +00:00
Tooru Fujisawa e2512aa075 Bug 1661079 - Part 6: Use SystemAllocPolicy in CompilationStencil.scriptData. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88344
2020-08-28 14:33:23 +00:00
Tooru Fujisawa c1f337346e Bug 1661079 - Part 5: Use SystemAllocPolicy in CompilationStencil.objLiteralData. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88343
2020-08-28 14:33:16 +00:00
Tooru Fujisawa a11f734f0e Bug 1661079 - Part 4: Use SystemAllocPolicy in CompilationStencil.bigIntData. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88342
2020-08-28 14:33:08 +00:00
Tooru Fujisawa c707dd5840 Bug 1661079 - Part 3: Use SystemAllocPolicy in CompilationStencil.regExpData. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88341
2020-08-28 14:33:00 +00:00
Tooru Fujisawa f137cbf408 Bug 1661079 - Part 2: Remove JSContext* parameter from CompilationInput. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88340
2020-08-28 14:32:53 +00:00
Tooru Fujisawa 08cc5ac8fc Bug 1661079 - Part 1: Use SystemAllocPolicy in CompilationInput.atoms. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88339
2020-08-28 14:32:51 +00:00
Tooru Fujisawa 441884a93f Bug 1661098 - Make CompilationInfo not stack class. r=tcampbell
To make CompilationInfo a result of off-thread compilation,
it should be allocated on heap.

Remove explicit rooting and add trace functions.

Differential Revision: https://phabricator.services.mozilla.com/D88338
2020-08-28 14:32:43 +00:00
Jon Coppeard 6356a732bc Bug 1660293 - Lock store buffer while sweeping weak caches on main thread after OOM r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D88043
2020-08-24 23:02:44 +00:00
Jan de Mooij e46853486e Bug 1660862 - Use the JIT's interpreter-trampoline for Wasm exports with lazy stubs. r=bbouvier
This ensures isWasmWithJitEntry() is always true for the function, fixing a perf
cliff with ICs (function was called with native ABI instead of JIT ABI). It also
fixes an assertion failure when Warp is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D88383
2020-08-28 14:29:11 +00:00
Simon Giesecke ff85972891 Bug 1661476 - Prevent Result<const V, E> or Result<V, const E> from being instantiated. r=froydnj
Also, remove the existing uses of Result<const nsCString, nsresult> in URLPreloader
and Result<CryptoScheme, const nsCString> in SampleIterator.

Differential Revision: https://phabricator.services.mozilla.com/D88419
2020-08-28 14:16:35 +00:00
Jan de Mooij 88fb7f1777 Bug 1661426 part 3 - Remove isWarpEnabled testing function. r=iain
Depends on D88406

Differential Revision: https://phabricator.services.mozilla.com/D88407
2020-08-28 03:09:28 +00:00
Jan de Mooij d5d87317dc Bug 1661426 part 2 - Add a browser pref for Warp. r=iain
The TI flag is only defined on Nightly (non-Nightly hardcodes to true) so for now
the pref is Nightly-only too.

Differential Revision: https://phabricator.services.mozilla.com/D88406
2020-08-28 03:09:28 +00:00
Jan de Mooij c546983389 Bug 1661426 part 1 - Add TI check to XDR. r=tcampbell
Firefox was crashing after toggling the Warp pref. This patch fixes it by storing
an isTypeInferenceEnabled flag in XDR similar to the pointer size.

Differential Revision: https://phabricator.services.mozilla.com/D88405
2020-08-28 03:09:27 +00:00
Ted Campbell a0546a5ab8 Bug 1661454 - Propegate OOM from isVarRedeclaredInInnermostScope. r=arai
Until we have a complete system for scope shapshotting, there is still a
window for OOM to happening while computing annex-B redeclaration behaviour
within eval. Work around this by propegating the OOM to further up to caller.

Differential Revision: https://phabricator.services.mozilla.com/D88476
2020-08-27 19:49:24 +00:00
Tooru Fujisawa 4afed2d20f Bug 1649968 - Part 14: Make CompilationInput::setSource private. r=tcampbell
Depends on D88217

Differential Revision: https://phabricator.services.mozilla.com/D88218
2020-08-27 22:14:28 +00:00
Tooru Fujisawa c51aef1767 Bug 1649968 - Part 13: Make CompilationInfo::init* explicit about the target. r=tcampbell
Now we have the following 5 public methods, and the consumer should call one of them, depending on the target:
  * initForGlobal
  * initForStandaloneFunction
  * initForEval
  * initForModule
  * initFromLazy

Depends on D88216

Differential Revision: https://phabricator.services.mozilla.com/D88217
2020-08-27 22:14:26 +00:00
Tooru Fujisawa 3f163d3045 Bug 1649968 - Part 12: Move CompilationState into SourceAwareCompiler. r=tcampbell
CompilationState is used from both Parser and BytecodeEmitter,
so SourceAwareCompiler should have it, and hide CompilationState from the API
consumers (except the place that directly calls Parser).

Depends on D88215

Differential Revision: https://phabricator.services.mozilla.com/D88216
2020-08-27 22:14:23 +00:00
Tooru Fujisawa a9591c626e Bug 1649968 - Part 11: Move dump to CompilationStencil. r=tcampbell
Depends on D88214

Differential Revision: https://phabricator.services.mozilla.com/D88215
2020-08-27 22:14:21 +00:00
Tooru Fujisawa a9c18434cc Bug 1649968 - Part 10: Move CompilationState out of CompilationInfo. r=tcampbell
The output of the compilation is input + stencil, and CompilationState is
purely the internal data.

Depends on D88213

Differential Revision: https://phabricator.services.mozilla.com/D88214
2020-08-27 22:13:16 +00:00
Tooru Fujisawa ad91d20146 Bug 1649968 - Part 9: Use CompilationState in ParseContext. r=tcampbell
Depends on D88212

Differential Revision: https://phabricator.services.mozilla.com/D88213
2020-08-27 22:12:53 +00:00
Tooru Fujisawa 9dd1b0d177 Bug 1649968 - Part 8: Use CompilationStencil in RegExpLiteral. r=tcampbell
Depends on D88211

Differential Revision: https://phabricator.services.mozilla.com/D88212
2020-08-27 22:12:45 +00:00
Tooru Fujisawa 0875a9dfa4 Bug 1649968 - Part 7: Use CompilationStencil in BigIntLiteral. r=tcampbell
Depends on D88210

Differential Revision: https://phabricator.services.mozilla.com/D88211
2020-08-27 22:12:30 +00:00
Tooru Fujisawa 59c98f2c1f Bug 1649968 - Part 6: Use CompilationStencil in ScopeCreationData::create. r=tcampbell
Depends on D88209

Differential Revision: https://phabricator.services.mozilla.com/D88210
2020-08-27 22:12:23 +00:00
Tooru Fujisawa 8af2640026 Bug 1649968 - Part 5: Move CompilationGCOutput out from CompilationInfo. r=tcampbell
CompilationGCOutput should have different lifetime than input + stencil.
CompilationGCOutput can even be allocated in different thread than the
compilation (off-thread compilation will instantiate stencil in main thread).

Depends on D88208

Differential Revision: https://phabricator.services.mozilla.com/D88209
2020-08-27 22:12:10 +00:00
Tooru Fujisawa 056a837191 Bug 1649968 - Part 4: Reorder ScriptStencilIterable definition. r=tcampbell
So that we don't need forward declaration.

Depends on D88207

Differential Revision: https://phabricator.services.mozilla.com/D88208
2020-08-27 22:11:50 +00:00
Tooru Fujisawa 76c4a7f0c0 Bug 1649968 - Part 3: Use CompilationStencil and CompilationGCOutput in ScriptStencilIterable. r=tcampbell
CompilationGCOutput will be moved out of CompilationInfo in later patch.

Depends on D88206

Differential Revision: https://phabricator.services.mozilla.com/D88207
2020-08-27 22:11:42 +00:00
Tooru Fujisawa 8751eb263b Bug 1649968 - Part 2: Move CompilationInfo methods to CompilationInput. r=tcampbell
Depends on D88205

Differential Revision: https://phabricator.services.mozilla.com/D88206
2020-08-27 22:11:29 +00:00
Tooru Fujisawa 20665eb36c Bug 1649968 - Part 1: Create CompilationInput, CompilationState, CompilationStencil, and CompilationGCOutput. r=tcampbell
This patch just adds 4 structs to categolize CompilationInfo fields.
Later patches will simplify methods and consumers.

Depends on D88204

Differential Revision: https://phabricator.services.mozilla.com/D88205
2020-08-27 22:11:16 +00:00
Tooru Fujisawa 1f293906ba Bug 1658556 - Do not use "stencil" for ScriptStencil variable. r=tcampbell
Where other stencil structure can appear, use `script` or `scriptStencil` instead.

Differential Revision: https://phabricator.services.mozilla.com/D88204
2020-08-26 22:14:56 +00:00
Tooru Fujisawa 90a2e27cb6 Bug 1660699 - Store JSAtom in CompilationInfo. r=tcampbell
ParserAtom now holds either AtomIndex that is an index into
CompilationInfo.atoms, or WellKnownAtomId that maps to cx->names() fields.

ParserAtoms in WellKnownParserAtoms holds WellKnownAtomId,
and ParserAtoms in CompilationInfo.parserAtoms holds AtomIndex.

GetWellKnownAtom relies on the struct layout of JSAtomState, to
quickly map WellKnownParserAtoms to its field.

Differential Revision: https://phabricator.services.mozilla.com/D88203
2020-08-26 22:14:48 +00:00
Ted Campbell 3742f3b6f0 Bug 1658720 - Remove CompilationInfo::topLevel. r=arai
Instead, rename funcData to scriptData and reserve index 0 for top-level. In
non-function script cases, we have to explicitly reserve the ScriptStencil
because this was previously only done by the FunctionBox code.

Differential Revision: https://phabricator.services.mozilla.com/D87068
2020-08-26 17:25:58 +00:00
Ted Campbell fb18e7d2dc Bug 1660891 - Remove more tracing code after ParserAtoms enabled. r=arai
The stencil data structures no longer interact directly with the GC and
remaining tracing code can be removed. The relevant vectors in the
CompilationInfo can also be simplified as a result.

Differential Revision: https://phabricator.services.mozilla.com/D88079
2020-08-27 16:49:32 +00:00
yohaan a7ebf0a72f Bug 1655110 added isPrivateName method to replace JSID manipulations r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D88404
2020-08-27 19:51:32 +00:00
Matthew Gaudet c39794a10f Bug 1660882 - Enable test262 tests for private methods r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D88161
2020-08-27 16:25:51 +00:00
Matthew Gaudet e54b26b98e Bug 1660882 - Edit test262-update.py to enable private methods tests r=jorendorff
(Running the script happens in a subsequent patch)

Depends on D88156

Differential Revision: https://phabricator.services.mozilla.com/D88157
2020-08-27 16:25:51 +00:00
Matthew Gaudet 0bf4606bd3 Bug 1660882 - Make --enable-private-methods imply --enable-private-fields r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D88156
2020-08-27 16:25:50 +00:00
Iain Ireland bf740b7795 Bug 1660592: Add --fast-warmup option r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D87937
2020-08-26 21:21:29 +00:00
Iain Ireland 3ed58d89e9 Bug 1661348: Fix CacheIRSpewer r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D88332
2020-08-27 16:04:41 +00:00
Adam Vandolder 314651cd20 Bug 1647437 - Allow accessing private fields and methods via Debugger.Frame.eval. r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D87868
2020-08-27 16:18:23 +00:00
Jon Coppeard c50d2510bc Bug 1635185 - Part 4: Removed the unused slotSpan field from BaseShape r=jandem
This also shrinks BaseShape down to 16 bytes on 32 bit platforms.

Differential Revision: https://phabricator.services.mozilla.com/D87889
2020-08-27 15:20:57 +00:00
Jon Coppeard f544bc0287 Bug 1635185 - Part 3: Store dictionary object slot span in the slots header r=jandem
This stores the slot span in the object slots error for dictionary mode
objects. Since it's possible to have dictionary mode objects without dynamic
slots, this adds sentinel ObjectSlots instances for each possible dictionary
slot span up to the maximum number of fixed slots.

Differential Revision: https://phabricator.services.mozilla.com/D87888
2020-08-27 15:20:39 +00:00
Jon Coppeard d73df31279 Bug 1635185 - Part 2: Use the stored capacity for NativeObject::numDynamicSlots() r=jandem
This renames methods that calculate the required slot count to calculateDynamicSlots().

Differential Revision: https://phabricator.services.mozilla.com/D87597
2020-08-27 15:24:00 +00:00
Jon Coppeard 2e30498ca3 Bug 1635185 - Part 1: Use a header for dynamic object slots and use it to store the capacity r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D87596
2020-08-27 15:18:17 +00:00
Steve Fink e3d6d03b60 Bug 1650501 - Fix memory handling in NewString test function r=anba
Differential Revision: https://phabricator.services.mozilla.com/D88333
2020-08-27 10:26:07 +00:00
Denis Palmeiro b89cef39b8 Bug 1653974 - Unwrap the module info object before changing realms r=jonco
The test in bug 1653974 fails because the debugee and debugger are in different compartments.

Differential Revision: https://phabricator.services.mozilla.com/D88233
2020-08-27 09:21:09 +00:00
yozaam 9a9397ca2d Bug 1651208 Set a bit in the UsedNameTracker and short circuit some private field early error checks r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D88190
2020-08-27 12:45:58 +00:00
Jan de Mooij edc22f8873 Bug 1660768 - Fix SMDOC comment in jsapi.h. r=mgaudet DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D88024
2020-08-26 11:24:49 +00:00
Jan de Mooij 36a4fe5a82 Bug 1661211 part 6 - Transpile setter calls. r=iain
Again similar to the IonBuilder code but without the stack spoofing.

IonBuilder uses BytecodeIsPopped(pc) for ignoresReturnValue but the return value
of a setter is never used so we can just pass true.

Depends on D88268

Differential Revision: https://phabricator.services.mozilla.com/D88269
2020-08-26 20:51:46 +00:00
Jan de Mooij d4a7afafad Bug 1661211 part 5 - CacheIR changes preparing for transpiling setter calls. r=iain
Add nargsAndFlags, add sameRealm flag to CallNativeSetter.

Differential Revision: https://phabricator.services.mozilla.com/D88268
2020-08-26 20:51:43 +00:00
Jan de Mooij 8c3c079760 Bug 1661211 part 4 - Transpile getter calls. r=iain
We can reuse most of the code in maybeCallTarget for creating a WrappedFunction
from callee/nargs/flags, so that was factored out as a helper function.

Instead of the "stack spoofing" that IonBuilder does (see ensureHasSlots call),
add initForGetterCall to CallInfo so we can set callee/thisv directly.

Depends on D88266

Differential Revision: https://phabricator.services.mozilla.com/D88267
2020-08-26 20:00:55 +00:00
Jan de Mooij d19aa98412 Bug 1661211 part 3 - Add sameRealm flag to CallNativeGetterResult. r=iain
Depends on D88265

Differential Revision: https://phabricator.services.mozilla.com/D88266
2020-08-26 20:00:51 +00:00
Jan de Mooij 51ddde02ae Bug 1661211 part 2 - Store nargsAndFlags for getter calls. r=iain
This is for use by the transpiler, similar to GuardSpecificFunction.

Depends on D88264

Differential Revision: https://phabricator.services.mozilla.com/D88265
2020-08-26 20:00:48 +00:00
Jan de Mooij 8428074833 Bug 1661211 part 1 - Clean up CacheIR ops for getter calls. r=iain
We had different CacheIR ops for receiver-is-object and receiver-is-Value. This
patch unifies them by always using the receiver-is-Value version. This makes it
easier to transpile in Warp.

When generating CacheIR, pass and use the receiverId (Value) in a few places
instead of objId. This also lets us support non-object receivers for super.prop

There are two places where this doesn't work and boxObject is used to convert
from object-id to value-id. In the future this could be a dedicated CacheIR op
instead of a cast, but that would require BaselineInspector changes.

Differential Revision: https://phabricator.services.mozilla.com/D88264
2020-08-26 20:00:45 +00:00
Julian Seward 14bfc1e8f4 Bug 1661064 - Enable wasm atomics when compiling via the Cranelift x64 new backend. r=bbouvier.
As of bug 1660976, the in-tree Cranelift copy supports wasm atomics when compiling via the new
x64 back end. This small patch contains the SM-side changes required to allow wasm atomics to be
passed into that compilation pipeline.

Differential Revision: https://phabricator.services.mozilla.com/D88245
2020-08-26 15:27:58 +00:00
Nicolas B. Pierron c4f862f368 Bug 1661231 - Add link to ARM64 ICache invalidation discussion. r=bbouvier DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D88256
2020-08-26 12:56:18 +00:00
Jon Coppeard 462950d30a Bug 1660346 - Rework helper thread creation to allow more threads to be added r=sfink
Previously HelperThread instances lived in the GlobalHelperThreadState vector.
This meant that resizing the vector could move the objects in memory which was
not safe. Also HelperThread members were not always initialized. I'm not sure
how this managed to work.

This changes the vector to contain pointers to HelperThreads which now won't
get moved. Also, for some reason the vector itself was a separate allocation
which was unnecessary. The patch makes this part of the main object.

I added a threads() method taking a lock reference since the thread list can
now change after initialization. Finally I simplified the thread creation
loop.

Differential Revision: https://phabricator.services.mozilla.com/D88111
2020-08-26 12:21:49 +00:00
Kannan Vijayan d06954a28d Bug 1660798 - Part 2 - Convert uses of JSAtom* and PropertyName* to ParserAtomId and ParserNameId. r=tcampbell
Depends on D84865

Differential Revision: https://phabricator.services.mozilla.com/D82826
2020-08-26 01:03:35 +00:00
Kannan Vijayan a667e30fe5 Bug 1660798 - Part 1 - Adaptor glue to allow for parser to transition to internal atoms representation. r=mgaudet,tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D84865
2020-08-26 00:15:23 +00:00
Matthew Gaudet 658e54cd2e No Bug - Fix spelling error in Promise.h r=caroline DONTBUILD DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D88188
2020-08-25 20:44:46 +00:00
Ted Campbell bbd523a0ca Bug 1661086 - Update function guessed names when updating ObjectGroup. r=mgaudet
This is needed since updating the function name will soon be fallible which
is not allowed in UpdateEmittedInnerFunctions. Move the name updates to the
same place that ObjectGroup updates happen which suffer the same OOM issue.
If an OOM occurs here during delazification, the next attempt at recompile
will compute the same name. Applying the name update early is not a problem
and is what the frontend previously did before stencil.

Differential Revision: https://phabricator.services.mozilla.com/D88174
2020-08-25 19:46:18 +00:00
Adam Vandolder 1dd1c165fb Bug 1660853 - Make sure to empty stack in private method initializers. r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D88050
2020-08-25 16:21:28 +00:00
Razvan Maries 481e1107bd Backed out changeset 13f1813b7ce8 (bug 1660346) for perma failure on asan_malloc_linux.cc. CLOSED TREE 2020-08-25 22:39:35 +03:00
Iain Ireland a58061ddd7 Bug 1660553: Inline FunCall r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D87910
2020-08-24 18:27:44 +00:00
Iain Ireland 6000e4634d Bug 1660553: Factor out argument fixup code r=jandem
Baseline call ICs can have 5 different argument formats (normal, spread, funcall, funapply-args, funapply-array). Some of these, like funcall, can be converted into a normal MCall by modifying the fields of the CallInfo. Others, like spread calls, are represented by different MIR nodes.

Inlining doesn't generate an MCall but also has to use the correct arguments. To avoid duplicating code, this patch splits out a helper function that updates CallInfo where possible, and returns an enum value to trigger special handling for more exotic cases. (When handling spread calls and funapply-array, I suspect that we will want to move the enum inside CallInfo, but I'm holding off on that until I actually try writing that code.)

Differential Revision: https://phabricator.services.mozilla.com/D87909
2020-08-24 07:19:06 +00:00
Jon Coppeard 7e618183ea Bug 1660346 - Rework helper thread creation to allow more threads to be added r=sfink
Previously HelperThread instances lived in the GlobalHelperThreadState vector.
This meant that resizing the vector could move the objects in memory which was
not safe. Also HelperThread members were not always initialized. I'm not sure
how this managed to work.

This changes the vector to contain pointers to HelperThreads which now won't
get moved. Also, for some reason the vector itself was a separate allocation
which was unnecessary. The patch makes this part of the main object.

I added a threads() method taking a lock reference since the thread list can
now change after initialization. Finally I simplified the thread creation
loop.

Differential Revision: https://phabricator.services.mozilla.com/D88111
2020-08-25 16:50:26 +00:00
Iain Ireland 087f113ed6 Bug 1646378: Turn trial inlining on by default for Warp r=jandem
Depends on D87899

Differential Revision: https://phabricator.services.mozilla.com/D87900
2020-08-24 07:10:54 +00:00
Iain Ireland f76fabba90 Bug 1646378: Preemptively disable warp compilation for unsupported ops r=jandem
If a script cannot be warp-compiled, then we do not want to do trial inlining for that script. Where possible, it seems better to mark scripts proactively, instead of undoing the trial inlining after failing to warp-compile.

Differential Revision: https://phabricator.services.mozilla.com/D87899
2020-08-24 07:09:57 +00:00
Ryan Hunt be382df63a Bug 1659997 - wasm: Use abstract reference type in switch in cranelift compile. r=lth
Fixes a regression from the refactoring in bug 1561521, where TC::Ref was previously
used as the value to represent any reference value in ValType.

Differential Revision: https://phabricator.services.mozilla.com/D88100
2020-08-25 14:55:57 +00:00
Jan de Mooij 5c863c5a71 Bug 1660983 part 3 - Don't turn prototypes into singletons if TI is disabled. r=evilpie
Just a drive-by change for something I noticed.

Depends on D88130

Differential Revision: https://phabricator.services.mozilla.com/D88131
2020-08-25 11:23:41 +00:00
Jan de Mooij 6b360a4a9a Bug 1660983 part 2 - Make the function.prototype AddSlot optimization not depend on TI. r=evilpie
This makes the optimization work with Warp.

Also stop emitting GuardGroup if TI is disabled.

Differential Revision: https://phabricator.services.mozilla.com/D88130
2020-08-25 12:53:37 +00:00
Jan de Mooij 936a42ad69 Bug 1660983 part 1 - Remove unnecessary holderId variable in tryAttachAddSlotStub. r=evilpie
holderId was used for unboxed object expando properties.

Differential Revision: https://phabricator.services.mozilla.com/D88129
2020-08-25 11:07:10 +00:00
Tom Schuster ecd654cdd9 Bug 1659133 - Add AssertShape after folding in MGuardShape. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D88127
2020-08-25 12:48:30 +00:00
Jon Coppeard aff64e4ea9 Bug 1660965 - Report bad JS::Value contents in crash messages r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D88117
2020-08-25 12:05:05 +00:00
Tom Schuster cb56c08ea4 Bug 1656890 - Folding for GuardIsNotProxy and GuardIsNotArrayBufferMaybeShared. r=anba
Differential Revision: https://phabricator.services.mozilla.com/D88032
2020-08-25 11:00:27 +00:00
Steve Fink c84febafcf Bug 1659801 - Implement a CTypes readTypedArray() for CData and CDataFinalizer r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D87477
2020-08-24 22:37:11 +00:00
Cosmin Sabou f66ec87fd8 Backed out 2 changesets (bug 1660798) for causing memory leaks. CLOSED TREE
Backed out changeset 846f88debca6 (bug 1660798)
Backed out changeset 12d099efac67 (bug 1660798)
2020-08-25 01:03:43 +03:00
Kannan Vijayan dadaa3f04c Bug 1660798 - Part 2 - Convert uses of JSAtom* and PropertyName* to ParserAtomId and ParserNameId. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D82826
2020-08-24 19:50:43 +00:00
Kannan Vijayan c1b98f75b8 Bug 1660798 - Part 1 - Adaptor glue to allow for parser to transition to internal atoms representation. r=mgaudet,tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D84865
2020-08-24 16:51:38 +00:00
Kannan Vijayan 0afd0b76f9 Bug 1660055 - Convert FoldConstants to use ParserAtoms. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D87643
2020-08-24 16:50:28 +00:00
Adam Vandolder 0e071c42fe Bug 1655947 - Change date parsing to be more consistent. r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D87458
2020-08-21 19:00:24 +00:00
Mike Hommey bfa1238f65 Bug 1659906 - Fix variadic arguments on arm64 darwin ABI. r=froydnj
Normal arguments that spill on the stack are packed, but not variadic
arguments. This is handled correctly for their placement already, but
code generated on the callee side with va_list expects word-size
sign-extension, so we need to fill the entire word.

Upstreamed as https://github.com/libffi/libffi/pull/577.

Differential Revision: https://phabricator.services.mozilla.com/D87825
2020-08-22 06:31:47 +00:00
Mike Hommey 81f76824b7 Bug 1659906 - Upgrade libffi to version 3.3. r=froydnj
All the patches previously applied, except the one from bug 1279096,
are either irrelevant (as pertaining to changes to the upstream build
system we don't use anymore), were applied upstream, or the issue they
fixed were fixed differently upstream.

Two additional patches, sent upstream as
https://github.com/libffi/libffi/pull/579 and
https://github.com/libffi/libffi/pull/580, are needed to fix our build
with, respectively, mingw-clang and GCC.

Our build system is adjusted according to upstream's configure.ac
and configure.host.

Differential Revision: https://phabricator.services.mozilla.com/D87824
2020-08-22 22:02:22 +00:00
Bogdan Tara 50dacc36d7 Backed out 2 changesets (bug 1659906) for asan failures CLOSED TREE
Backed out changeset 40edcd06d482 (bug 1659906)
Backed out changeset 08a1c02d93e4 (bug 1659906)
2020-08-22 09:26:23 +03:00
Mike Hommey b689e3742e Bug 1659905 - Fix ctypes variadic support. r=jorendorff
It never told libffi what the variadic arguments were.
Also fix the ctypes declaration of test_vector_add_va_cdecl in the unit test,
which is actually wrong, but the test still passed for some reason.

Differential Revision: https://phabricator.services.mozilla.com/D87557
2020-08-21 16:56:11 +00:00
Mike Hommey db7bacca7d Bug 1659906 - Fix variadic arguments on arm64 darwin ABI. r=froydnj
Normal arguments that spill on the stack are packed, but not variadic
arguments. This is handled correctly for their placement already, but
code generated on the callee side with va_list expects word-size
sign-extension, so we need to fill the entire word.

Upstreamed as https://github.com/libffi/libffi/pull/577.

Differential Revision: https://phabricator.services.mozilla.com/D87825
2020-08-21 14:54:07 +00:00
Mike Hommey d27ed90b47 Bug 1659906 - Upgrade libffi to version 3.3. r=froydnj
All the patches previously applied, except the one from bug 1279096,
are either irrelevant (as pertaining to changes to the upstream build
system we don't use anymore), were applied upstream, or the issue they
fixed were fixed differently upstream.

Two additional patches, sent upstream as
https://github.com/libffi/libffi/pull/579 and
https://github.com/libffi/libffi/pull/580, are needed to fix our build
with, respectively, mingw-clang and GCC.

Our build system is adjusted according to upstream's configure.ac
and configure.host.

Differential Revision: https://phabricator.services.mozilla.com/D87824
2020-08-21 21:54:32 +00:00
Tooru Fujisawa ac1d47e35d Bug 1659852 - Properly report error in dumpStencil with smoosh + module. r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D87515
2020-08-21 16:13:54 +00:00
Tooru Fujisawa 50f13a4125 Bug 1659304 - Update opcode for bug 1435826. r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D87591
2020-08-21 16:13:24 +00:00
André Bargull 5a605fed3d Bug 1659694 - Part 5: MLoadElementAndUnbox and MSpectreMaskIndex don't need MKeepAliveObject. r=jandem
Neither MLoadElementAndUnbox nor MSpectreMaskIndex can GC, so we don't need a
MKeepAliveObject instruction.

Differential Revision: https://phabricator.services.mozilla.com/D87564
2020-08-21 08:40:24 +00:00
André Bargull 5184229ee8 Bug 1659694 - Part 4: Transpile StoreDenseElementHole. r=jandem
`MStoreElement` with `needsHoleCheck=false` matches the Baseline implementation
of `StoreDenseElementHole`. `MStoreElementHole` handles more cases than the
Baseline (and Ion) implementation of StoreDenseElementHole`, namely it also
allows to set elements for `index > initializedLength`.

The `index > initializedLength` restriction for `StoreDenseElementHole` may be
lifted in the future when it's no longer necessary to call `noteHasDenseAdd()`
for Ion.

Differential Revision: https://phabricator.services.mozilla.com/D87563
2020-08-21 08:20:33 +00:00
André Bargull d32cb99115 Bug 1659694 - Part 3: Transpile LoadDenseElementExistsResult. r=jandem
Using `MLoadElement` with `needsHoleCheck=true` to trigger a bailout when a
hole is encountered was slightly slower than the new `MGuardElementNotHole`
instruction from this patch, even though the `MLoadElement` from a `JSOp::In`
can be merged with a subsequent `MLoadElement` from a `JSOp::GetElem`. This
sequence happens for the common pattern of `if (i in array) val = array[i]`.

The magic value check in `LGuardElementNotHole` works without unboxing the
value, so it's possible using separate instructions leads to fewer register
dependencies (when compared to merging the `MLoadElement`), which helps
speculative execution. And because the loaded value may still be in a cache,
it doesn't matter to load it repeatedly.

Differential Revision: https://phabricator.services.mozilla.com/D87562
2020-08-21 08:20:29 +00:00
André Bargull 2dc6e4a5ff Bug 1659694 - Part 2: Change `OperatorInI` function to take int32 instead of uint32. r=jandem
The code generator uses a signed value and the value is implicitly coerced to
`int32_t` anyway (via `Int32Value`), so we might as well directly use `int32_t`
for that function.

Differential Revision: https://phabricator.services.mozilla.com/D87561
2020-08-21 08:14:26 +00:00
André Bargull fe22407910 Bug 1659694 - Part 1: Replace non-writable array length failure paths with assertions. r=jandem
`StoreDenseElementHole` and `ArrayPush` are both preceded by shape guards and
are only attached when the object has a writable array length. That means the
generated code doesn't actually need to test `NONWRITABLE_ARRAY_LENGTH`,
because it's implied by the shape guard: Changing the array length to
non-writable through either `js::ArraySetLength` or `js::SetIntegrityLevel`
already changes the shape and thus invalidates the shape guard.

The same applies to the non-extensible bits, so we can assert that, too.

Drive-by change:
Remove the `thisarray->lengthIsWritable()` assertion in `tryAttachArrayPush`
because it's tested just a few lines earlier.

Differential Revision: https://phabricator.services.mozilla.com/D87560
2020-08-21 08:13:28 +00:00
Lars T Hansen c57fa21220 Bug 1659687 - Use Maybe<uint64_t> for max memory size. r=rhunt
Use Maybe<uint64_t> for the max size in three places where this is required.

Drive-by fix: Use standard printf macros for formatting, and use them correctly.

Differential Revision: https://phabricator.services.mozilla.com/D87710
2020-08-21 04:44:36 +00:00
Caroline Cullen 97d1b86763 Bug 1657022 - Only spew JSOps that have ICs. r=iain
Differential Revision: https://phabricator.services.mozilla.com/D87657
2020-08-20 22:19:10 +00:00
Caroline Cullen 8a41e066b1 Bug 1657022 - Spew lineno and column of JSOps. r=iain
Differential Revision: https://phabricator.services.mozilla.com/D87656
2020-08-20 22:19:02 +00:00
Iain Ireland c5077ba863 Bug 1658811: Unify funapply/spread args limits between CacheIR and MIR r=jandem
It appears that the existing limit of 16 args for CacheIR was established when we first added FunApplyArray support in bug 906781 and never revisited.

Depends on D87681

Differential Revision: https://phabricator.services.mozilla.com/D87682
2020-08-20 13:07:45 +00:00