Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Unified Diff: src/objects-inl.h

Issue 882913006: Make functions contexts in optimized code weak. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/lithium.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « src/lithium.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698