Index: src/stub-cache.cc |
diff --git a/src/stub-cache.cc b/src/stub-cache.cc |
index f9918ed62ef46c1286f743f37584527b3a3f7349..f8607bfe60651747cc1ca44102d18b9c70d21369 100644 |
--- a/src/stub-cache.cc |
+++ b/src/stub-cache.cc |
@@ -1785,12 +1785,12 @@ int CallOptimization::GetPrototypeDepthOfExpectedType( |
if (expected_receiver_type_.is_null()) return 0; |
int depth = 0; |
while (!object.is_identical_to(holder)) { |
- if (object->IsInstanceOf(*expected_receiver_type_)) return depth; |
+ if (expected_receiver_type_->IsTemplateFor(object->map())) return depth; |
object = Handle<JSObject>(JSObject::cast(object->GetPrototype())); |
if (!object->map()->is_hidden_prototype()) return kInvalidProtoDepth; |
++depth; |
} |
- if (holder->IsInstanceOf(*expected_receiver_type_)) return depth; |
+ if (expected_receiver_type_->IsTemplateFor(holder->map())) return depth; |
return kInvalidProtoDepth; |
} |