Index: src/mips/lithium-codegen-mips.cc |
diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc |
index ab713a3cec4a06d74e6c4e3edf1980eae0789283..265cb43e2097457b165ff681fdb209825a5d3f97 100644 |
--- a/src/mips/lithium-codegen-mips.cc |
+++ b/src/mips/lithium-codegen-mips.cc |
@@ -835,14 +835,16 @@ void LCodeGen::DeoptimizeIf(Condition condition, |
void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { |
ZoneList<Handle<Map> > maps(1, zone()); |
+ ZoneList<Handle<JSObject> > objects(1, zone()); |
int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { |
- RelocInfo::Mode mode = it.rinfo()->rmode(); |
- if (mode == RelocInfo::EMBEDDED_OBJECT && |
- it.rinfo()->target_object()->IsMap()) { |
- Handle<Map> map(Map::cast(it.rinfo()->target_object())); |
- if (map->CanTransition()) { |
+ if (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()); |
} |
} |
} |
@@ -855,6 +857,9 @@ void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { |
for (int i = 0; i < maps.length(); i++) { |
maps.at(i)->AddDependentCode(DependentCode::kWeaklyEmbeddedGroup, code); |
} |
+ for (int i = 0; i < objects.length(); i++) { |
+ AddWeakObjectToCodeDependency(isolate()->heap(), objects.at(i), code); |
+ } |
} |