diff options
Diffstat (limited to 'deps/v8/src/snapshot/context-serializer.cc')
-rw-r--r-- | deps/v8/src/snapshot/context-serializer.cc | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/deps/v8/src/snapshot/context-serializer.cc b/deps/v8/src/snapshot/context-serializer.cc index cec20262ab..f9e2ab8935 100644 --- a/deps/v8/src/snapshot/context-serializer.cc +++ b/deps/v8/src/snapshot/context-serializer.cc @@ -18,17 +18,14 @@ namespace internal { namespace { // During serialization, puts the native context into a state understood by the -// serializer (e.g. by clearing lists of Code objects). After serialization, -// the original state is restored. +// serializer (e.g. by clearing lists of InstructionStream objects). After +// serialization, the original state is restored. class V8_NODISCARD SanitizeNativeContextScope final { public: SanitizeNativeContextScope(Isolate* isolate, NativeContext native_context, bool allow_active_isolate_for_testing, const DisallowGarbageCollection& no_gc) - : native_context_(native_context), - optimized_code_list_(native_context.OptimizedCodeListHead()), - deoptimized_code_list_(native_context.DeoptimizedCodeListHead()), - no_gc_(no_gc) { + : native_context_(native_context), no_gc_(no_gc) { #ifdef DEBUG if (!allow_active_isolate_for_testing) { // Microtasks. @@ -37,24 +34,16 @@ class V8_NODISCARD SanitizeNativeContextScope final { DCHECK(!microtask_queue->HasMicrotasksSuppressions()); DCHECK_EQ(0, microtask_queue->GetMicrotasksScopeDepth()); DCHECK(microtask_queue->DebugMicrotasksScopeDepthIsZero()); - // Code lists. - DCHECK(optimized_code_list_.IsUndefined(isolate)); - DCHECK(deoptimized_code_list_.IsUndefined(isolate)); } #endif microtask_queue_external_pointer_ = native_context .RawExternalPointerField(NativeContext::kMicrotaskQueueOffset) .GetAndClearContentForSerialization(no_gc); - Object undefined = ReadOnlyRoots(isolate).undefined_value(); - native_context.SetOptimizedCodeListHead(undefined); - native_context.SetDeoptimizedCodeListHead(undefined); } ~SanitizeNativeContextScope() { // Restore saved fields. - native_context_.SetOptimizedCodeListHead(optimized_code_list_); - native_context_.SetDeoptimizedCodeListHead(deoptimized_code_list_); native_context_ .RawExternalPointerField(NativeContext::kMicrotaskQueueOffset) .RestoreContentAfterSerialization(microtask_queue_external_pointer_, @@ -64,8 +53,6 @@ class V8_NODISCARD SanitizeNativeContextScope final { private: NativeContext native_context_; ExternalPointerSlot::RawContent microtask_queue_external_pointer_; - const Object optimized_code_list_; - const Object deoptimized_code_list_; const DisallowGarbageCollection& no_gc_; }; @@ -190,7 +177,7 @@ void ContextSerializer::SerializeObjectImpl(Handle<HeapObject> obj) { if (closure.shared().HasBaselineCode()) { closure.shared().FlushBaselineCode(); } - closure.set_code(closure.shared().GetCode(), kReleaseStore); + closure.set_code(closure.shared().GetCode(isolate()), kReleaseStore); } } } @@ -207,10 +194,9 @@ bool ContextSerializer::ShouldBeInTheStartupObjectCache(HeapObject o) { // contain a unique ID, and deserializing several context snapshots containing // script would cause dupes. return o.IsName() || o.IsScript() || o.IsSharedFunctionInfo() || - o.IsHeapNumber() || - (V8_EXTERNAL_CODE_SPACE_BOOL && o.IsCodeDataContainer()) || - o.IsCode() || o.IsScopeInfo() || o.IsAccessorInfo() || - o.IsTemplateInfo() || o.IsClassPositions() || + o.IsHeapNumber() || o.IsCode() || o.IsInstructionStream() || + o.IsScopeInfo() || o.IsAccessorInfo() || o.IsTemplateInfo() || + o.IsClassPositions() || o.map() == ReadOnlyRoots(isolate()).fixed_cow_array_map(); } |