v8/test/cctest/heap
Jakob Linke 3ebbb651e2 Remove CodeLookupResult
.. and replace it by base::Optional<Code>. It's no longer needed, now
that Code and InstructionStream cases are merged.

This was trickier than it sounds at first, because:

- CodeLookupResult (CLR) was used during the MARK_COMPACT GC phase and
  thus had to observe subtle semantics in the presence of
  forwarding pointers.
- CLR implicitly contained a Code object for off_heap_trampolines
  and an InstructionStream object for everything else. These implicit
  behaviors threaded through elsewhere, e.g. in the
  inner-pointer-to-code cache which relies on the fact that the
  underlying object pointer does not move until GC completes and
  the cache is flushed.
- Semantics of the dual-object {Code,InstructionStream} are generally
  very subtle during GC.

This CL attempts to make all this more explicit by introducing a
GcSafeCode wrapper type which must be used in code that is affected
by semantics described above. The GcSafeCode type exposes only methods
that are safe to call during MARK_COMPACT.

Drive-by:
- Rename the Heap::GcSafeFoo function family s.t. a 'GcSafe' prefix
  means that the function can be used during GC and returns
  GcSafeCode objects; and 'TryFind' vs. 'Find' returns a
  base::Optional<Foo> vs. just Foo.

Bug: v8:13654
Change-Id: I410b5539ea1b584b823bce2dafd8d1328eedc039
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4203385
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85562}
2023-01-31 15:03:28 +00:00
..
heap-tester.h [heap] Remove references to semi spaces from heap.cc 2022-05-16 15:45:40 +00:00
heap-utils.cc [heap] Enable conservative stack scanning on tests 2022-12-14 16:14:12 +00:00
heap-utils.h [heap] Remove unused TemporaryEmbedderHeapTracerScope 2022-12-19 13:40:41 +00:00
test-alloc.cc [heap] Remove Heap::map_space_ field and MapSpace class 2022-10-19 08:04:27 +00:00
test-array-buffer-tracker.cc [heap] Enable conservative stack scanning on tests 2022-12-14 16:14:12 +00:00
test-compaction.cc [heap] Move Sweeper from collectors to heap 2022-10-06 13:30:33 +00:00
test-concurrent-allocation.cc Various post-Code rename cleanups 2023-01-18 16:26:26 +00:00
test-concurrent-marking.cc [heap] Move Sweeper from collectors to heap 2022-10-06 13:30:33 +00:00
test-external-string-tracker.cc [heap] Fix saving the callee-saved registers on stack 2023-01-19 12:29:05 +00:00
test-heap.cc Remove CodeLookupResult 2023-01-31 15:03:28 +00:00
test-incremental-marking.cc [heap] Rename safepoint scopes 2022-10-25 16:32:55 +00:00
test-invalidated-slots.cc [heap] Use v8_flags for accessing flag values 2022-09-05 10:59:05 +00:00
test-iterators.cc [test] reuse logic in heap test iterators 2022-11-07 11:24:43 +00:00
test-mark-compact.cc [heap] Remove outdated map space compaction test 2022-12-20 08:11:02 +00:00
test-memory-measurement.cc [test] Make cctest run one test, with maybe custom platform 2022-04-05 09:39:18 +00:00
test-spaces.cc Revert "Reland "[heap] Invoke allocation observers before limiting the LAB"" 2022-11-17 23:05:37 +00:00
test-unmapper.cc Reland: [heap] Load MarkingBarrier from thread local on main thread 2022-11-14 12:18:18 +00:00
test-weak-references.cc Various post-Code rename cleanups 2023-01-18 16:26:26 +00:00
test-write-barrier.cc [heap] Remove V8_CONCURRENT_MARKING_BOOL constant 2022-11-14 10:38:17 +00:00