v8/test/cctest/compiler
Jakob Gruber c7cb9beca1 Reland "Reland "[deoptimizer] Change deopt entries into builtins""
This is a reland of fbfa9bf4ec

The arm64 was missing proper codegen for CFI, thus sizes were off.

Original change's description:
> Reland "[deoptimizer] Change deopt entries into builtins"
>
> This is a reland of 7f58ced72e
>
> It fixes the different exit size emitted on x64/Atom CPUs due to
> performance tuning in TurboAssembler::Call. Additionally, add
> cctests to verify the fixed size exits.
>
> Original change's description:
> > [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}
>
> Tbr: ulan@chromium.org, tebbi@chromium.org, rmcilroy@chromium.org
> Bug: v8:8661,v8:8768,chromium:1140165
> Change-Id: Ibcd5c39c58a70bf2b2ac221aa375fc68d495e144
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2485506
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#70655}

Tbr: ulan@chromium.org, tebbi@chromium.org, rmcilroy@chromium.org
Bug: v8:8661
Bug: v8:8768
Bug: chromium:1140165
Change-Id: I471cc94fc085e527dc9bfb5a84b96bd907c2333f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2488682
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70672}
2020-10-21 06:01:38 +00:00
..
c-signature.h [zone] Cleanup zone allocations in src/compiler and tests, pt.3 2020-07-10 16:39:05 +00:00
call-tester.h Move handles-related files to src/handles 2019-05-23 06:00:15 +00:00
code-assembler-tester.h Reland "Reland "[deoptimizer] Change deopt entries into builtins"" 2020-10-21 06:01:38 +00:00
codegen-tester.cc Move more relevant files to src/objects 2019-05-23 08:52:30 +00:00
codegen-tester.h Reland "Reland "[deoptimizer] Change deopt entries into builtins"" 2020-10-21 06:01:38 +00:00
function-tester.cc Rename legacy code kinds 2020-09-30 15:39:23 +00:00
function-tester.h Move handles-related files to src/handles 2019-05-23 06:00:15 +00:00
graph-and-builders.h [zone] Cleanup zone allocations in src/compiler and tests, pt.3 2020-07-10 16:39:05 +00:00
serializer-tester.cc [test] Only update FLAG_local_heaps if still disabled 2020-09-22 15:09:38 +00:00
serializer-tester.h [iwyu] Add missing includes of <memory> for std::unique_ptr 2019-09-13 17:13:36 +00:00
test-basic-block-profiler.cc [diagnostics] Support --turbo-profiling for builtins 2020-05-21 16:31:52 +00:00
test-branch-combine.cc Move more relevant files to src/objects 2019-05-23 08:52:30 +00:00
test-code-assembler.cc [CSA] Tnodify CodeAssembler::Parameter 2020-10-01 16:07:03 +00:00
test-code-generator.cc Reland "Reland "[deoptimizer] Change deopt entries into builtins"" 2020-10-21 06:01:38 +00:00
test-gap-resolver.cc [zone] Cleanup zone allocations in src/compiler and tests, pt.3 2020-07-10 16:39:05 +00:00
test-graph-visualizer.cc Reland "[zone-compr] Introduce ZoneTypeTraits and ZoneCompression" 2020-07-31 11:43:08 +00:00
test-instruction-scheduler.cc Reland "[zone-compr] Introduce ZoneTypeTraits and ZoneCompression" 2020-07-31 11:43:08 +00:00
test-instruction.cc [zone-compr] Add kCompressGraphZone constant 2020-07-24 08:50:11 +00:00
test-js-constant-cache.cc [compiler] Remove persistent handles as a broker parameter 2020-08-13 08:13:33 +00:00
test-js-context-specialization.cc [compiler] Fix --trace-turbo-reduction in the presence of direct reads 2020-09-11 17:21:43 +00:00
test-js-typed-lowering.cc [compiler] Fix --trace-turbo-reduction in the presence of direct reads 2020-09-11 17:21:43 +00:00
test-jump-threading.cc Augment jump threading to handle redundant returns 2020-07-29 18:36:07 +00:00
test-linkage.cc Reland "Reland "[deoptimizer] Change deopt entries into builtins"" 2020-10-21 06:01:38 +00:00
test-loop-analysis.cc [zone-compr] Add kCompressGraphZone constant 2020-07-24 08:50:11 +00:00
test-machine-operator-reducer.cc [compiler] Fix --trace-turbo-reduction in the presence of direct reads 2020-09-11 17:21:43 +00:00
test-multiple-return.cc [tests] Run TestReturnMultipleValuesLargeFrame just once 2020-10-07 14:55:30 +00:00
test-node.cc Reland "[zone-compr] Introduce ZoneTypeTraits and ZoneCompression" 2020-07-31 11:43:08 +00:00
test-operator.cc Normalize casing of hexadecimal digits 2017-12-02 01:24:40 +00:00
test-representation-change.cc [compiler] Remove persistent handles as a broker parameter 2020-08-13 08:13:33 +00:00
test-run-bytecode-graph-builder.cc Rename legacy code kinds 2020-09-30 15:39:23 +00:00
test-run-calls-to-external-references.cc [turbofan] Add float unit tests for c-linkage/x64 2020-09-28 16:46:40 +00:00
test-run-deopt.cc Move relevant files to src/execution 2019-05-22 08:36:33 +00:00
test-run-intrinsics.cc [nci] Refactor optimized compilation info flags 2020-06-10 13:46:10 +00:00
test-run-jsbranches.cc Move more relevant files to src/objects 2019-05-23 08:52:30 +00:00
test-run-jscalls.cc Move remaining files in src/ 2019-05-24 18:24:36 +00:00
test-run-jsexceptions.cc Move more relevant files to src/objects 2019-05-23 08:52:30 +00:00
test-run-jsobjects.cc [keys] Handle RangeError in GetKeysWithPrototypeInfoCache 2020-03-04 13:38:10 +00:00
test-run-jsops.cc Move more relevant files to src/objects 2019-05-23 08:52:30 +00:00
test-run-load-store.cc [ptr-compr] Enable pointer compression on s390x 2020-03-31 17:06:17 +00:00
test-run-machops.cc PPC/s390: [turbofan][wasm] Improved float32 to int32. 2020-07-28 13:32:51 +00:00
test-run-native-calls.cc Reland "Reland "[deoptimizer] Change deopt entries into builtins"" 2020-10-21 06:01:38 +00:00
test-run-retpoline.cc [CSA] Tnodify CodeAssembler::Parameter 2020-10-01 16:07:03 +00:00
test-run-stackcheck.cc Move relevant files to src/execution 2019-05-22 08:36:33 +00:00
test-run-tail-calls.cc [CSA] Tnodify CodeAssembler::Parameter 2020-10-01 16:07:03 +00:00
test-run-unwinding-info.cc Remove --perf-prof flag on non-linux 2020-01-10 13:58:50 +00:00
test-run-variables.cc Move more relevant files to src/objects 2019-05-23 08:52:30 +00:00
value-helper.cc Reland "[test] Avoid unnecessary std::vector allocations" 2017-10-19 08:47:31 +00:00
value-helper.h [base] Fix {StaticCharVector} and add {StaticOneByteVector} 2020-04-17 18:45:32 +00:00