7db6d76e97
19 Commits
Author | SHA1 | Message | Date | |
---|---|---|---|---|
Peter Kasting
|
db24d136fb |
C++20 fixes.
Math between disparate enums is deprecated. Use constexprs instead. This requires switching some caller code to work with the new non-enum constants also. Bug: chromium:1284275 Change-Id: Ifb3c8757ed62e2a0966120f830f0a7e282b53a16 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3661148 Auto-Submit: Peter Kasting <pkasting@chromium.org> Commit-Queue: Leszek Swirski <leszeks@chromium.org> Reviewed-by: Leszek Swirski <leszeks@chromium.org> Reviewed-by: Deepti Gandluri <gdeepti@chromium.org> Commit-Queue: Peter Kasting <pkasting@chromium.org> Cr-Commit-Position: refs/heads/main@{#80722} |
||
Jakob Gruber
|
c7cb9beca1 |
Reland "Reland "[deoptimizer] Change deopt entries into builtins""
This is a reland of |
||
Maya Lekova
|
7c7aa4fa94 |
Revert "Reland "[deoptimizer] Change deopt entries into builtins""
This reverts commit |
||
Jakob Gruber
|
fbfa9bf4ec |
Reland "[deoptimizer] Change deopt entries into builtins"
This is a reland of
|
||
Jakob Gruber
|
8bc9a7941c |
Revert "[deoptimizer] Change deopt entries into builtins"
This reverts commit
|
||
Jakob Gruber
|
7f58ced72e |
[deoptimizer] Change deopt entries into builtins
While the overall goal of this commit is to change deoptimization entries into builtins, there are multiple related things happening: - Deoptimization entries, formerly stubs (i.e. Code objects generated at runtime, guaranteed to be immovable), have been converted into builtins. The major restriction is that we now need to preserve the kRootRegister, which was formerly used on most architectures to pass the deoptimization id. The solution differs based on platform. - Renamed DEOPT_ENTRIES_OR_FOR_TESTING code kind to FOR_TESTING. - Removed heap/ support for immovable Code generation. - Removed the DeserializerData class (no longer needed). - arm64: to preserve 4-byte deopt exits, introduced a new optimization in which the final jump to the deoptimization entry is generated once per Code object, and deopt exits can continue to emit a near-call. - arm,ia32,x64: change to fixed-size deopt exits. This reduces exit sizes by 4/8, 5, and 5 bytes, respectively. On arm the deopt exit size is reduced from 12 (or 16) bytes to 8 bytes by using the same strategy as on arm64 (recalc deopt id from return address). Before: e300a002 movw r10, <id> e59fc024 ldr ip, [pc, <entry offset>] e12fff3c blx ip After: e59acb35 ldr ip, [r10, <entry offset>] e12fff3c blx ip On arm64 the deopt exit size remains 4 bytes (or 8 bytes in same cases with CFI). Additionally, up to 4 builtin jumps are emitted per Code object (max 32 bytes added overhead per Code object). Before: 9401cdae bl <entry offset> After: # eager deoptimization entry jump. f95b1f50 ldr x16, [x26, <eager entry offset>] d61f0200 br x16 # lazy deoptimization entry jump. f95b2b50 ldr x16, [x26, <lazy entry offset>] d61f0200 br x16 # the deopt exit. 97fffffc bl <eager deoptimization entry jump offset> On ia32 the deopt exit size is reduced from 10 to 5 bytes. Before: bb00000000 mov ebx,<id> e825f5372b call <entry> After: e8ea2256ba call <entry> On x64 the deopt exit size is reduced from 12 to 7 bytes. Before: 49c7c511000000 REX.W movq r13,<id> e8ea2f0700 call <entry> After: 41ff9560360000 call [r13+<entry offset>] Bug: v8:8661,v8:8768 Change-Id: I13e30aedc360474dc818fecc528ce87c3bfeed42 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2465834 Commit-Queue: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#70597} |
||
Jakob Gruber
|
29bcdaad1d |
Rename legacy code kinds
CodeKind::OPTIMIZED_CODE -> TURBOFAN Kinds are now more fine-grained and distinguish between TF, TP, NCI. CodeKind::STUB -> DEOPT_ENTRIES_OR_FOR_TESTING Code stubs (like builtins, but generated at runtime) were removed from the codebase years ago, this is the last remnant. This kind is used only for deopt entries (which should be converted into builtins) and for tests. Change-Id: I67beb15377cb60f395e9b051b25f3e5764982e93 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2440335 Auto-Submit: Jakob Gruber <jgruber@chromium.org> Commit-Queue: Mythri Alle <mythria@chromium.org> Reviewed-by: Mythri Alle <mythria@chromium.org> Cr-Commit-Position: refs/heads/master@{#70234} |
||
Jakob Gruber
|
c51041f454 |
[nci] Replace CompilationTarget with a new Code::Kind value
With the new Turbofan variants (NCI and Turboprop), we need a way to distinguish between them both during and after compilation. We initially introduced CompilationTarget to track the variant during compilation, but decided to reuse the code kind as the canonical spot to store this information instead. Why? Because it is an established mechanism, already available in most of the necessary spots (inside the pipeline, on Code objects, in profiling traces). This CL removes CompilationTarget and adds a new NATIVE_CONTEXT_INDEPENDENT kind, plus helper functions to determine various things about a given code kind (e.g.: does this code kind deopt?). As a (very large) drive-by, refactor both Code::Kind and AbstractCode::Kind into a new CodeKind enum class. Bug: v8:8888 Change-Id: Ie858b9a53311b0731630be35cf5cd108dee95b39 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2336793 Commit-Queue: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Clemens Backes <clemensb@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Dominik Inführ <dinfuehr@chromium.org> Reviewed-by: Georg Neis <neis@chromium.org> Cr-Commit-Position: refs/heads/master@{#69244} |
||
Emanuel Ziegler
|
6cd28b522a |
[wasm] Save FP & PC when calling C functions
Added implementations for ia32, arm, arm64. mips/mips64 will be committed in separate CL once the build is green again in order not to stall this CL with the supported architectures. Drive-by: Fixed issues with kScratchRegister being overwritten in case of RegExp compilation by using alternative temp register for x64. Drive-by: Added missing NoRootArrayScope to ia32, arm and arm64 RegExp macro assemblers. R=clemensb@chromium.org R=petermarshall@chromium.org R=jgruber@chromium.org Bug: chromium:1045860 Change-Id: I716d852b9bf780ae7b8d61376c6505dd3af96a50 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2071866 Commit-Queue: Emanuel Ziegler <ecmziegler@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#66482} |
||
Yang Guo
|
f455f86d89 |
Move architecture dependent files
Bug: v8:9247 Change-Id: I2f999ed3a8cc0931e5092f2ac6e709b8ff3f9e42 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1630678 Commit-Queue: Yang Guo <yangguo@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#61896} |
||
Yang Guo
|
dec3298d9c |
Move utility code to src/utils
NOPRESUBMIT=true TBR=mstarzinger@chromium.org Bug: v8:9247 Change-Id: I4cd6b79a1c2cba944f6f23caed59d4f1a4ee358b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1624217 Commit-Queue: Yang Guo <yangguo@chromium.org> Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Georg Neis <neis@chromium.org> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org> Cr-Commit-Position: refs/heads/master@{#61790} |
||
Yang Guo
|
0fa243af70 |
Move relevant files to src/execution
Bug: v8:9247 Change-Id: I79e0553e8a0d6dac2aa16b94a6c0e05b6ccde4a1 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1621934 Commit-Queue: Yang Guo <yangguo@chromium.org> Reviewed-by: Yang Guo <yangguo@chromium.org> Reviewed-by: Toon Verwaest <verwaest@chromium.org> Reviewed-by: Clemens Hammacher <clemensh@chromium.org> Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#61725} |
||
Yang Guo
|
a6eeea35cb |
Move code generation related files to src/codegen
Bug: v8:9247 TBR=bmeurer@chromium.org,neis@chromium.org NOPRESUBMIT=true Change-Id: Ia1e49d1aac09c4ff9e05d58fab9d08dd71198878 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1621931 Reviewed-by: Yang Guo <yangguo@chromium.org> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Commit-Queue: Yang Guo <yangguo@chromium.org> Cr-Commit-Position: refs/heads/master@{#61682} |
||
Pierre Langlois
|
3f1a59f47f |
[arm][arm64] Do not allocate temp registers for the write barrier.
Improve code generation for stores with write barriers slightly by using the assembler's dedicated scratch registers (x16 and x17 on Arm64, ip on Arm) instead of allocating temporaries. To do this, we've done two things: - Use ip as a scratch register when loading page flags. - TurboAssembler::CallRecordWriteStub() now takes the offset of the slot that's written to rather than its address, removing the need to allocate a temporary register for it. In essence, we've gone from: ``` ;; Do the store. stur x19, [x9, #15] ;; Check *destination* object page flags and jump out-of-line. and x4, x9, #0xfffffffffff80000 ldr x4, [x4, #8] tbnz x4, #2, #+0x1e7c | ;; Check *source* object page flags. | `-> and x4, x19, #0xfffffffffff80000 | ldr x4, [xM, #8] |,--- tbz x4, #1, #-0x1e80 | ;; Compute address of slot. | add x5, x9, #0xf (15) | ;; Setup arguments to RecordWrite | stp x2, x3, [sp, #-32]! | stp x4, lr, [sp, #16] | stp x0, x1, [sp, #-16]! | mov x0, x9 ;; Object address in x9 | mov x1, x5 ;; Slot address in x5 | movz x2, #0x0 | movz x3, #0x100000000 | ;; Call RecordWrite | ldr x16, pc+2056 | blr x16 ``` Which allocates x4 and x5 as temporaries. To: ``` stur x19, [x9, #15] and x16, x9, #0xfffffffffff80000 ;; Using x16 instead of allocating x4. ldr x16, [x16, #8] tbnz x16, #2, #+0x1e7c | `-> and x16, x19, #0xfffffffffff80000 | ldr x16, [xM, #8] |,--- tbz x16, #1, #-0x1e80 | stp x2, x3, [sp, #-32]! | stp x4, lr, [sp, #16] | stp x0, x1, [sp, #-16]! | mov x0, x9 ;; Object address still in x9. | add x1, x9, #0xf (15) ;; Compute the slot address directly. | movz x2, #0x0 | movz x3, #0x100000000 | ldr x16, pc+2056 | blr x16 ``` Finally, `RecordWriteField()` does not need an extra scratch register anymore. Change-Id: Icb71310e7b8ab1ca83ced250851456166b337d00 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1505793 Commit-Queue: Pierre Langlois <pierre.langlois@arm.com> Reviewed-by: Sigurd Schneider <sigurds@chromium.org> Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#61153} |
||
Clemens Hammacher
|
1a1f4e1ef4 |
[test] Refactor AllocateAssemblerBuffer
Refactor the AllocateAssemblerBuffer helper for the new Assembler API. This is the only non-mechanical part, all other callsites that create Assembler instances can be trivially changed to the new API. This will be done in a separate CL. R=mstarzinger@chromium.org Bug: v8:8689, v8:8562 Change-Id: I6c150748eeea778d9b70f41fd66fbb1221035a1b Reviewed-on: https://chromium-review.googlesource.com/c/1415490 Commit-Queue: Clemens Hammacher <clemensh@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#58881} |
||
Clemens Hammacher
|
91ab657e36 |
Enable TurboAssembler tests on native android
We currently don't execute the tests on android, because the error message is redirected to the android log. What we can still to though is ensuring that the call aborts the process, but just ignore the error message. R=mstarzinger@chromium.org Bug: chromium:863799 Change-Id: I54b503849358133ffe647be83eae7a964c2ac49e Reviewed-on: https://chromium-review.googlesource.com/1148444 Commit-Queue: Clemens Hammacher <clemensh@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#54839} |
||
Clemens Hammacher
|
d324382e1c |
Reland "[turboassembler] Introduce hard-abort mode"
This is a reland of
|
||
Sigurd Schneider
|
039c18e19a |
Speculatively revert "[turboassembler] Introduce hard-abort mode"
This reverts commit
|
||
Clemens Hammacher
|
a462a7854a |
[turboassembler] Introduce hard-abort mode
For checks and assertions (mostly for debug code, like stack alignment or zero extension), we had two modes: Emit a call to the {Abort} runtime function (the default), and emit a debug break (used for testing, enabled via --trap-on-abort). In wasm, where we cannot just call a runtime function because code must be isolate independent, we always used the trap-on-abort behaviour. This causes problems for our fuzzers, which do not catch SIGTRAP, and hence do not detect debug code failures. This CL introduces a third mode ("hard abort"), which calls a C function via {ExternalReference}. The C function still outputs the abort reason, but does not print the stack trace. It then aborts via "OS::Abort", just like the runtime function. This will allow fuzzers to detect the crash and even find a nice error message. Even though this looks like a lot of code churn, it is actually not. Most added lines are new tests, and other changes are minimal. R=mstarzinger@chromium.org Bug: chromium:863799 Change-Id: I77c58ff72db552d49014614436259ccfb49ba87b Reviewed-on: https://chromium-review.googlesource.com/1142163 Commit-Queue: Clemens Hammacher <clemensh@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#54592} |