Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 2212e575ebc704d2c3e813c954b90945fe2648ed..6cb5e212026de06051e8d83d9000964d4e3a7ba5 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -10550,7 +10550,23 @@ void Code::FindAllMaps(MapHandleList* maps) { |
for (RelocIterator it(this, mask); !it.done(); it.next()) { |
RelocInfo* info = it.rinfo(); |
Object* object = info->target_object(); |
- if (object->IsMap()) maps->Add(Handle<Map>(Map::cast(object))); |
+ if (object->IsMap()) maps->Add(handle(Map::cast(object))); |
+ } |
+} |
+ |
+ |
+void Code::FindAllTypes(TypeHandleList* types) { |
+ ASSERT(is_inline_cache_stub()); |
+ DisallowHeapAllocation no_allocation; |
+ int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
+ Isolate* isolate = GetIsolate(); |
+ for (RelocIterator it(this, mask); !it.done(); it.next()) { |
+ RelocInfo* info = it.rinfo(); |
+ Object* object = info->target_object(); |
+ if (object->IsMap()) { |
+ Handle<Map> map(Map::cast(object)); |
+ types->Add(handle(IC::MapToType(map), isolate)); |
+ } |
} |
} |