Index: src/lithium-codegen.cc |
diff --git a/src/lithium-codegen.cc b/src/lithium-codegen.cc |
index 84e95888ea86fd5d6d94029f6ebf716d16062123..2d71d13c69fd9536203e99f40b88dee006b85bc0 100644 |
--- a/src/lithium-codegen.cc |
+++ b/src/lithium-codegen.cc |
@@ -150,15 +150,26 @@ int LCodeGenBase::GetNextEmittedBlock() const { |
void LCodeGenBase::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { |
ZoneList<Handle<Map> > maps(1, zone()); |
ZoneList<Handle<JSObject> > objects(1, zone()); |
- int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
+ ZoneList<Handle<Cell> > cells(1, zone()); |
+ int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | |
+ RelocInfo::ModeMask(RelocInfo::CELL); |
for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { |
- if (Code::IsWeakEmbeddedObject(code->kind(), it.rinfo()->target_object())) { |
+ RelocInfo::Mode mode = it.rinfo()->rmode(); |
+ if (mode == RelocInfo::CELL && |
+ Code::IsWeakEmbeddedObject(code->kind(), it.rinfo()->target_cell())) { |
+ Handle<Cell> cell(it.rinfo()->target_cell()); |
+ cells.Add(cell, zone()); |
+ } else if (mode == RelocInfo::EMBEDDED_OBJECT && |
+ Code::IsWeakEmbeddedObject(code->kind(), it.rinfo()->target_object())) { |
if (it.rinfo()->target_object()->IsMap()) { |
Handle<Map> map(Map::cast(it.rinfo()->target_object())); |
maps.Add(map, zone()); |
} else if (it.rinfo()->target_object()->IsJSObject()) { |
Handle<JSObject> object(JSObject::cast(it.rinfo()->target_object())); |
objects.Add(object, zone()); |
+ } else if (it.rinfo()->target_object()->IsCell()) { |
+ Handle<Cell> cell(Cell::cast(it.rinfo()->target_object())); |
+ cells.Add(cell, zone()); |
} |
} |
} |
@@ -174,6 +185,9 @@ void LCodeGenBase::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { |
for (int i = 0; i < objects.length(); i++) { |
AddWeakObjectToCodeDependency(isolate()->heap(), objects.at(i), code); |
} |
+ for (int i = 0; i < cells.length(); i++) { |
+ AddWeakObjectToCodeDependency(isolate()->heap(), cells.at(i), code); |
+ } |
} |