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

82487 Коммитов

Автор SHA1 Сообщение Дата
Matthew Gaudet 66a30381a0 Bug 1706763 - Specialize InExpr emission for private brand checks to correctly handle the variety of storage locations required. r=arai
This ends up changing the NoThrow condition on CheckPrivateField to instead emulate the object check of JSOp::In instead.

As well, to create PrivateOpEmitter::Kind::ErgonomicBrandCheck, it's no longer aliased to the ElemOpEmitter::Kind enum.

Differential Revision: https://phabricator.services.mozilla.com/D114024
2021-05-05 19:39:28 +00:00
Matthew Gaudet 9c0b475dd0 Bug 1706763 - Assert we don't return JSOp::Nop from BinaryOpParseNodeKindToJSOp r=arai
Differential Revision: https://phabricator.services.mozilla.com/D114149
2021-05-05 19:39:27 +00:00
Csoregi Natalia 6cae0625ba Backed out 2 changesets (bug 1706763) for failures on private-reflect-01.js. CLOSED TREE
Backed out changeset d660b516c029 (bug 1706763)
Backed out changeset 37b12c82c93f (bug 1706763)
2021-05-05 21:48:21 +03:00
Steve Fink 928396fe99 Bug 1709404 - Add a new SM(fuzzilli) spidermonkey build job r=jmaher
Differential Revision: https://phabricator.services.mozilla.com/D114277
2021-05-05 18:30:32 +00:00
Matthew Gaudet f035a4f375 Bug 1706763 - Specialize InExpr emission for private brand checks to correctly handle the variety of storage locations required. r=arai
This ends up changing the NoThrow condition on CheckPrivateField to instead emulate the object check of JSOp::In instead.

As well, to create PrivateOpEmitter::Kind::ErgonomicBrandCheck, it's no longer aliased to the ElemOpEmitter::Kind enum.

Differential Revision: https://phabricator.services.mozilla.com/D114024
2021-05-05 17:57:52 +00:00
Matthew Gaudet 8657c42caf Bug 1706763 - Assert we don't return JSOp::Nop from BinaryOpParseNodeKindToJSOp r=arai
Differential Revision: https://phabricator.services.mozilla.com/D114149
2021-05-05 17:57:52 +00:00
Yury Delendik 0f1d2e2ebe Bug 1687629 - ARM64 Ion SIMD. r=lth
Differential Revision: https://phabricator.services.mozilla.com/D100659
2021-05-05 16:53:02 +00:00
Yury Delendik 21d18781a6 Bug 1687629 - Enable simd for arm64 in moz.configure. r=lth
Differential Revision: https://phabricator.services.mozilla.com/D100656
2021-05-05 16:53:02 +00:00
Yury Delendik 82a21c3b15 Bug 1709467 - Add getBuildConfiguration() info about if CPU was simulated. r=lth
Differential Revision: https://phabricator.services.mozilla.com/D114282
2021-05-05 15:35:48 +00:00
Julian Seward 40dabb3533 Bug 1678097 - Add vector registers on ARM64. r=lth,nbp.
In short, this patch adds support for vector registers on ARM64, including
machinery to save and restore them on the stack.  It also cleans up and
documents some of the save/restore logic.

There are many changes:

* We add a new type, Bitset128, that can represent the register set on ARM64
  with vector registers. This is a mostly-constexpr class with two uint64_t's
  that behaves like a 128-bit integer in the cases we need for register sets.

* Since the new type is 16 bytes wide, misc code throughout the system that
  switches on register set width is updated to handle the case.

* The FloatRegisters::SetType is changed to use Bitset128, and various
  constants defined in ARM64 FloatRegisters are updated to reflect this.  As
  the constants are constexpr, we can be reasonably sure that there are no
  initialization-order problems introduced by this.

* The registers in ARM64 FloatRegisters are rearranged so that single comes
  before double, which comes before vector registers, to conform to the order
  used everywhere else.

* In MacroAssembler.h, the semantics required of PushRegsInMask and its
  associated functions have been further documented.

* For ARM64, PushRegsInMask and its associated functions (PushRegsInMask,
  storeRegsInMask, PopRegsInMaskIgnore, ReduceSetForPush, GetPushSizeInBytes,
  getRegisterDumpOffsetInBytes, and new function
  FloatRegister::BroadcastToAllSizes), have been rewritten to handle
  saving/restoring of SIMD registers.  PushRegsInMask and storeRegsInMask have
  been merged into a single function so as to reduce code duplication and the
  associated danger of mistakenly writing different formats.

* In many places that are ARM64-specific, code guarded by `#ifndef
  ENABLE_WASM_SIMD` has been removed, so that in effect we always assume that
  SIMD register state is available on the target, and can be loaded and
  stored, even though we haven't yet enabled ARM64 SIMD support per se.

* The routines PushRegsInMaskForWasmStubs, PopRegsInMaskForWasmStubs and
  GetPushSizeInBytesForWasmStubs have been removed, since their operation has
  now been subsumed into their non-`ForWasmStubs` equivalents.

* In Safepoints.cpp, {Write,Read}FloatRegisterMask have been rewritten to
  support 128-bit sets.  One side effect is that reads/writes of 64-bit chunks
  have been changed to use new routines {write,read}Unsigned64 rather than two
  uses of {write,read}Unsigned.  The effect is to save one byte when
  bits 64:32 are all zero.

* Ridealong cleanup: the constant ION_FRAME_SLACK_SIZE has been removed.  It
  has no known uses.

* Note that RABALDR_SIDEALLOC_V128 is still in place in the wasm baseline
  compiler.  This patch does not remove it.

Differential Revision: https://phabricator.services.mozilla.com/D100116
2021-05-05 05:45:35 +00:00
Tooru Fujisawa 4c060cb465 Bug 1704185 - Rename JS::GetRealmWeakMapKey to JS::GetRealmKeyObject. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D111635
2021-05-04 23:48:26 +00:00
Narcis Beleuzu 09fdf287a6 Backed out changeset fd747fbe4058 (bug 1688188) as req by sfink 2021-05-05 01:07:13 +03:00
Iain Ireland fbf60a7b4e Bug 1700443: Remove JS_OPTIMIZED_ARGUMENTS r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D114175
2021-05-04 17:51:28 +00:00
Iain Ireland fd16996334 Bug 1700443: Remove AnalysisMode r=jandem
Depends on D114173

Differential Revision: https://phabricator.services.mozilla.com/D114174
2021-05-04 17:51:27 +00:00
Iain Ireland 62bbee08db Bug 1700443: Clean up SetFrameArgumentsObject r=jandem
The only remaining caller of SetFrameArgumentsObject is FinishBailoutToBaseline.

Depends on D114172

Differential Revision: https://phabricator.services.mozilla.com/D114173
2021-05-04 17:51:27 +00:00
Iain Ireland 5ae67a8455 Bug 1700443: Clean up EnvironmentObject and Debugger r=jandem
There's a separate usecase here that overloaded JS_OPTIMIZED_ARGUMENTS. getMissingArgumentsMaybeSentinelValue returns JS_OPTIMIZED_ARGUMENTS if it can't recreate the arguments object. The comment on createMissingArguments explains that this occurs if the environment is dead; see `tests/debug/Frame-eval-12.js`, where we return an inner function that subsequently tries to access its parent's arguments. There's a bunch of code on the devtools side of the wall to handle this case, and we have test coverage, so instead of ripping this out I'm just rewriting it to use a different magic value.

Depends on D114171

Differential Revision: https://phabricator.services.mozilla.com/D114172
2021-05-04 17:51:26 +00:00
Iain Ireland 3d63c70d95 Bug 1700443: Remove MIRType::MagicOptimizedArguments r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D114171
2021-05-04 17:51:26 +00:00
Iain Ireland 3065ef6e50 Bug 1700443: Remove FunApplyMagicArgs r=jandem
Depends on D114169

Differential Revision: https://phabricator.services.mozilla.com/D114170
2021-05-04 17:51:26 +00:00
Iain Ireland fa935040be Bug 1700443: Remove dead CacheIR ops r=jandem
The next patch removes CallFlags::FunApplyMagicArgs.

Depends on D114036

Differential Revision: https://phabricator.services.mozilla.com/D114169
2021-05-04 17:51:25 +00:00
Iain Ireland f99b3d6b4f Bug 1700443: Clean up CompileInfo r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D114036
2021-05-04 17:51:25 +00:00
Iain Ireland 9108741300 Bug 1700443: Simplify JSScript flags for arguments r=jandem
After the previous patches, JSScript still has three flags related to arguments analysis. Two of them are immutable (`argumentsHasVarBinding` and `alwaysNeedsArgsObj`), and one is mutable (`needsArgsObj`). We can simplify this down to just `needsArgsObj`, which is now immutable.

After the simplification, there's no longer any difference between `argsObjAliasesFormals` and `argumentsAliasesFormals`.

Depends on D114034

Differential Revision: https://phabricator.services.mozilla.com/D114035
2021-05-04 17:51:24 +00:00
Iain Ireland 10ffc14be7 Bug 1700443: Clean up BaselineCodeGen r=jandem
The `HAS_ARGS_OBJ` flag in BaselineFrame needs to stick around for the baseline interpreter, but it's immutable for the baseline compiler. (The next patch will move `needsArgsObj` from MutableFlags to ImmutableFlags.)

Depends on D114033

Differential Revision: https://phabricator.services.mozilla.com/D114034
2021-05-04 17:51:24 +00:00
Iain Ireland 613c40a99c Bug 1700443: Remove argumentsOptimizationFailed r=jandem
Depends on D114032

Differential Revision: https://phabricator.services.mozilla.com/D114033
2021-05-04 17:51:24 +00:00
Iain Ireland 68468b3a61 Bug 1700443: Remove AnalyzeArgumentsUsage r=jandem
This patch removes the `needsArgsAnalysis` flag. Other flags will be cleaned up in a later patch.

Differential Revision: https://phabricator.services.mozilla.com/D114032
2021-05-04 17:51:23 +00:00
Iain Ireland 7e9674da69 Bug 1708839: Add implicit use after folding away fallible unbox r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D114165
2021-05-04 17:41:09 +00:00
Yulia Startsev d15f5ac9b6 Bug 1708469 - Split realms, compartments, zones, context and runtime from JSApi; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D113813
2021-05-04 16:53:05 +00:00
Jon Coppeard 3103c7e943 Bug 1708692 - Rearrange arena header to move alloc kind out of flags bitfield r=sfink
This patch moves the alloc kind out of the flags word and places it between the
freespan and the zone. On 64 bit platforms there is 32 bits of padding here
because zone has pointer alignment and the freespan is 32 bits. On 32 bits
platforms this increases the size of the header but there is enough spare that
this doesn't reduce the arena density for any of our alloc kinds.

This also lets us type allocKind appropraitely.

Depends on D114213

Differential Revision: https://phabricator.services.mozilla.com/D114214
2021-05-04 16:15:32 +00:00
Asumu Takikawa a96bd5adef Bug 1708124 - Fix OOM case in Wasm ReportError r=rhunt
Differential Revision: https://phabricator.services.mozilla.com/D114146
2021-05-04 16:08:27 +00:00
Ryan Hunt 6374503adf Bug 1706124 - wasm: Implement the extended-const proposal. r=lth
This commit implements the extended-constants proposal.
 * A new feature flag and pref are added.
 * Basic tests are added.

Differential Revision: https://phabricator.services.mozilla.com/D112661
2021-05-04 15:58:26 +00:00
Ryan Hunt 17eab55693 Bug 1706124 - wasm: Clean up ref.func/exported function logic in InitExpr. r=lth
ref.func validates specially.
  * In the 'module environment', any function may be the target and using a function
    as a target marks it as available to be targeted in the code section.
  * The the code section, only functions used in the 'module environment' may
    be targeted.

Additionally, any target of ref.func becomes an 'exported function' and will get
a thunk generated for it. The logic for this existed in ModuleGenerator, which
would traverse over all relevant metadata in ModuleEnvironment to find which
functions may be exported. This no longer is trivial, as an InitExpr may
now contain a ref.func instruction encoded in its bytecode vector, instead
of the tagged union that InitExpr was before.

To satisfy all of these requirements, this patch reworks this code.
  * A `FuncFlags` enum is added to `FuncDesc` for each function definition.
  * `FuncFlags` describes whether a func is exported, eager, and can be
    targetted by ref.func.
  * Decoding the ModuleEnvironment now updates the flags of functions as
    it goes.
  * OpIter uses the validation mode to determine whether to check the
    func flags for a ref.func, or not.
  * ConstExpr::decodeAndValidate updates the flags of functions as it goes.
  * ModuleGenerator no longer computes the exported function information
    itself, and relies on function flags.
  * AsmJS writes to function flags for exported functions specially, as
    it previously relied on sharing the exported function code in
    ModuleGenerator that has moved to decoding/validation.

Differential Revision: https://phabricator.services.mozilla.com/D112659
2021-05-04 15:58:26 +00:00
Ryan Hunt 2ea24aaf6b Bug 1706124 - wasm: Rewrite InitExpr to support multiple instructions. r=lth
This commit rewrites InitExpr so that it supports multiple instructions. This
unlocks the ability to implement the extended-constants proposal, along with
rtt.canon/rtt.sub initializers for the GC proposal.

An InitExpr now contains either a literal value for simple expressions, or
a vector of bytecode to be evaluated later. Decoding an InitExpr now uses OpIter
to iterate over instructions and validate the results. OpIter is tweaked to
support alternate validation rules to support the additional restrictions that
initializer expressions have, such as global.get only working on immutable
imported globals. The exception is ref.func, which has special rules that I
defer to its own commit to follow.

An interpreter loop is added to evaluate the bytecode and yield a wasm::Val.
The loop uses a Decoder directly and assumes that the bytecode has been validated
already. The interpreter is not fast, and I assume it doesn't need to be at
this time.

Much code that assumed InitExp was POD had to be updated. Notably, GlobalDesc's
fields have been reorganized to remove the double nested union to make it
sane to store allocated data in it.

I initially intended for the expanded constant expression support to have
it's own header and implementation file (WasmInitExpr.h, WasmInitExpr.cpp).
I then discovered that InitExpr is involved with a challenging include loop
with WasmTypes.h and settled with a just giving it it's own implementation
file. This is unusual for `wasm/` some I'm open to discussions. In the
longer term, I would like to break up WasmTypes.h.

Differential Revision: https://phabricator.services.mozilla.com/D112658
2021-05-04 15:58:25 +00:00
Ryan Hunt cc3d5b5068 Bug 1706124 - wasm: Organize OpIter. r=lth
Non-essential clean up of OpIter to prepare for being used to decode
and validate constant expressions, in addition to function bodies.

Depends on D112655

Differential Revision: https://phabricator.services.mozilla.com/D112656
2021-05-04 15:58:24 +00:00
Ryan Hunt 88cb224a09 Bug 1706124 - wasm: Organize Decoder for adding more methods. r=lth
Non-essential clean up to prepare Decoder for being used in an
interpreter loop.

Depends on D112654

Differential Revision: https://phabricator.services.mozilla.com/D112655
2021-05-04 15:58:24 +00:00
Ryan Hunt 720cb43b51 Bug 1706124 - wasm: Move Encoder/Decoder to their own file. r=lth
Non-essential clean-up to split off functionality for binary parsing out
of validation. This is useful for a future interpreter loop which runs
in a non-validation context, and would only like to deal with a
Decoder.

Differential Revision: https://phabricator.services.mozilla.com/D112654
2021-05-04 15:58:23 +00:00
AshwiniWankhede b332049130 Bug 1520434-Improve the error messages when creating unaligned typed arrays r=mgaudet
Improved error messages emitted by JSMSG_TYPED_ARRAY_CONSTRUCT_BOUNDS.Error messages improved to specify the type and cause of error.
Added the test to check the error messages modified matches the expected cases.

Differential Revision: https://phabricator.services.mozilla.com/D113874
2021-05-04 15:34:36 +00:00
Yury Delendik 50fe06fce0 Bug 1706427 - Update wasmparser and cranelift. r=rhunt
Differential Revision: https://phabricator.services.mozilla.com/D112806
2021-05-04 14:59:40 +00:00
mr.robot ba9b6c6e39 Bug 1688188: Replace GC parameters and zeal mode with auto classes in jsapi-tests r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D113592
2021-05-04 14:26:17 +00:00
Matthew Gaudet 9601868417 Bug 1708973 - Support private field preferences outside of nightly r=caroline
Differential Revision: https://phabricator.services.mozilla.com/D114125
2021-05-04 14:25:39 +00:00
Marco Trevisan (Treviño) 16991ea00c Bug 1709241 - Use JSAutoStructuredCloneBuffer callbacks when set r=sfink
During calls to read() and write() for JSAutoStructuredCloneBuffer the
data callbacks and closure are ignored also if none are explicitly
passed.

Use them in such case

Differential Revision: https://phabricator.services.mozilla.com/D114195
2021-05-04 14:18:54 +00:00
Marco Trevisan (Treviño) 933ce9bdb9 Bug 1644600 - Move JSStructuredCloneData destructor into private impl r=sfink
This is using js::SharedArrayRawBufferRefs that is a private API and not
exported. Leaving it in the header makes linking not to work when using
StructuredClone:

  JSStructuredCloneData::~JSStructuredCloneData()':
    /usr/include/mozjs-78/js/StructuredClone.h:459:
    undefined reference to
    `js::SharedArrayRawBufferRefs::~SharedArrayRawBufferRefs()

Differential Revision: https://phabricator.services.mozilla.com/D114128
2021-05-04 14:05:08 +00:00
Jon Coppeard 96492d5f4b Bug 1708722 - Move error reporting APIs to a new public header r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D113993
2021-05-04 10:55:52 +00:00
Jon Coppeard 8ba309016a Bug 1708472 - Part 4: Remove template object from NewArray fallback stub r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D113926
2021-05-04 09:32:29 +00:00
Jon Coppeard 4a955d61b4 Bug 1708472 - Part 3: Simplify object scalar replacement a little r=nbp
When writing the previous patch I noticed the object path could be simplified to just use a shape.

Differential Revision: https://phabricator.services.mozilla.com/D113925
2021-05-04 09:32:28 +00:00
Jon Coppeard 5faee4513f Bug 1708472 - Part 2: Add recover instructions for MNewArrayObject and support scalar replacement r=nbp
I didn't add any new tests for this yet - maybe there are some you could suggest?

Differential Revision: https://phabricator.services.mozilla.com/D113924
2021-05-04 09:32:28 +00:00
Jon Coppeard 10e5258034 Bug 1708472 - Part 1: Transpile optimised NewArray stub along the same lines as for NewObject r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D113923
2021-05-04 09:32:28 +00:00
Sandor Molnar b5ebdf39ff Backed out changeset e4c8bc9f6f34 (bug 1708722) for causing build bustages. DONTBUILD CLOSED TREE 2021-05-04 12:17:25 +03:00
Jon Coppeard cddcbf10be Bug 1708722 - Move error reporting APIs to a new public header r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D113993
2021-05-04 08:52:17 +00:00
Lars T Hansen fa1414e4b5 Bug 1706891 - Config machinery for relaxed simd. r=rhunt
Introduce moz.configure, WasmFeatures, and StaticPrefList.yaml
machinery to define a config option for relaxed SIMD
(https://github.com/WebAssembly/relaxed-simd).  At the moment, there
are no defined relaxed SIMD opcodes, but a dozen or so are in the
works.  This just sets us up for implementing those.

Differential Revision: https://phabricator.services.mozilla.com/D114117
2021-05-04 06:26:13 +00:00
Yury Delendik 56803b57c7 Bug 1699620 - Refactor i64x2.shr_s and remove scalarization. r=lth
Differential Revision: https://phabricator.services.mozilla.com/D113184
2021-05-03 23:36:12 +00:00
Brindusan Cristian 2b6edfd254 Backed out changeset 2ab466464002 (bug 1688188) for causing sm bustages in tests.h. CLOSED TREE 2021-05-04 01:26:03 +03:00