Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 23cd6d91752d1f6e360215b16e88e395f31f6571..6899caad363bdabc97a2435e8448ff06e5827d7d 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -10311,11 +10311,15 @@ void Code::InvalidateRelocation() { |
void Code::InvalidateEmbeddedObjects() { |
Object* undefined = GetHeap()->undefined_value(); |
- int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
+ Cell* undefined_cell = GetHeap()->undefined_cell(); |
+ int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | |
+ RelocInfo::ModeMask(RelocInfo::CELL); |
for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { |
RelocInfo::Mode mode = it.rinfo()->rmode(); |
if (mode == RelocInfo::EMBEDDED_OBJECT) { |
it.rinfo()->set_target_object(undefined, SKIP_WRITE_BARRIER); |
+ } else if (mode == RelocInfo::CELL) { |
+ it.rinfo()->set_target_cell(undefined_cell, SKIP_WRITE_BARRIER); |
} |
} |
} |
@@ -11277,7 +11281,8 @@ bool Code::IsWeakEmbeddedObject(Kind kind, Object* object) { |
FLAG_weak_embedded_maps_in_optimized_code; |
} |
- if (object->IsJSObject()) { |
+ if (object->IsJSObject() || |
+ (object->IsCell() && Cell::cast(object)->value()->IsJSObject())) { |
return FLAG_weak_embedded_objects_in_optimized_code; |
} |