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

87142 Коммитов

Автор SHA1 Сообщение Дата
André Bargull 5855fc2684 Bug 1784490 - Part 3: Remove unnecessary includes in js/src/builtin. r=mgaudet
Similar to part 1, remove includes which are flagged as unnecessary by IWYU.

Differential Revision: https://phabricator.services.mozilla.com/D154536
2022-08-15 12:59:05 +00:00
André Bargull 888303d10b Bug 1784490 - Part 2: Remove StringsAreEqual from intl/CommonFunctions.h. r=mgaudet
Collator.cpp:
It's actually faster to compare the entries as Span, because we don't have
to scan for the terminating null-character.

That leaves only two other callers to `StringsAreEqual`. Inline it into both
files and give the version in "String.cpp" a better name. `CaseMappingLocale`
should probably be changed to return a `Span`, so we can remove another caller
with raw pointers from `mozilla::intl`, but that's better left for another bug.

Depends on D154534

Differential Revision: https://phabricator.services.mozilla.com/D154535
2022-08-15 12:59:05 +00:00
André Bargull 5495534331 Bug 1784490 - Part 1: Remove unnecessary includes in js/src/builtin/intl. r=mgaudet
Remove unnecessary includes reported by IWYU, but don't bother with adding all
missing includes, because that requires more effort to filter out invalid
suggestions from IWYU. The added includes are only needed to avoid build breakage.

Differential Revision: https://phabricator.services.mozilla.com/D154534
2022-08-15 12:59:03 +00:00
Marian-Vasile Laza d1dd9ef346 Backed out 3 changesets (bug 1784490) for causing build bustages. CLOSED TREE
Backed out changeset 6e9b32e45fee (bug 1784490)
Backed out changeset a79a9860433b (bug 1784490)
Backed out changeset f5aadfd152c5 (bug 1784490)
2022-08-15 15:11:09 +03:00
André Bargull e0fc07c997 Bug 1784490 - Part 3: Remove unnecessary includes in js/src/builtin. r=mgaudet
Similar to part 1, remove includes which are flagged as unnecessary by IWYU.

Depends on D154535

Differential Revision: https://phabricator.services.mozilla.com/D154536
2022-08-15 11:47:44 +00:00
André Bargull 77cf0d55b4 Bug 1784490 - Part 2: Remove StringsAreEqual from intl/CommonFunctions.h. r=mgaudet
Collator.cpp:
It's actually faster to compare the entries as Span, because we don't have
to scan for the terminating null-character.

That leaves only two other callers to `StringsAreEqual`. Inline it into both
files and give the version in "String.cpp" a better name. `CaseMappingLocale`
should probably be changed to return a `Span`, so we can remove another caller
with raw pointers from `mozilla::intl`, but that's better left for another bug.

Depends on D154534

Differential Revision: https://phabricator.services.mozilla.com/D154535
2022-08-15 11:47:43 +00:00
André Bargull 65d200ba02 Bug 1784490 - Part 1: Remove unnecessary includes in js/src/builtin/intl. r=mgaudet
Remove unnecessary includes reported by IWYU, but don't bother with adding all
missing includes, because that requires more effort to filter out invalid
suggestions from IWYU. The added includes are only needed to avoid build breakage.

Differential Revision: https://phabricator.services.mozilla.com/D154534
2022-08-15 11:47:43 +00:00
Julian Seward 4ebfb64753 Bug 1774840 - Implement new GC instructions in baseline (Part 3). r=rhunt.
Adds wasm baseline implementation and test cases for `array.new_fixed`.

Differential Revision: https://phabricator.services.mozilla.com/D154230
2022-08-15 10:08:39 +00:00
Julian Seward c5d5216d8e Bug 1774840 - Implement new GC instructions in baseline (Part 2). r=rhunt.
In the existing GC array implementation, change some names that are `length`
or `elementsLength` to be `numElements`, to remove ambiguity about whether
those quantities are "number of bytes" or "number of array elements".  No
functional change.

Differential Revision: https://phabricator.services.mozilla.com/D154229
2022-08-15 10:08:38 +00:00
Julian Seward 5f86714cba Bug 1774840 - Implement new GC instructions in baseline (Part 1). r=rhunt.
Part 1 - debug/comment improvements.  No functional change.

* Add a debug-only method BaseCompiler::showStack, to dump the compiler's
  value stack to stderr.

* Add comment describing argument-handling in BaseCompiler::emitInstanceCall.

Differential Revision: https://phabricator.services.mozilla.com/D154228
2022-08-15 10:08:38 +00:00
Jan de Mooij 49529a9109 Bug 1784478 - Support loading from rope right-child in MacroAssembler::loadStringChar. r=anba
Differential Revision: https://phabricator.services.mozilla.com/D154527
2022-08-14 11:23:12 +00:00
Mohamed Atef 9b822c126b Bug 1784435: Support generic error in js::StringToBigInt. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D154581
2022-08-13 14:36:36 +00:00
Yury Delendik b3b91f03ec Bug 1780819 - Allow non-nullable references in locals. r=rhunt
* Allows non-defaultable locals to be present
* Adds UnsetLocalsState to track state (as defined by spec)
* Add testing of generated sequences of blocks and locals operations

Differential Revision: https://phabricator.services.mozilla.com/D154003
2022-08-12 20:41:03 +00:00
Ryan Hunt f3a70ff9e6 Bug 1782770 - wasm: Don't make extra copy of FuncType for debugging. r=yury
Now that we transfer all type definitions to Metadata, we can
remove the special debugging case where we would transfer all
function types. Instead, we can just transfer the funcTypeIndex
and find the function type in Metadata.

Differential Revision: https://phabricator.services.mozilla.com/D153500
2022-08-12 17:21:56 +00:00
Ryan Hunt 4ed81efbb9 Bug 1782770 - wasm: Make ValType a uint32_t now that rtt's are gone. r=yury
ValType needed to be pointer size to support (rtt) types. Now that
they have been removed, we can revert to 32-bit on all platforms.

Differential Revision: https://phabricator.services.mozilla.com/D153499
2022-08-12 17:21:56 +00:00
Ryan Hunt bbc6652080 Bug 1782770 - wasm: Transfer all type definitions to Metadata. r=yury
Metadata stores a vector of TypeDef that comes from the type section of the module.
We currently only transfer a type if it's a struct type, array type, or else a
function type that cannot fit in an immediate for call_indirect signature checks.

Because we filter out some types, this means we need to renumber the type index
space to match. This is a bit hacky, and is difficult to do consistently.

The original reason for only bringing function types that cannot fit in an
immediate was to reduce the size of metadata as most function types can fit in an
immediate. However, I discovered that we make a copies of function types for
FuncExport and FuncImport metadata. This can create multiple copies of the original
function type, e.g. when multiple exported functions reference the same type
definition.

If we instead transfer all types and store the index of the function type in
FuncExport/FuncImport we can reduce total metadata size, reduce allocations,
and remove type renumbering.

This commit does this by:
  1. Transferring all type definitions to Metadata (WasmGenerator.cpp)
  2. Removing the typeRenumbering vector
  3. Replacing FuncType with typeIndex on FuncImport/FuncExport
  4. Updating all users of FuncImport/FuncExport to get the FuncType using
     the typeIndex and Metadata. This the bulk of the changes.

Differential Revision: https://phabricator.services.mozilla.com/D153498
2022-08-12 17:21:55 +00:00
Yulia Startsev dee4b84e71 Bug 1784477 - Make ModuleLoaderBase thread-insensitive; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D147323
2022-08-12 16:18:44 +00:00
Yulia Startsev ddbc6378de Bug 1784477 - Remove Dynamic Import option; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D154529
2022-08-12 16:18:44 +00:00
André Bargull ad1746d63e Bug 1784092 - Part 5: Update test262 exclusions. r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D154271
2022-08-12 15:22:19 +00:00
André Bargull e02f67890b Bug 1784092 - Part 4: Update test262. r=mgaudet
Update test262 after enabling the features from part 2.

Depends on D154269

Differential Revision: https://phabricator.services.mozilla.com/D154270
2022-08-12 15:22:18 +00:00
André Bargull 56216f7437 Bug 1784092 - Part 3: Update test262 importer feature checks. r=mgaudet
Enable "array-grouping" and "change-array-by-copy" tests.

Depends on D154268

Differential Revision: https://phabricator.services.mozilla.com/D154269
2022-08-12 15:22:18 +00:00
André Bargull 40c109ec7b Bug 1784092 - Part 2: Enable change-array-by-copy build option by default on Nightly. r=mgaudet
This only enables the build option, which allows to actually run any tests in CI.

Depends on D154267

Differential Revision: https://phabricator.services.mozilla.com/D154268
2022-08-12 15:22:17 +00:00
André Bargull 437553873a Bug 1784092 - Part 1: Remove tests for removed TypedArray.prototype.toSpliced function. r=mgaudet
Depends on D154266

Differential Revision: https://phabricator.services.mozilla.com/D154267
2022-08-12 15:22:17 +00:00
André Bargull ba2a960d5f Bug 1784454: Initialise dense elements before copying into them. r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D154505
2022-08-12 15:15:52 +00:00
André Bargull bcdadebfbb Bug 1784091: Update unscopable names for Array grouping. r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D154266
2022-08-12 12:49:55 +00:00
André Bargull b4cd6b075b Bug 1784090 - Part 5: Avoid copying the array for ArrayToSorted. r=mgaudet
Change `MergeSort` to directly modify its input instead of creating a copy.
`ArraySort` now needs to copy the input and re-arrange any holes, whereas
`ArrayToSorted` can directly return the result from `MergeSort`.

Depends on D154264

Differential Revision: https://phabricator.services.mozilla.com/D154265
2022-08-12 12:49:54 +00:00
André Bargull 324aa95386 Bug 1784090 - Part 4: Inline ArraySort into ArrayToSorted. r=mgaudet
Inline `ArraySort` into `ArrayToSorted` in preparation for the next part.

Depends on D154263

Differential Revision: https://phabricator.services.mozilla.com/D154264
2022-08-12 12:49:54 +00:00
André Bargull a6906a1108 Bug 1784090 - Part 3: Change comments to single-line comments. r=mgaudet
We generally prefer single-line comments in new code.

Depends on D154262

Differential Revision: https://phabricator.services.mozilla.com/D154263
2022-08-12 12:49:54 +00:00
André Bargull 2dbab44bf7 Bug 1784090 - Part 2: Remove SortArray with direct call to ArraySort. r=mgaudet
Depends on D154261

Differential Revision: https://phabricator.services.mozilla.com/D154262
2022-08-12 12:49:53 +00:00
André Bargull 5911ceb687 Bug 1784090 - Part 1: Create fewer copies in TypedArrayToSorted. r=mgaudet
Change `MergeSortTypedArray` to return the sorted array. `TypedArraySort` now
needs to copy the sorted elements back into the original array and
`TypedArrayToSorted` can directly return the sorted array. When `TypedArrayToSorted`
is called without a comparator function, we still have to create a copy in
`TypedArrayToSorted` which is then passed to `TypedArrayNativeSort`. When the
input has fewer than two elements, we only have to copy the input without performing
any sort operations.

Differential Revision: https://phabricator.services.mozilla.com/D154261
2022-08-12 12:49:53 +00:00
Cosmin Sabou 0426478035 Backed out 11 changesets (bug 1784090, bug 1784091, bug 1784092) for causing SM assertion failures on js/Value.h. CLOSED TREE
Backed out changeset a8f802732daf (bug 1784092)
Backed out changeset b92f9185c00e (bug 1784092)
Backed out changeset 293b349acef8 (bug 1784092)
Backed out changeset 43f09ff76a7c (bug 1784092)
Backed out changeset 8525901a008a (bug 1784092)
Backed out changeset 94fcc8600381 (bug 1784091)
Backed out changeset 35d068070f81 (bug 1784090)
Backed out changeset 3966a0f0f413 (bug 1784090)
Backed out changeset 3492785e6bb1 (bug 1784090)
Backed out changeset ac8bb0be9f26 (bug 1784090)
Backed out changeset 9c38d51940e8 (bug 1784090)
2022-08-12 12:38:04 +03:00
André Bargull e1af99c7b1 Bug 1784092 - Part 5: Update test262 exclusions. r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D154271
2022-08-12 08:44:18 +00:00
André Bargull 690bcb5e95 Bug 1784092 - Part 4: Update test262. r=mgaudet
Update test262 after enabling the features from part 2.

Depends on D154269

Differential Revision: https://phabricator.services.mozilla.com/D154270
2022-08-12 08:44:18 +00:00
André Bargull 9dc71a7f29 Bug 1784092 - Part 3: Update test262 importer feature checks. r=mgaudet
Enable "array-grouping" and "change-array-by-copy" tests.

Depends on D154268

Differential Revision: https://phabricator.services.mozilla.com/D154269
2022-08-12 08:44:17 +00:00
André Bargull cde63795b3 Bug 1784092 - Part 2: Enable change-array-by-copy build option by default on Nightly. r=mgaudet
This only enables the build option, which allows to actually run any tests in CI.

Depends on D154267

Differential Revision: https://phabricator.services.mozilla.com/D154268
2022-08-12 08:44:17 +00:00
André Bargull 87b4b0cd62 Bug 1784092 - Part 1: Remove tests for removed TypedArray.prototype.toSpliced function. r=mgaudet
Depends on D154266

Differential Revision: https://phabricator.services.mozilla.com/D154267
2022-08-12 08:44:16 +00:00
André Bargull 60d653c940 Bug 1784091: Update unscopable names for Array grouping. r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D154266
2022-08-12 08:44:16 +00:00
André Bargull 75f9bce01e Bug 1784090 - Part 5: Avoid copying the array for ArrayToSorted. r=mgaudet
Change `MergeSort` to directly modify its input instead of creating a copy.
`ArraySort` now needs to copy the input and re-arrange any holes, whereas
`ArrayToSorted` can directly return the result from `MergeSort`.

Depends on D154264

Differential Revision: https://phabricator.services.mozilla.com/D154265
2022-08-12 08:44:16 +00:00
André Bargull c8acc7429b Bug 1784090 - Part 4: Inline ArraySort into ArrayToSorted. r=mgaudet
Inline `ArraySort` into `ArrayToSorted` in preparation for the next part.

Depends on D154263

Differential Revision: https://phabricator.services.mozilla.com/D154264
2022-08-12 08:44:15 +00:00
André Bargull 2f0b2f1bbe Bug 1784090 - Part 3: Change comments to single-line comments. r=mgaudet
We generally prefer single-line comments in new code.

Depends on D154262

Differential Revision: https://phabricator.services.mozilla.com/D154263
2022-08-12 08:44:15 +00:00
André Bargull 1d0f1c0e4b Bug 1784090 - Part 2: Remove SortArray with direct call to ArraySort. r=mgaudet
Depends on D154261

Differential Revision: https://phabricator.services.mozilla.com/D154262
2022-08-12 08:44:14 +00:00
André Bargull e670072641 Bug 1784090 - Part 1: Create fewer copies in TypedArrayToSorted. r=mgaudet
Change `MergeSortTypedArray` to return the sorted array. `TypedArraySort` now
needs to copy the sorted elements back into the original array and
`TypedArrayToSorted` can directly return the sorted array. When `TypedArrayToSorted`
is called without a comparator function, we still have to create a copy in
`TypedArrayToSorted` which is then passed to `TypedArrayNativeSort`. When the
input has fewer than two elements, we only have to copy the input without performing
any sort operations.

Differential Revision: https://phabricator.services.mozilla.com/D154261
2022-08-12 08:44:14 +00:00
Julian Descottes 6d4437d90f Bug 1783814 - Add documentation for remaining SandboxOptions r=kmag
Depends on D154260

Add documentation for
- allowWaivers
- discardSource
- forceSecureContext
- freshCompartment
- invisibleToDebugger
- isWebExtensionContentScript
- metadata
- originAttributes
- userContextId

Differential Revision: https://phabricator.services.mozilla.com/D154307
2022-08-12 08:34:53 +00:00
Julian Descottes 590a767d3a Bug 1783814 - Add documentation for SandboxOptions previously documented on MDN r=kmag
This only ports documentation for options which used to be documented on MDN.
Since then new sandbox options have been added, I will try to add documentation for them in a second changeset

Differential Revision: https://phabricator.services.mozilla.com/D154260
2022-08-12 08:34:53 +00:00
Iulian Moraru 19bdd8586c Backed out 3 changesets (bug 1782770) for causing wasm related spidermonkey build bustages. CLOSED TREE
Backed out changeset dfb8854e3ac0 (bug 1782770)
Backed out changeset c4eca5ce1a52 (bug 1782770)
Backed out changeset a881b6ab4795 (bug 1782770)
2022-08-12 01:29:18 +03:00
Ryan Hunt fad61321d1 Bug 1782770 - wasm: Don't make extra copy of FuncType for debugging. r=yury
Now that we transfer all type definitions to Metadata, we can
remove the special debugging case where we would transfer all
function types. Instead, we can just transfer the funcTypeIndex
and find the function type in Metadata.

Differential Revision: https://phabricator.services.mozilla.com/D153500
2022-08-11 21:28:35 +00:00
Ryan Hunt b9d8fee556 Bug 1782770 - wasm: Make ValType a uint32_t now that rtt's are gone. r=yury
ValType needed to be pointer size to support (rtt) types. Now that
they have been removed, we can revert to 32-bit on all platforms.

Differential Revision: https://phabricator.services.mozilla.com/D153499
2022-08-11 21:28:35 +00:00
Ryan Hunt 72735abb79 Bug 1782770 - wasm: Transfer all type definitions to Metadata. r=yury
Metadata stores a vector of TypeDef that comes from the type section of the module.
We currently only transfer a type if it's a struct type, array type, or else a
function type that cannot fit in an immediate for call_indirect signature checks.

Because we filter out some types, this means we need to renumber the type index
space to match. This is a bit hacky, and is difficult to do consistently.

The original reason for only bringing function types that cannot fit in an
immediate was to reduce the size of metadata as most function types can fit in an
immediate. However, I discovered that we make a copies of function types for
FuncExport and FuncImport metadata. This can create multiple copies of the original
function type, e.g. when multiple exported functions reference the same type
definition.

If we instead transfer all types and store the index of the function type in
FuncExport/FuncImport we can reduce total metadata size, reduce allocations,
and remove type renumbering.

This commit does this by:
  1. Transferring all type definitions to Metadata (WasmGenerator.cpp)
  2. Removing the typeRenumbering vector
  3. Replacing FuncType with typeIndex on FuncImport/FuncExport
  4. Updating all users of FuncImport/FuncExport to get the FuncType using
     the typeIndex and Metadata. This the bulk of the changes.

Differential Revision: https://phabricator.services.mozilla.com/D153498
2022-08-11 21:28:34 +00:00
Matthew Gaudet 90d0f4f428 Bug 1784181 - Add Reflect.parse tests to the JS Feature Checklist r=dminor DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D154438
2022-08-11 20:15:19 +00:00
Steve Fink 96f66df1a3 Bug 1784164 - update comment on current state r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D154316
2022-08-11 16:21:06 +00:00