v8/test/cctest
Jakob Linke ee0c7f459d Fix CodeMoveEvent
The invariants in this method are fairly strict since it is called
during object evacution and thus a) objects may be in transitory states
and b) multiple threads are working on evacuation objects concurrently.

Previously, this method ensured valid object accesses because only the
object currently being observed by ProfilingMigrationObserver was
accessed. This changed with crrev.com/c/4178821, where we (incorrectly)
also accessed another object (InstructionStream::code), leading to data
races and incorrect behavior.

This CL fixes that problem by changing LogEventListener API as follows:

 void CodeMoveEvent(InstructionStream from, InstructionStream to);
 void BytecodeMoveEvent(BytecodeArray from, BytecodeArray to);

With this change we again correctly observe invariants, and also remove
one use of AbstractCode.

Bug: v8:13654
Change-Id: Ida022e8c7f14d821e1139f025edc71c20fa386c0
Fixed: chromium:1409786
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4194192
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85474}
2023-01-25 13:55:28 +00:00
..
compiler [gap-resolver] Emit move based on destination representation 2023-01-19 14:32:57 +00:00
heap [heap] Introduce getters for MemoryReducer::State 2023-01-23 07:54:44 +00:00
torque Various post-Code rename cleanups 2023-01-18 16:26:26 +00:00
wasm Various post-Code rename cleanups 2023-01-18 16:26:26 +00:00
assembler-helper-arm.cc Various post-Code rename cleanups 2023-01-18 16:26:26 +00:00
assembler-helper-arm.h Various post-Code rename cleanups 2023-01-18 16:26:26 +00:00
BUILD.gn [turbofan] Add the v8_enable_turbofan build option 2023-01-11 10:57:54 +00:00
cctest-utils.h Reland "[riscv32] Add RISCV32 backend" 2022-08-04 12:47:44 +00:00
cctest.cc Various post-Code rename cleanups 2023-01-18 16:26:26 +00:00
cctest.h [heap] Enable conservative stack scanning on tests 2022-12-14 16:14:12 +00:00
cctest.status [static-roots] Test to ensure mksnapshot creates a predictable r/o heap 2023-01-19 17:27:58 +00:00
collector.h [base] Move utils/vector.h to base/vector.h 2021-06-18 13:33:13 +00:00
DEPS Reland "[tracing] Roll perfetto @ 28b633cd" 2019-09-06 13:42:02 +00:00
expression-type-collector-macros.h [cleanup] Fix remaining (D)CHECK macro usages 2017-10-18 10:12:31 +00:00
feedback-vector-helper.h [test] Migrate cctest/test-feedback-vector to unittests/ 2022-08-22 16:36:28 +00:00
jsonstream-helper.h [profiler] add Serialize to v8::CpuProfile 2022-10-25 10:49:04 +00:00
manually-externalized-buffer.h [api] Deprecate [Shared]ArrayBuffer::Externalize/GetContents and constructors 2019-10-29 22:01:54 +00:00
OWNERS Update OWNERS in test/* 2021-02-25 14:26:24 +00:00
print-extension.cc Reland "[include] Split out v8.h" 2021-08-24 13:08:55 +00:00
print-extension.h Reland "[include] Split out v8.h" 2021-08-24 13:08:55 +00:00
profiler-extension.cc Reland "[include] Split out v8.h" 2021-08-24 13:08:55 +00:00
profiler-extension.h Reland "[include] Split out v8.h" 2021-08-24 13:08:55 +00:00
setup-isolate-for-tests.cc [static-roots] Refactor setup_isolate_delegate 2022-11-29 16:23:19 +00:00
setup-isolate-for-tests.h [static-roots] Refactor setup_isolate_delegate 2022-11-29 16:23:19 +00:00
test-accessor-assembler.cc Various post-Code rename cleanups 2023-01-18 16:26:26 +00:00
test-accessors.cc Rename CodeDataContainer to Code 2023-01-18 08:44:08 +00:00
test-allocation.cc Reland "Reland "[v8] Use |AllocateAtLeast| for resizing v8 zones."" 2022-10-19 11:55:27 +00:00
test-api-array-buffer.cc [rab/gsab,api] Add resizable BackingStore creation 2022-12-14 01:54:00 +00:00
test-api-interceptors.cc [cctest] Use v8_flags for accessing flag values 2022-09-16 08:22:03 +00:00
test-api-stack-traces.cc [cctest] Use v8_flags for accessing flag values 2022-09-16 08:22:03 +00:00
test-api-typed-array.cc [cctest] Use v8_flags for accessing flag values 2022-09-16 08:22:03 +00:00
test-api.cc [heap] Move the Stack object from ThreadLocalTop to Isolate 2023-01-23 22:04:33 +00:00
test-api.h [test] Remove some unused includes 2022-07-18 12:59:03 +00:00
test-assembler-arm64.cc Various post-Code rename cleanups 2023-01-18 16:26:26 +00:00
test-assembler-arm.cc Various post-Code rename cleanups 2023-01-18 16:26:26 +00:00
test-assembler-ia32.cc Various post-Code rename cleanups 2023-01-18 16:26:26 +00:00
test-assembler-loong64.cc [loong64][mips64] Rename Code to InstructionStream 2023-01-18 07:46:59 +00:00
test-assembler-mips64.cc [loong64][mips64] Rename Code to InstructionStream 2023-01-18 07:46:59 +00:00
test-assembler-ppc.cc PPC/s390: Various post-Code rename cleanups 2023-01-18 19:56:42 +00:00
test-assembler-riscv32.cc [riscv] Fix cctest/test-assembler-riscv*/RISCV_UTEST_FLOAT_WIDENING_vfwredosum_vv. 2022-09-21 08:25:27 +00:00
test-assembler-riscv64.cc [riscv] Fix cctest/test-assembler-riscv*/RISCV_UTEST_FLOAT_WIDENING_vfwredosum_vv. 2022-09-21 08:25:27 +00:00
test-assembler-s390.cc PPC/s390: Various post-Code rename cleanups 2023-01-18 19:56:42 +00:00
test-code-stub-assembler.cc Various post-Code rename cleanups 2023-01-18 16:26:26 +00:00
test-constantpool.cc PPC: [cleanup] Replace all remaining Min/Max uses with std::min/max 2020-11-25 08:49:53 +00:00
test-cpu-profiler.cc Fix CodeMoveEvent 2023-01-25 13:55:28 +00:00
test-debug-helper.cc Fix failing test test-debug-helper/GetObjectProperties 2023-01-19 10:00:28 +00:00
test-debug.cc [heap] Move the Stack object from ThreadLocalTop to Isolate 2023-01-23 22:04:33 +00:00
test-descriptor-array.cc Various post-Code rename cleanups 2023-01-18 16:26:26 +00:00
test-disasm-regex-helper.cc Rename CodeDataContainer to Code 2023-01-18 08:44:08 +00:00
test-disasm-regex-helper.h Unify naming convention for tests and filter them in TestLoader for cctest 2022-04-20 14:19:55 +00:00
test-field-type-tracking.cc Various post-Code rename cleanups 2023-01-18 16:26:26 +00:00
test-func-name-inference.cc [test] Remove some unused includes 2022-07-18 12:59:03 +00:00
test-fuzz-arm64.cc Move architecture dependent files 2019-05-28 14:02:15 +00:00
test-heap-profiler.cc Various post-Code rename cleanups 2023-01-18 16:26:26 +00:00
test-helper-riscv32.cc [cctest] Use v8_flags for accessing flag values 2022-09-16 08:22:03 +00:00
test-helper-riscv32.h Reland "[riscv32] Add RISCV32 backend" 2022-08-04 12:47:44 +00:00
test-helper-riscv64.cc [cctest] Use v8_flags for accessing flag values 2022-09-16 08:22:03 +00:00
test-helper-riscv64.h [riscv] Fix cctest/test-assembler-riscv64/RISCV_UTEST_swlwu. 2022-09-09 13:19:26 +00:00
test-icache.cc Reland "[riscv32] Add RISCV32 backend" 2022-08-04 12:47:44 +00:00
test-ignition-statistics-extension.cc [cctest] Use v8_flags for accessing flag values 2022-09-16 08:22:03 +00:00
test-inobject-slack-tracking.cc [cctest] Use v8_flags for accessing flag values 2022-09-16 08:22:03 +00:00
test-javascript-arm64.cc [test] Remove some unused includes 2022-07-18 12:59:03 +00:00
test-js-arm64-variables.cc [test] Remove some unused includes 2022-07-18 12:59:03 +00:00
test-js-to-wasm.cc [wasm] Use v8_flags for accessing flag values 2022-08-29 12:43:46 +00:00
test-js-weak-refs.cc [heap] Enable conservative stack scanning on tests 2022-12-14 16:14:12 +00:00
test-liveedit.cc [cctest] Use v8_flags for accessing flag values 2022-09-16 08:22:03 +00:00
test-lockers.cc [heap] Move the Stack object from ThreadLocalTop to Isolate 2023-01-23 22:04:33 +00:00
test-log-stack-tracer.cc [cctest] Use v8_flags for accessing flag values 2022-09-16 08:22:03 +00:00
test-macro-assembler-arm.cc Various post-Code rename cleanups 2023-01-18 16:26:26 +00:00
test-macro-assembler-loong64.cc [loong64][mips64] Rename Code to InstructionStream 2023-01-18 07:46:59 +00:00
test-macro-assembler-mips64.cc [loong64][mips64] Rename Code to InstructionStream 2023-01-18 07:46:59 +00:00
test-macro-assembler-riscv32.cc [test] Migrate cctest/compiler/test-codegen to unittests/ 2022-08-22 17:28:27 +00:00
test-macro-assembler-riscv64.cc [test] Migrate cctest/compiler/test-codegen to unittests/ 2022-08-22 17:28:27 +00:00
test-mementos.cc Revert "[ptr-compr] Improve ptr compression/decompresion in C++" 2023-01-12 17:26:08 +00:00
test-orderedhashtable.cc [test] Remove some unused includes 2022-07-18 12:59:03 +00:00
test-profile-generator.cc Rename Code to InstructionStream 2023-01-17 12:45:45 +00:00
test-property-details.cc [dict-proto] Allow storing certain PropertyDetails in single byte 2021-02-04 13:45:13 +00:00
test-ptr-compr-cage.cc Rename Code to InstructionStream 2023-01-17 12:45:45 +00:00
test-random-number-generator.cc [cctest] Use v8_flags for accessing flag values 2022-09-16 08:22:03 +00:00
test-sampler-api.cc [cctest] Use v8_flags for accessing flag values 2022-09-16 08:22:03 +00:00
test-serialize.cc [static-roots] Test to ensure mksnapshot creates a predictable r/o heap 2023-01-19 17:27:58 +00:00
test-shared-strings.cc [heap] Add tests for OLD_TO_SHARED failures 2023-01-16 11:42:43 +00:00
test-simple-riscv32.cc Reland "[riscv32] Add RISCV32 backend" 2022-08-04 12:47:44 +00:00
test-simple-riscv64.cc [cleanup][test] Remove redundant NOLINT annotations 2021-04-30 11:46:14 +00:00
test-smi-lexicographic-compare.cc [test] Remove some unused includes 2022-07-18 12:59:03 +00:00
test-stack-unwinding-win64.cc [cctest] Use v8_flags for accessing flag values 2022-09-16 08:22:03 +00:00
test-strings.cc [test] Fix cctest/test-strings/Regress1402187 for non sandbox builds 2023-01-03 17:14:13 +00:00
test-swiss-name-dictionary-csa.cc Rename CodeDataContainer to Code 2023-01-18 08:44:08 +00:00
test-swiss-name-dictionary-infra.cc [runtime] Clean up runtime function Arguments accesses 2022-03-09 13:03:15 +00:00
test-swiss-name-dictionary-infra.h [test] Remove some unused includes 2022-07-18 12:59:03 +00:00
test-swiss-name-dictionary-shared-tests.h Replace STATIC_ASSERT with static_assert 2022-05-13 13:46:27 +00:00
test-swiss-name-dictionary.cc Reland "[dict-proto] SIMD support for SwissNameDictionary in Torque" 2021-03-31 13:01:34 +00:00
test-sync-primitives-arm64.cc Various post-Code rename cleanups 2023-01-18 16:26:26 +00:00
test-sync-primitives-arm.cc [test] Remove some unused includes 2022-07-18 12:59:03 +00:00
test-trace-event.cc [test] Make cctest run one test, with maybe custom platform 2022-04-05 09:39:18 +00:00
test-transitions.cc [test] Remove some unused includes 2022-07-18 12:59:03 +00:00
test-transitions.h Reland "[runtime] Refactor TransitionsAccessor" 2022-02-14 12:05:06 +00:00
test-typedarrays.cc [test] Remove some unused includes 2022-07-18 12:59:03 +00:00
test-unscopables-hidden-prototype.cc [test] Remove some unused includes 2022-07-18 12:59:03 +00:00
test-unwinder-code-pages.cc Various post-Code rename cleanups 2023-01-18 16:26:26 +00:00
test-usecounters.cc [test] Remove some unused includes 2022-07-18 12:59:03 +00:00
test-utils-arm64.cc [test] Remove some unused includes 2022-07-18 12:59:03 +00:00
test-utils-arm64.h [test] Remove some unused includes 2022-07-18 12:59:03 +00:00
test-utils.cc [test] Remove some unused includes 2022-07-18 12:59:03 +00:00
test-v8windbg.cc [tools] Add v8windbg, a WinDbg extension for V8 2020-02-18 19:16:18 +00:00
test-verifiers.cc [cleanup] Remove atomic kRelaxed accessors in favour for non-atomic ones 2021-03-08 10:57:19 +00:00
testcfg.py [test] Refactor testrunner (4) 2022-07-18 09:52:24 +00:00
trace-extension.cc Reland "[include] Split out v8.h" 2021-08-24 13:08:55 +00:00
trace-extension.h [test] Remove some unused includes 2022-07-18 12:59:03 +00:00