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
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
DEPS
expression-type-collector-macros.h
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
OWNERS
print-extension.cc
print-extension.h
profiler-extension.cc
profiler-extension.h
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-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
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
test-field-type-tracking.cc Various post-Code rename cleanups 2023-01-18 16:26:26 +00:00
test-func-name-inference.cc
test-fuzz-arm64.cc
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
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
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-js-arm64-variables.cc
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-profile-generator.cc Rename Code to InstructionStream 2023-01-17 12:45:45 +00:00
test-property-details.cc
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
test-simple-riscv64.cc
test-smi-lexicographic-compare.cc
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
test-swiss-name-dictionary-infra.h
test-swiss-name-dictionary-shared-tests.h
test-swiss-name-dictionary.cc
test-sync-primitives-arm64.cc Various post-Code rename cleanups 2023-01-18 16:26:26 +00:00
test-sync-primitives-arm.cc
test-trace-event.cc
test-transitions.cc
test-transitions.h
test-typedarrays.cc
test-unscopables-hidden-prototype.cc
test-unwinder-code-pages.cc Various post-Code rename cleanups 2023-01-18 16:26:26 +00:00
test-usecounters.cc
test-utils-arm64.cc
test-utils-arm64.h
test-utils.cc
test-v8windbg.cc
test-verifiers.cc
testcfg.py
trace-extension.cc
trace-extension.h