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

77516 Коммитов

Автор SHA1 Сообщение Дата
Lars T Hansen 57a5014959 Bug 1647991 - Allow wasmDis to return its result as a string. r=rhunt
This is useful for limited whitebox testing that inspects the assembly
output.  Ask me about details (s-s).

The code, adding a thread-local, is not completely pretty.  This
seemed like a better fix than adding the plumbing for a more elaborate
callback mechanism (basically we need to pass a context argument down
through the disassembly pipeline and adapt all the disassemblers),
though I'm open for discussion on this point.

Differential Revision: https://phabricator.services.mozilla.com/D80819
2020-06-24 19:17:40 +00:00
Ryan Hunt 87ef44e6ab Bug 1642940 - Report OOM on table allocation failure. r=lth
Table::create() returns false when allocation fails, but does
not report the OOM. This commit adds appropriate calls to
ReportOutOfMemory around calls to Table::create().

Differential Revision: https://phabricator.services.mozilla.com/D80754
2020-06-25 05:21:41 +00:00
Ryan Hunt fe6aa87a6d Bug 1642940 - Remove redundant GetLimits parameter. r=lth
This is clean-up from the refactoring that made initial/max limits the same.

Differential Revision: https://phabricator.services.mozilla.com/D80142
2020-06-25 05:21:39 +00:00
Ryan Hunt a7d5673bc3 Bug 1642940 - Consolidate and expand tests of memory/table limits. r=lth
There were some ad-hoc tests for this behavior that are now consolidated and
extended in 'limits.js'.

Differential Revision: https://phabricator.services.mozilla.com/D80141
2020-06-25 08:28:09 +00:00
Ryan Hunt e2cb431b65 Bug 1615434 - Increase maximum initial memory size to 2GiB. r=lth
The spec no longer has an initial memory size limit, so we should allow up to
the limit imposed upon us by ArrayBuffer.

Differential Revision: https://phabricator.services.mozilla.com/D80140
2020-06-25 05:21:45 +00:00
Ryan Hunt 7802c0a015 Bug 1642940 - Separate the validation and runtime table limit checks. r=lth
This commit separates the validation limit defined by the core spec and the
implementation runtime limit defined by the JS-API spec. The exception
generated for the runtime check is a WebAssembly.RuntimeError as decided upon
upstream.

Additionally, there is no longer the concept of an initial limit. The code is
updated to reflect this.

Differential Revision: https://phabricator.services.mozilla.com/D80139
2020-06-25 05:21:48 +00:00
Ryan Hunt a7d7a2f65b Bug 1642940 - Separate the validation and runtime memory limit checks. r=lth
This commit separates the validation limit defined by the core spec and the
implementation runtime limit defined by the JS-API spec. The exception
generated for the runtime check is a WebAssembly.RuntimeError as decided upon
upstream.

Additionally, there is no longer the concept of an 'initial' limit, so code
is updated to reflect this.

Differential Revision: https://phabricator.services.mozilla.com/D80138
2020-06-25 05:21:50 +00:00
Ryan Hunt 55957b9c23 Bug 1642940 - Factor out data/elem segment implementation limits. r=lth
Data and element segment decoding used the initial memory/table limit values
which will be removed in a later commit, this commit gives data/elem segments
their own implementation defined limit to prevent interference.

Differential Revision: https://phabricator.services.mozilla.com/D80137
2020-06-25 05:21:36 +00:00
Ryan Hunt e88b049c20 Bug 1642940 - Widen Limits::{initial, maximum} to uint64_t. r=lth
There are two kinds of limits to table and memory types. A limit applied during
validation defined by the core spec, and a limit applied during instantiation
by the JS-API embedders spec. Our current implementation combines both and
applies them at validation time.

The validation limit is 2^16 for memory and 2^32-1 for tables.

(actually the limit for tables is 2^32 in the core spec and fixed to 2^32-1 in
the reference-types proposal, which should be merged soon)

Unfortunately, memory types are defined in pages and our implementation
eagerly converts from pages to bytes upon decoding. This allows for an overflow
when the maximum memory size is used (2^16 * PageSize == UINT32_MAX + 1).

Additionally, the memory64 proposal is planning on widening the encoding of
limit values to u64, which will put us in this same situation also for tables.

(the current memory64 validation limit for 64-bit memories is 2^48 which
would overflow even uint64_t when converted to bytes, so we may want to lobby
for a lower limit there)

This commit widens the fields of Limits to uint64_t to make overflow impossible
in these situations and (less importantly) to get ready for memory64.

The wasm array buffer code stores the runtime value of maximum length and was
widened. We don't need to change the byte length representation because our
implementation limit will fail memory allocations well before UINT32_MAX.

The table code used Limits in TableDesc and was re-written to store just the
initial/maximum values in 32-bit form so that no table code has to worry
about 64-bit values. This has the small nice effect of dropping the shared
flag, which was never used and won't be in the future.

There should be no functional changes in this commit.

Differential Revision: https://phabricator.services.mozilla.com/D80136
2020-06-25 05:21:52 +00:00
Narcis Beleuzu d5f6bcfb75 Backed out 8 changesets (bug 1615434, bug 1642940) for SM bustages on limits.js . CLOSED TREE
Backed out changeset b4a816af3fdf (bug 1642940)
Backed out changeset 5660e8f9b0f5 (bug 1642940)
Backed out changeset 3f3f63e1156b (bug 1642940)
Backed out changeset 068ffb754356 (bug 1615434)
Backed out changeset daa7bbbfe721 (bug 1642940)
Backed out changeset 4312510d2a52 (bug 1642940)
Backed out changeset 0fde857a66d9 (bug 1642940)
Backed out changeset 534530689a10 (bug 1642940)
2020-06-25 08:16:03 +03:00
Ryan Hunt 948e22eaaf Bug 1637884 - Wasm: Enable reference-types by default. r=lth
This commit enable reference-types by default. The existing config/ifdef'ery is
spared to allow for an easier backout and to support Cranelift until it gains
support for the feature.

Depends on D81012

Differential Revision: https://phabricator.services.mozilla.com/D81013
2020-06-25 04:52:05 +00:00
Ryan Hunt 34491c6ee8 Bug 1528294 - Wasm: Enable bulk-memory-operations by default. r=lth
This commit enables the bulk-memory-operations feature by default. The config/
ifdef'ery is spared to allow for easier backouts if needed.

Differential Revision: https://phabricator.services.mozilla.com/D81012
2020-06-25 04:52:22 +00:00
Ryan Hunt 0c490d558c Bug 1642940 - Report OOM on table allocation failure. r=lth
Table::create() returns false when allocation fails, but does
not report the OOM. This commit adds appropriate calls to
ReportOutOfMemory around calls to Table::create().

Differential Revision: https://phabricator.services.mozilla.com/D80754
2020-06-24 06:54:02 +00:00
Ryan Hunt 813131c727 Bug 1642940 - Remove redundant GetLimits parameter. r=lth
This is clean-up from the refactoring that made initial/max limits the same.

Differential Revision: https://phabricator.services.mozilla.com/D80142
2020-06-23 23:17:20 +00:00
Ryan Hunt b9b4fd8f3e Bug 1642940 - Consolidate and expand tests of memory/table limits. r=lth
There were some ad-hoc tests for this behavior that are now consolidated and
extended in 'limits.js'.

Differential Revision: https://phabricator.services.mozilla.com/D80141
2020-06-23 23:16:43 +00:00
Ryan Hunt 8e87798b9f Bug 1615434 - Increase maximum initial memory size to 2GiB. r=lth
The spec no longer has an initial memory size limit, so we should allow up to
the limit imposed upon us by ArrayBuffer.

Differential Revision: https://phabricator.services.mozilla.com/D80140
2020-06-23 23:06:34 +00:00
Ryan Hunt f8f16d85fd Bug 1642940 - Separate the validation and runtime table limit checks. r=lth
This commit separates the validation limit defined by the core spec and the
implementation runtime limit defined by the JS-API spec. The exception
generated for the runtime check is a WebAssembly.RuntimeError as decided upon
upstream.

Additionally, there is no longer the concept of an initial limit. The code is
updated to reflect this.

Differential Revision: https://phabricator.services.mozilla.com/D80139
2020-06-23 23:05:29 +00:00
Ryan Hunt b522b98a15 Bug 1642940 - Separate the validation and runtime memory limit checks. r=lth
This commit separates the validation limit defined by the core spec and the
implementation runtime limit defined by the JS-API spec. The exception
generated for the runtime check is a WebAssembly.RuntimeError as decided upon
upstream.

Additionally, there is no longer the concept of an 'initial' limit, so code
is updated to reflect this.

Differential Revision: https://phabricator.services.mozilla.com/D80138
2020-06-23 23:03:10 +00:00
Ryan Hunt 5fcbd2d352 Bug 1642940 - Factor out data/elem segment implementation limits. r=lth
Data and element segment decoding used the initial memory/table limit values
which will be removed in a later commit, this commit gives data/elem segments
their own implementation defined limit to prevent interference.

Differential Revision: https://phabricator.services.mozilla.com/D80137
2020-06-23 23:01:01 +00:00
Ryan Hunt def391a019 Bug 1642940 - Widen Limits::{initial, maximum} to uint64_t. r=lth
There are two kinds of limits to table and memory types. A limit applied during
validation defined by the core spec, and a limit applied during instantiation
by the JS-API embedders spec. Our current implementation combines both and
applies them at validation time.

The validation limit is 2^16 for memory and 2^32-1 for tables.

(actually the limit for tables is 2^32 in the core spec and fixed to 2^32-1 in
the reference-types proposal, which should be merged soon)

Unfortunately, memory types are defined in pages and our implementation
eagerly converts from pages to bytes upon decoding. This allows for an overflow
when the maximum memory size is used (2^16 * PageSize == UINT32_MAX + 1).

Additionally, the memory64 proposal is planning on widening the encoding of
limit values to u64, which will put us in this same situation also for tables.

(the current memory64 validation limit for 64-bit memories is 2^48 which
would overflow even uint64_t when converted to bytes, so we may want to lobby
for a lower limit there)

This commit widens the fields of Limits to uint64_t to make overflow impossible
in these situations and (less importantly) to get ready for memory64.

The wasm array buffer code stores the runtime value of maximum length and was
widened. We don't need to change the byte length representation because our
implementation limit will fail memory allocations well before UINT32_MAX.

The table code used Limits in TableDesc and was re-written to store just the
initial/maximum values in 32-bit form so that no table code has to worry
about 64-bit values. This has the small nice effect of dropping the shared
flag, which was never used and won't be in the future.

There should be no functional changes in this commit.

Differential Revision: https://phabricator.services.mozilla.com/D80136
2020-06-25 04:06:58 +00:00
Jeff Walden e88268be75 Bug 1502355 - Fill in most of the body of the "finalize" operation in the piping algorithm. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D80785
2020-06-24 18:41:15 +00:00
Jeff Walden 4e41734ac2 Bug 1502355 - Implement some of the process of performing an action and then finalizing, in the shutdown with an action process. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D80784
2020-06-24 18:41:07 +00:00
Jeff Walden 7cc9de0a71 Bug 1502355 - Wait for completed reads to finish writing before finalizing, during pipe-to shutdown with an action. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D80783
2020-06-24 18:41:00 +00:00
Jeff Walden a30e220cb7 Bug 1502355 - Save to the side the action specified when we're supposed to "shutdown with an action". r=arai
Differential Revision: https://phabricator.services.mozilla.com/D80782
2020-06-24 18:40:52 +00:00
Jeff Walden 266888d6f0 Bug 1502355 - Store the value optionally passed to finalizing as an extra value in a handler function. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D80781
2020-06-24 18:40:45 +00:00
Jeff Walden b632801c8d Bug 1502355 - React to a read promise that rejects. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D80780
2020-06-24 18:40:32 +00:00
Jeff Walden 1f7d9fadd3 Bug 1502355 - Implement |WritableStreamDefaultWriterCloseWithErrorPropagation|. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D80779
2020-06-24 18:40:25 +00:00
Jeff Walden bfd74effd4 Bug 1502355 - Allow handler functions to store an extra *value*, not merely an extra T* that's an object. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D80778
2020-06-24 18:40:12 +00:00
Jason Orendorff 1b921cff65 Bug 1646317 - Fix Assertion failure: errorObj->type() == JSEXN_AGGREGATEERR, at builtin/Promise.cpp:3896. r=jwalden.
Differential Revision: https://phabricator.services.mozilla.com/D80721
2020-06-24 14:06:05 +00:00
Steve Fink d11d7fad9a Bug 1647118 - Throw error on short read in readTransferMap r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D80554
2020-06-23 22:03:06 +00:00
Jon Coppeard 065f106d88 Bug 1638764 - Make the incremental marking validator check that all chunks are found in its map r=sfink
I still don't know why this is happening, but this should make the problem a release mode assertion failure rather than an illegal memory access.

Differential Revision: https://phabricator.services.mozilla.com/D80866
2020-06-24 14:04:39 +00:00
Jan de Mooij dfbd9c9222 Bug 1646036 - Prevent bailout loops in Warp from bounds check and lexical check hoisting. r=iain
This is necessary to fix some jit-test timeouts from bailout/recompile loops
with the patch to bail out for cold Baseline ICs. We're also hitting the bounds
check case on Octane-pdfjs already where it's slowing us down.

Hopefully these are the only cases we need to handle. For shape guards and other
guards derived from Baseline ICs I want to make other changes soon.

Eventually the bailout code should be made more obviously-correct but this should
do for now until IonBuilder is gone.

Differential Revision: https://phabricator.services.mozilla.com/D80648
2020-06-24 13:33:28 +00:00
Tom Schuster 366e3067b4 Bug 1647895 - Remove inputType from MTypeof. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D80746
2020-06-24 08:12:22 +00:00
Jan de Mooij 31af427a90 Bug 1646302 - Only create a template object if prototype is an object in getTemplateObjectForScripted. r=evilpie
Differential Revision: https://phabricator.services.mozilla.com/D80595
2020-06-23 10:11:10 +00:00
Yoshi Cheng-Hao Huang 116f13bd23 Bug 1644111 : Remove isEnabled() check. r=jonco
As we have bail out early if !isEnabled()
https://searchfox.org/mozilla-central/rev/5e6c7717255ca9638b2856c2b2058919aec1d21d/js/src/gc/Nursery.cpp#965

Differential Revision: https://phabricator.services.mozilla.com/D80282
2020-06-22 09:49:54 +00:00
Yoshi Cheng-Hao Huang 7eb496c2fe Bug 1644111 : Don't send promotionRate and pretenureCount telemetry if nursery was empty. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D80281
2020-06-23 15:09:11 +00:00
Jon Coppeard 8af6d2df69 Bug 1647325 - Trace weak edges of FinalizationRegistrationsObjects when required r=sfink
FinalizationRegistrationsObject only holds a vector of weak pointers to FinalizationRecordObjects, but it still needs a trace method so that those weak pointers can get updated by a moving GC.

Differential Revision: https://phabricator.services.mozilla.com/D80630
2020-06-23 15:22:58 +00:00
David Major ce70c59eeb Bug 1647739 - Fix a clang-11 snprintf complaint in XPCConvert.cpp r=mccr8
We have a clang-plugin checker that wants to favor `SprintfLiteral` over `snprintf`, but for some reason it didn't catch this instance prior to clang-11.

Differential Revision: https://phabricator.services.mozilla.com/D80668
2020-06-23 17:08:17 +00:00
David Major 81fe5564c4 Bug 1647734 - Fix a clang-11 snprintf complaint in JitSpewer.cpp r=nbp
We have a clang-plugin checker that wants to favor `SprintfLiteral` over `snprintf`, but for some reason it didn't catch this instance prior to clang-11.

Differential Revision: https://phabricator.services.mozilla.com/D80667
2020-06-23 16:24:04 +00:00
Adam Vandolder e82638a634 Bug 1645439 - Add eager AsyncIterator helper methods. r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D79491
2020-06-23 14:29:59 +00:00
Lars T Hansen d580a283b8 Bug 1647295 - assert that we're not using a forbidden ABI. r=rhunt
For regular calls, the combination of the system ABI and softFP is forbidden
because the code that handles multi-value returns does not contain the
special-case workarounds that are needed to move GPR results into FPRs.
Assert that we're not running into this.

Differential Revision: https://phabricator.services.mozilla.com/D80510
2020-06-23 14:56:52 +00:00
Tom Schuster dfd88da8cf Bug 1646975 - Transpile ToString instructions. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D80359
2020-06-23 10:14:07 +00:00
Jon Coppeard 69525895d4 Bug 1647319 - Use NestedIterator to implement ArenasToUnmark r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D80487
2020-06-23 10:55:33 +00:00
Jon Coppeard bfd35d8eba Bug 1647319 - Use NestedIterator to implement ZoneAllCellIter r=sfink
This also means we can simplify ArenaCellIter is it doesn't need to support reset() any more.  I had to rename the getCell/get methods returning TenuredCell*/T* to get/as to make this work.

I also changed use of |ArenaCellIter i| to |ArenaCellIter cell|, like we do for ZonesIter.

Differential Revision: https://phabricator.services.mozilla.com/D80486
2020-06-23 11:18:15 +00:00
Jon Coppeard d30d4236ea Bug 1647319 - GCZones constructor doesn't need to take ZoneSelector parameter r=sfink
There's only one place this is called with SkipAtoms and it's fine to include the atoms zone there.

Differential Revision: https://phabricator.services.mozilla.com/D80485
2020-06-23 11:11:14 +00:00
Jon Coppeard 364dcee4bd Bug 1647319 - Use NestedIterator to implement public iterators for realms and compartments r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D80484
2020-06-23 10:54:50 +00:00
Jon Coppeard 813ac1335a Bug 1647319 - Add NestedIterator template class r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D80483
2020-06-23 10:54:43 +00:00
Jon Coppeard 203797fa5e Bug 1647319 - Split off NonAtomZonesIter from ZonesIter and add AllZonesIter r=sfink
It's useful in later patches to have zone iterators whose constructors take a single parameter.

Differential Revision: https://phabricator.services.mozilla.com/D80482
2020-06-23 10:54:35 +00:00
Coroiu Cristina 767def701a Backed out 6 changesets (bug 1647319) fooooooooor build bustage at gecko/js/src/gc/GC-inl.h on a CLOSED TREE
Backed out changeset cf488a06921e (bug 1647319)
Backed out changeset 61916f49f2b3 (bug 1647319)
Backed out changeset 32b62f886374 (bug 1647319)
Backed out changeset 0e900e18ead7 (bug 1647319)
Backed out changeset bd0b3614efcf (bug 1647319)
Backed out changeset 1adf40ab95b9 (bug 1647319)
2020-06-23 11:52:10 +03:00
Jon Coppeard a4cc817d0d Bug 1647319 - Use NestedIterator to implement ArenasToUnmark r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D80487
2020-06-23 08:32:14 +00:00