- 21 Aug, 2018 1 commit
-
-
Toon Verwaest authored
This reverts the following 3 CLs: Revert "[scanner] Templatize scan functions by encoding" Revert "[asm] Remove invalid static cast of character stream" Revert "[scanner] Prepare CharacterStreams for specializing scanner and parser by character type" The original idea behind this work was to avoid copying, converting and buffering characters to be scanned by specializing the scanner functions. The additional benefit was for scanner functions to have a bigger window over the input. Even though we can get a pretty nice speedup from having a larger window, in practice this rarely helps. The cost is a larger binary. Since we can't eagerly convert utf8 to utf16 due to memory overhead, we'd also need to have a specialized version of the scanner just for utf8. That's pretty complex, and likely won't be better than simply bulk converting and buffering utf8 as utf16. Change-Id: Ic3564683932a0097e3f9f51cd88f62c6ac879dcb Reviewed-on: https://chromium-review.googlesource.com/1183190Reviewed-by:
Andreas Haas <ahaas@chromium.org> Reviewed-by:
Marja Hölttä <marja@chromium.org> Commit-Queue: Toon Verwaest <verwaest@chromium.org> Cr-Commit-Position: refs/heads/master@{#55258}
-
- 01 Aug, 2018 1 commit
-
-
Toon Verwaest authored
This templatizes CharacterStream by char type, and makes them subclass ScannerStream. Methods that are widely used by tests are marked virtual on ScannerStream and final on CharacterStream<T> so the specialized scanner will know what to call. ParseInfo passes around ScannerStream, but the scanner requires the explicit CharacterStream<T>. Since AdvanceUntil is templatized by FunctionType, I couldn't mark that virtual; so instead I adjusted those tests to operate directly on ucs2 (not utf8 since we'll drop that in the future). In the end no functionality was changed. Some calls became virtual in tests. This is mainly just preparation. Change-Id: I0b4def65d3eb8fa5c806027c7e9123a590ebbdb5 Reviewed-on: https://chromium-review.googlesource.com/1156690 Commit-Queue: Toon Verwaest <verwaest@chromium.org> Reviewed-by:
Michael Starzinger <mstarzinger@chromium.org> Reviewed-by:
Marja Hölttä <marja@chromium.org> Cr-Commit-Position: refs/heads/master@{#54848}
-
- 12 Jul, 2018 1 commit
-
-
Clemens Hammacher authored
An unordered_map typically provides better performance. Instead of a compare function, we now need a hash function and equality defined on {Signature<T>}. R=mstarzinger@chromium.org Bug: chromium:862123 Change-Id: Iba71030f91949d7453740c884de1d8a4f921c618 Reviewed-on: https://chromium-review.googlesource.com/1131182 Commit-Queue: Clemens Hammacher <clemensh@chromium.org> Reviewed-by:
Michael Starzinger <mstarzinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#54404}
-
- 25 Sep, 2017 1 commit
-
-
Michael Starzinger authored
This fixes the signatures of "Math.ceil", "Math.floor" and "Math.sqrt" from "(float?) -> float" to "(float?) -> floatish" which avoids using a resulting float value without coercing the value via explicit "fround" annotations. This ensures proper ECMAScript semantics are maintained. R=clemensh@chromium.org TEST=mjsunit/regress/regress-6838-2 BUG=v8:6838 Change-Id: Ib5821641265bc862184adb270e8dbf8c703fdfb0 Reviewed-on: https://chromium-review.googlesource.com/681694Reviewed-by:
Clemens Hammacher <clemensh@chromium.org> Commit-Queue: Michael Starzinger <mstarzinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#48142}
-
- 22 Aug, 2017 2 commits
-
-
Ross McIlroy authored
Instead of creating a new character stream to re-parse the asm.js module, use the existing stream which was used by the parser. By doing this, we avoid accessing the heap if the original character stream is a streaming source or an external string, which will enable asm.js verification to run off-thread in those situations. BUG=v8:5203 Change-Id: I5dbf83c993512eb2f3dd709120e152e3f9900bdf Reviewed-on: https://chromium-review.googlesource.com/616723Reviewed-by:
Michael Starzinger <mstarzinger@chromium.org> Reviewed-by:
Andreas Haas <ahaas@chromium.org> Reviewed-by:
Marja Hölttä <marja@chromium.org> Commit-Queue: Ross McIlroy <rmcilroy@chromium.org> Cr-Commit-Position: refs/heads/master@{#47500}
-
Michael Starzinger authored
This makes sure that shift expressions (not wrapped in parentheses) can appear as part of the index in a valid heap access expression. Only the last operand of a sequence of shift expressions is taken into account when validating the heap access. R=jarin@chromium.org TEST=mjsunit/regress/regress-6700 BUG=v8:6700,chromium:754751 Change-Id: Icc7a71bd64461da4d3daea41b995964e3dfc6dc6 Reviewed-on: https://chromium-review.googlesource.com/623811 Commit-Queue: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by:
Jaroslav Sevcik <jarin@chromium.org> Reviewed-by:
Andreas Haas <ahaas@chromium.org> Cr-Commit-Position: refs/heads/master@{#47497}
-
- 26 Jul, 2017 1 commit
-
-
Michael Starzinger authored
This switches the {StdlibSet} to be a data structure that does not require dynamic memory allocation. This makes it easier to carry it around as part of a {CompilationJob} and serialize it into the heap. R=clemensh@chromium.org Change-Id: I77b2353cfdcd9438a26f04d00749159fed9b9b6c Reviewed-on: https://chromium-review.googlesource.com/584868 Commit-Queue: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by:
Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#46889}
-
- 25 Jul, 2017 1 commit
-
-
Ross McIlroy authored
Moves AsmJs compilation into an AsmJs compilation job. This enables it to be treated like other unoptimized compilations and avoids some special-casing in compiler.cc. BUG=v8:5203 Change-Id: I71ad27e3f72815b4c4074634fff0d168a9c89102 Reviewed-on: https://chromium-review.googlesource.com/581487Reviewed-by:
Clemens Hammacher <clemensh@chromium.org> Reviewed-by:
Michael Starzinger <mstarzinger@chromium.org> Commit-Queue: Ross McIlroy <rmcilroy@chromium.org> Cr-Commit-Position: refs/heads/master@{#46863}
-
- 31 May, 2017 1 commit
-
-
Michael Starzinger authored
This removes any kind of heap access from the asm.js validator internals and hence makes it independent of a specific Isolate. It is a precursor towards potentially being able to run validation while streaming. R=clemensh@chromium.org Change-Id: Ia3770bf03bb973b56de897b27be60d7e050af2c4 Reviewed-on: https://chromium-review.googlesource.com/518188 Commit-Queue: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by:
Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#45628}
-
- 30 May, 2017 1 commit
-
-
Clemens Hammacher authored
This CL replaces the last usages of std::vector in the AsmJsParser by ZoneVector. This allows to also measure the memory consumption of these vectors, since it is now contained in the zone memory. ZoneVectors are reused to avoid accumulating lots of unused memory. This also saves 2.6% performance (avg over 1000 runs) on my local workstation. R=mstarzinger@chromium.org Change-Id: I04c96db558d9c362b1494ddd9e975edf2783403c Reviewed-on: https://chromium-review.googlesource.com/516985Reviewed-by:
Michael Starzinger <mstarzinger@chromium.org> Commit-Queue: Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#45591}
-
- 19 May, 2017 1 commit
-
-
Michael Starzinger authored
This fixes crashes during validation when trying to construct modules with excessively large function tables. The {WasmModuleBuilder} now gracefully checks against existing WebAssembly implementation limits. R=clemensh@chromium.org TEST=mjsunit/regress/regress-crbug-715455 BUG=chromium:715455 Change-Id: Ia9738cb0b49a1eb4caf073b75301c0303f295699 Reviewed-on: https://chromium-review.googlesource.com/509530 Commit-Queue: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by:
Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#45429}
-
- 15 May, 2017 1 commit
-
-
Michael Starzinger authored
This makes sure that the evaluation result of the first expression in for-statements is properly dropped, to leave the stack in a balanced state after the statement. It also makes sure validation failures in said expression are handled correctly. R=clemensh@chromium.org TEST=mjsunit/regress/regress-crbug-721835 BUG=chromium:721835 Change-Id: I7e6cff4cea0bbf5aad6a3459e27a08ea814dbdbe Reviewed-on: https://chromium-review.googlesource.com/506148 Commit-Queue: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by:
Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#45299}
-
- 05 May, 2017 2 commits
-
-
Michael Starzinger authored
R=clemensh@chromium.org TEST=message/asm-import-wrong-object BUG=chromium:718653 Change-Id: Ib903d7041ffb6a67c1b3c7be3e0f9455229acd90 Reviewed-on: https://chromium-review.googlesource.com/497747Reviewed-by:
Clemens Hammacher <clemensh@chromium.org> Commit-Queue: Michael Starzinger <mstarzinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#45129}
-
Michael Starzinger authored
R=clemensh@chromium.org BUG=v8:6127 Change-Id: I6a098151fef14c0c76c1762d99316a3ae7d12a8e Reviewed-on: https://chromium-review.googlesource.com/496266 Commit-Queue: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by:
Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#45119}
-
- 26 Apr, 2017 2 commits
-
-
Michael Starzinger authored
R=clemensh@chromium.org TEST=mjsunit/asm/int32-mul BUG=chromium:715482 Change-Id: I525e901fd6ade101999694a53d5147b6e4ccc2e5 Reviewed-on: https://chromium-review.googlesource.com/488024Reviewed-by:
Clemens Hammacher <clemensh@chromium.org> Commit-Queue: Michael Starzinger <mstarzinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#44892}
-
Michael Starzinger authored
This fixes the bounds checking of "unsigned" numeric literals (those that do not contains dots) by the parser. In particular this fixes a bogus truncation to 32-bit in the scanner. It also makes the scanner more robust by limiting the range of those numeric literals, hence completely avoiding rounding loss or truncation errors. R=clemensh@chromium.org TEST=unittests/AsmJsScannerTest.UnsignedNumbers BUG=v8:6298 Change-Id: Id31ab3c652e99fa8d3d6663315768e1bfaf3b773 Reviewed-on: https://chromium-review.googlesource.com/486881Reviewed-by:
Clemens Hammacher <clemensh@chromium.org> Commit-Queue: Michael Starzinger <mstarzinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#44890}
-
- 25 Apr, 2017 1 commit
-
-
Michael Starzinger authored
This unifies the memory management of identifier strings passed between the scanner, parser and module builder. The following scheme is used: - The scanner does not create copies of identifier strings itself, it exposes a reference to the current identifier. This reference becomes invalid as soon as the scanner advanced. - The parser preserves a single copy of each identifier that is stored in any data structure. That copy is allocated in the zone, lifetime is coupled to that of the zone. - The module builder can use all such identifiers by reference, as long as its lifetime is also coupled to the same zone. Note that the module builder still creates redundant copies for some identifiers (in order to maintain backwards compatibility with the old AST-based parser). This can be fixed once the "old validator" has been removed. R=clemensh@chromium.org BUG=v8:6127 Change-Id: I8611d162e87730045a6061d08c3fe841daae8a7d Reviewed-on: https://chromium-review.googlesource.com/484439 Commit-Queue: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by:
Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#44836}
-
- 21 Apr, 2017 2 commits
-
-
Michael Starzinger authored
This simplifies the double-indirection used for the signature cache in function imports and also reduces the memory its memory footprint. Also switch to use the local zone as an underlying storage. R=rossberg@chromium.org BUG=v8:6127 Change-Id: I8bc6cf13f2ce9ffa02485e76b7e36f389c9e02e5 Reviewed-on: https://chromium-review.googlesource.com/483443Reviewed-by:
Andreas Rossberg <rossberg@chromium.org> Commit-Queue: Michael Starzinger <mstarzinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#44768}
-
Michael Starzinger authored
This also removes a broken optimization regarding immutable (i.e. const) global variables. For now mutable and immutable global variables are treated the same and hence copied during module initialization. R=rossberg@chromium.org TEST=mjsunit/asm/global-imports BUG=v8:6279 Change-Id: I020fc12036dc534f5a62fb43f5c6fdb252314e62 Reviewed-on: https://chromium-review.googlesource.com/483360Reviewed-by:
Andreas Rossberg <rossberg@chromium.org> Commit-Queue: Michael Starzinger <mstarzinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#44763}
-
- 19 Apr, 2017 2 commits
-
-
Michael Starzinger authored
This uses the common macro lists instead of duplicating the list of available math functions and values in {AsmJs::IsStdlibValid}. R=rossberg@chromium.org BUG=v8:6127 Change-Id: Ic480d74bb0b5f0f425d1e601e5128fa6f466bea1 Reviewed-on: https://chromium-review.googlesource.com/481260Reviewed-by:
Andreas Rossberg <rossberg@chromium.org> Commit-Queue: Michael Starzinger <mstarzinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#44725}
-
Michael Starzinger authored
This fixes source position tracking within the "increment" expression of a for-statement. The old {StashCode} method was inherently incompatible with side tables like the source position table, as it would leave them untouched while mutating the bytecode stream. It was hence trimmed down to {DeleteCode}. R=bradnelson@chromium.org BUG=v8:6127 Change-Id: I7a5ff60cd5334208c44b165c8b54144d9ae83209 Reviewed-on: https://chromium-review.googlesource.com/480301 Commit-Queue: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by:
Brad Nelson <bradnelson@chromium.org> Cr-Commit-Position: refs/heads/master@{#44714}
-
- 18 Apr, 2017 1 commit
-
-
Michael Starzinger authored
This switches the parser to use token positions (i.e. {Position}) instead of stream positions (i.e. {GetPosition}) everywhere. Access to the latter is being removed as it is unsupported when the scanner is in rewind state anyways. This prevents "skipping" a token when seeking. R=bradnelson@chromium.org BUG=v8:6127 Change-Id: I9c13dd20a981061a2bccc4fb57e5c57d2a64ac5c Reviewed-on: https://chromium-review.googlesource.com/480300Reviewed-by:
Brad Nelson <bradnelson@chromium.org> Commit-Queue: Brad Nelson <bradnelson@chromium.org> Cr-Commit-Position: refs/heads/master@{#44699}
-
- 13 Apr, 2017 1 commit
-
-
Michael Starzinger authored
This fixes the validation of "|0" annotations of call sites that are used to indicate a "signed" return type of functions. We use lookahead during call validation and request deferred validation as part of the actual OR-expression. Special care has to be taken to get precedence levels of all involved operators right. R=clemensh@chromium.org TEST=mjsunit/asm/call-annotation BUG=v8:6183 Change-Id: If0586f669e7cee26a13425b0fd9f41098e852d68 Reviewed-on: https://chromium-review.googlesource.com/475871 Commit-Queue: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by:
Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#44639}
-
- 05 Apr, 2017 1 commit
-
-
Michael Starzinger authored
This extends the test coverage for source position tracking of ToNumber conversion to also test conversion to "double" type. It also fixes the discovered inconsistencies. Note that the conversion to "float" remains untested as imported functions are not allowed have "float" return type. R=clemensh@chromium.org TEST=mjsunit/wasm/asm-wasm-exception-in-tonumber BUG=v8:6127 Change-Id: I6c59b7a24456a585a814f19a86eb9447ac5098ab Reviewed-on: https://chromium-review.googlesource.com/467251 Commit-Queue: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by:
Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#44409}
-
- 04 Apr, 2017 1 commit
-
-
Michael Starzinger authored
This makes temporary variables nestable and fixes borked nesting with function table calls by introducing a {TemporaryVariableScope} helper. R=clemensh@chromium.org TEST=mjsunit/regress/regress-6196 BUG=v8:6196 Change-Id: Ie760f27ce9ede3d4d5dacdebdc295c56cc666970 Reviewed-on: https://chromium-review.googlesource.com/467327 Commit-Queue: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by:
Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#44367}
-
- 03 Apr, 2017 1 commit
-
-
Michael Starzinger authored
This adds support for tracking token positions in the asm.js scanner and uses these positions to emit a mapping from WASM to asm.js positions. Note that the mapping is still incomplete (some call sites are not yet covered). R=clemensh@chromium.org TEST=debugger/debug/wasm/asm-debug BUG=v8:6127 Change-Id: Ic8aad1a85e7d9e19da2eec523fcc73d4984afcc8 Reviewed-on: https://chromium-review.googlesource.com/466046 Commit-Queue: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by:
Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#44335}
-
- 28 Mar, 2017 3 commits
-
-
bradnelson authored
Fix a few items broken during review of scanner + parser: * Make the scanner retain stale newline state on a rewind (as otherwise it must be able to correctly rewind that too, though it doesn't need it). (Probably should revisit). * Change StashCode in the builder skip to the zero case, as it crashes for some reason (added TODO). Also fix: * Drop test based on constant expression evaluation in main parser * Support constant defined based on existing constant. * Type constants as signed. * Added a check that all used functions are defined eventually. * Zone allocate strings for simplicity (TODOs to refactor better). BUG=v8:6090 BUG=v8:4203 R=mstarzinger@chromium.org,marja@chromium.org,vogelheim@chromium.org Review-Url: https://codereview.chromium.org/2771183002 Cr-Original-Commit-Position: refs/heads/master@{#44200} Committed: https://chromium.googlesource.com/v8/v8/+/be0dbdd679b60c31d480d7635e579787a6a218df Review-Url: https://codereview.chromium.org/2771183002 Cr-Commit-Position: refs/heads/master@{#44203}
-
bradnelson authored
Revert of [wasm][asm.js] Fix and enable several asm.js tests with the new parser. (patchset #10 id:180001 of https://codereview.chromium.org/2771183002/ ) Reason for revert: Fails on gc-stress. Original issue's description: > [wasm][asm.js] Fix and enable several asm.js tests with the new parser. > > Fix a few items broken during review of scanner + parser: > * Make the scanner retain stale newline state on a rewind (as otherwise it must be able to correctly rewind that too, though it doesn't need it). (Probably should revisit). > * Change StashCode in the builder skip to the zero case, as it crashes for some reason (added TODO). > > Also fix: > * Drop test based on constant expression evaluation in main parser > * Support constant defined based on existing constant. > * Type constants as signed. > * Added a check that all used functions are defined eventually. > * Zone allocate strings for simplicity (TODOs to refactor better). > > BUG=v8:6090 > BUG=v8:4203 > R=mstarzinger@chromium.org,marja@chromium.org,vogelheim@chromium.org > > Review-Url: https://codereview.chromium.org/2771183002 > Cr-Commit-Position: refs/heads/master@{#44200} > Committed: https://chromium.googlesource.com/v8/v8/+/be0dbdd679b60c31d480d7635e579787a6a218df TBR=clemensh@chromium.org,bradnelson@google.com,marja@chromium.org,mstarzinger@chromium.org,vogelheim@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=v8:6090 Review-Url: https://codereview.chromium.org/2782613002 Cr-Commit-Position: refs/heads/master@{#44201}
-
bradnelson authored
Fix a few items broken during review of scanner + parser: * Make the scanner retain stale newline state on a rewind (as otherwise it must be able to correctly rewind that too, though it doesn't need it). (Probably should revisit). * Change StashCode in the builder skip to the zero case, as it crashes for some reason (added TODO). Also fix: * Drop test based on constant expression evaluation in main parser * Support constant defined based on existing constant. * Type constants as signed. * Added a check that all used functions are defined eventually. * Zone allocate strings for simplicity (TODOs to refactor better). BUG=v8:6090 BUG=v8:4203 R=mstarzinger@chromium.org,marja@chromium.org,vogelheim@chromium.org Review-Url: https://codereview.chromium.org/2771183002 Cr-Commit-Position: refs/heads/master@{#44200}
-
- 24 Mar, 2017 1 commit
-
-
bradnelson authored
Add the --fast-validate-asm option, which directs asm.js code to a new parser + validator + wasm code generator, which is then compiled using WebAssembly. This parser takes advantage of asm.js structure to linearly parse asm.js code, keeping a scope stack + a few additional tables to track varibles. BUG=v8:6090 BUG=v8:4203 R=mstarzinger@chromium.org,marja@chromium.org,vogelheim@chromium.org,kschimpf@chromium.org Review-Url: https://codereview.chromium.org/2757693003 Cr-Commit-Position: refs/heads/master@{#44084}
-