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

78667 Коммитов

Автор SHA1 Сообщение Дата
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
Iain Ireland 862a753887 Bug 1658811: Use the correct arguments when transpiling inside an inlined function r=jandem
We didn't have very good jit-test coverage of this code, so I'm also adding a simple testcase.

Differential Revision: https://phabricator.services.mozilla.com/D87681
2020-08-20 13:07:38 +00:00
Iain Ireland 26819b1fab Bug 1658811: Transpile FunApplyArgs r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D86859
2020-08-20 01:23:49 +00:00
Iain Ireland d5fb55ddf4 Bug 1658811: Transpile function flag guards r=jandem
GuardFunctionIsConstructor isn't necessary for FunApplyArgs, but it seemed reasonable to implement it now anyway.

Differential Revision: https://phabricator.services.mozilla.com/D86858
2020-08-13 13:57:11 +00:00
Iain Ireland 5ec0527f8f Bug 1658811: Transpile GuardNotClassConstructor r=jandem
Depends on D86856

Differential Revision: https://phabricator.services.mozilla.com/D86857
2020-08-13 13:48:31 +00:00
Iain Ireland 8c9f33f398 Bug 1658811: Clean up tryAttachFunApply r=jandem
1. tryAttachFunApply was the last remaining use of GuardSpecificNativeFunction.
2. The FunApplyArgs side of GuardFunApply can be reimplemented using existing CacheIR ops. We might be able to do a similar thing with GuardFunApplyArray, but it will require a bit of refactoring, so I'm leaving it as its own op for now.
3. Like FunCall, FunApply now has a Specialized variant that guards on the specific target to make inlining easier.

Differential Revision: https://phabricator.services.mozilla.com/D86856
2020-08-19 23:59:50 +00:00
Jeff Walden 2fe4e38ce2 Bug 1659885 - Define |JS::shadow::Realm| in public shadow API in its own minimal header. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D87536
2020-08-20 19:23:08 +00:00
Jeff Walden 47fa4336f7 Bug 1659885 - Define |JS::shadow::Zone| in public shadow API in its own minimal header. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D87535
2020-08-20 19:22:53 +00:00
Jeff Walden d9ba945d19 Bug 1659885 - Define |JS::shadow::Symbol| in public shadow API in its own minimal header. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D87534
2020-08-20 19:22:23 +00:00
Jeff Walden f327473b12 Bug 1659885 - Define |JS::shadow::Function| in public shadow API in its own minimal header. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D87533
2020-08-20 19:22:08 +00:00
Jeff Walden babd5bb7fb Bug 1659885 - Define |JS::shadow::Object| in public shadow API in its own minimal header. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D87532
2020-08-20 19:21:53 +00:00
Jeff Walden 4602933cb4 Bug 1659885 - Define |JS::shadow::Shape| and |JS::shadow::BaseShape| in public shadow API in their own minimal header. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D87531
2020-08-20 19:21:21 +00:00
Jeff Walden d65f864b4e Bug 1659885 - Define |JS::shadow::ObjectGroup| in public shadow API in its own minimal header. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D87530
2020-08-20 19:21:09 +00:00
Jeff Walden 63004db93f Bug 1659885 - Define |JS::shadow::String| in public shadow API in its own minimal header. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D87529
2020-08-20 19:20:44 +00:00
Steve Fink b668e1475c Bug 1658654 - Diagnostics for weakmap marking bug r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D87659
2020-08-20 17:52:50 +00:00
Tom Schuster 0c1fea9d46 Bug 1659133 - Improve the alias information for instructions that don't actually alias AddAndStoreSlot. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D87577
2020-08-20 13:01:54 +00:00
Lars T Hansen 42ff6e7fd3 Bug 1656229 - move unused SIMD code. r=jseward
This separates unused SIMD code (from asm.js) from code that's being
actively maintained by placing out-of-line definitions in a new file,
and creating separate sections in the header for the declarations and
in-line definitions.

The code is included in the build so that it doesn't go completely
stale, but this is not technically required.

Differential Revision: https://phabricator.services.mozilla.com/D87307
2020-08-20 14:43:13 +00:00
Lars T Hansen a64bb98703 Bug 1656229 - replace a computation by a constant load. r=jseward
This is technical debt from the initial SIMD work - it's faster to load a
constant here than to compute it.  Benchmark data not forthcoming, but
elsewhere i've found that we break even at two instructions and it's
better to load the value than to compute it in three.

Differential Revision: https://phabricator.services.mozilla.com/D87306
2020-08-20 14:43:04 +00:00
Lars T Hansen 889191a3c7 Bug 1656229 - Use scratch scopes for v128. r=jseward
Always use ScratchSimd128Scope to claim ScratchSimd128Reg.

The only hard part is that the register was claimed deep in the
assembler in what appears to be a late non-AVX bugfix to work around
the fact that compare operations are not three-address on non-AVX.

I fixed this by making compare operations two-address and moving the
code that shuffles registers for this case into the macroassembler,
where the scratch can be claimed correctly.

As a result, we have less support for AVX, but since AVX is not
supported or tested this does not actually matter.  A MOZ_CRASH
ensures we'll run into this if testing with AVX.

Another couple of similar cases elsewhere have similar local fixes:
MOZ_CRASH for AVX, two-address code for the normal case.

Differential Revision: https://phabricator.services.mozilla.com/D87284
2020-08-20 14:42:49 +00:00
Lars T Hansen 8687d7549f Bug 1659667 - expect less specific NaN values. r=bbouvier
These test cases expected specific payloads for some NaN results but
the wasm spec does not guarantee that, and some implementations of
some architectures will not return the same payloads as x64.  So
adjust the tests.

Differential Revision: https://phabricator.services.mozilla.com/D87455
2020-08-20 14:08:40 +00:00
Benjamin Bouvier a9f55ae7c8 Bug 1657561: Fix wasm arguments processing logic for shared memory; r=lth
The flag setting in the ModuleEnv if shared memory is available was using the
wrong predicate. In addition to looking at if shared memory is effectively
enabled, it should also look at whether we're fuzzing or not.

This fixes crashes that happen only when fuzzing, that is, running the shell
with --wasm-compiler=cranelift --fuzzing-safe.

Differential Revision: https://phabricator.services.mozilla.com/D87739
2020-08-20 12:43:18 +00:00
Jon Coppeard f325666338 Bug 1659151 - Mark wrapper rooters in mark slice if we might start sweeping in this slice r=sfink
The idea behind removing marking of wrapper rooters from the mark phase is OK
except we rely on marking being done by the time we start sweeping (we can't
yield between the end of marking and the start of sweeping) and if we delay
marking these wrappers until the sweep phase we may end up with marking work to
do at this point.

The fix is to mark these in mark slices that may end up sweeping (mostly this
doesn't happen because we yield before we start sweeping). Then the marking
gets done by markUntilBudgetExhausted before we get to the sweep phase.

Differential Revision: https://phabricator.services.mozilla.com/D87459
2020-08-19 14:29:13 +00:00
Nicolò Ribaudo dfd18c189d Bug 1659996 - Remove unused hasArrayHoleOrSpread in ListNode (in ParseNode.h) r=arai
While working on https://phabricator.services.mozilla.com/D87586 I noticed that the hasArrayHoleOrSpread flag is set but it's never used.

Searchfox: https://searchfox.org/mozilla-central/search?q=hasArrayHoleOrSpread&path=&case=false&regexp=false

Differential Revision: https://phabricator.services.mozilla.com/D87592
2020-08-20 07:43:01 +00:00
Ted Campbell 1585781cef Bug 1659107 - Factor out XDRSourceExtent method. r=arai
This will be reused by the Stencil XDR code later.

Differential Revision: https://phabricator.services.mozilla.com/D87071
2020-08-19 22:26:46 +00:00
Ted Campbell 3790ec21f7 Bug 1659107 - Move js::SourceExtent to SharedStencil.h. r=arai
This data structure is the same between ScriptStencil and BaseScript forms so
it belongs in SharedStencil.h. Avoid pulling in CompileOptions.h by passing
lineno/column explicitly.

Differential Revision: https://phabricator.services.mozilla.com/D87070
2020-08-19 22:26:42 +00:00
Mike Hommey 790f20eebd Bug 1659902 - Account for the larger page size on arm64 mac for ReadOnlyPage. r=mccr8
Eventually we'll have to adjust on x86_64 mac too if we want to be able
to run some tests under Rosetta, but let's leave that for another day.

Differential Revision: https://phabricator.services.mozilla.com/D87549
2020-08-19 18:06:49 +00:00
Tooru Fujisawa fce9eae61d Bug 1659884 - Rewind asm.js module. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D87541
2020-08-19 19:52:08 +00:00
Steve Fink 69083483a5 Bug 1607970 - Switch from jsid to PropertyKey as the base type r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D59958
2020-08-19 18:05:22 +00:00
Steve Fink 7b302bcff7 Bug 1607970 - Fix missing debuginfo problems in optimized gcc compile of gdb-tests r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D59956
2020-08-19 18:05:20 +00:00
Steve Fink 19dee18170 Bug 1607970 - [gdb tests] compile without optimization with clang to fix test failures due to inadequate debuginfo r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D59948
2020-08-19 18:05:17 +00:00
André Bargull 3a981e3671 Bug 1659140 - Part 4: Use VM calls for non-Latin1 characters in LoadStringCharResult. r=jandem
Restricting LoadStringCharResult to Latin-1 characters means Warp won't be
able to optimise accesses when Two-Byte characters are present. Instead slow
generic VM calls were used for string accesses.

Differential Revision: https://phabricator.services.mozilla.com/D87101
2020-08-19 10:06:33 +00:00
André Bargull 413020db0e Bug 1659140 - Part 3: Change LoadStringCharResult to an unshared CacheIR op. r=jandem
Part 4 will add compiler specific changes to these methods.

Differential Revision: https://phabricator.services.mozilla.com/D87100
2020-08-19 09:10:58 +00:00
André Bargull ee7df3a451 Bug 1659140 - Part 2: Optimise string comparisons in Warp. r=jandem
Implement `MCompare::tryFoldCharCompare` to port the improvements from
bug 813836 and bug 1538690. This wasn't previously handled through `foldsTo`,
because relational comparison support for strings (bug 1538692) wasn't present
at that point of time.

Differential Revision: https://phabricator.services.mozilla.com/D87099
2020-08-19 09:06:02 +00:00
André Bargull cfc15cd8f5 Bug 1659140 - Part 1: Implement constant charCodeAt optimisation through MCharCodeAt::foldsTo. r=jandem
This optimisation was added in bug 1041781 and still seems useful to have.

Differential Revision: https://phabricator.services.mozilla.com/D87098
2020-08-19 09:05:54 +00:00
André Bargull 53e90efa15 Bug 1657117: Call `ToObject(options)` before validating the language tag parameter in Intl.Locale. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D85864
2020-08-19 08:55:47 +00:00
Tom Schuster 2631f16bb2 Bug 1659133 - Improve GuardShape folding in Ion. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D87089
2020-08-18 21:33:15 +00:00
Jon Coppeard 9fc3fa7cb4 Bug 1659477 - Replace sweepMarkTaskStarted field by using sweepMarkTask state r=sfink
Depends on D87293

Differential Revision: https://phabricator.services.mozilla.com/D87294
2020-08-18 16:12:55 +00:00
Lars T Hansen a88e6c3d15 Bug 1659262 - SIMD is riding the trains, so fix tests. r=rhunt,aryx
This adjusts the feature test to accept SIMD on beta+release for
x86/x64, since we're letting SIMD ride the trains behind a pref that
is off by default.  In the shell, we don't make a distinction for
prefs between nightly and non-nightly, so test that SIMD is on in
beta+release on these platforms.  It's complicated: SIMD may be off if
the hardware is feeble.  See comment in the test.

(The alternative is to start making that distinction in the setting of
the shell flag, but does anyone benefit from this?)

Differential Revision: https://phabricator.services.mozilla.com/D87224
2020-08-19 03:48:54 +00:00
Tooru Fujisawa 63088ef04a Bug 1659851 - Do not parse twice in parse shell function. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D87513
2020-08-19 01:17:04 +00:00
Jeff Walden 44ea1a179b Bug 1502355 - Fix Rust build to not depend on previously-bootlegged symbols.
Differential Revision: https://phabricator.services.mozilla.com/D87524
2020-08-19 00:07:14 +00:00
Jeff Walden 0136cc322d Bug 1502355 - Recognize already-aborted signals passed to |ReadableStreamPipeTo| and don't pipe in this case. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D87380
2020-08-18 20:50:24 +00:00
Jeff Walden a5cfe7db08 Bug 1502355 - Correctly detect AbortSignal instances using a |const JSClass*| supplied by the embedding. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D87379
2020-08-18 20:50:21 +00:00
Jeff Walden 783189525a Bug 1502355 - Add support for unwrapping a value/object, known at one time to have a given class, as an object of that class. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D87378
2020-08-18 20:50:18 +00:00
Jeff Walden ace8226763 Bug 1502355 - Remove various unused detritus from jsfriendapi.h. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D87377
2020-08-18 20:50:11 +00:00
Jeff Walden 81f4ca4ee6 Bug 1502355 - Declare |JSClass| in consistent fashion everywhere. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D87376
2020-08-18 20:50:07 +00:00
Tom Schuster c3ccd2a7fa Bug 1659424 - Transpile AllocateAndStoreDynamicSlot. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D87269
2020-08-18 18:34:56 +00:00
Adam Vandolder d8e2490fd9 Bug 1659509 - Add tests for Reflect.parse private method support. r=mgaudet
Depends on D87310

Differential Revision: https://phabricator.services.mozilla.com/D87349
2020-08-18 15:31:24 +00:00
Adam Vandolder 0b5f30f383 Bug 1659134 - Implement private static methods. r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D87093
2020-08-18 17:45:27 +00:00
Jon Coppeard f3e44d5aa4 Bug 1659472 - Avoid pre-barrier when marking JS Map/Set keys r=sfink
Ideally this would be reworked to separate out the barrier from HashableValue
but that ended up being more work than expected. This is a small fix to clear
the value and avoid the barrier in this situation.

Differential Revision: https://phabricator.services.mozilla.com/D87293
2020-08-18 17:33:51 +00:00
Ryan Hunt 8356043d37 Bug 1561521 - Clean up wasm::ToString and drop wasm::ToCString. r=lth
wasm::ToCString is losing relevance as we have more constructed types. This
commit removes ToCString and replaces all uses with wasm::ToString.

Differential Revision: https://phabricator.services.mozilla.com/D85071
2020-08-18 16:59:26 +00:00
Ryan Hunt e554e8264b Bug 1561521 - Report error when decoding a value-type and there are no bytes. r=lth
We need to report an error message here or else it will be reported as an OOM.

Differential Revision: https://phabricator.services.mozilla.com/D85070
2020-08-18 16:59:22 +00:00
Ryan Hunt 54b0d27de1 Bug 1561521 - Refine ref.null decoding to decode heaptype instead of reftype. r=lth
ref.null takes a heaptype immediate. This is backwards compatible for
reference-types, but is a breaking change for the GC proposal. This commit
implements decoding for this refinement.

Differential Revision: https://phabricator.services.mozilla.com/D85069
2020-08-18 16:59:06 +00:00
Ryan Hunt 84f9e0c38e Bug 1561521 - Add non-nullable references. r=lth
This commit adds decoding, validation, and JS-API type-checking for
non-nullable references.

Differential Revision: https://phabricator.services.mozilla.com/D85068
2020-08-18 16:58:59 +00:00
Ryan Hunt 85d8a80c08 Bug 1561521 - Add constant for abstracting reference-types values. r=lth
TypeCode::OptRef is currently used to represent any reference-typed value
for UnpackTypeCodeTypeAbstracted and IsReferenceType. I think it's actually
clearer to have this behind a named constant.

Differential Revision: https://phabricator.services.mozilla.com/D85066
2020-08-18 16:58:55 +00:00
Ryan Hunt 0baa5c9770 Bug 1561521 - Generalize table/element code for future reference-types. r=lth
wasm::Table uses wasm::TableKind to determine the element type of the table,
which makes it difficult to extend tables to support more reference types. This
commit drops TableKind in favor of directly storing the element RefType, along
with a flag for whether this table is forAsmJS, which influences the funcref
ABI. RefType is extended to return the existing TableRepr enum, which indicates
the memory representation to use for the table.

wasm::ElemSegment uses wasm::ValType, which is a superset of the allowed
types of an elem segment. This commit switches it to use the proper
RefType class, and tweaks decoding.

Differential Revision: https://phabricator.services.mozilla.com/D85064
2020-08-18 16:58:48 +00:00
Ryan Hunt c656f2f523 Bug 1561521 - Rename TypeCode/ValType/RefType::Any to Extern. r=lth
This commit renames the TypeCode/ValType/RefType occurrences of 'any' to 'extern'
to match what they actually represent. All public API facing occurrences have
already been switched to 'externref' so this should only be aligning the
internal names with their extern usage.

Comments that only apply to 'externref' code paths are renamed as well.

Differential Revision: https://phabricator.services.mozilla.com/D85063
2020-08-18 16:58:32 +00:00
Ryan Hunt ff588ab359 Bug 1561521 - Tests: Change tests that rely on old test messages. r=lth
The following commits will change test messages for a couple tests, and this
commit fixes the breakage.

Differential Revision: https://phabricator.services.mozilla.com/D85062
2020-08-18 16:58:21 +00:00
Ryan Hunt 3b63230f7f Bug 1561521 - Tests: Clean up disabled tests for gc/ref-types. r=lth
This commit finishes the split of wasm/gc and wasm/ref-types tests by splitting
the disabled-ref.js test into a GC test and a ref-type test.

Differential Revision: https://phabricator.services.mozilla.com/D85061
2020-08-18 16:54:16 +00:00
Ryan Hunt 9f548367e7 Bug 1561521 - Tests: Rename ref-types/ tests that actually test externref. r=lth
Follow-up to the previous commit that moved these tests over to wasm/ref-types,
this commit renames the tests from 'anyref' to 'externref'.

Differential Revision: https://phabricator.services.mozilla.com/D85060
2020-08-18 16:53:58 +00:00
Ryan Hunt ab94b258ac Bug 1561521 - Tests: Add wasm/ref-types/ folder, move non-gc specific tests there. r=lth
The tests in wasm/gc are a mix of reftypes/gc tests. This commit adds a
ref-types folder and moves relevant tests over.

Differential Revision: https://phabricator.services.mozilla.com/D85059
2020-08-18 16:53:34 +00:00
Ryan Hunt 1bc94f3ab1 Bug 1561521 - Tests: Rewrite (ref.null $reftype) to (ref.null $heaptype). r=lth
The function-references spec refined ref.null to take a heaptype, which has a
slightly different text format for non-nullable references. This commit updates
tests to the new syntax.

Differential Revision: https://phabricator.services.mozilla.com/D85056
2020-08-18 16:52:42 +00:00
Ryan Hunt d433f6afa3 Bug 1561521 - Tests: Remove tests that assert one-level imports are invalid text. r=lth
Wat now implements the module-linking proposal which includes one-level imports.

This commit removes tests of the text format which asserted these were not-valid.

Differential Revision: https://phabricator.services.mozilla.com/D85055
2020-08-18 16:52:09 +00:00
Ryan Hunt 1539899844 Bug 1561521 - Tests: Rename (ref opt T) to (ref null T). r=lth
The nullable reference syntax has changed from `opt` to `null`.

Differential Revision: https://phabricator.services.mozilla.com/D85054
2020-08-18 16:51:55 +00:00
Ryan Hunt 8264a9f640 Bug 1561521 - Tests: Automatically replace all uses of anyref with externref. r=lth
When we removed subtyping, we kept the anyref text syntax as an alias of
externref. This commit completes the migration over to externref. A future
commit will switch uses of externref which should be anyref back.

Differential Revision: https://phabricator.services.mozilla.com/D85053
2020-08-18 16:51:11 +00:00
Ryan Hunt 7157eeec3a Bug 1561521 - Vendor the latest wat. r=lth
Differential Revision: https://phabricator.services.mozilla.com/D85052
2020-08-18 16:50:27 +00:00
Jon Coppeard 911a5d3265 Bug 1657850 - Add prefs to control how many background threads are used for GC r=sfink
This adds a thread count for GC parallel tasks calculated from GC parameters
for a helper thread ratio and max helper thread count. It also adds one to
report the number of helper threads used for GC.

This is slightly complicated by the fact that the helper thread system is
per-process and there are potentially many JS runtimes in a process. I
disallowed setting these parameters from workers (i.e. child JS runtimes), but
there may be more than one non-worker JS runtime so this isn't perfect.

I had to swap the mutex order for the GC and helper thread locks.  Whatever
reason they were the other way round seems to have gone and this order makes
more sense to me (I see the GC lock as being 'coarser' than the helper thread
lock).

Differential Revision: https://phabricator.services.mozilla.com/D86725
2020-08-18 15:38:24 +00:00
Jon Coppeard 6aeb23731a Bug 1657850 - Add an uninitialized JSContext kind to simplify protected data checks r=jandem
Currently we hack around the protected data checks during helper thread
initialization in GlobalHelperThreadState::ensureContextListForThreadCount.
This removes the need to do that and allows us to simplify that method. I added
some more assertions in JSContext::set/clearHelperThread too.

Differential Revision: https://phabricator.services.mozilla.com/D87423
2020-08-18 15:47:57 +00:00
Adam Vandolder e24acf632f Bug 1659501 - Remove failing assertion from Reflect.parse classes test. r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D87310
2020-08-18 14:05:12 +00:00
Jan de Mooij f884e283b2 Bug 1659062 part 5 - Support MegamorphicSetElement in the transpiler. r=anba
Differential Revision: https://phabricator.services.mozilla.com/D87081
2020-08-18 11:44:11 +00:00
Jan de Mooij e02abe5715 Bug 1659062 part 4 - Support MegamorphicHasPropResult in the transpiler. r=anba
Differential Revision: https://phabricator.services.mozilla.com/D87080
2020-08-18 11:44:03 +00:00
Jan de Mooij 034dc11d35 Bug 1659062 part 3 - Support MegamorphicStoreSlot in the transpiler. r=anba
Differential Revision: https://phabricator.services.mozilla.com/D87079
2020-08-18 11:43:45 +00:00
Jan de Mooij 9e0f2fb99b Bug 1659062 part 2 - Support MegamorphicLoadSlotByValueResult in the transpiler. r=anba
Differential Revision: https://phabricator.services.mozilla.com/D87078
2020-08-18 11:43:26 +00:00
Jan de Mooij e53078d096 Bug 1659062 part 1 - Support MegamorphicLoadSlotResult in the transpiler. r=anba
Differential Revision: https://phabricator.services.mozilla.com/D87077
2020-08-18 11:43:15 +00:00
Dorel Luca 7cf9cb9d07 Backed out 16 changesets (bug 1561521) for WASM build bustages
Backed out changeset a850ff24c2ae (bug 1561521)
Backed out changeset 3d1a8283d2f8 (bug 1561521)
Backed out changeset 02ce4be46831 (bug 1561521)
Backed out changeset 00d2290648a7 (bug 1561521)
Backed out changeset cd847eba7f9c (bug 1561521)
Backed out changeset a7ad7e2b02c1 (bug 1561521)
Backed out changeset 538920d2d777 (bug 1561521)
Backed out changeset 3d3e3d124767 (bug 1561521)
Backed out changeset c827ecead12d (bug 1561521)
Backed out changeset 1cb2561bf28f (bug 1561521)
Backed out changeset a18f7f6320c4 (bug 1561521)
Backed out changeset bc80a4372ba0 (bug 1561521)
Backed out changeset a3abc2d14f78 (bug 1561521)
Backed out changeset b8c0cb8771b6 (bug 1561521)
Backed out changeset fe600b71015f (bug 1561521)
Backed out changeset 41e46f9041bd (bug 1561521)
2020-08-18 05:35:55 +03:00
Ryan Hunt 181b95a627 Bug 1561521 - Clean up wasm::ToString and drop wasm::ToCString. r=lth
wasm::ToCString is losing relevance as we have more constructed types. This
commit removes ToCString and replaces all uses with wasm::ToString.

Differential Revision: https://phabricator.services.mozilla.com/D85071
2020-08-18 00:45:24 +00:00
Ryan Hunt d88ab9d38f Bug 1561521 - Report error when decoding a value-type and there are no bytes. r=lth
We need to report an error message here or else it will be reported as an OOM.

Differential Revision: https://phabricator.services.mozilla.com/D85070
2020-08-18 00:07:29 +00:00
Ryan Hunt 978e1852ba Bug 1561521 - Refine ref.null decoding to decode heaptype instead of reftype. r=lth
ref.null takes a heaptype immediate. This is backwards compatible for
reference-types, but is a breaking change for the GC proposal. This commit
implements decoding for this refinement.

Differential Revision: https://phabricator.services.mozilla.com/D85069
2020-08-18 00:37:28 +00:00
Ryan Hunt 7ce7945cc8 Bug 1561521 - Add non-nullable references. r=lth
This commit adds decoding, validation, and JS-API type-checking for
non-nullable references.

Differential Revision: https://phabricator.services.mozilla.com/D85068
2020-08-18 00:40:20 +00:00
Ryan Hunt f6c4069dce Bug 1561521 - Add constant for abstracting reference-types values. r=lth
TypeCode::OptRef is currently used to represent any reference-typed value
for UnpackTypeCodeTypeAbstracted and IsReferenceType. I think it's actually
clearer to have this behind a named constant.

Differential Revision: https://phabricator.services.mozilla.com/D85066
2020-08-18 00:06:00 +00:00
Ryan Hunt 4d72ca080e Bug 1561521 - Generalize table/element code for future reference-types. r=lth
wasm::Table uses wasm::TableKind to determine the element type of the table,
which makes it difficult to extend tables to support more reference types. This
commit drops TableKind in favor of directly storing the element RefType, along
with a flag for whether this table is forAsmJS, which influences the funcref
ABI. RefType is extended to return the existing TableRepr enum, which indicates
the memory representation to use for the table.

wasm::ElemSegment uses wasm::ValType, which is a superset of the allowed
types of an elem segment. This commit switches it to use the proper
RefType class, and tweaks decoding.

Differential Revision: https://phabricator.services.mozilla.com/D85064
2020-08-18 00:45:07 +00:00
Ryan Hunt afa136be68 Bug 1561521 - Rename TypeCode/ValType/RefType::Any to Extern. r=lth
This commit renames the TypeCode/ValType/RefType occurrences of 'any' to 'extern'
to match what they actually represent. All public API facing occurrences have
already been switched to 'externref' so this should only be aligning the
internal names with their extern usage.

Comments that only apply to 'externref' code paths are renamed as well.

Differential Revision: https://phabricator.services.mozilla.com/D85063
2020-08-18 00:04:37 +00:00
Ryan Hunt 198d70cda9 Bug 1561521 - Tests: Change tests that rely on old test messages. r=lth
The following commits will change test messages for a couple tests, and this
commit fixes the breakage.

Differential Revision: https://phabricator.services.mozilla.com/D85062
2020-08-18 00:03:29 +00:00
Ryan Hunt 33eab5d76c Bug 1561521 - Tests: Clean up disabled tests for gc/ref-types. r=lth
This commit finishes the split of wasm/gc and wasm/ref-types tests by splitting
the disabled-ref.js test into a GC test and a ref-type test.

Differential Revision: https://phabricator.services.mozilla.com/D85061
2020-08-18 00:03:01 +00:00
Ryan Hunt 9bb0ee7621 Bug 1561521 - Tests: Rename ref-types/ tests that actually test externref. r=lth
Follow-up to the previous commit that moved these tests over to wasm/ref-types,
this commit renames the tests from 'anyref' to 'externref'.

Differential Revision: https://phabricator.services.mozilla.com/D85060
2020-08-18 00:02:43 +00:00
Ryan Hunt 3090064cec Bug 1561521 - Tests: Add wasm/ref-types/ folder, move non-gc specific tests there. r=lth
The tests in wasm/gc are a mix of reftypes/gc tests. This commit adds a
ref-types folder and moves relevant tests over.

Differential Revision: https://phabricator.services.mozilla.com/D85059
2020-08-18 00:02:35 +00:00
Ryan Hunt 3fdbce0674 Bug 1561521 - Tests: Rewrite (ref.null $reftype) to (ref.null $heaptype). r=lth
The function-references spec refined ref.null to take a heaptype, which has a
slightly different text format for non-nullable references. This commit updates
tests to the new syntax.

Differential Revision: https://phabricator.services.mozilla.com/D85056
2020-08-18 00:01:25 +00:00
Ryan Hunt 2a3f22fe4d Bug 1561521 - Tests: Remove tests that assert one-level imports are invalid text. r=lth
Wat now implements the module-linking proposal which includes one-level imports.

This commit removes tests of the text format which asserted these were not-valid.

Differential Revision: https://phabricator.services.mozilla.com/D85055
2020-08-18 00:00:47 +00:00
Ryan Hunt d3ad2220b0 Bug 1561521 - Tests: Rename (ref opt T) to (ref null T). r=lth
The nullable reference syntax has changed from `opt` to `null`.

Differential Revision: https://phabricator.services.mozilla.com/D85054
2020-08-18 00:17:37 +00:00
Ryan Hunt d2a03707b7 Bug 1561521 - Tests: Automatically replace all uses of anyref with externref. r=lth
When we removed subtyping, we kept the anyref text syntax as an alias of
externref. This commit completes the migration over to externref. A future
commit will switch uses of externref which should be anyref back.

Differential Revision: https://phabricator.services.mozilla.com/D85053
2020-08-17 23:59:40 +00:00
Ryan Hunt c7239f8aaa Bug 1561521 - Vendor the latest wat. r=lth
Differential Revision: https://phabricator.services.mozilla.com/D85052
2020-08-17 23:57:53 +00:00
caroline 4a26090369 Bug 1659561 - End CacheIRHealth report entries list in the correct spot. r=mgaudet
Depends on D87343

Differential Revision: https://phabricator.services.mozilla.com/D87348
2020-08-17 21:30:35 +00:00
caroline 3e8656037c Bug 1659007 - Properly begin JSONPrinter list for the StructuredSpewer. r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D87343
2020-08-17 21:23:02 +00:00
Kris Maglione 0c976d908a Bug 1651519: Part 2 - Also remove nsIDOMWindowUtils::outerWindowID. r=nika,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82957
2020-08-17 20:22:12 +00:00
Kris Maglione 3af8c4138c Bug 1651519: Remove nsIDOMWindowUtils::currentInnerWindowID. r=nika,remote-protocol-reviewers,webcompat-reviewers,whimboo
It has some properties which make it footgunny, especially in the face of
Fission. Callers should use WindowGlobalChild.innerWindowId instead.

Differential Revision: https://phabricator.services.mozilla.com/D82801
2020-08-17 20:20:50 +00:00
Cosmin Sabou 3c41b208bb Backed out changeset bf287de30e50 (bug 1592105) for bustages on TokenStream.cpp CLOSED TREE 2020-08-17 22:48:08 +03:00
Kannan Vijayan 698fbae965 Bug 1592105 - 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-17 18:37:40 +00:00
Adam Vandolder 0ebdab674a Bug 1659261 - Declare privateMethodsEnabled outside of just nightly. r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D87282
2020-08-17 14:06:36 +00:00
Jan de Mooij a97cc4af06 Bug 1659093 part 4 - Remove fixed register uses that are no longer necessary. r=anba
Also remove some misleading comments (temps never alias inputs, see part 1).

Differential Revision: https://phabricator.services.mozilla.com/D87266
2020-08-17 13:19:49 +00:00
Jan de Mooij 28852f1b45 Bug 1659093 part 3 - Require call instruction temps to be fixed registers. r=anba
This prevents the potential issue described in the comment and most instructions
already did this anyway.

Differential Revision: https://phabricator.services.mozilla.com/D87265
2020-08-17 13:19:49 +00:00
Jan de Mooij 266b3b7352 Bug 1659093 part 2 - Remove a now-unnecessary assertion. r=anba
Given that temps never alias inputs as established in the previous patch, this
assertion isn't necessary. It's possible the LSRA allocator did things differently.

The assertion was also weird/wrong because it depends on LDefinition::Type, but
there are multiple Types that could still map to the same Register. It looks
like bug 1067610 broke this; before that refactoring we compared isFloatReg().

Differential Revision: https://phabricator.services.mozilla.com/D87264
2020-08-17 13:19:48 +00:00
Jan de Mooij 340ac16ce4 Bug 1659093 part 1 - Assert temps don't alias inputs, fix some comments. r=anba
Temps cover both the input and output part of the instruction, so their ranges
always overlap with at-start uses (covering the input) and non-at-start uses
(covering both input and output). This means the allocated register must be
different from any uses.

Defs cover only the output part of the instruction so there at-start makes a
difference.

Differential Revision: https://phabricator.services.mozilla.com/D87263
2020-08-17 13:19:48 +00:00
Tom Schuster 290d6e2d72 Bug 1659441 - Switch on ValueType in PrimitiveToX. r=tcampbell
I noticed this while looking at D87232. Using an exhaustive switch makes it easier to find all the places that need to be updated when adding a new ValueType.

Differential Revision: https://phabricator.services.mozilla.com/D87273
2020-08-17 13:37:52 +00:00
Lars T Hansen cf7ae9564e Bug 1656832 - Remove setARMHwCapFlags testing functions. r=bbouvier
This removes the testing function and adjusts the tests that use it.
One test is removed because wasm, and asm.js, are not available
without floating point support (guarded against in HasSupport).

The patch also documents the meaning and logic of the remaining
hardware flag management.

There is already a command line switch for setting the ARM flags (and
an environment variable) so we don't need to introduce anything to
allow flags to be set.  However, this code needed to be updated to
properly compute the JIT flags after setting the ARM flags.

Test cases are introduced to test that wasm is not available in
situations where the required hardware is not in place.

A final adjustment is made to HasSupport: It can call
JitSupportsAtomics() rather than test the ARM flags directly, since
the jit tests those flags on ARM.

Differential Revision: https://phabricator.services.mozilla.com/D87262
2020-08-17 13:07:49 +00:00
André Bargull ea02c6e4b8 Bug 1655766 - Part 2: Optimise Object.is in CacheIR and Warp. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D85166
2020-08-15 12:05:20 +00:00
André Bargull 3259bbf890 Bug 1655766 - Part 1: Move same-value comparison for doubles into MacroAssembler. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D85165
2020-08-15 12:02:44 +00:00
Jon Coppeard 429b457123 Bug 1659065 - Don't trigger barriers in WeakRef trace hook r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D87054
2020-08-14 14:48:44 +00:00
Bogdan Tara fef5d21eae Backed out 3 changesets (bug 1607970) for lint failure on PropertyKey.py CLOSED TREE
Backed out changeset 4185f5488be6 (bug 1607970)
Backed out changeset 00fa73b52b96 (bug 1607970)
Backed out changeset aff7ccb18258 (bug 1607970)
2020-08-15 01:36:38 +03:00
Steve Fink 2f771694b9 Bug 1607970 - Switch from jsid to PropertyKey as the base type r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D59958
2020-08-14 21:04:05 +00:00
Steve Fink 12da26e2c4 Bug 1607970 - Fix missing debuginfo problems in optimized gcc compile of gdb-tests r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D59956
2020-08-14 21:04:03 +00:00
Steve Fink 2ee867459c Bug 1607970 - [gdb tests] compile without optimization with clang to fix test failures due to inadequate debuginfo r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D59948
2020-08-14 21:04:01 +00:00
Adam Vandolder a560af420d Bug 1435826 - Implement private instance methods and accessors. r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D86239
2020-08-14 16:16:15 +00:00
Tom Schuster 1971ae69cc Bug 1658990 - Transpile AddAndStoreFixedSlot and AddAndStoreDynamicSlot. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D87000
2020-08-14 14:46:24 +00:00
Tom Schuster c838228f9f Bug 1658990 - Transpile GuardGroup. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D86999
2020-08-14 12:52:06 +00:00
Adam Vandolder c9aad0c1b1 Bug 1435826 - Add pref for private methods. r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D86556
2020-08-14 14:11:02 +00:00
Mike Hommey 7a4041f35b Bug 1659049 - Don't use mrs instruction on arm64 macOS. r=lth
This is similar to bug 1517594.

Differential Revision: https://phabricator.services.mozilla.com/D87027
2020-08-14 11:51:41 +00:00
Lars T Hansen 2cc8935f0d Bug 1657374 - Reject v128 if simd disabled. r=rhunt
This adds guards in readValType() and in the validator, and a test
case that checks that the guards are working if SIMD is disabled.

Nearly everything was in place already and this is almost all
plumbing; the exception is the new guard in WasmValidate.h.

Differential Revision: https://phabricator.services.mozilla.com/D86949
2020-08-14 12:31:16 +00:00
Lars T Hansen 9e2ed30feb Bug 1657374 - flip flags for wasm simd. r=rhunt
This should be enough to enable wasm simd on x86/x64 in all channels, but
leave it preffed-off on non-nightly.

Differential Revision: https://phabricator.services.mozilla.com/D86822
2020-08-14 12:30:43 +00:00
André Bargull a58d0aca18 Bug 1658270 - Part 3: Optimise "assertRecoveredOnBailout" testing function in CacheIR and Warp. r=jandem
`WarpCacheIRTranspiler::emitAssertRecoveredOnBailoutResult()` was copied from the
MCallOptimize implementation. A new `addEffectfulUnsafe()` helper was added to
avoid triggering the safety assertions in `addEffectful()`. The `MResumePoint`
also needs to be created manually to avoid triggering assertions in the
`WarpCacheIRTranspiler::resumeAfter()` helper. Bypassing the safety assertions
should be okay in this case, because `assertRecoveredOnBailout()` is a fuzzy
unsafe testing function, so we can directly control how it is called.

JIT tests which don't (yet) pass in Warp have been disabled and annotated
with "TODO(Warp)".

Drive-by change:
- Use `add()` in `WarpCacheIRTranspiler::addDataViewData()`.

Differential Revision: https://phabricator.services.mozilla.com/D86528
2020-08-14 12:16:48 +00:00
André Bargull 9017134558 Bug 1658270 - Part 2: Optimise "assertFloat32" testing function in CacheIR and Warp. r=jandem
This is currently a NOP until bug 1655773 has been implemented.

Differential Revision: https://phabricator.services.mozilla.com/D86527
2020-08-14 12:16:51 +00:00
André Bargull 5102a1bbea Bug 1658270 - Part 1: Optimise "bailout" testing function in CacheIR and Warp. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D86526
2020-08-14 12:13:34 +00:00
André Bargull 07190147de Bug 1077305: Return Double for Atomics on Uint32 TypedArrays. r=jandem
Change Atomics for Uint32 TypedArrays to use Double-typed numbers. That way we
get a stable return type (always Double typed instead of Int32 or Double typed),
which ensures we get a deterministic inlining behaviour in Ion and make it
possible to inline Atomics functions for Uint32 in Warp.

Differential Revision: https://phabricator.services.mozilla.com/D86932
2020-08-14 11:45:25 +00:00
André Bargull 62af4b9d9e Bug 1658279 - Part 3: Don't create a template object for String when not constructing. r=jandem
Calling `String()` shouldn't create a template object.

Differential Revision: https://phabricator.services.mozilla.com/D86534
2020-08-14 10:38:16 +00:00
André Bargull 9139565fcb Bug 1658279 - Part 2: Remove unnecessary rooting in CacheIR. r=jandem
Noticed while working on ArraySlice that ArrayPush and ArrayJoin have
unnecessary rooting. Also found some other places where rooting can
be omitted.

Differential Revision: https://phabricator.services.mozilla.com/D86533
2020-08-14 08:03:48 +00:00
André Bargull 4ed6b5eb87 Bug 1658279 - Part 1: Optimise ArraySlice in CacheIR and Warp. r=jandem
Optimise Array.prototype.slice for packed arrays in CacheIR and Warp. Ion
also optimises `slice()` for non-packed arrays, but unless non-packed arrays
actually appear in user code, only optimising packed arrays should be okay
for now.

The second argument to `slice()` defaults to the array length, which means
we need a non-result version of `LoadInt32ArrayLength`.


Drive-by change:
- Move `IonCacheIRCompiler::emitArrayPush` to the bottom of the file,
  next to the other non-implemented methods. Also change from
  `MOZ_ASSERT_UNREACHABLE` to `MOZ_CRASH` for consistency.

Differential Revision: https://phabricator.services.mozilla.com/D86532
2020-08-14 08:03:27 +00:00
André Bargull a2917e11ee Bug 1659051: Take failure path before discarding the stack. r=jandem
The test case crashes without this patch when two `AutoScratchRegister`
are added to `BaselineCacheIRCompiler::emitStringFromCodeResult()`.

Differential Revision: https://phabricator.services.mozilla.com/D87028
2020-08-14 07:14:02 +00:00
Csoregi Natalia c9c139cfd7 Backed out changeset fb664f6d43ed (bug 1657850) for failures on helper-thread-params.js. CLOSED TREE 2020-08-13 21:41:13 +03:00
Jon Coppeard 9eb0dfc2fa Bug 1658895 - Don't trace wrapper rooters in mark slices r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D86938
2020-08-13 16:22:05 +00:00
Jon Coppeard df6a3dabdf Bug 1657850 - Add prefs to control how many background threads are used for GC r=sfink
This adds a thread count for GC parallel tasks calculated from GC parameters
for a helper thread ratio and max helper thread count. It also adds one to
report the number of helper threads used for GC.

This is slightly complicated by the fact that the helper thread system is
per-process and there are potentially many JS runtimes in a process. I
disallowed setting these parameters from workers (i.e. child JS runtimes), but
there may be more than one non-worker JS runtime so this isn't perfect.

I had to swap the mutex order for the GC and helper thread locks.  Whatever
reason they were the other way round seems to have gone and this order makes
more sense to me (I see the GC lock as being 'coarser' than the helper thread
lock).

Differential Revision: https://phabricator.services.mozilla.com/D86725
2020-08-13 17:35:04 +00:00
Jon Coppeard 977ed9487d Bug 1658675 - Initialize module loader before starting an interactive shell r=jandem
The problem was that the module loader intialization was skipped if there were
no paths passed on the commandline.

Differential Revision: https://phabricator.services.mozilla.com/D86933
2020-08-13 13:16:23 +00:00
Tom Schuster 9cc135d8a6 Bug 1658786 - KnownClass support for iterators. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D86843
2020-08-13 13:53:55 +00:00
Tom Schuster f1934bf4d4 Bug 1658786 - Move KnownClass analysis to a new file. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D86842
2020-08-13 13:53:43 +00:00
Razvan Maries ed0c23f802 Backed out 3 changesets (bug 1658279) for perma failures on browser_topsites_section.js. CLOSED TREE
Backed out changeset 728d98643858 (bug 1658279)
Backed out changeset 761efef13026 (bug 1658279)
Backed out changeset 25869d8b6148 (bug 1658279)
2020-08-13 16:16:03 +03:00
Jan de Mooij 431cd8b7e1 Bug 1658882 part 5 - Support ProxySet and ProxySetByValue in the transpiler. r=anba
Depends on D86923

Differential Revision: https://phabricator.services.mozilla.com/D86924
2020-08-13 09:10:41 +00:00
Jan de Mooij a14fa27ec3 Bug 1658882 part 4 - Support ProxyHasPropResult in the transpiler. r=anba
Depends on D86922

Differential Revision: https://phabricator.services.mozilla.com/D86923
2020-08-13 09:10:39 +00:00
Jan de Mooij 77d0c3cec0 Bug 1658882 part 3 - Support ProxyGetResult and ProxyGetByValueResult in the transpiler. r=anba
Depends on D86921

Differential Revision: https://phabricator.services.mozilla.com/D86922
2020-08-13 09:10:36 +00:00
Jan de Mooij f552f0c1db Bug 1658882 part 2 - Support GuardIsNotDOMProxy in the transpiler. r=anba
Depends on D86920

Differential Revision: https://phabricator.services.mozilla.com/D86921
2020-08-13 09:10:34 +00:00
Jan de Mooij 57f4936b9d Bug 1658882 part 1 - Support GuardIsProxy in the transpiler. r=anba
Differential Revision: https://phabricator.services.mozilla.com/D86920
2020-08-13 09:10:26 +00:00
André Bargull 5216d6395e Bug 1658279 - Part 3: Don't create a template object for String when not constructing. r=jandem
Calling `String()` shouldn't create a template object.

Differential Revision: https://phabricator.services.mozilla.com/D86534
2020-08-13 09:28:52 +00:00
André Bargull 423d2f0dee Bug 1658279 - Part 2: Remove unnecessary rooting in CacheIR. r=jandem
Noticed while working on ArraySlice that ArrayPush and ArrayJoin have
unnecessary rooting. Also found some other places where rooting can
be omitted.

Differential Revision: https://phabricator.services.mozilla.com/D86533
2020-08-12 15:04:00 +00:00
André Bargull 4fe5120171 Bug 1658279 - Part 1: Optimise ArraySlice in CacheIR and Warp. r=jandem
Optimise Array.prototype.slice for packed arrays in CacheIR and Warp. Ion
also optimises `slice()` for non-packed arrays, but unless non-packed arrays
actually appear in user code, only optimising packed arrays should be okay
for now.

The second argument to `slice()` defaults to the array length, which means
we need a non-result version of `LoadInt32ArrayLength`.


Drive-by change:
- Move `IonCacheIRCompiler::emitArrayPush` to the bottom of the file,
  next to the other non-implemented methods. Also change from
  `MOZ_ASSERT_UNREACHABLE` to `MOZ_CRASH` for consistency.

Differential Revision: https://phabricator.services.mozilla.com/D86532
2020-08-12 15:03:37 +00:00
kanishk509 8dbab186a4 Bug 1527839 - Set maximum recursion limit for ExtractLinearSum. r=iain
Differential Revision: https://phabricator.services.mozilla.com/D86873
2020-08-12 23:51:59 +00:00
André Bargull c258dcd9fb Bug 1658268: Optimise Boolean in CacheIR and Warp. r=jandem
The CacheIR implementation uses the new `LoadValueTruthyResult` op instead of
the existing `LoadThingTruthyResult` ops to mirror how Warp implements boolean
coercion: Warp doesn't use ICs but instead uses MNot resp. MTest with Value
typed inputs.
Mirroring this approach avoids to have (from the user POV) strange performance
differences where for example using `if (Boolean(v))` can be faster than just
`if (v)`, when `v` is Value-typed, but monomorphic.

Differential Revision: https://phabricator.services.mozilla.com/D86524
2020-08-12 18:18:54 +00:00
Iain Ireland 96b9ff8d37 Bug 1646378: Make inlining work with arguments analysis r=jandem
We have to loosen this assertion to handle cases where we trial-inline a script because `needsArgsObj` is false, but then we call argumentsOptimizationFailed on that script before we reach the warp oracle.

Depends on D86771

Differential Revision: https://phabricator.services.mozilla.com/D86772
2020-08-12 08:20:19 +00:00
Iain Ireland b843768ae2 Bug 1646378: Factor out maybeInlineCallIC r=jandem
Pulling this out into its own function so that the next patch can add an early return.

Differential Revision: https://phabricator.services.mozilla.com/D86771
2020-08-12 08:11:48 +00:00
Ted Campbell 86210cd0dc Bug 1658742 - Cleanups in js::frontend::ScopeStencil. r=arai
Inline a few helper methods into their only callers when reasonable and
remove dead code.

Differential Revision: https://phabricator.services.mozilla.com/D86824
2020-08-12 14:09:51 +00:00
Bogdan Tara 4b9ed8c48e Backed out changeset 004aa4224a84 (bug 1658268) for test_ext_test.html failures CLOSED TREE 2020-08-12 18:09:34 +03:00
André Bargull 1e14fc9dd5 Bug 1658268: Optimise Boolean in CacheIR and Warp. r=jandem
The CacheIR implementation uses the new `LoadValueTruthyResult` op instead of
the existing `LoadThingTruthyResult` ops to mirror how Warp implements boolean
coercion: Warp doesn't use ICs but instead uses MNot resp. MTest with Value
typed inputs.
Mirroring this approach avoids to have (from the user POV) strange performance
differences where for example using `if (Boolean(v))` can be faster than just
`if (v)`, when `v` is Value-typed, but monomorphic.

Differential Revision: https://phabricator.services.mozilla.com/D86524
2020-08-12 13:41:08 +00:00
Lars T Hansen 08d961db58 Bug 1647288 - Handle NaN in SIMD min, max: Code. r=jseward
This adds correct NaN handling to the SIMD f32x4/f64x2.min/max code.
This is a bit of a horror show actually.  There is a reasonable fast
path if neither operand contains a NaN, but the slow path to handle
NaN is long and there's a lot of code.  (This is an Intel-only
problem, on other architectures there's a direct mapping.)

It is possible the slow-path code could be somewhat improved (both
speed and size) by using at least three BLEND instructions, but I
consider that a possible optimization that needs investigation and
empirical backing.  Meanwhile, we can land this plausible code.

Differential Revision: https://phabricator.services.mozilla.com/D86318
2020-08-12 13:11:03 +00:00
Lars T Hansen 36aba15e18 Bug 1647288 - Handle signalling NaN generally: Test cases. r=jseward
Wasm treats signalling and quiet NaN the same - as quiet NaN.  Where
convenient, test also signalling NaN.  This is complicated by JS not
being able to represent signalling NaN directly.

Differential Revision: https://phabricator.services.mozilla.com/D86317
2020-08-12 13:10:55 +00:00
Lars T Hansen 27e16cf681 Bug 1647288 - Handle NaN in SIMD min, max: Generated test cases. r=jseward
These test cases were generated by a script from some of the
preliminary test cases in the SIMD spec repository, taking into
account the specific NaN types asked for.

These tests are temporary: once we have proper generated test cases
from the spec repository, these will no longer be needed.

Differential Revision: https://phabricator.services.mozilla.com/D86316
2020-08-12 13:10:53 +00:00
Lars T Hansen 619c579af1 Bug 1657628 - Fix bugs in some ad-hack simd tests. r=jseward
Two bugs:

- an accidental redefinition of the 'eq' predicate resulted in the
  'permute' function not working and thus in us not testing floating
  point operations for NaN, Infinity, and some other interesting
  values.

- the previous bug masked the fact that the max and min operations for
  floating point were not implemented properly; they have to handle
  NaN specially.

Differential Revision: https://phabricator.services.mozilla.com/D86315
2020-08-12 13:10:50 +00:00
Lars T Hansen a9729a7f1c Bug 1656226 - Implement the experimental opcodes. r=jseward
Implement some of the experimental SIMD opcodes that are supported by
all of V8, LLVM, and Binaryen, for maximum compatibility with test
content we might be exposed to.  Most/all of these will probably make
it into the spec, as they lead to substantial speedups in some
programs, and they are deterministic.

For spec and cpu mapping details, see:

https://github.com/WebAssembly/simd/pull/122 (pmax/pmin)
https://github.com/WebAssembly/simd/pull/232 (rounding)
https://github.com/WebAssembly/simd/pull/127 (dot product)
https://github.com/WebAssembly/simd/pull/237 (load zero)

The wasm bytecode values used here come from the binaryen changes that
are linked from those tickets, that's the best documentation right
now.  Current binaryen opcode mappings are here:
https://github.com/WebAssembly/binaryen/blob/master/src/wasm-binary.h

Also: Drive-by fix for signatures of vroundss and vroundsd, these are
unary operations and should follow the conventions for these with
src/dest arguments, not src0/src1/dest.

Also: Drive-by fix to add variants of vmovss and vmovsd on x64 that
take Operand source and FloatRegister destination.

Differential Revision: https://phabricator.services.mozilla.com/D85982
2020-08-12 13:10:48 +00:00
Lars T Hansen 231a0a415d Bug 1656216 - Improve SIMD test cases. r=jseward
This fleshes out the test cases to cover some corner cases that were
left uncovered before.  No errors were found.

Differential Revision: https://phabricator.services.mozilla.com/D85981
2020-08-12 13:09:20 +00:00
Kannan Vijayan b430e79e18 Bug 1658593 - Bugfixes in ParserAtoms implementation. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D86734
2020-08-12 03:23:06 +00:00
yulia 7973b79f97 Bug 1657835 - Update Reflect.parse to include Optional Element deletion; r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D86694
2020-08-12 09:22:51 +00:00
Cosmin Sabou 70019255cb Backed out 6 changesets (bug 1657628, bug 1656216, bug 1656226, bug 1647288) for SM bustages. CLOSED TREE
Backed out changeset c19dcb11b940 (bug 1647288)
Backed out changeset bfd5e17cb4d0 (bug 1647288)
Backed out changeset 64e82366834a (bug 1647288)
Backed out changeset a6d240ef908b (bug 1657628)
Backed out changeset 2e7ddb00c8f9 (bug 1656226)
Backed out changeset 656340534354 (bug 1656216)
2020-08-12 12:06:24 +03:00
Jan de Mooij e39063bd4d Bug 1657830 part 6 - Don't use extended jumps for cross-JitCode jumps on x64. r=tcampbell
A lot of entries in the extended jump table were never used because they were for
jumps/calls to other addresses in the executable memory (JitCodes or trampolines).

This patch takes advantage of the contiguous 2 GB executable code buffer: we know
any address in this buffer can always be jumped to without needing an extended jump
table. This also lets us simplify the jump relocation code more.

With Fission coming soon, max 2 GB JIT code per process will hopefully be sufficient.

Depends on D86374

Differential Revision: https://phabricator.services.mozilla.com/D86375
2020-08-10 14:07:33 +00:00
Jan de Mooij aec5eeaac9 Bug 1657830 part 5 - Move jumps_ Vector from Assembler-x86-shared to Assembler-x86 and Assembler-x64. r=tcampbell
This lets us make x64-specific changes in the next patch.

Depends on D86373

Differential Revision: https://phabricator.services.mozilla.com/D86374
2020-08-10 13:36:54 +00:00
Jan de Mooij 6c0247a729 Bug 1657830 part 4 - Fold writeRelocation/addJumpRelocation into sole callers. r=tcampbell
Depends on D86372

Differential Revision: https://phabricator.services.mozilla.com/D86373
2020-08-07 20:14:14 +00:00
Jan de Mooij c99fa56d27 Bug 1657830 part 3 - Remove dead JumpRelocation struct on ARM64. r=tcampbell
Depends on D86370

Differential Revision: https://phabricator.services.mozilla.com/D86372
2020-08-07 19:35:08 +00:00
Jan de Mooij f5c2c88ac2 Bug 1657830 part 2 - Remove dead addPatchableJump on ARM64 and x64. r=tcampbell
All pending jumps then have a known (non-null) target, so replace an if-statement
with an assertion.

Other platforms don't define addPatchableJump.

Depends on D86368

Differential Revision: https://phabricator.services.mozilla.com/D86370
2020-08-07 19:18:19 +00:00
Jan de Mooij 71f38ae1f4 Bug 1657830 part 1 - Remove some never-used data from jump relocation table on ARM64 and x64. r=tcampbell
The jump instruction itself is sufficient to get the address from the extended jump
table. This has been 'dead' code on x64 since the code landed in 2011. ARM64 copied it.

Differential Revision: https://phabricator.services.mozilla.com/D86368
2020-08-07 17:50:24 +00:00
Mike Hommey 916c6b4a09 Bug 1658386 - add support for arm64 macOS WASM signal handling. r=lth
Differential Revision: https://phabricator.services.mozilla.com/D86802
2020-08-12 08:07:10 +00:00
Lars T Hansen 02f75f3779 Bug 1647288 - Handle NaN in SIMD min, max: Code. r=jseward
This adds correct NaN handling to the SIMD f32x4/f64x2.min/max code.
This is a bit of a horror show actually.  There is a reasonable fast
path if neither operand contains a NaN, but the slow path to handle
NaN is long and there's a lot of code.  (This is an Intel-only
problem, on other architectures there's a direct mapping.)

It is possible the slow-path code could be somewhat improved (both
speed and size) by using at least three BLEND instructions, but I
consider that a possible optimization that needs investigation and
empirical backing.  Meanwhile, we can land this plausible code.

Differential Revision: https://phabricator.services.mozilla.com/D86318
2020-08-12 07:50:45 +00:00
Lars T Hansen b8004477bb Bug 1647288 - Handle signalling NaN generally: Test cases. r=jseward
Wasm treats signalling and quiet NaN the same - as quiet NaN.  Where
convenient, test also signalling NaN.  This is complicated by JS not
being able to represent signalling NaN directly.

Differential Revision: https://phabricator.services.mozilla.com/D86317
2020-08-12 07:50:23 +00:00
Lars T Hansen 56a597afc0 Bug 1647288 - Handle NaN in SIMD min, max: Generated test cases. r=jseward
These test cases were generated by a script from some of the
preliminary test cases in the SIMD spec repository, taking into
account the specific NaN types asked for.

These tests are temporary: once we have proper generated test cases
from the spec repository, these will no longer be needed.

Differential Revision: https://phabricator.services.mozilla.com/D86316
2020-08-12 07:50:15 +00:00
Lars T Hansen 3c3df3e220 Bug 1657628 - Fix bugs in some ad-hack simd tests. r=jseward
Two bugs:

- an accidental redefinition of the 'eq' predicate resulted in the
  'permute' function not working and thus in us not testing floating
  point operations for NaN, Infinity, and some other interesting
  values.

- the previous bug masked the fact that the max and min operations for
  floating point were not implemented properly; they have to handle
  NaN specially.

Differential Revision: https://phabricator.services.mozilla.com/D86315
2020-08-12 07:50:07 +00:00
Lars T Hansen 807022887f Bug 1656226 - Implement the experimental opcodes. r=jseward
Implement some of the experimental SIMD opcodes that are supported by
all of V8, LLVM, and Binaryen, for maximum compatibility with test
content we might be exposed to.  Most/all of these will probably make
it into the spec, as they lead to substantial speedups in some
programs, and they are deterministic.

For spec and cpu mapping details, see:

https://github.com/WebAssembly/simd/pull/122 (pmax/pmin)
https://github.com/WebAssembly/simd/pull/232 (rounding)
https://github.com/WebAssembly/simd/pull/127 (dot product)
https://github.com/WebAssembly/simd/pull/237 (load zero)

The wasm bytecode values used here come from the binaryen changes that
are linked from those tickets, that's the best documentation right
now.  Current binaryen opcode mappings are here:
https://github.com/WebAssembly/binaryen/blob/master/src/wasm-binary.h

Also: Drive-by fix for signatures of vroundss and vroundsd, these are
unary operations and should follow the conventions for these with
src/dest arguments, not src0/src1/dest.

Also: Drive-by fix to add variants of vmovss and vmovsd on x64 that
take Operand source and FloatRegister destination.

Differential Revision: https://phabricator.services.mozilla.com/D85982
2020-08-12 07:50:00 +00:00
Lars T Hansen dc4f419488 Bug 1656216 - Improve SIMD test cases. r=jseward
This fleshes out the test cases to cover some corner cases that were
left uncovered before.  No errors were found.

Differential Revision: https://phabricator.services.mozilla.com/D85981
2020-08-12 07:49:12 +00:00
Sylvestre Ledru 5ea6c250c3 Bug 1657926 - firefox doc: fix some warnings r=championshuttler
Differential Revision: https://phabricator.services.mozilla.com/D86732
2020-08-11 23:20:25 +00:00
Tooru Fujisawa 39f40e654c Bug 1658621 - Remove JS_WEB_PARSER_COMPILE_LAZY_AFTER_MS/JS_PRIVILEGED_PARSER_COMPILE_LAZY_AFTER_MS probes. r=Yoric
Differential Revision: https://phabricator.services.mozilla.com/D86751
2020-08-11 20:19:51 +00:00
Matthew Gaudet f1e25e9043 Bug 1654851 - Correctly handle transplanting objects with private fields r=jorendorff,extension-reviewers,zombie
As part of DOM node adoption they are transplanted, and their expando chains are copied over.

This copying uses JS_CopyPropertiesFrom, which until this patch, cannot see
private fields as they are excluded from property iteration. This patch adds
property iteration for private fields, and renames JS_CopyPropertiesFrom to
JS_CopyOwnPropertiesAndPrivateFields which is more accurate.

The users of this method are all doing object manipulation in ways where
preserving the copied private field is the better default.

In addition to testing DOM nodes explicitly, this patch also adds a jit-test
which uses transplantableObject to test similar things with FakeDOMObjects.

Differential Revision: https://phabricator.services.mozilla.com/D84737
2020-08-11 21:35:40 +00:00
Matthew Gaudet d17334a69d Bug 1655563 - Ensure Private Fields are enabled in workers, following the preference setting r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D85866
2020-08-11 19:12:49 +00:00
Matthew Gaudet 365a6221f5 Bug 1655729 - Correct merge to beta error for private fields r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D85164
2020-08-11 19:13:26 +00:00
Steve Fink 282eb17b37 Bug 1658160 - Give shell workers a module loader r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D86568
2020-08-11 15:11:05 +00:00
Ricky Stewart cd9a620ede Bug 1657954 - Move various branding options from `old-configure` r=geckoview-reviewers,mhentges,nalexander,snorp
Differential Revision: https://phabricator.services.mozilla.com/D86391
2020-08-11 15:58:52 +00:00
André Bargull a45fe8b3b9 Bug 1657820 - Part 12: Optimise Atomics.isLockFree in CacheIR and Warp. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D86310
2020-08-11 11:22:06 +00:00
André Bargull 16d6b2abe2 Bug 1657820 - Part 11: Move isLockFree into the MacroAssembler. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D86309
2020-08-11 06:55:15 +00:00
André Bargull e71bccf63f Bug 1657820 - Part 10: Optimise Atomics.store in CacheIR and Warp. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D86308
2020-08-11 07:01:02 +00:00
André Bargull c9e2a15588 Bug 1657820 - Part 9: Optimise Atomics.load in CacheIR and Warp. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D86307
2020-08-11 06:53:48 +00:00
André Bargull 679be27288 Bug 1657820 - Part 8: Optimise Atomics.xor in CacheIR and Warp. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D86306
2020-08-11 06:51:53 +00:00
André Bargull f305eca878 Bug 1657820 - Part 7: Optimise Atomics.or in CacheIR and Warp. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D86304
2020-08-11 06:50:14 +00:00
André Bargull 42caef15cf Bug 1657820 - Part 6: Optimise Atomics.and in CacheIR and Warp. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D86303
2020-08-11 06:48:35 +00:00
André Bargull 36d1746553 Bug 1657820 - Part 5: Optimise Atomics.sub in CacheIR and Warp. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D86302
2020-08-11 06:47:42 +00:00
André Bargull 2e53b617c0 Bug 1657820 - Part 4: Optimise Atomics.add in CacheIR and Warp. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D86301
2020-08-11 06:45:17 +00:00
André Bargull 7dbb7c6eae Bug 1657820 - Part 3: Optimise Atomics.exchange in CacheIR and Warp. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D86300
2020-08-11 06:43:40 +00:00
André Bargull f47ccee416 Bug 1657820 - Part 2: Optimise Atomics.compareExchange in CacheIR and Warp. r=jandem
Uint32 isn't yet supported, because it may return a Double, which is difficult
to represent in CacheIR. Bug 1077305 proposes to unconditionally use Double
for Uint32 Atomics, which will make this easier to implement in CacheIR.

Differential Revision: https://phabricator.services.mozilla.com/D86299
2020-08-11 06:41:46 +00:00
André Bargull e8c9163853 Bug 1657820 - Part 1: Add support for ArgumentKind::Arg3. r=jandem
The next patch requires to have support for four arguments.

Differential Revision: https://phabricator.services.mozilla.com/D86298
2020-08-11 06:40:06 +00:00
Jan de Mooij be3490d556 Bug 1657399 - Don't use MNewTypedArray if the length is zero. r=anba
Also add an assertion for this to MacroAssembler::initTypedArraySlots. This replaces
some invalid code that used dataSlotOffset instead of dataOffset.

Not adding the test because with the new assertion this failed jit-tests.

Differential Revision: https://phabricator.services.mozilla.com/D86551
2020-08-11 08:33:11 +00:00
Jan de Mooij 93e7d4f25c Bug 1657303 - Support using the arguments analysis with WarpBuilder. r=iain
* If WarpBuilder is enabled, use WarpBuilder instead of IonBuilder for the analysis itself.
* Support optimized-arguments accesses in the transpiler (FunApplyArgs is still missing).
* Slow paths insert MGuardNotOptimizedArguments to deoptimize optimized-arguments.

Differential Revision: https://phabricator.services.mozilla.com/D86003
2020-08-11 08:33:11 +00:00
Iain Ireland ac02da064e Bug 1646378: Improve inlining heuristics r=jandem
Limit the maximum depth of the inlining tree and don't inline scripts with too many arguments.

Differential Revision: https://phabricator.services.mozilla.com/D86283
2020-08-07 11:52:19 +00:00
Chris Fallin 51fc6aaf4a Bug 1657895: update Baldrdash (Cranelift bindings) for minor API changes. r=jseward
Recently Cranelift modified the spelling of `Stackmap` and `stackmap` to
two-word forms; this adapts our embedding of Cranelift accordingly.

Differential Revision: https://phabricator.services.mozilla.com/D86460
2020-08-10 20:19:48 +00:00
Chris Fallin 5ed39fc5f3 Bug 1657888: Cranelift Wasm backend: zero-extend i32 args as well as returns. r=jseward
The Baldrdash (SpiderMonkey-to-Cranelift) glue layer was properly
setting the argument extension mode for 32-bit return values, so that
the high bits were zeroed, but it was not correctly setting this for
32-bit arguments. This matters when generated Wasm code calls back into
JS or native code; it must zero-extend the value before passing it to
the callee.

Differential Revision: https://phabricator.services.mozilla.com/D86446
2020-08-10 20:31:36 +00:00
Adam Vandolder 3027481103 Bug 1647789 - Add CheckPrivateField support to expression decompiler. r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D86579
2020-08-10 19:15:42 +00:00
yulia fc1fc91a81 Bug 1644839 - add oomTest for optionalChain bug; r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D79797
2020-07-28 20:08:44 +00:00
Ted Campbell ffa84134ce Bug 1608195 - Rename {RegExp,BigInt,ObjLiteral}CreationData to *Stencil. r=djvj
Differential Revision: https://phabricator.services.mozilla.com/D86007
2020-08-10 15:15:10 +00:00
Ted Campbell e43558859c Bug 1608195 - Cleanup some includes and forward decls in SpiderMonkey frontend. r=djvj
Differential Revision: https://phabricator.services.mozilla.com/D86006
2020-08-10 15:16:04 +00:00
Tooru Fujisawa ba5257fbf6 Bug 1656749 - Update opcode for bug 1655465. r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D86455
2020-08-10 15:16:27 +00:00
André Bargull 6f7ec0660f Bug 1657552 - Part 2: Use fallibleUnbox(Boolean|Int32) to unbox boolean/int32. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D86159
2020-08-10 09:50:56 +00:00
André Bargull 14096074b7 Bug 1657552 - Part 1: Use fallibleUnboxObject to test + unbox objects. r=jandem
Replace sequences of `branchTestObject` followed by `unboxObject` with a
single call to `fallibleUnboxObject`.

`fallibleUnboxObject(src, dst, fail)` clobbers `dst` on failure, so for each
updated call site we need to make sure `dst` isn't used when we jump to `fail`.

Differential Revision: https://phabricator.services.mozilla.com/D86158
2020-08-10 06:01:20 +00:00
Jan de Mooij cdfd50ad61 Bug 1657372 - Don't create/increment ScriptCounts in Baseline when Warp is enabled. r=iain
Differential Revision: https://phabricator.services.mozilla.com/D86194
2020-08-06 16:40:16 +00:00
Mike Hommey 527e667296 Bug 1537703 - Use llvm-rc instead of rc.exe. r=mhentges,froydnj
This makes us use one less tool from MSVC, and removes one more use of wine
in cross builds.

We replace the call to either rc/llvm-rc or windres with a wrapper script.
While the script is not strictly needed for the latter, we use a wrapper
in that case anyway because it's one step towards fixing bug 1498414.
For llvm-rc, however, we need a wrapper because llvm-rc doesn't preprocess
on its own, so the wrapper does that too.

The wrapper script also allows to deal with the default flags passed to
llvm-rc or windres, rather than inherit them from old-configure.

We also need to explicitly pass the codepage to llvm-rc, which was not
necessary with rc (presumably, llvm-rc has a different default).

While here, remove the unused WINDRES subst from js/src/old-configure.in.
Also, while here, we remove --use-temp-file, because as described in the
linked bug and in the windres manual page, it was used to work around bugs
on Windows 98 and earlier.

Differential Revision: https://phabricator.services.mozilla.com/D86312
2020-08-08 21:02:04 +00:00
daemon1024 44d7729376 Bug 1483269 - Rename gc::AbortReason to GCAbortReason; r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D86431
2020-08-08 13:54:52 +00:00
Evan Welsh 2e8ba0e06f Bug 1654696 - Implement code coverage JSAPI. r=nbp,jwalden
Differential Revision: https://phabricator.services.mozilla.com/D85808
2020-08-08 03:23:31 +00:00
Andrew McCreight 2215280cca Bug 1657231, part 4 - Don't allow using the URL preloader in the child. r=kmag
It never gets initialized there anyways, so assert and clean up
a bit of dead code.

Differential Revision: https://phabricator.services.mozilla.com/D86032
2020-08-07 22:58:58 +00:00
Andrew McCreight 5a8ee67dd8 Bug 1657231, part 3 - Fail if add observer fails. r=kmag
This can cause the URL preloader to think that initialization has succeeded
when it hasn't. This add observer call can fail if we're late in shutdown,
because the observer service still exists, but it isn't taking new
observers. I'm not sure how much it matters that we're failing to listen for
an observer that can't possibly fire at this stage, but a failure to check
for this seems to have contributed to the crash in bug 1656973, so we
might as well just fail.

Differential Revision: https://phabricator.services.mozilla.com/D86031
2020-08-07 22:58:55 +00:00
Andrew McCreight eccbaefffc Bug 1657231, part 2 - Clear sInitialized when we destroy the singleton url preloader. r=kmag
Some of the entry points into the URL preloader check sInitialized, and only
use it if it is true. However, if we're late in shutdown and we've already
cleared the singleton for the preloader then our failure to clear the
sInitialized flag means we'll recreate the preloader, which is going
to fail in various ways.

I think this won't help in the case of bug 1656973, because that seems
to go through AutoBeginReading, which unconditionally creates a new
singleton if one does not exist.

Differential Revision: https://phabricator.services.mozilla.com/D86030
2020-08-07 22:58:53 +00:00
Andrew McCreight 1f620cc4a1 Bug 1657231, part 1 - Only register the URL preloader as a reporter after it has been addrefed. r=kmag
Normally this happens during initialization because we add the preloader
as an observer, but that seems fragile.

Differential Revision: https://phabricator.services.mozilla.com/D86029
2020-08-07 22:58:51 +00:00
Ricky Stewart 31755b431d Bug 1657650 - Require that Mach command providers subclass MachCommandBase. r=remote-protocol-reviewers,marionette-reviewers,maja_zf,mhentges,froydnj
Today we don't require that `mach` `CommandProvider`s subclass from any particular parent class and we're very lax about the requirements they must meet. While that's convenient in certain circumstances, it has some unfortunate implications for feature development.

Today the only requirements that we have for `CommandProvider`s are that they have an `__init__()` method that takes either 1 or 2 arguments, the second of which must be called `context` and is populated with the `mach` `CommandContext`. Again, while this flexibility is occasionally convenient, it is limiting. As we add features to `mach`, having a better idea what the shape of our `CommandProvider`s are and how we can instantiate them and use them is increasingly important, and this gives us additional control when having `mach` configure `CommandProvider`s based on data that is only available at the `mach` level. In particular, we plan to leverage this in bugs 985141 and 1654074.

Here we add validation to the `CommandProvider` decorator to ensure all classes inherit from `MachCommandBase`, update all `CommandProvider`s in-tree to inherit from `MachCommandBase`, and update source and test code accordingly.

Follow-up work: we now require (de facto) that the `context` be populated with a `topdir` attribute by the `populate_context_handler` function, since instantiating the `MachCommandBase` requires a `topdir` be provided. This is fine for now in the interest of keeping this patch reasonably sized, but some additional refactoring could make this cleaner.

Differential Revision: https://phabricator.services.mozilla.com/D86255
2020-08-07 18:24:59 +00:00
Chris Fallin 227741192b Bug 1649928: add CI jobs for Cranelift/aarch64 Wasm backend using simulator. r=sfink
This adds a new job variant `arm64-cranelift-sim` to the SpiderMonkey
build configurations, and adds a Taskherder CI configuration to run it.
The job uses the aarch64 simulator support built-in to SpiderMonkey, so
it does not need to run on native aarch64 hardware.

A few tests needed to be added to the "slow tests" list as they time out
under the simulator otherwise.

This also fixes an issue with an error message in `build-sm.sh` in which
the overloading of the backtick's meaning (code-quotes in
Markdown-world, and command interpolation in shell scripts) led to an
amusing attempt to execute parts of the error message.

Finally, this fixes an error that seems unrelated to Cranelift or
WebAssembly in a GC jit-test, wherein its way of measuring maximum stack
recursion depth was failing.

Differential Revision: https://phabricator.services.mozilla.com/D86131
2020-08-07 18:17:37 +00:00
Ted Campbell 23cde3ec79 Bug 1657817 - Fix initGCThing for functions with many TDZ arguments. r=jandem
Check that we will actually need to fill slots before calling
getFixedSlotOffset. This fixes some sanity check asserts, but the issue is
benign in optimized builds because the invalid `offset` is not used if there
are not slots to fill.

Differential Revision: https://phabricator.services.mozilla.com/D86383
2020-08-07 16:21:22 +00:00
Kannan Vijayan 113e936fa1 Bug 1654037 - Add immediate representation for ParserAtoms. r=tcampbell,mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D84224
2020-08-07 13:53:51 +00:00
Jon Coppeard 881deac17d Bug 1655455 - Replace setModuleResolveHook() with registerModule() test function r=jandem
Rather than allowing test code to replace HostResolveImportedModule directly, this adds a test function to register a module and specifier such that attempting to import that specifier later finds the given module (which was what the hook was mostly used to acheive).

Mostly this is test code updates.  I deleted test code for bugs which were only caused by the existence of this API in the first place.

Differential Revision: https://phabricator.services.mozilla.com/D85560
2020-08-06 14:21:34 +00:00
André Bargull 8aa2e27c24 Bug 1655465 - Part 9: Change JSOp::FunctionProto to JSOp::BuiltinObject. r=jandem
Callers to `GetBuiltinPrototype()` rely on inlining the function itself plus
optimising the object access, so that the property value is directly seen as a
constant in the compiler. By changing `GetBuiltinPrototype()` and
`GetBuiltinConstructor()` to be directly translated into a JSOp, we can avoid
heavily relying on the compiler to optimise these two functions.

The new opcode replaces the existing JSOp::FunctionProto opcode. It doesn't
use JSProtoKey directly in order to help jsparagus (bug 1622530), but instead
uses its own set of mapping from enum values to built-in prototypes and
constructors.

This change also resolves bug 1377264.

Differential Revision: https://phabricator.services.mozilla.com/D84991
2020-08-07 13:03:19 +00:00
André Bargull 17346573ef Bug 1655465 - Part 8: Support StringSplitString in CacheIR and Warp. r=jandem
Drive-by change:
- Make `intrinsic_StringSplitString` a static function.

Differential Revision: https://phabricator.services.mozilla.com/D84989
2020-08-07 12:22:48 +00:00
André Bargull 0e9cdf76b5 Bug 1655465 - Part 7: Avoid MToString on string-typed inputs in Warp. r=jandem
Warp can't currently fold away `MToString`, as a workaround handle the already
string case in WarpBuilder.

Differential Revision: https://phabricator.services.mozilla.com/D84988
2020-08-07 12:21:15 +00:00
André Bargull 226d33b1e3 Bug 1655465 - Part 6: Support StringReplaceString in CacheIR and Warp. r=jandem
Drive-by change:
- Remove a bogus `resumeAfter()`, `MStringReplace` is never effectful.

Differential Revision: https://phabricator.services.mozilla.com/D84987
2020-08-07 12:20:46 +00:00
André Bargull ee9dcbcd12 Bug 1655465 - Part 5: Support ObjectHasPrototype in CacheIR. r=jandem
Inling `ObjectHasPrototype()` using the `GuardProto` CacheIR op for the normal
case when the prototype chain wasn't modified.

Also change `intrinsic_ObjectHasPrototype()` to expect that both objects are
`NativeObject`, because then we don't need to handle proxies in CacheIR.

Drive-by change:
- Use `staticPrototype()` in ObjectOperations-inl.h instead of effectively inlining it.

Differential Revision: https://phabricator.services.mozilla.com/D84984
2020-08-07 12:32:37 +00:00
André Bargull 6a4b86eac3 Bug 1655465 - Part 4: Transpile GuardTagNotEqual in Warp. r=jandem
This is part two to support comparing strictly different types in Warp.

The operation doesn't have any result, so when folding it, `MNop` is used to
optimise it away when the value tags are already different at compile time.

Differential Revision: https://phabricator.services.mozilla.com/D84980
2020-08-07 12:32:37 +00:00
André Bargull a63ab675ab Bug 1655465 - Part 3: Use BytecodeUtil.h helpers to test for equality operations. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D84978
2020-08-07 12:16:49 +00:00
André Bargull 94c50eef30 Bug 1655465 - Part 2: Test node is commutative before swapping the operands. r=jandem
Swapping `bi`'s operands should depend on `bi` itself being commutative.

Drive-by change: Use `std::swap` to swap the operands.

Differential Revision: https://phabricator.services.mozilla.com/D84977
2020-08-07 12:16:39 +00:00
André Bargull 8ae6b9fd09 Bug 1655465 - Part 1: Transpile LoadValueTag in Warp. r=jandem
LoadValueTag is used when comparing strictly different types. This happens in
the string built-ins when the this-value is a primitive string and it is
compared against null or undefined.

Value tags are represented as MIRType::Int32 and folding is supported to be
able to optimise away the checks after inlining.

Differential Revision: https://phabricator.services.mozilla.com/D84976
2020-08-07 12:15:05 +00:00
Ted Campbell f9256a0d84 Bug 1657557 - Remove erroneous assert in GCRuntime::mergeRealms r=jonco
This assert was intended to assure that off-thread parse realm sets the same
special prototype flags off-thread as on-thread. In practice though, the
`setImmutablePrototype` testing function allows us to set the flag on a
common prototype which confuses the assert.

Differential Revision: https://phabricator.services.mozilla.com/D86243
2020-08-07 08:15:27 +00:00
Jan de Mooij 5d206d9c31 Bug 1657559 - Add StringToAtomCache to fix perf cliffs when atomizing strings repeatedly. r=sfink,jonco
This improves performance a lot when a long string is atomized more than once. This
is happening on Reddit (strings with length 1897).

The cache is also used to de-duplicate strings during nursery GC before it's purged.
This handles some cases the existing string deduplication doesn't handle and if a
string is in the StringToAtomCache it should be faster.

Differential Revision: https://phabricator.services.mozilla.com/D86171
2020-08-07 12:19:13 +00:00
Bogdan Tara b043933d2f Merge mozilla-central to autoland a=merge on a CLOSED TREE 2020-08-07 12:35:00 +03:00
Bogdan Tara a3b25e347e Merge autoland to mozilla-central. a=merge 2020-08-07 12:31:21 +03:00
Bogdan Tara 1d2deae76a Backed out 3 changesets (bug 1639153) on lth's request a=backout DONTBUILD
Backed out changeset 30af0e8c7956 (bug 1639153)
Backed out changeset 25931ec43a32 (bug 1639153)
Backed out changeset 95d6c42f07fd (bug 1639153)
2020-08-07 12:29:21 +03:00
Mihai Alexandru Michis b88c487681 Backed out 4 changesets (bug 1657231) for causing multiple xpcshell failures.
CLOSED TREE

Backed out changeset caa4f187b037 (bug 1657231)
Backed out changeset 73418f013a61 (bug 1657231)
Backed out changeset e196f9cc2bb2 (bug 1657231)
Backed out changeset 5f4aab0ad04a (bug 1657231)
2020-08-07 02:49:49 +03:00