Commit Graph

73520 Commits

Author SHA1 Message Date
Andy Wingo
b1b874a300 Bug 1593618 - Fix WebAssembly Ion codegen for a loop with parameter r=luke
Differential Revision: https://phabricator.services.mozilla.com/D51598

--HG--
extra : moz-landing-system : lando
2019-11-04 16:34:37 +00:00
Iain Ireland
68ef00581e Bug 1587638: Deduplicate atoms in XDR r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D48785

--HG--
extra : moz-landing-system : lando
2019-11-04 15:29:45 +00:00
Iain Ireland
d5503b5dd4 Bug 1587638: Add support for buffer switching to incremental encoder r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D48784

--HG--
extra : moz-landing-system : lando
2019-11-01 20:28:23 +00:00
Iain Ireland
e084acf2f4 Bug 1587638: Add testcase to check GC barriers during XDR encoding/decoding r=tcampbell
Depends on D48782

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

--HG--
extra : moz-landing-system : lando
2019-10-31 21:12:51 +00:00
Iain Ireland
65c313ae8e Bug 1587638: Add atom map to XDRIncrementalEncoder and atom table to XDRDecoder r=jonco,tcampbell
The code that uses these fields is part of a subsequent patch. This patch is just getting the tracing right.

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

--HG--
extra : moz-landing-system : lando
2019-10-31 21:57:56 +00:00
Iain Ireland
4e557e0f11 Bug 1587638: Clear GC pointers in ScriptSource when canonical ScriptSourceObject is finalized r=tcampbell
Right now there BinAST is the only case, but subsequent patches will add GC pointers to XDR encoders and decoders.

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

--HG--
extra : moz-landing-system : lando
2019-10-31 21:10:41 +00:00
Nathan Froyd
77d5c7817f Bug 1593673 - add a VIXL_UNREACHABLE in SubstituteImmediateField; r=sstangl
Otherwise we get warnings about possible (unintended) fallthrough here.

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

--HG--
extra : moz-landing-system : lando
2019-11-04 15:20:27 +00:00
André Bargull
11c3c57ab3 Bug 1531716 - Part 4: Replace jstypes macros with constexpr functions. r=jonco
JS_BIT and JS_BITMASK are only used in contexts where uint32_t is used, so these
two functions are now typed to accept and return uint32_t.

JS_HOWMANY and the three JS_ROUND functions are only used with size_t inputs,
so these four functions are now typed to accept and return size_t.

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

--HG--
extra : moz-landing-system : lando
2019-11-04 14:04:35 +00:00
André Bargull
5efd76b5a4 Bug 1531716 - Part 3: Replace ROUNDUP with JS_ROUNDUP. r=jonco
Both macros compute the same result, so we can replace ROUNDUP with JS_ROUNDUP.

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

--HG--
extra : moz-landing-system : lando
2019-11-04 14:02:57 +00:00
André Bargull
73bbabcee5 Bug 1531716 - Part 2: Remove unused macro in vm/Probes.cpp. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D51140

--HG--
extra : moz-landing-system : lando
2019-11-04 14:02:37 +00:00
André Bargull
93b477dc4a Bug 1531716 - Part 1: Remove macros for generating the SmallChars array. r=jonco
And the two macros to convert to and from SmallChars.

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

--HG--
extra : moz-landing-system : lando
2019-11-04 14:02:14 +00:00
Kurt Miller
01378151ec Bug 1586912: Don't ComputeRandomAllocationAddress on OpenBSD r=nbp
OpenBSD already has a random mmap()

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

--HG--
extra : moz-landing-system : lando
2019-11-04 14:04:53 +00:00
Jan de Mooij
2e26c4e5a1 Bug 1593175 - Check mightHaveSideEffects in CodeGenerator::visitValueToString too. r=anba
Differential Revision: https://phabricator.services.mozilla.com/D51379

--HG--
extra : moz-landing-system : lando
2019-11-01 08:37:02 +00:00
Andy Wingo
8ea1934f15 Bug 1593247 - Fix WebAssembly Ion codegen for if/then without else r=luke
Differential Revision: https://phabricator.services.mozilla.com/D51404

--HG--
extra : moz-landing-system : lando
2019-11-04 12:17:40 +00:00
Jeff Walden
409b142d79 Bug 1591386 - Mark one other test262 test of DateTimeFormat functionality as nightly-only, til we enable the relatedYear field in beta/release. r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D51493

--HG--
extra : source : ceeb77f79442a9710da29162281e3403955a9a22
2019-11-02 22:50:51 +00:00
Coroiu Cristina
948cc9d861 Backed out changeset ceeb77f79442 (bug 1591386) for jsreftests at jsreftest.html?test=non262/Date/15.9.5.7.js 2019-11-03 03:46:10 +02:00
Jeff Walden
5f889a91f3 Bug 1591386 - Mark one other test262 test of DateTimeFormat functionality as nightly-only, til we enable the relatedYear field in beta/release. r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D51493

--HG--
extra : moz-landing-system : lando
2019-11-02 22:50:51 +00:00
Jim Blandy
4635915c52 Bug 1591342: When setting breakpoints, require usable cross-compartment wrappers. r=jonco
When the `Debugger` API sets a breakpoint in a JSScript or wasm::Instance, the
BreakpointSite and Breakpoint objects belong to the code's compartment
(logically, at least - they're C++ objects and don't actually have any
compartment). Since a `Debugger` and its debuggees must be in separate
compartments, the Breakpoint's references to its owning `Debugger` and its
handler object must go through cross-compartment wrappers.

If we have nuked the `Debugger`'s compartment, it's not clear how we're still
trying to set breakpoints in its debuggees, but we should at least throw an
error, to capture a JavaScript stack when it occurs.

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

--HG--
extra : moz-landing-system : lando
2019-11-02 02:05:01 +00:00
Jeff Walden
de66507e5e Bug 1591386 - Mark the one test262 test of DateTimeFormat relatedYear functionality as nightly-only, til we enable the field in beta/release. r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D50696

--HG--
extra : moz-landing-system : lando
2019-10-31 21:50:05 +00:00
Jeff Walden
17e7f697d4 Bug 1589545 - Add a test. r=arai,jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D49693

--HG--
extra : moz-landing-system : lando
2019-11-02 00:28:49 +00:00
Jeff Walden
de45fc895e Bug 1589545 - Don't pass a CCW to AutoRealm in streams code, when processing pull/cancel functionality. r=arai,jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D49694

--HG--
extra : moz-landing-system : lando
2019-11-02 00:28:49 +00:00
Jeff Walden
0994b1fc51 Bug 1582348 - Enable writable streams in the browser when the javascript.options.{,writable_}streams prefs are set. (Writable streams are only half-implemented; DO NOT start reporting bugs yet, it *will* crash in all sorts of trivial ways.) r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D51049

--HG--
extra : moz-landing-system : lando
2019-11-01 22:55:05 +00:00
Rohit Awate
2c355244bf Bug 1589072 - Improve numeric separators error messages r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D51134

--HG--
extra : moz-landing-system : lando
2019-11-01 22:43:52 +00:00
André Bargull
6ffc0356ab Bug 1526870 - Part 16: Change Proxy CacheIR VM functions to use unboxed returned types when possible. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D51072

--HG--
extra : moz-landing-system : lando
2019-11-01 16:06:12 +00:00
André Bargull
18c6d4b6e2 Bug 1526870 - Part 15: Use AutoCallVM for additional CacheIR emitters. r=jandem
Use a single implementation in CacheIRCompiler.cpp for CacheIR emitters which
can be updated to the changed AutoCallVM class.

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

--HG--
extra : moz-landing-system : lando
2019-10-31 13:23:43 +00:00
André Bargull
9e6e95098a Bug 1526870 - Part 14: Deduce return types in AutoCallVM. r=jandem
The previous parts had separate Baseline and Ion implementations for some
CacheIR ops, because AutoCallVM only supports Values as the return type. With
this patch AutoCallVM can deduce the return types from VM calls, so more return
types than just Values can be supported.

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

--HG--
extra : moz-landing-system : lando
2019-10-31 13:22:23 +00:00
André Bargull
da572d6878 Bug 1526870 - Part 13: Support BigInt x String comparisons. r=jandem
Comparisons between BigInts and Strings is the only remaining unsupported
sloppy equality operation. Add support for these operand types, so there's
no unexpected performance cliff for non-Object operands in equality
comparisons.

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

--HG--
extra : moz-landing-system : lando
2019-10-31 13:22:00 +00:00
André Bargull
f5b9ffcb35 Bug 1526870 - Part 12: Specialise BigInt x Int32 comparisons. r=jandem
When comparing a BigInt against an Int32, it's not actually necessary to call
into the VM, because we only need to perform some range checks and unsigned
comparisons, which can all be performed directly in inline assembly. This
gives another easy >2x performance improvement compared to the previous part.

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

--HG--
extra : moz-landing-system : lando
2019-10-31 13:21:37 +00:00
André Bargull
b5546e6d92 Bug 1526870 - Part 11: Support BigInt x Number comparisons. r=jandem
Adds support to compare BigInt and Number values against each other. In contrast
to binary operations, comparison operations allow mixing BigInts and Numbers.
For example when testing if a BigInt value is negative, `bigInt < 0` can be used
in addition to `bigInt < 0n`.

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

--HG--
extra : moz-landing-system : lando
2019-10-31 13:32:34 +00:00
André Bargull
b542b58454 Bug 1526870 - Part 11.a: Add support for (double, int) -> int ABI calls to the ARM simulators. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D51263

--HG--
extra : moz-landing-system : lando
2019-11-01 09:14:30 +00:00
André Bargull
3ff7407a75 Bug 1526870 - Part 10: Support the missing equality ops cases for Boolean values. r=jandem
Comparing Booleans with either Doubles or Strings always performs ToNumber on
the Boolean operand. So when we add a Boolean to (boxed) Number operation to
CacheIR, we can reuse the existing support for comparing Numbers resp. comparing
Numbers and Strings and further trim down the list of unsupported sloppy equality
operations.

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

--HG--
extra : moz-landing-system : lando
2019-10-31 13:32:34 +00:00
André Bargull
7ead5a91c9 Bug 1526870 - Part 9: Support the missing equality ops cases for Symbol values. r=jandem
Comparing a Symbol with one of {String,Boolean,Number,BigInt} is always false (resp.
true for NE/STRICTNE), so it's easy to support this case, too.

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

--HG--
extra : moz-landing-system : lando
2019-10-30 09:49:21 +00:00
André Bargull
c3d1db5fb6 Bug 1526870 - Part 8: Update list of unsupported sloppy equality ops. r=jandem
The list of unsupported operations with missing some entries and wasn't
consistent when to omit equivalent cases.

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

--HG--
extra : moz-landing-system : lando
2019-10-30 09:48:59 +00:00
André Bargull
e5ad6381a6 Bug 1526870 - Part 7: Replace LBitOpV with LBinaryV. r=jandem
The separate `LBitOpV` class is no longer needed, because `LBitOpV` and
`LBinaryV` now both use `Value` for their input and output parameters.

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

--HG--
extra : moz-landing-system : lando
2019-10-30 09:48:36 +00:00
André Bargull
43709322cc Bug 1526870 - Part 6: Support bitwise- and shift-operations in Ion CacheIR. r=jandem
Ion never emitted MBinaryCache for bitwise- and shift-operations, so we never
used Ion CacheIR for these operations on BigInt values and instead always emitted
a LBitOpV, i.e. a VM call. With this patch, the changes in part 4 now also lead
to a performance improvement in Ion code.

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

--HG--
extra : moz-landing-system : lando
2019-10-30 10:18:45 +00:00
André Bargull
f7ff17af2b Bug 1526870 - Part 5: Handle BigInts via abi-call in CompareIRGenerator. r=jandem
Adds new CacheIR ops to support comparison operations with BigInt operands. All
methods simply call into the VM to perform the actual operation. Comparisons
between two BigInt values can't GC or perform any side-effects, so we can use
an ABI call, which saves us an extra indirection through a VM function wrapper
and makes it possible to use a shared implementation in CacheIRCompiler.cpp.

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

--HG--
extra : moz-landing-system : lando
2019-10-30 09:48:09 +00:00
André Bargull
e6679af1a8 Bug 1526870 - Part 4: Handle BigInts via vm-call in BinaryArithIRGenerator. r=jandem
Adds new CacheIR ops to support binary operations with BigInt operands. All
methods simply call into the VM to perform the actual operation.

JSOP_URSH isn't supported because it always throws when used with BigInts.

Parts 14/15 move the separate Baseline and Ion implementations into a single
implementation in CacheIRCompiler.

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

--HG--
extra : moz-landing-system : lando
2019-10-30 09:48:07 +00:00
André Bargull
601582d615 Bug 1526870 - Part 3: Handle BigInts via vm-call in UnaryArithIRGenerator. r=jandem
Adds new CacheIR ops to support unary operations with BigInt operands. All
methods simply call into the VM to perform the actual operation.

Parts 14/15 move the separate Baseline and Ion implementations into a single
implementation in CacheIRCompiler.

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

--HG--
extra : moz-landing-system : lando
2019-10-30 09:46:54 +00:00
André Bargull
63d1e16612 Bug 1526870 - Part 2: Support BigInts in ToBoolIRGenerator. r=jandem
Adds the 'LoadBigIntTruthyResult' CacheIR op to handle BigInts in boolean contexts.

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

--HG--
extra : moz-landing-system : lando
2019-10-30 09:46:31 +00:00
André Bargull
3ec7c7d5ca Bug 1526870 - Part 1: Support BigInts in VMFunctions. r=jandem
Adds support for BigInt argument and return types to VM functions.

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

--HG--
extra : moz-landing-system : lando
2019-10-30 09:46:08 +00:00
Ryan Hunt
a09e970f02 Bug 1591047 part 6 - Add ABIArgType::Pointer and use it for builtin functions. r=lth
When adding a pointer to WasmInstance::memCopy, it appears that we ran out of
GPRs for calling and the pointer needed to be passed via stack.

GenerateBuiltinThunk uses ABIFunctionType/ABIArgType, and converts it to
MIRType for calling StackCopy [1]. ArgType_General is treated as being equal to
MIRType::Int32, leading to only half of the pointer being passed correctly on
64bit window systems.

This means that all instance functions currently have an incorrect
ABIFunctionType but avoid this issue because they don't have enough parameters
or don't have a 64bit value that is passed by the stack.

We have to use ABIFunctionType here for compatibility with the ARM/ARM64
simulators, otherwise it would be convenient to use a different representation.

This commit:
  1. Adds an ArgType_Pointer which is equivalent to MIRType::Pointer
  2. Adds a helper constexpr for defining ABIFunctionType
  3. Fixes the ABIFunctionType used for instance calls
  4. Fixes the simulators to recognize the new ABIFunctionType's
  5. Adds an assertion that the SymbolicAddressSignature and ABIFunctionType
     are compatible.

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

--HG--
extra : moz-landing-system : lando
2019-11-01 14:48:16 +00:00
Ryan Hunt
e64ce978df Bug 1591047 part 5 - Pass heapBase to memCopy/memFill and use that to acquire length. r=lth
This commit uses the previous commits to actually optimize the OOL
implementations.

This is done by:
  * Passing the heap base pointer to each builtin
  * Acquiring the WasmArrayRawBuffer/SharedArrayRawBuffer from this pointer
    - This is trivial as they are embedded a fixed offset before the Wasm heap
  * Acquiring the heap length from the raw buffer

By doing this, we avoid cache misses from accessing:
TLSData -> Instance -> WasmMemoryObject -> ArrayBufferObject -> WasmArrayRawBuffer

This is enough to get close enough to parity with V8 for small sizes. Further
improvements should be done with an inline generated code path.

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

--HG--
extra : moz-landing-system : lando
2019-11-01 13:45:09 +00:00
Ryan Hunt
6a392ca282 Bug 1591047 part 4 - Track Wasm memory length in WasmArrayRawBuffer. r=lth
Currently the Wasm memory length for non-shared memory is stored in a slot of
the ArrayBuffer. This commit tracks it in the WasmArrayRawBuffer as well, for
use in a future commit.

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

--HG--
extra : moz-landing-system : lando
2019-11-01 13:44:14 +00:00
Ryan Hunt
06ed76a362 Bug 1591047 part 3 - Expose WasmArrayRawBuffer from 'ArrayBufferObject.h'. r=lth
This commit declares WasmArrayRawBuffer in the ArrayBufferObject header. This
will allow WasmInstance to access the buffer in a future commit.

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

--HG--
extra : moz-landing-system : lando
2019-11-01 13:44:00 +00:00
Ryan Hunt
5eb3ba3b97 Bug 1591047 part 2 - Split memCopy/memFill implementations for shared/non-shared modules. r=lth
Whether a module uses shared memory or not is fixed throughout its lifetime. We
can use this to specialize the implementation of memCopy/memFill and remove a
branch on the memory type. This will also be useful when acquiring the memory
length in a future commit, which will require different code per shared-ness.

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

--HG--
extra : moz-landing-system : lando
2019-11-01 13:43:45 +00:00
Ryan Hunt
ba528581e8 Bug 1591047 part 1 - Don't lock when acquiring length of shared Wasm memory. r=lth
This commit drops the requirement to acquire the shared memory lock when we
are only acquiring the length. The length_ field is changed to be an
Atomic<SeqCst> in the process. We still need to acquire the lock when growing
the memory in order to atomically compute the new length and commit the new
pages.

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

--HG--
extra : moz-landing-system : lando
2019-11-01 14:46:35 +00:00
Lars T Hansen
131796c748 Bug 1590539 - Filter atomics ops for type early. r=jorendorff
Spec compliance requires us to check the element type of the
TypedArray at the same time as we check it's a shared TypedArray, not
later.  This results in some tests being done twice, but only for the
slow C++ path.

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

--HG--
extra : moz-landing-system : lando
2019-10-31 15:09:02 +00:00
Jon Coppeard
0c433ccc87 Bug 1592537 - Fix hazard warnings because the analysis can't tell that GCParallelTask::runTask won't GC r=me CLOSED TREE
--HG--
extra : histedit_source : e7ee24460d29c770002dd5f1bde663027a41d4e0
2019-11-01 13:27:52 +02:00
Jon Coppeard
8e6f76f4bc Bug 1592936 - Remove unncessary check that helper threads have been started in GCParallelTask::startWithLockHeld r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D51274

--HG--
extra : moz-landing-system : lando
2019-11-01 10:52:05 +00:00
Jon Coppeard
08d1fba1d5 Bug 1587096 - Part 4: Support FinlalizationGroups in the shell and add tests r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D49947

--HG--
extra : moz-landing-system : lando
2019-11-01 10:38:08 +00:00