diff options
Diffstat (limited to 'deps/v8/src/deoptimizer/deoptimizer.cc')
-rw-r--r-- | deps/v8/src/deoptimizer/deoptimizer.cc | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/deps/v8/src/deoptimizer/deoptimizer.cc b/deps/v8/src/deoptimizer/deoptimizer.cc index 64551c6899..fcb4c27d0b 100644 --- a/deps/v8/src/deoptimizer/deoptimizer.cc +++ b/deps/v8/src/deoptimizer/deoptimizer.cc @@ -357,6 +357,9 @@ void Deoptimizer::DeoptimizeMarkedCodeForContext(NativeContext native_context) { for (Code code : codes) { isolate->heap()->InvalidateCodeDeoptimizationData(code); } + + native_context.GetOSROptimizedCodeCache().EvictMarkedCode( + native_context.GetIsolate()); } void Deoptimizer::DeoptimizeAll(Isolate* isolate) { @@ -375,6 +378,7 @@ void Deoptimizer::DeoptimizeAll(Isolate* isolate) { while (!context.IsUndefined(isolate)) { NativeContext native_context = NativeContext::cast(context); MarkAllCodeForContext(native_context); + OSROptimizedCodeCache::Clear(native_context); DeoptimizeMarkedCodeForContext(native_context); context = native_context.next_context_link(); } @@ -432,6 +436,13 @@ void Deoptimizer::DeoptimizeFunction(JSFunction function, Code code) { code.set_deopt_already_counted(true); } DeoptimizeMarkedCodeForContext(function.context().native_context()); + // TODO(mythria): Ideally EvictMarkCode should compact the cache without + // having to explicitly call this. We don't do this currently because + // compacting causes GC and DeoptimizeMarkedCodeForContext uses raw + // pointers. Update DeoptimizeMarkedCodeForContext to use handles and remove + // this call from here. + OSROptimizedCodeCache::Compact( + Handle<NativeContext>(function.context().native_context(), isolate)); } } @@ -3640,8 +3651,7 @@ void TranslatedState::EnsurePropertiesAllocatedAndMarked( // Set markers for the double properties. Handle<DescriptorArray> descriptors(map->instance_descriptors(), isolate()); - int field_count = map->NumberOfOwnDescriptors(); - for (int i = 0; i < field_count; i++) { + for (InternalIndex i : map->IterateOwnDescriptors()) { FieldIndex index = FieldIndex::ForDescriptor(*map, i); if (descriptors->GetDetails(i).representation().IsDouble() && !index.is_inobject()) { @@ -3673,10 +3683,9 @@ void TranslatedState::EnsureJSObjectAllocated(TranslatedValue* slot, Handle<ByteArray> object_storage = AllocateStorageFor(slot); // Now we handle the interesting (JSObject) case. Handle<DescriptorArray> descriptors(map->instance_descriptors(), isolate()); - int field_count = map->NumberOfOwnDescriptors(); // Set markers for the double properties. - for (int i = 0; i < field_count; i++) { + for (InternalIndex i : map->IterateOwnDescriptors()) { FieldIndex index = FieldIndex::ForDescriptor(*map, i); if (descriptors->GetDetails(i).representation().IsDouble() && index.is_inobject()) { @@ -3712,8 +3721,7 @@ void TranslatedState::InitializeJSObjectAt( CHECK_GE(slot->GetChildrenCount(), 2); // Notify the concurrent marker about the layout change. - isolate()->heap()->NotifyObjectLayoutChange( - *object_storage, slot->GetChildrenCount() * kTaggedSize, no_allocation); + isolate()->heap()->NotifyObjectLayoutChange(*object_storage, no_allocation); // Fill the property array field. { @@ -3772,8 +3780,7 @@ void TranslatedState::InitializeObjectWithTaggedFieldsAt( } // Notify the concurrent marker about the layout change. - isolate()->heap()->NotifyObjectLayoutChange( - *object_storage, slot->GetChildrenCount() * kTaggedSize, no_allocation); + isolate()->heap()->NotifyObjectLayoutChange(*object_storage, no_allocation); // Write the fields to the object. for (int i = 1; i < slot->GetChildrenCount(); i++) { |