v8/test/cctest/compiler
Igor Sheludko d2ab873de9 Reland^2 "[csa] Fix semantics of PopAndReturn"
This is a reland of 3593ee832c

The MSAN doesn't seem to be considering initializing stores via inline
assembly as such (in a new cctest helper GetStackPointer()), so this
reland attempt fixes the issue and ensures that the MSAN bot is happy.

Original change's description:
> Reland "[csa] Fix semantics of PopAndReturn"
>
> This is a reland of 5e5eaf7954
>
> This CL fixes the "function returns address of local variable" issue
> which GCC was complaining about by using inline assembly instead of
> address of a local for getting stack pointer approximation.
>
> Original change's description:
> > [csa] Fix semantics of PopAndReturn
> >
> > This CL prohibits using PopAndReturn from the builtins that
> > have calling convention with arguments on the stack.
> >
> > This CL also updates the PopAndReturn tests so that even off-by-one
> > errors in the number of poped arguments are caught which was not the
> > case before.
> >
> > Motivation:
> >
> > PopAndReturn is supposed to be using ONLY in CSA/Torque builtins for
> > dropping ALL JS arguments that are currently located on the stack.
> > Disallowing PopAndReturn in builtins with stack arguments simplifies
> > semantics of this instruction because in case of presence of declared
> > stack parameters it's impossible to distinguish the following cases:
> > 1) stack parameter is included in JS arguments (and therefore it will
> >    be dropped as a part of 'pop' number of arguments),
> > 2) stack parameter is NOT included in JS arguments (and therefore it
> >    should be dropped in ADDITION to the 'pop' number of arguments).
> >
> > This issue wasn't noticed before because builtins with stack parameters
> > relied on adapter frames machinery to ensure that the expected
> > parameters are present on the stack, but on the same time the adapter
> > frame tearing down code was effectively recovering the stack pointer
> > potentially broken by the CSA builtin.
> >
> > Once we get rid of the arguments adapter frames keeping stack pointer
> > in a valid state becomes crucial.
> >
> > Bug: v8:5269, v8:10201
> > Change-Id: Id3ea9730bb0d41d17999c73136c4dfada374a822
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2460819
> > Commit-Queue: Igor Sheludko <ishell@chromium.org>
> > Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#70454}
>
> Tbr: tebbi@chromium.org
> Bug: v8:5269
> Bug: v8:10201
> Change-Id: Ic1a05fcc4efd2068538bff28189545cfd2617d9b
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2465839
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Victor Gomes <victorgomes@chromium.org>
> Commit-Queue: Igor Sheludko <ishell@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#70483}

Tbr: tebbi@chromium.org
Cq-Include-Trybots: luci.v8.try:v8_linux64_msan_rel_ng
Bug: v8:5269
Bug: v8:10201
Change-Id: Ib09af2d1260bb42ac26aabface14e6b83b3efec4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2467847
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70492}
2020-10-13 16:58:01 +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^2 "[csa] Fix semantics of PopAndReturn" 2020-10-13 16:58:01 +00:00
codegen-tester.cc Move more relevant files to src/objects 2019-05-23 08:52:30 +00:00
codegen-tester.h Rename legacy code kinds 2020-09-30 15:39:23 +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 [CSA] Tnodify CodeAssembler::Parameter 2020-10-01 16:07:03 +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 Rename legacy code kinds 2020-09-30 15:39:23 +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 Rename legacy code kinds 2020-09-30 15:39:23 +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