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
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
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
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
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
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
* 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
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
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
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
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
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
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
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
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
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
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
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