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

78888 Коммитов

Автор SHA1 Сообщение Дата
Gerald Squelart a087b2df35 Bug 1663554 - Convert AUTO_PROFILER_TEXT_MARKER_... to new AUTO_PROFILER_MARKER_TEXT - r=gregtatum
The name `AUTO_PROFILER_MARKER_TEXT` is more consistent with the equivalent non-`AUTO` macro, and similarly arguments have been re-ordered to be the same, i.e.: Name, category&options, text.

The different macros with different argument sets can now be collapsed into one macro, and the optional arguments (timing, inner window id, backtrace) can easily be added to the `MarkerOptions` where needed.

As a bonus, a specific start time can optionally be provided at construction time.

Differential Revision: https://phabricator.services.mozilla.com/D89588
2020-09-11 00:42:51 +00:00
Tooru Fujisawa cfd0790e49 Bug 1664281 - Start encoding in GlobalHelperThreadState::finishSingleParseTask with !useOffThreadParseGlobal. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D89815
2020-09-10 19:32:19 +00:00
Jon Coppeard 81469e4b50 Bug 1663938 - Assert that the collector doesn't trigger barriers during marking r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D89638
2020-09-10 18:10:00 +00:00
Csoregi Natalia 67eb265e55 Backed out changeset db6f7a903c64 (bug 1651725) for spidermonkey bustage on /basic.js. CLOSED TREE 2020-09-10 19:43:00 +03:00
Tooru Fujisawa 0a00eddff0 Bug 1664182 - Add JS::SetUseOffThreadParseGlobal and js::UseOffThreadParseGlobal, replacing JS::ContextOptions::setUseOffThreadParseGlobal. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D89784
2020-09-10 16:05:39 +00:00
Tooru Fujisawa f7175553bb Bug 1663962 - Part 2: Add JS::CompileAndStartIncrementalEncoding. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D89690
2020-09-10 16:05:25 +00:00
Tooru Fujisawa 035fcb1074 Bug 1663962 - Part 1: Add JS::FinishOffThreadScriptAndStartIncrementalEncoding. r=tcampbell
Depends on D89688

Differential Revision: https://phabricator.services.mozilla.com/D89689
2020-09-10 15:17:03 +00:00
Tooru Fujisawa 68d7cb31bf Bug 1663889 - Remove JS::CompileForNonSyntacticScope and set CompileOptions in caller. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D89688
2020-09-10 15:00:36 +00:00
Iain Ireland 54a1cf8201 Bug 1662146: Support bailing out from inlined funcall with no arguments r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D89525
2020-09-10 02:18:16 +00:00
Iain Ireland 966b1d38ac Bug 1662915: Part 15: Update comments r=jandem
I was thinking about writing an [SMDOC] comment until I realized we already had one. I settled for a few updates to that comment and some annotations on the ASCII diagrams.

Differential Revision: https://phabricator.services.mozilla.com/D89524
2020-09-10 02:17:48 +00:00
Iain Ireland 6d2a67211e Bug 1662915: Part 14: Change InitFromBailout to BaselineStackBuilder::buildOneFrame r=jandem
Tying everything together.

Differential Revision: https://phabricator.services.mozilla.com/D89523
2020-09-10 02:17:25 +00:00
Iain Ireland 2b07e70594 Bug 1662915: Part 13: Split up BaselineStackBuilder::prepareForNextFrame r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D89522
2020-09-10 02:16:42 +00:00
Iain Ireland c01a6dff60 Bug 1662915: Part 12: Add BaselineStackBuilder::prepareForNextFrame r=jandem
This patch hoists the stub frame / rectifier frame code into its own function. The next patch splits that function up.

Differential Revision: https://phabricator.services.mozilla.com/D89521
2020-09-10 02:16:39 +00:00
Iain Ireland ebc73e51d1 Bug 1662915: Part 11: Move script, function, and exception info logic inside BaselineStackBuilder r=jandem
In preparation for the next patch, get rid of the out-parameters in `InitFromBailout` and clean a few things up.

Differential Revision: https://phabricator.services.mozilla.com/D89520
2020-09-10 02:16:37 +00:00
Iain Ireland 702eb2bcd4 Bug 1662915: Part 10: Add BaselineStackBuilder::finishLastFrame r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D89519
2020-09-10 02:15:16 +00:00
Iain Ireland 8ed88f1285 Bug 1662915: Part 9: Add BaselineStackBuilder::validateFrame r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D89518
2020-09-10 02:14:57 +00:00
Iain Ireland bc76396190 Bug 1662915: Part 8: Add BaselineStackBuilder::buildExpressionStack r=jandem
The `invalidate` argument to `BailoutIonToBaseline` and `InitFromBailout` was only used for a single assertion in the IonReturnOverride case, which could be more directly asserted in `jit::Bailout`.

Differential Revision: https://phabricator.services.mozilla.com/D89517
2020-09-10 02:14:34 +00:00
Iain Ireland ee407a0f05 Bug 1662915: Part 7: Add BaselineStackBuilder::fixUpCallerArgs r=jandem
To simplify things, I changed FunCall so that the arguments are pushed during fixup, instead of using the main expression stack slot loop (https://searchfox.org/mozilla-central/rev/84922363f4014eae684aabc4f1d06380066494c5/js/src/jit/BaselineBailouts.cpp#981-1019). This is safe because the special cases in that loop only trigger on the final frame (`!iter.hasMoreFrames()`), and FunCall fixup only happens when we are *not* building the final frame.

Differential Revision: https://phabricator.services.mozilla.com/D89516
2020-09-10 02:13:46 +00:00
Iain Ireland 8c58dd0547 Bug 1662915: Part 6: Add BaselineStackBuilder::buildFixedSlots r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D89515
2020-09-10 02:13:23 +00:00
Iain Ireland 1a5ccc2fe4 Bug 1662915: Part 5: Add BaselineStackBuilder::buildArguments r=jandem
I would like to add a comment here explaining *why* we have to overwrite the arguments in the caller, but I'm not confident I understand myself.

Similarly, I tried rewriting the comment about not updating when the arguments object aliases the formals ("In such cases, the list of arguments reported by the snapshot are only aliases of argument object slots..."), but I wasn't sure I understood.

Differential Revision: https://phabricator.services.mozilla.com/D89514
2020-09-10 02:36:30 +00:00
Iain Ireland da9b0aa9fb Bug 1662915: Part 4: Add BaselineStackBuilder::nextFrame r=jandem
This will be expanded in a future patch to also update `script_` and `fun_`.

Differential Revision: https://phabricator.services.mozilla.com/D89513
2020-09-10 02:12:27 +00:00
Iain Ireland 745f9f8820 Bug 1662915: Part 3: Add BaselineStackBuilder::buildBaselineFrame r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D89512
2020-09-10 02:12:00 +00:00
Iain Ireland 26272ba807 Bug 1662915: Part 2: Add BaselineStackBuilder::initFrame r=jandem
My approach in this stack is to incrementally extract parts of `InitFromBailout` (and some parts of `BailoutIonToBaseline` into methods on BaselineStackBuilder. Some of the intermediate patches look a little strange, but I think it ends up in a reasonable place.

Differential Revision: https://phabricator.services.mozilla.com/D89511
2020-09-10 02:11:37 +00:00
Iain Ireland d5bea71886 Bug 1662915: Part 1: Change BaselineStackBuilder from struct to class r=jandem
Deleting some dead code.

Differential Revision: https://phabricator.services.mozilla.com/D89510
2020-09-10 02:11:09 +00:00
Tom Ritter dd4abea504 Bug 1656588 - Create a disnative command to print the assembly of the JITed function r=lth
Differential Revision: https://phabricator.services.mozilla.com/D85624
2020-09-10 14:46:34 +00:00
Yoshi Cheng-Hao Huang 123f34fa45 Bug 1651322 - Part 6: Update HelperThread::threadLoop. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D86819
2020-09-10 12:41:08 +00:00
Yoshi Cheng-Hao Huang cb271cbc59 Bug 1651322 - Part 5: Update checkTaskThreadLimit. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D86818
2020-09-10 12:41:05 +00:00
Yoshi Cheng-Hao Huang 835cf057c1 Bug 1651322 - Part 4: Add HelperThreadTaskVector. r=jonco
Introduce a vector of HelperThreadTask, called HelperThreadTaskVector.
When a HelperThreadTask is running, the task will be added into the
vector, and be removed when runHelperThreadTask is done.

And add is<T> and as<T> utilities for HelperThreadTask, so when some
CancelOffThreadXXX function is called, it could iterate the vector and
check if the task from the vector is of certain type.

Differential Revision: https://phabricator.services.mozilla.com/D86354
2020-09-10 14:57:11 +00:00
Yoshi Cheng-Hao Huang 0cf91a55fa Bug 1651322 - Part 3: All classes inherit HelperThreadTask. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D86353
2020-09-10 12:40:56 +00:00
Yoshi Cheng-Hao Huang 345b20efff Bug 1651322 - Part 2: Add submitTask interfaces in HelperThreadState. r=jonco
Add submitTask interfaces in GlobalHelperThreadState.

Differential Revision: https://phabricator.services.mozilla.com/D83934
2020-09-10 12:40:53 +00:00
Yoshi Cheng-Hao Huang fffa12b407 Bug 1651322 - Part 1: Add a IonFreeTask class. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D84702
2020-09-10 12:40:46 +00:00
Jessica Tallon fa54b8f87f Bug 1651725 - Add 'minimum' argument to WASM's Memory & Table r=lth
This adds a 'minimum' argument to the JS-API for the WebAssembly.Memory
and WebAssembly.Table objects. This parameter represents the minimum
size of the object which was specified by the 'initial' parameter. This
supports using either initial or minimum to specify the parameter.

This commit is part of the work to add type reflections to the
WebAssembly JS-API as specified in the js-types proposal.

Differential Revision: https://phabricator.services.mozilla.com/D85887
2020-09-10 14:24:35 +00:00
Jan de Mooij 3b21062b11 Bug 1662688 part 6 - Check for previously-inlined ICScripts. r=iain
This fixes an issue where we could inline twice at the same pc, confusing the
bailout code.

Differential Revision: https://phabricator.services.mozilla.com/D89362
2020-09-10 10:38:47 +00:00
Jan de Mooij 1df963b206 Bug 1662688 part 5 - Emit GuardFunctionScript for scripted functions. r=iain
Because guarding on the Class and the BaseScript is quite a bit slower than
GuardSpecificFunction, try the function guard if we're attaching the first stub.

Make trial inlining ignore the unused stub so we can still inline. This is similar
to the heuristics WarpOracle uses but is still a bit more conservative.

Differential Revision: https://phabricator.services.mozilla.com/D89140
2020-09-10 10:40:15 +00:00
Jan de Mooij edb2829523 Bug 1662688 part 4 - Support GuardFunctionScript in call specialization and trial inlining code. r=iain
Differential Revision: https://phabricator.services.mozilla.com/D89139
2020-09-10 10:40:03 +00:00
Jan de Mooij 3494222880 Bug 1662688 part 3 - Add GuardFunctionScript CacheIR and MIR instructions. r=iain
Differential Revision: https://phabricator.services.mozilla.com/D89138
2020-09-10 10:39:55 +00:00
Jan de Mooij 84dac290ee Bug 1662688 part 2 - Add support for BaseScript stub fields. r=iain
Differential Revision: https://phabricator.services.mozilla.com/D89137
2020-09-10 10:39:30 +00:00
Jan de Mooij 1fbdfe951d Bug 1662688 part 1 - Ensure native functions never have a valid BaseScript* in the 'extra' field. r=iain
We want GuardFunctionScript to compare the JSFunction field without any flag checks
but that only works if native functions are guaranteed to not have an identical value
stored there.

Differential Revision: https://phabricator.services.mozilla.com/D89136
2020-09-10 10:39:17 +00:00
Simon Giesecke 254c759317 Bug 1663924 - Create single-element arrays in-place. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D89601
2020-09-10 10:15:05 +00:00
Jon Coppeard a50657a013 Bug 1663741 - Fix problems updating slots after swapping objects r=jandem
This does two things: avoid triggering an assertion about the number of dynamic slots while the object is in an intermidiate state, and preserve the number of dictionary mode slots when reallocating the dynamic slots.

Differential Revision: https://phabricator.services.mozilla.com/D89630
2020-09-10 09:18:39 +00:00
Jon Coppeard 22628aba16 Bug 1205132 - Remove unused AutoKeepAtoms r=tcampbell
With the latest parser changes this class is now unnecessary. Remove the count of live AutoKeepAtoms instances on the zone and anything that used it.

Differential Revision: https://phabricator.services.mozilla.com/D89645
2020-09-10 09:41:06 +00:00
Benjamin Bouvier 1651b6f3cf Bug 1663919: Report cranelift verifier errors as panics in debug builds; r=cfallin
Differential Revision: https://phabricator.services.mozilla.com/D89593
2020-09-09 15:07:10 +00:00
Benjamin Bouvier 7eac9eadba Bug 1662763: Document how to run Spidermonkey on Android aarch64; r=tcampbell DONTBUILD
Depends on D89149

Differential Revision: https://phabricator.services.mozilla.com/D89150
2020-09-08 13:04:43 +00:00
Benjamin Bouvier fecebe6695 Bug 1662763: Update references to the global build doc from the SM doc; r=mgaudet DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D89149
2020-09-09 19:25:26 +00:00
Benjamin Bouvier 59f9caa496 Bug 1663895: aarch64: define the MEMBARRIER_CMD when they don't exist; r=lth
Values taken from the Linux kernel source, and confirmed in Android source's
code.

Differential Revision: https://phabricator.services.mozilla.com/D89581
2020-09-10 06:21:40 +00:00
Ryan Hunt 2b308938ce Bug 1663862 - Check OOM from wasm::ToString(). r=lth
wasm::ToCString() couldn't OOM, but wasm::ToString() can, so the
all the use cases need to check for OOM and propagate it.

Differential Revision: https://phabricator.services.mozilla.com/D89671
2020-09-10 06:08:45 +00:00
Butkovits Atila b7de916a2f Backed out changeset eb35fdc50799 (bug 1639153) for bustages at Lowering.cpp. CLOSED TREE 2020-09-10 09:14:01 +03:00
Dmitry Bezhetskov 8b9afb0283 Bug 1639153 - Part 6.2: Establish dependency from tls for x86 callWithABI div/mod i64. r=lth
x86 has few register so to do div/mod for i64 it call the runtime
and clobber almost all gp registers including WasmTlsReg.
To be able to call c++ runtime via Builtin thunk we need to set up WasmTlsReg.
In this patch I create dependencies from MIR level to Codegen to be sure that WasmTlsReg is alive
when we call runtime.

Differential Revision: https://phabricator.services.mozilla.com/D88524
2020-09-10 05:18:04 +00:00
Andrew McCreight bff4fd6721 Bug 1663690, part 2 - Inline mozJSComponentLoader::ReallyInit(). r=kmag
This method only asserts that mInitialized is false, then sets
mInitialized to true. All call sites check that the flag is false,
so the assertion is redundant, so this method can be inlined
and simplified.

Differential Revision: https://phabricator.services.mozilla.com/D89480
2020-09-09 19:03:51 +00:00
Andrew McCreight 33ddd4eb56 Bug 1663690, part 1 - Remove ComponentLoaderInfo::EnsureKey(). r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D89479
2020-09-09 19:03:49 +00:00
Razvan Maries c20f78dd7e Backed out 2 changesets (bug 1663690) for build bustages on mozJSComponentLoader.cpp. CLOSED TREE
Backed out changeset 04236fadb4cc (bug 1663690)
Backed out changeset 3def11143e6c (bug 1663690)
2020-09-09 21:05:54 +03:00
Andrew McCreight dbaf62267d Bug 1663690, part 2 - Inline mozJSComponentLoader::ReallyInit(). r=kmag
This method only asserts that mInitialized is false, then sets
mInitialized to true. All call sites check that the flag is false,
so the assertion is redundant, so this method can be inlined
and simplified.

Differential Revision: https://phabricator.services.mozilla.com/D89480
2020-09-08 18:43:22 +00:00
Andrew McCreight 02d01fc48b Bug 1663690, part 1 - Remove ComponentLoaderInfo::EnsureKey(). r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D89479
2020-09-08 18:41:39 +00:00
Tooru Fujisawa be755138c7 Bug 1660940 - Part 3: Use stencil-specific frontend API in JS shell. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88616
2020-09-09 15:33:20 +00:00
Tooru Fujisawa c1bea42ce9 Bug 1660940 - Part 2: Add Smoosh::compileGlobalScriptToStencil with ReadOnlyCompileOptions. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88615
2020-09-09 15:33:12 +00:00
Tooru Fujisawa 85e77b918f Bug 1660940 - Part 1: Add frontend API that allocates CompilationInfo. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D88614
2020-09-09 15:33:05 +00:00
Dmitry Bezhetskov 937a3b8b6e Bug 1639153 - Part 6.1: Untie callWithAbi from Frame::tls for Baseline. r=lth
We have a tls dependency in callWithABI for wasm because we call builtins via BuiltinThunk.
Last one requires that tls to be loaded. In this patch I gradually extend callWithABI interface to
pass offset to tls. This allows us to preserve tls and load it by offset in callWithABI and frees us from
the Frame::tls dependency.

Differential Revision: https://phabricator.services.mozilla.com/D88426
2020-09-09 09:22:39 +00:00
Jon Coppeard e9340fc8d9 Bug 1663616 - Use the helper thread lock for off-thread promise state r=jandem
This changes the off-thread promise helper code from using its own mutex to
using the helper thread lock for synchronisation.

For promise tasks executed on helper threads there's little benefit from using
a separate mutex as we already have to wait on the helper thread lock to start
the task. The changes ensure we don't delete the OffThreadPromiseTask while the
helper thread system thinks it's still running.

Differential Revision: https://phabricator.services.mozilla.com/D89472
2020-09-09 10:26:11 +00:00
Jon Coppeard 46e40d8072 Bug 1663616 - Use the helper thread lock for off-thread wasm compilation r=lth
Currently wasm uses its own mutex for off-thread compilation. This leads to the
sitation where the CompileTask structure can be freed while the helper thread
is still running (the ModuleGenerator destructor synchronises on its mutex, but
the helper thread run method releases this mutex before it returns).

Using the helper thread lock here makes sense. The helper thread lock is
already required to start the compiation task so I don't think there's much
gain from using a separate mutex.

Differential Revision: https://phabricator.services.mozilla.com/D89471
2020-09-09 09:57:45 +00:00
Dmitry Bezhetskov 1e6bf3662f Bug 1639153 - Part 6: Force Ion to preserve its tls. r=lth
Let's see following code and let's assume that wasm-compiler is ion:

call foo
call bar

Ion can clobber tls inside foo and then it can go with clobbered tls into bar.
There will be a crash if bar uses tls. At compile-time we don't know whether bar will use tls or not.

It works when we restore tls each time when we are returning from a function because of the current frame structure.
But now, when we want to get rid of Frame::tls we should guarantee that Ion doesn't clobber tls inside a function.
In fact we forces Ion to restore tls iff it clobbers it and it is a rare case.

Baseline doesn't need such logic because of its private stack slot for tls.

Differential Revision: https://phabricator.services.mozilla.com/D83061
2020-09-09 08:55:17 +00:00
Jeff Walden 933368cb18 Bug 1663365 - Move DOM proxy-related details (including expand support) to separate headers out of jsfriendapi.h. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D89336
2020-09-08 22:57:14 +00:00
Jeff Walden 45d8047ca9 Bug 1663365 - Move JSM environment-related functionality to its own header. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D89335
2020-09-08 22:57:01 +00:00
Jeff Walden 5c5e824b56 Bug 1663365 - Move allocation-logging functions and |JS_COUNT_{CTOR,DTOR}| into a separate header. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D89334
2020-09-08 22:56:56 +00:00
Jeff Walden 6d5beafab1 Bug 1663365 - Move various Object-related functions to a new js/public/Object.h header. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D89333
2020-09-08 22:55:38 +00:00
Jeff Walden 49d77af36e Bug 1663365 - Move |JSJitInfo| out of jsfriendapi.h to its own experimental header. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D89332
2020-09-08 22:52:34 +00:00
Jeff Walden 5608660da2 Bug 1663365 - Move |XrayJitInfo| functionality to its own friend header. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D89331
2020-09-08 22:51:10 +00:00
Jeff Walden b5ec4c7eba Bug 1663365 - Create a new js/public/String.h header seeded with the inline string functions previously found in jsfriendapi.h. (More functions ought be added/moved here, but these make a good start.) r=jandem,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D89330
2020-09-08 22:50:52 +00:00
Andrew McCreight ff2f7c0866 Bug 1663315 - Don't load new JSMs during shutdown. r=kmag
Under unknown circumstances, we can end up running chrome
JS during thread manager shutdown. Sometimes this ends up
trying to load new JSMs, but gJarHandler has already been
cleared, leading to a crash.

To avoid this and other issues, this patch forbids the
importing of new JSMs after we're late enough in shutdown
to have cleared the ClearOnShutdown pointers. I allow the
importing of JSMs that have already been loaded, as that
seems like it should be okay.

Differential Revision: https://phabricator.services.mozilla.com/D89477
2020-09-08 19:36:27 +00:00
Iain Ireland cd050a9362 Bug 1661763: Add jitsrc rr command r=sfink DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D88634
2020-09-08 18:34:54 +00:00
Bogdan Tara 16b089719e Backed out changeset d393c620ee6d (bug 1656588) for scr related bustage CLOSED TREE 2020-09-09 00:01:01 +03:00
Tom Ritter 186c100c1a Bug 1656588 - Create a disnative command to print the assembly of the JITed function r=lth
Differential Revision: https://phabricator.services.mozilla.com/D85624
2020-09-08 16:24:05 +00:00
Sylvestre Ledru c320561565 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D89392
2020-09-08 04:32:00 +00:00
Tom Schuster e703e7e06b Bug 1663260 - Support primitive Number toString in CacheIR. r=anba
Depends on D89307

Differential Revision: https://phabricator.services.mozilla.com/D89308
2020-09-07 06:46:50 +00:00
Tom Schuster 982321bc49 Bug 1663260 - Support primitive String toString and valueOf in CacheIR. r=anba
Differential Revision: https://phabricator.services.mozilla.com/D89307
2020-09-07 06:46:43 +00:00
Benjamin Bouvier 30820e3a4b Bug 1661016: aarch64: slightly refactor the check that membarrier is available; r=lth
Depends on D89366

Differential Revision: https://phabricator.services.mozilla.com/D89367
2020-09-07 12:21:02 +00:00
Benjamin Bouvier 49433c644a Bug 1663030: include unistd.h in MozCpu-vixl.cpp on Android too; r=lth
This includes the declaration of the syscall(2) function.

Differential Revision: https://phabricator.services.mozilla.com/D89366
2020-09-07 12:19:10 +00:00
Jan de Mooij 43d1e791ad Bug 1663401 - Add ARM64 implementation of Pop(FloatRegister). r=evilpie
We were hitting the MOZ_CRASH when running jit-tests or Fenix with Warp enabled.

Differential Revision: https://phabricator.services.mozilla.com/D89356
2020-09-07 11:09:01 +00:00
Mihai Alexandru Michis c3eb196d93 Backed out changeset abee121f64e7 (bug 1662404) for causing lint failures in MozCachingDecoder.h
CLOSED TREE
2020-09-07 13:41:49 +03:00
Benjamin Bouvier 93dfd9ae85 Bug 1662404: arm64 simulator: move mozilla-specific files in arm64/ and clang-format them; r=nbp
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D88977
2020-09-07 10:29:29 +00:00
Jon Coppeard fb11d9f496 Bug 1662502 - Rename some methods on GC wrapped pointers to 'unbarriered' rather than 'unsafe' r=sfink
This should clarify why they are unsafe.

Also rename the overlong 'unsafeUnbarrieredForTracing' to 'unbarrieredAddress'
to be more like Rooted::address and since it is used outside of tracing in a
couple of places.

Differential Revision: https://phabricator.services.mozilla.com/D89012
2020-09-02 19:32:25 +00:00
Jon Coppeard 49959262e5 Bug 1662502 - Refactor barrier implemenations r=sfink
This moves the default barrier implementations for the pre and read barriers to
the Cell base class and combines the existing post barrier implemenations in to
a single function.

Differential Revision: https://phabricator.services.mozilla.com/D89011
2020-09-02 19:30:23 +00:00
Kannan Vijayan bc06456993 Bug 1662260 - OOM check in parser. r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D89071
2020-09-03 15:35:39 +00:00
Iain Ireland 4e76abb6ce Bug 1661728: Add testcase r=jandem
This testcase is a bit fragile to changes in warmup thresholds. It might be nice if we added a testing function to trial-inline a function on-demand.

Differential Revision: https://phabricator.services.mozilla.com/D89215
2020-09-03 07:41:38 +00:00
Simon Giesecke 5cacc3e1dc Bug 1661502 - Make Result move-only. r=froydnj,jandem
Differential Revision: https://phabricator.services.mozilla.com/D88443
2020-09-02 17:56:23 +00:00
Tom Schuster 0786bf636a Bug 1662852 - Fix crash in CacheIRSpewer when writing failed. r=caroline
This happens when using the logger on youtube.com.
The written CacheIR code is not actually valid when writing failed, so we crash.

Differential Revision: https://phabricator.services.mozilla.com/D89195
2020-09-02 21:11:46 +00:00
Jan de Mooij 4832e93faf Bug 1662645 - Don't emit Baseline OOL post-barrier code if it's not used. r=iain
Differential Revision: https://phabricator.services.mozilla.com/D89097
2020-09-02 14:51:16 +00:00
Iain Ireland d12c86aa57 Bug 1661728: Remove ICScript::jitScript_ r=jandem
The bug here occurs when we:
a) Trial-inline A into B, creating an ICScript owned by B with a pointer to A's JitScript.
b) Perform a compacting GC, discarding the JitScript for A, but preserving the JitScript for B (because it is on the stack).
c) Create a new JitScript for A.
d) Warp-compile B, without hitting the B->A trial-inlined call IC.

In this case, the `JitScript*` stored in the ICScript created in `a)` is dangling, and does not match the JitScript created in `c)`.

The easy way to fix this is to not store a `JitScript*` here in the first place. We only use `ICScript::jitScript_` to:
a) Tell whether the ICScript is inlined, which can be done more easily by looking at the depth.
b) Find the `FallbackICStubSpace` for non-inlined ICScripts.

If we use the depth to tell when an ICScript is inlined, then we don't need a pointer to find the owning JitScript (and therefore its stub space) for non-inlined ICScripts. Non-inlined ICScripts are embedded inside a JitScript, so we can compute the offset directly.

Differential Revision: https://phabricator.services.mozilla.com/D88690
2020-08-31 12:52:47 +00:00
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
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