Index: src/lithium.cc |
diff --git a/src/lithium.cc b/src/lithium.cc |
index c15e9dbee2612f8e670a036a42357e76302c725e..e9991cb81e0c777002556b78af3e66c20dc63588 100644 |
--- a/src/lithium.cc |
+++ b/src/lithium.cc |
@@ -448,6 +448,10 @@ void LChunk::RegisterWeakObjectsInOptimizedCode(Handle<Code> code) const { |
} |
} |
for (int i = 0; i < maps.length(); i++) { |
+ if (maps.at(i)->dependent_code()->number_of_entries( |
+ DependentCode::kWeakCodeGroup) == 0) { |
+ isolate()->heap()->AddRetainedMap(maps.at(i)); |
+ } |
Map::AddDependentCode(maps.at(i), DependentCode::kWeakCodeGroup, code); |
} |
for (int i = 0; i < objects.length(); i++) { |