[heap] Rename safepoint scopes
This CL simplifies safepoint scopes, there are now three kinds of safepoint scopes: 1) IsolateSafepointScope - performs an isolate local safepoint 2) GlobalSafepointScope - a global safepoint across multiple isolates 3) SafepointScope - chooses based on condition between local/global This CL is not supposed to change current safepointing behavior in any way. The CL renames the current SafepointScope to IsolateSafepointScope and changes GlobalSafepointScope to always perform a global safepoint. It then also introduces the new SafepointScope and makes use of it for snapshotting and in heap.cc. Bug: v8:13267 Change-Id: Ie7e1f81b6158c98d3d98552ba735cc73c9b869c5 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3973310 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org> Cr-Commit-Position: refs/heads/main@{#83912}
This commit is contained in:
parent
6cd8c58097
commit
34d6823f8b
@ -617,7 +617,10 @@ StartupData SnapshotCreator::CreateBlob(
|
||||
i::Snapshot::ClearReconstructableDataForSerialization(
|
||||
i_isolate, function_code_handling == FunctionCodeHandling::kClear);
|
||||
|
||||
i::GlobalSafepointScope global_safepoint(i_isolate);
|
||||
i::SafepointKind safepoint_kind = i_isolate->has_shared_heap()
|
||||
? i::SafepointKind::kGlobal
|
||||
: i::SafepointKind::kIsolate;
|
||||
i::SafepointScope safepoint_scope(i_isolate, safepoint_kind);
|
||||
i::DisallowGarbageCollection no_gc_from_here_on;
|
||||
|
||||
// Create a vector with all contexts and clear associated Persistent fields.
|
||||
@ -655,7 +658,7 @@ StartupData SnapshotCreator::CreateBlob(
|
||||
|
||||
data->created_ = true;
|
||||
return i::Snapshot::Create(i_isolate, &contexts, embedder_fields_serializers,
|
||||
global_safepoint, no_gc_from_here_on);
|
||||
safepoint_scope, no_gc_from_here_on);
|
||||
}
|
||||
|
||||
bool StartupData::CanBeRehashed() const {
|
||||
|
@ -26,7 +26,7 @@ class V8_EXPORT_PRIVATE CombinedHeapObjectIterator final {
|
||||
HeapObject Next();
|
||||
|
||||
private:
|
||||
SafepointScope safepoint_scope_;
|
||||
IsolateSafepointScope safepoint_scope_;
|
||||
HeapObjectIterator heap_iterator_;
|
||||
ReadOnlyHeapObjectIterator ro_heap_iterator_;
|
||||
};
|
||||
|
@ -73,7 +73,7 @@ void HeapVerification::Verify() {
|
||||
CHECK(heap()->HasBeenSetUp());
|
||||
AllowGarbageCollection allow_gc;
|
||||
IgnoreLocalGCRequests ignore_gc_requests(heap());
|
||||
SafepointScope safepoint_scope(heap());
|
||||
IsolateSafepointScope safepoint_scope(heap());
|
||||
HandleScope scope(isolate());
|
||||
|
||||
heap()->MakeHeapIterable();
|
||||
|
@ -1841,18 +1841,16 @@ void Heap::StartIncrementalMarking(int gc_flags,
|
||||
CompleteSweepingFull();
|
||||
}
|
||||
|
||||
base::Optional<GlobalSafepointScope> global_safepoint_scope;
|
||||
base::Optional<SafepointScope> safepoint_scope;
|
||||
|
||||
{
|
||||
AllowGarbageCollection allow_shared_gc;
|
||||
IgnoreLocalGCRequests ignore_gc_requests(this);
|
||||
|
||||
if (isolate()->is_shared_heap_isolate()) {
|
||||
global_safepoint_scope.emplace(isolate());
|
||||
} else {
|
||||
safepoint_scope.emplace(this);
|
||||
}
|
||||
SafepointKind safepoint_kind = isolate()->is_shared_heap_isolate()
|
||||
? SafepointKind::kGlobal
|
||||
: SafepointKind::kIsolate;
|
||||
safepoint_scope.emplace(isolate(), safepoint_kind);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -2165,18 +2163,17 @@ size_t Heap::PerformGarbageCollection(
|
||||
DCHECK(tracer()->IsConsistentWithCollector(collector));
|
||||
TRACE_GC_EPOCH(tracer(), CollectorScopeId(collector), ThreadKind::kMain);
|
||||
|
||||
base::Optional<GlobalSafepointScope> global_safepoint_scope;
|
||||
base::Optional<SafepointScope> isolate_safepoint_scope;
|
||||
base::Optional<SafepointScope> safepoint_scope;
|
||||
|
||||
{
|
||||
AllowGarbageCollection allow_shared_gc;
|
||||
IgnoreLocalGCRequests ignore_gc_requests(this);
|
||||
|
||||
if (isolate()->is_shared_heap_isolate()) {
|
||||
global_safepoint_scope.emplace(isolate());
|
||||
} else {
|
||||
isolate_safepoint_scope.emplace(this);
|
||||
}
|
||||
SafepointKind safepoint_kind =
|
||||
v8_flags.shared_space && isolate()->is_shared_heap_isolate()
|
||||
? SafepointKind::kGlobal
|
||||
: SafepointKind::kIsolate;
|
||||
safepoint_scope.emplace(isolate(), safepoint_kind);
|
||||
}
|
||||
|
||||
collection_barrier_->StopTimeToCollectionTimer();
|
||||
@ -3433,7 +3430,7 @@ FixedArrayBase Heap::LeftTrimFixedArray(FixedArrayBase object,
|
||||
if (v8_flags.enable_slow_asserts) {
|
||||
// Make sure the stack or other roots (e.g., Handles) don't contain pointers
|
||||
// to the original FixedArray (which is now the filler object).
|
||||
base::Optional<SafepointScope> safepoint_scope;
|
||||
base::Optional<IsolateSafepointScope> safepoint_scope;
|
||||
|
||||
{
|
||||
AllowGarbageCollection allow_gc;
|
||||
@ -4201,7 +4198,7 @@ std::unique_ptr<v8::MeasureMemoryDelegate> Heap::MeasureMemoryDelegate(
|
||||
void Heap::CollectCodeStatistics() {
|
||||
TRACE_EVENT0("v8", "Heap::CollectCodeStatistics");
|
||||
IgnoreLocalGCRequests ignore_gc_requests(this);
|
||||
SafepointScope safepoint_scope(this);
|
||||
IsolateSafepointScope safepoint_scope(this);
|
||||
MakeHeapIterable();
|
||||
CodeStatistics::ResetCodeAndMetadataStatistics(isolate());
|
||||
// We do not look for code in new space, or map space. If code
|
||||
@ -6401,7 +6398,7 @@ class UnreachableObjectsFilter : public HeapObjectsFilter {
|
||||
HeapObjectIterator::HeapObjectIterator(
|
||||
Heap* heap, HeapObjectIterator::HeapObjectsFiltering filtering)
|
||||
: heap_(heap),
|
||||
safepoint_scope_(std::make_unique<SafepointScope>(heap)),
|
||||
safepoint_scope_(std::make_unique<IsolateSafepointScope>(heap)),
|
||||
filtering_(filtering),
|
||||
filter_(nullptr),
|
||||
space_iterator_(nullptr),
|
||||
|
@ -105,6 +105,7 @@ class HeapObjectAllocationTracker;
|
||||
class HeapObjectsFilter;
|
||||
class HeapStats;
|
||||
class Isolate;
|
||||
class IsolateSafepointScope;
|
||||
class JSFinalizationRegistry;
|
||||
class LinearAllocationArea;
|
||||
class LocalEmbedderHeapTracer;
|
||||
@ -123,7 +124,6 @@ class PagedNewSpace;
|
||||
class ReadOnlyHeap;
|
||||
class RootVisitor;
|
||||
class RwxMemoryWriteScope;
|
||||
class SafepointScope;
|
||||
class ScavengeJob;
|
||||
class Scavenger;
|
||||
class ScavengerCollector;
|
||||
@ -2751,7 +2751,7 @@ class V8_EXPORT_PRIVATE HeapObjectIterator {
|
||||
HeapObject NextObject();
|
||||
|
||||
Heap* heap_;
|
||||
std::unique_ptr<SafepointScope> safepoint_scope_;
|
||||
std::unique_ptr<IsolateSafepointScope> safepoint_scope_;
|
||||
HeapObjectsFiltering filtering_;
|
||||
HeapObjectsFilter* filter_;
|
||||
// Space iterator for iterating all the spaces.
|
||||
|
@ -335,11 +335,11 @@ class V8_EXPORT_PRIVATE LocalHeap {
|
||||
friend class CollectionBarrier;
|
||||
friend class ConcurrentAllocator;
|
||||
friend class GlobalSafepoint;
|
||||
friend class IsolateSafepoint;
|
||||
friend class Heap;
|
||||
friend class Isolate;
|
||||
friend class IsolateSafepoint;
|
||||
friend class IsolateSafepointScope;
|
||||
friend class ParkedScope;
|
||||
friend class SafepointScope;
|
||||
friend class UnparkedScope;
|
||||
};
|
||||
|
||||
|
@ -282,11 +282,14 @@ Isolate* IsolateSafepoint::shared_heap_isolate() const {
|
||||
return isolate()->shared_heap_isolate();
|
||||
}
|
||||
|
||||
SafepointScope::SafepointScope(Heap* heap) : safepoint_(heap->safepoint()) {
|
||||
IsolateSafepointScope::IsolateSafepointScope(Heap* heap)
|
||||
: safepoint_(heap->safepoint()) {
|
||||
safepoint_->EnterLocalSafepointScope();
|
||||
}
|
||||
|
||||
SafepointScope::~SafepointScope() { safepoint_->LeaveLocalSafepointScope(); }
|
||||
IsolateSafepointScope::~IsolateSafepointScope() {
|
||||
safepoint_->LeaveLocalSafepointScope();
|
||||
}
|
||||
|
||||
GlobalSafepoint::GlobalSafepoint(Isolate* isolate)
|
||||
: shared_heap_isolate_(isolate) {}
|
||||
@ -415,23 +418,22 @@ void GlobalSafepoint::LeaveGlobalSafepointScope(Isolate* initiator) {
|
||||
|
||||
GlobalSafepointScope::GlobalSafepointScope(Isolate* initiator)
|
||||
: initiator_(initiator),
|
||||
shared_heap_isolate_(initiator->has_shared_heap()
|
||||
? initiator->shared_heap_isolate()
|
||||
: nullptr) {
|
||||
if (shared_heap_isolate_) {
|
||||
shared_heap_isolate_(initiator->shared_heap_isolate()) {
|
||||
shared_heap_isolate_->global_safepoint()->EnterGlobalSafepointScope(
|
||||
initiator_);
|
||||
} else {
|
||||
initiator_->heap()->safepoint()->EnterLocalSafepointScope();
|
||||
}
|
||||
}
|
||||
|
||||
GlobalSafepointScope::~GlobalSafepointScope() {
|
||||
if (shared_heap_isolate_) {
|
||||
shared_heap_isolate_->global_safepoint()->LeaveGlobalSafepointScope(
|
||||
initiator_);
|
||||
}
|
||||
|
||||
SafepointScope::SafepointScope(Isolate* initiator, SafepointKind kind) {
|
||||
if (kind == SafepointKind::kIsolate) {
|
||||
isolate_safepoint_.emplace(initiator->heap());
|
||||
} else {
|
||||
initiator_->heap()->safepoint()->LeaveLocalSafepointScope();
|
||||
DCHECK_EQ(kind, SafepointKind::kGlobal);
|
||||
global_safepoint_.emplace(initiator);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -148,14 +148,14 @@ class IsolateSafepoint final {
|
||||
friend class GlobalSafepoint;
|
||||
friend class GlobalSafepointScope;
|
||||
friend class Isolate;
|
||||
friend class IsolateSafepointScope;
|
||||
friend class LocalHeap;
|
||||
friend class SafepointScope;
|
||||
};
|
||||
|
||||
class V8_NODISCARD SafepointScope {
|
||||
class V8_NODISCARD IsolateSafepointScope {
|
||||
public:
|
||||
V8_EXPORT_PRIVATE explicit SafepointScope(Heap* heap);
|
||||
V8_EXPORT_PRIVATE ~SafepointScope();
|
||||
V8_EXPORT_PRIVATE explicit IsolateSafepointScope(Heap* heap);
|
||||
V8_EXPORT_PRIVATE ~IsolateSafepointScope();
|
||||
|
||||
private:
|
||||
IsolateSafepoint* safepoint_;
|
||||
@ -204,6 +204,18 @@ class V8_NODISCARD GlobalSafepointScope {
|
||||
Isolate* const shared_heap_isolate_;
|
||||
};
|
||||
|
||||
enum class SafepointKind { kIsolate, kGlobal };
|
||||
|
||||
class V8_NODISCARD SafepointScope {
|
||||
public:
|
||||
V8_EXPORT_PRIVATE explicit SafepointScope(Isolate* initiator,
|
||||
SafepointKind kind);
|
||||
|
||||
private:
|
||||
base::Optional<IsolateSafepointScope> isolate_safepoint_;
|
||||
base::Optional<GlobalSafepointScope> global_safepoint_;
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
} // namespace v8
|
||||
|
||||
|
@ -2463,7 +2463,7 @@ void V8HeapExplorer::CollectGlobalObjectsTags() {
|
||||
}
|
||||
|
||||
void V8HeapExplorer::MakeGlobalObjectTagMap(
|
||||
const SafepointScope& safepoint_scope) {
|
||||
const IsolateSafepointScope& safepoint_scope) {
|
||||
for (const auto& pair : global_object_tag_pairs_) {
|
||||
global_object_tag_map_.emplace(*pair.first, pair.second);
|
||||
}
|
||||
@ -2723,7 +2723,7 @@ bool HeapSnapshotGenerator::GenerateSnapshot() {
|
||||
heap_->CollectAllAvailableGarbage(GarbageCollectionReason::kHeapProfiler);
|
||||
|
||||
NullContextForSnapshotScope null_context_scope(isolate);
|
||||
SafepointScope scope(heap_);
|
||||
IsolateSafepointScope scope(heap_);
|
||||
v8_heap_explorer_.MakeGlobalObjectTagMap(scope);
|
||||
handle_scope.reset();
|
||||
|
||||
|
@ -36,6 +36,7 @@ class HeapEntry;
|
||||
class HeapProfiler;
|
||||
class HeapSnapshot;
|
||||
class HeapSnapshotGenerator;
|
||||
class IsolateSafepointScope;
|
||||
class JSArrayBuffer;
|
||||
class JSCollection;
|
||||
class JSGeneratorObject;
|
||||
@ -43,7 +44,6 @@ class JSGlobalObject;
|
||||
class JSGlobalProxy;
|
||||
class JSPromise;
|
||||
class JSWeakCollection;
|
||||
class SafepointScope;
|
||||
|
||||
struct SourceLocation {
|
||||
SourceLocation(int entry_index, int scriptId, int line, int col)
|
||||
@ -390,7 +390,7 @@ class V8_EXPORT_PRIVATE V8HeapExplorer : public HeapEntriesAllocator {
|
||||
uint32_t EstimateObjectsCount();
|
||||
bool IterateAndExtractReferences(HeapSnapshotGenerator* generator);
|
||||
void CollectGlobalObjectsTags();
|
||||
void MakeGlobalObjectTagMap(const SafepointScope& safepoint_scope);
|
||||
void MakeGlobalObjectTagMap(const IsolateSafepointScope& safepoint_scope);
|
||||
void TagBuiltinCodeObject(CodeT code, const char* name);
|
||||
HeapEntry* AddEntry(Address address,
|
||||
HeapEntry::Type type,
|
||||
|
@ -315,7 +315,10 @@ void Snapshot::SerializeDeserializeAndVerifyForTesting(
|
||||
|
||||
// Test serialization.
|
||||
{
|
||||
GlobalSafepointScope global_safepoint(isolate);
|
||||
SafepointKind safepoint_kind = isolate->has_shared_heap()
|
||||
? SafepointKind::kGlobal
|
||||
: SafepointKind::kIsolate;
|
||||
SafepointScope safepoint_scope(isolate, safepoint_kind);
|
||||
DisallowGarbageCollection no_gc;
|
||||
|
||||
Snapshot::SerializerFlags flags(
|
||||
@ -325,7 +328,7 @@ void Snapshot::SerializeDeserializeAndVerifyForTesting(
|
||||
? Snapshot::kReconstructReadOnlyAndSharedObjectCachesForTesting
|
||||
: 0));
|
||||
serialized_data = Snapshot::Create(isolate, *default_context,
|
||||
global_safepoint, no_gc, flags);
|
||||
safepoint_scope, no_gc, flags);
|
||||
auto_delete_serialized_data.reset(serialized_data.data);
|
||||
}
|
||||
|
||||
@ -369,14 +372,14 @@ v8::StartupData Snapshot::Create(
|
||||
Isolate* isolate, std::vector<Context>* contexts,
|
||||
const std::vector<SerializeInternalFieldsCallback>&
|
||||
embedder_fields_serializers,
|
||||
const GlobalSafepointScope& global_safepoint,
|
||||
const SafepointScope& safepoint_scope,
|
||||
const DisallowGarbageCollection& no_gc, SerializerFlags flags) {
|
||||
TRACE_EVENT0("v8", "V8.SnapshotCreate");
|
||||
DCHECK_EQ(contexts->size(), embedder_fields_serializers.size());
|
||||
DCHECK_GT(contexts->size(), 0);
|
||||
HandleScope scope(isolate);
|
||||
|
||||
// The GlobalSafepointScope ensures we are in a safepoint scope so that the
|
||||
// The HeapSafepointScope ensures we are in a safepoint scope so that the
|
||||
// string table is safe to iterate. Unlike mksnapshot, embedders may have
|
||||
// background threads running.
|
||||
|
||||
@ -453,13 +456,13 @@ v8::StartupData Snapshot::Create(
|
||||
|
||||
// static
|
||||
v8::StartupData Snapshot::Create(Isolate* isolate, Context default_context,
|
||||
const GlobalSafepointScope& global_safepoint,
|
||||
const SafepointScope& safepoint_scope,
|
||||
const DisallowGarbageCollection& no_gc,
|
||||
SerializerFlags flags) {
|
||||
std::vector<Context> contexts{default_context};
|
||||
std::vector<SerializeInternalFieldsCallback> callbacks{{}};
|
||||
return Snapshot::Create(isolate, &contexts, callbacks, global_safepoint,
|
||||
no_gc, flags);
|
||||
return Snapshot::Create(isolate, &contexts, callbacks, safepoint_scope, no_gc,
|
||||
flags);
|
||||
}
|
||||
|
||||
v8::StartupData SnapshotImpl::CreateSnapshotBlob(
|
||||
|
@ -15,10 +15,10 @@ namespace v8 {
|
||||
namespace internal {
|
||||
|
||||
class Context;
|
||||
class GlobalSafepointScope;
|
||||
class Isolate;
|
||||
class SnapshotData;
|
||||
class JSGlobalProxy;
|
||||
class SafepointScope;
|
||||
class SnapshotData;
|
||||
|
||||
class Snapshot : public AllStatic {
|
||||
public:
|
||||
@ -69,14 +69,14 @@ class Snapshot : public AllStatic {
|
||||
Isolate* isolate, std::vector<Context>* contexts,
|
||||
const std::vector<SerializeInternalFieldsCallback>&
|
||||
embedder_fields_serializers,
|
||||
const GlobalSafepointScope& global_safepoint,
|
||||
const SafepointScope& safepoint_scope,
|
||||
const DisallowGarbageCollection& no_gc,
|
||||
SerializerFlags flags = kDefaultSerializerFlags);
|
||||
|
||||
// Convenience helper for the above when only serializing a single context.
|
||||
static v8::StartupData Create(
|
||||
Isolate* isolate, Context default_context,
|
||||
const GlobalSafepointScope& global_safepoint,
|
||||
const SafepointScope& safepoint_scope,
|
||||
const DisallowGarbageCollection& no_gc,
|
||||
SerializerFlags flags = kDefaultSerializerFlags);
|
||||
|
||||
|
@ -263,7 +263,7 @@ void SimulateIncrementalMarking(i::Heap* heap, bool force_completion) {
|
||||
i::IncrementalMarking* marking = heap->incremental_marking();
|
||||
|
||||
if (heap->sweeping_in_progress()) {
|
||||
SafepointScope scope(heap);
|
||||
IsolateSafepointScope scope(heap);
|
||||
heap->EnsureSweepingCompleted(
|
||||
Heap::SweepingForcedFinalizationMode::kV8Only);
|
||||
}
|
||||
@ -282,7 +282,7 @@ void SimulateIncrementalMarking(i::Heap* heap, bool force_completion) {
|
||||
CHECK(marking->IsMarking());
|
||||
if (!force_completion) return;
|
||||
|
||||
SafepointScope scope(heap);
|
||||
IsolateSafepointScope scope(heap);
|
||||
MarkingBarrier::PublishAll(heap);
|
||||
marking->MarkRootsForTesting();
|
||||
|
||||
@ -315,7 +315,7 @@ void AbandonCurrentlyFreeMemory(PagedSpace* space) {
|
||||
void GcAndSweep(Heap* heap, AllocationSpace space) {
|
||||
heap->CollectGarbage(space, GarbageCollectionReason::kTesting);
|
||||
if (heap->sweeping_in_progress()) {
|
||||
SafepointScope scope(heap);
|
||||
IsolateSafepointScope scope(heap);
|
||||
heap->EnsureSweepingCompleted(
|
||||
Heap::SweepingForcedFinalizationMode::kV8Only);
|
||||
}
|
||||
@ -343,14 +343,14 @@ bool InCorrectGeneration(HeapObject object) {
|
||||
}
|
||||
|
||||
void GrowNewSpace(Heap* heap) {
|
||||
SafepointScope scope(heap);
|
||||
IsolateSafepointScope scope(heap);
|
||||
if (!heap->new_space()->IsAtMaximumCapacity()) {
|
||||
heap->new_space()->Grow();
|
||||
}
|
||||
}
|
||||
|
||||
void GrowNewSpaceToMaximumCapacity(Heap* heap) {
|
||||
SafepointScope scope(heap);
|
||||
IsolateSafepointScope scope(heap);
|
||||
while (!heap->new_space()->IsAtMaximumCapacity()) {
|
||||
heap->new_space()->Grow();
|
||||
}
|
||||
|
@ -5860,7 +5860,7 @@ TEST(Regress598319) {
|
||||
}
|
||||
}
|
||||
|
||||
SafepointScope safepoint_scope(heap);
|
||||
IsolateSafepointScope safepoint_scope(heap);
|
||||
MarkingBarrier::PublishAll(heap);
|
||||
|
||||
// Finish marking with bigger steps to speed up test.
|
||||
@ -6566,7 +6566,7 @@ HEAP_TEST(Regress670675) {
|
||||
heap->tracer()->StopFullCycleIfNeeded();
|
||||
i::IncrementalMarking* marking = CcTest::heap()->incremental_marking();
|
||||
if (marking->IsStopped()) {
|
||||
SafepointScope safepoint_scope(heap);
|
||||
IsolateSafepointScope safepoint_scope(heap);
|
||||
heap->tracer()->StartCycle(
|
||||
GarbageCollector::MARK_COMPACTOR, GarbageCollectionReason::kTesting,
|
||||
"collector cctest", GCTracer::MarkingType::kIncremental);
|
||||
|
@ -118,7 +118,7 @@ TEST_WITH_PLATFORM(IncrementalMarkingUsingTasks, MockPlatform) {
|
||||
i::IncrementalMarking* marking = heap->incremental_marking();
|
||||
marking->Stop();
|
||||
{
|
||||
SafepointScope scope(heap);
|
||||
IsolateSafepointScope scope(heap);
|
||||
heap->tracer()->StartCycle(
|
||||
GarbageCollector::MARK_COMPACTOR, GarbageCollectionReason::kTesting,
|
||||
"collector cctest", GCTracer::MarkingType::kIncremental);
|
||||
|
@ -161,7 +161,7 @@ static unsigned int PseudorandomAreaSize() {
|
||||
TEST(MemoryChunk) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
Heap* heap = isolate->heap();
|
||||
SafepointScope safepoint(heap);
|
||||
IsolateSafepointScope safepoint(heap);
|
||||
|
||||
v8::PageAllocator* page_allocator = GetPlatformPageAllocator();
|
||||
size_t area_size;
|
||||
|
@ -210,7 +210,7 @@ static StartupBlobs Serialize(v8::Isolate* isolate) {
|
||||
Isolate* i_isolate = reinterpret_cast<Isolate*>(isolate);
|
||||
CcTest::CollectAllAvailableGarbage(i_isolate);
|
||||
|
||||
SafepointScope safepoint(i_isolate->heap());
|
||||
IsolateSafepointScope safepoint(i_isolate->heap());
|
||||
HandleScope scope(i_isolate);
|
||||
|
||||
DisallowGarbageCollection no_gc;
|
||||
@ -403,7 +403,7 @@ static void SerializeContext(base::Vector<const byte>* startup_blob_out,
|
||||
|
||||
env.Reset();
|
||||
|
||||
SafepointScope safepoint(heap);
|
||||
IsolateSafepointScope safepoint(heap);
|
||||
|
||||
DisallowGarbageCollection no_gc;
|
||||
SnapshotByteSink read_only_sink;
|
||||
@ -572,7 +572,7 @@ static void SerializeCustomContext(
|
||||
|
||||
env.Reset();
|
||||
|
||||
SafepointScope safepoint(isolate->heap());
|
||||
IsolateSafepointScope safepoint(isolate->heap());
|
||||
|
||||
DisallowGarbageCollection no_gc;
|
||||
SnapshotByteSink read_only_sink;
|
||||
|
@ -127,7 +127,7 @@ static int DumpHeapConstants(FILE* out, const char* argv0) {
|
||||
{
|
||||
Isolate::Scope scope(isolate);
|
||||
i::Heap* heap = reinterpret_cast<i::Isolate*>(isolate)->heap();
|
||||
i::SafepointScope safepoint_scope(heap);
|
||||
i::IsolateSafepointScope safepoint_scope(heap);
|
||||
i::ReadOnlyHeap* read_only_heap =
|
||||
reinterpret_cast<i::Isolate*>(isolate)->read_only_heap();
|
||||
i::PrintF(out, "%s", kHeader);
|
||||
|
@ -466,7 +466,7 @@ TEST_F(EmbedderTracingTest, FinalizeTracingWhenMarking) {
|
||||
|
||||
i::IncrementalMarking* marking = heap->incremental_marking();
|
||||
{
|
||||
SafepointScope scope(heap);
|
||||
IsolateSafepointScope scope(heap);
|
||||
heap->tracer()->StartCycle(
|
||||
GarbageCollector::MARK_COMPACTOR, GarbageCollectionReason::kTesting,
|
||||
"collector cctest", GCTracer::MarkingType::kIncremental);
|
||||
|
@ -162,7 +162,7 @@ TEST_F(HeapTest, HeapLayout) {
|
||||
base::AddressRegion heap_reservation(cage_base, size_t{4} * GB);
|
||||
base::AddressRegion code_reservation(code_cage_base, size_t{4} * GB);
|
||||
|
||||
SafepointScope scope(i_isolate()->heap());
|
||||
IsolateSafepointScope scope(i_isolate()->heap());
|
||||
OldGenerationMemoryChunkIterator iter(i_isolate()->heap());
|
||||
for (;;) {
|
||||
MemoryChunk* chunk = iter.next();
|
||||
@ -373,7 +373,7 @@ TEST_F(HeapTest, RememberedSet_InsertOnPromotingObjectToOld) {
|
||||
CHECK(!new_space->IsAtMaximumCapacity());
|
||||
// Fill current pages to force MinorMC to promote them.
|
||||
SimulateFullSpace(new_space, &handles);
|
||||
SafepointScope scope(heap);
|
||||
IsolateSafepointScope scope(heap);
|
||||
// New empty pages should remain in new space.
|
||||
new_space->Grow();
|
||||
} else {
|
||||
@ -422,7 +422,7 @@ TEST_F(HeapTest, Regress978156) {
|
||||
// 5. Start incremental marking.
|
||||
i::IncrementalMarking* marking = heap->incremental_marking();
|
||||
if (marking->IsStopped()) {
|
||||
SafepointScope scope(heap);
|
||||
IsolateSafepointScope scope(heap);
|
||||
heap->tracer()->StartCycle(
|
||||
GarbageCollector::MARK_COMPACTOR, GarbageCollectionReason::kTesting,
|
||||
"collector cctest", GCTracer::MarkingType::kIncremental);
|
||||
|
@ -24,7 +24,7 @@ void HeapInternalsBase::SimulateIncrementalMarking(Heap* heap,
|
||||
i::IncrementalMarking* marking = heap->incremental_marking();
|
||||
|
||||
if (heap->sweeping_in_progress()) {
|
||||
SafepointScope scope(heap);
|
||||
IsolateSafepointScope scope(heap);
|
||||
heap->EnsureSweepingCompleted(
|
||||
Heap::SweepingForcedFinalizationMode::kV8Only);
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ class WithHeapInternals : public TMixin, HeapInternalsBase {
|
||||
}
|
||||
|
||||
void GrowNewSpace() {
|
||||
SafepointScope scope(heap());
|
||||
IsolateSafepointScope scope(heap());
|
||||
if (!heap()->new_space()->IsAtMaximumCapacity()) {
|
||||
heap()->new_space()->Grow();
|
||||
}
|
||||
@ -89,7 +89,7 @@ class WithHeapInternals : public TMixin, HeapInternalsBase {
|
||||
void GcAndSweep(i::AllocationSpace space) {
|
||||
heap()->CollectGarbage(space, GarbageCollectionReason::kTesting);
|
||||
if (heap()->sweeping_in_progress()) {
|
||||
SafepointScope scope(heap());
|
||||
IsolateSafepointScope scope(heap());
|
||||
heap()->EnsureSweepingCompleted(
|
||||
Heap::SweepingForcedFinalizationMode::kV8Only);
|
||||
}
|
||||
|
@ -680,7 +680,7 @@ TEST_F(InnerPointerResolutionHeapTest, UnusedRegularYoungPages) {
|
||||
// Start incremental marking and mark the third object.
|
||||
i::IncrementalMarking* marking = heap()->incremental_marking();
|
||||
if (marking->IsStopped()) {
|
||||
SafepointScope scope(heap());
|
||||
IsolateSafepointScope scope(heap());
|
||||
heap()->tracer()->StartCycle(
|
||||
GarbageCollector::MARK_COMPACTOR, GarbageCollectionReason::kTesting,
|
||||
"unit test", GCTracer::MarkingType::kIncremental);
|
||||
|
@ -21,7 +21,7 @@ TEST_F(SafepointTest, ReachSafepointWithoutLocalHeaps) {
|
||||
Heap* heap = i_isolate()->heap();
|
||||
bool run = false;
|
||||
{
|
||||
SafepointScope scope(heap);
|
||||
IsolateSafepointScope scope(heap);
|
||||
run = true;
|
||||
}
|
||||
CHECK(run);
|
||||
@ -68,7 +68,7 @@ TEST_F(SafepointTest, StopParkedThreads) {
|
||||
}
|
||||
|
||||
{
|
||||
SafepointScope scope(heap);
|
||||
IsolateSafepointScope scope(heap);
|
||||
safepoints++;
|
||||
}
|
||||
mutex.Unlock();
|
||||
@ -124,7 +124,7 @@ TEST_F(SafepointTest, StopRunningThreads) {
|
||||
}
|
||||
|
||||
for (int i = 0; i < kSafepoints; i++) {
|
||||
SafepointScope scope(heap);
|
||||
IsolateSafepointScope scope(heap);
|
||||
safepoint_count++;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user