Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 1dde60df546fc85ec110f2a5f5ef47381589dd99..cdfa0773bfedd8fb7e7b91b98b338cf00803de85 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -5234,10 +5234,17 @@ bool Code::IsWeakObjectInOptimizedCode(Object* object) { |
return Map::cast(object)->CanTransition() && |
FLAG_weak_embedded_maps_in_optimized_code; |
} |
- if (object->IsJSObject() || |
- (object->IsCell() && Cell::cast(object)->value()->IsJSObject())) { |
+ if (object->IsCell()) object = Cell::cast(object)->value(); |
+ if (object->IsJSObject()) { |
return FLAG_weak_embedded_objects_in_optimized_code; |
} |
+ if (object->IsFixedArray()) { |
+ // Contexts of inlined functions are embedded in optimized code. |
+ Map* map = HeapObject::cast(object)->map(); |
+ Heap* heap = map->GetHeap(); |
+ return FLAG_weak_embedded_objects_in_optimized_code && |
+ map == heap->function_context_map(); |
+ } |
return false; |
} |