[objects] Use global safepoint in OptimizedCodeIterator if needed
MakeHeapIterable() in a shared heap isolate requires a global safepoint. OptimizedCodeIterator uses MakeHeapIterable() but always entered a local safepoint. This CL changes OptimizedCodeIterator to request a global safepoint for shared heap isolates. Bug: v8:13267 Change-Id: I642a7731f4294cc1558de92d4daf5a1e3603f6cc Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4110854 Commit-Queue: Nikolaos Papaspyrou <nikolaos@chromium.org> Auto-Submit: Dominik Inführ <dinfuehr@chromium.org> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org> Reviewed-by: Nikolaos Papaspyrou <nikolaos@chromium.org> Cr-Commit-Position: refs/heads/main@{#84967}
This commit is contained in:
parent
ab957d40bd
commit
72f041654d
@ -420,8 +420,10 @@ bool Code::Inlines(SharedFunctionInfo sfi) {
|
||||
|
||||
Code::OptimizedCodeIterator::OptimizedCodeIterator(Isolate* isolate)
|
||||
: isolate_(isolate),
|
||||
safepoint_scope_(
|
||||
std::make_unique<IsolateSafepointScope>(isolate->heap())),
|
||||
safepoint_scope_(std::make_unique<SafepointScope>(
|
||||
isolate, isolate->is_shared_heap_isolate()
|
||||
? SafepointKind::kGlobal
|
||||
: SafepointKind::kIsolate)),
|
||||
object_iterator_(
|
||||
isolate->heap()->code_space()->GetObjectIterator(isolate->heap())),
|
||||
state_(kIteratingCodeSpace) {}
|
||||
|
@ -29,7 +29,7 @@ class BytecodeArray;
|
||||
class CodeDataContainer;
|
||||
class CodeDesc;
|
||||
class ObjectIterator;
|
||||
class IsolateSafepointScope;
|
||||
class SafepointScope;
|
||||
|
||||
class LocalFactory;
|
||||
template <typename Impl>
|
||||
@ -993,7 +993,7 @@ class Code::OptimizedCodeIterator {
|
||||
|
||||
private:
|
||||
Isolate* isolate_;
|
||||
std::unique_ptr<IsolateSafepointScope> safepoint_scope_;
|
||||
std::unique_ptr<SafepointScope> safepoint_scope_;
|
||||
std::unique_ptr<ObjectIterator> object_iterator_;
|
||||
enum { kIteratingCodeSpace, kIteratingCodeLOSpace, kDone } state_;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user