| Index: src/stub-cache.cc
|
| diff --git a/src/stub-cache.cc b/src/stub-cache.cc
|
| index 7cb02f6a241f97bbe24bdd4b3c4d61798a32244c..3d33367850e89e2c3ffd00acbe5bbed09ef26842 100644
|
| --- a/src/stub-cache.cc
|
| +++ b/src/stub-cache.cc
|
| @@ -1959,20 +1959,18 @@ CallOptimization::CallOptimization(Handle<JSFunction> function) {
|
| }
|
|
|
|
|
| -int CallOptimization::GetPrototypeDepthOfExpectedType(
|
| +Handle<JSObject> CallOptimization::GetPrototypeOfExpectedType(
|
| Handle<JSObject> object,
|
| Handle<JSObject> holder) const {
|
| ASSERT(is_simple_api_call());
|
| - if (expected_receiver_type_.is_null()) return 0;
|
| - int depth = 0;
|
| + if (expected_receiver_type_.is_null()) return object;
|
| while (!object.is_identical_to(holder)) {
|
| - if (expected_receiver_type_->IsTemplateFor(object->map())) return depth;
|
| + if (expected_receiver_type_->IsTemplateFor(object->map())) return object;
|
| object = Handle<JSObject>(JSObject::cast(object->GetPrototype()));
|
| - if (!object->map()->is_hidden_prototype()) return kInvalidProtoDepth;
|
| - ++depth;
|
| + if (!object->map()->is_hidden_prototype()) return Handle<JSObject>::null();
|
| }
|
| - if (expected_receiver_type_->IsTemplateFor(holder->map())) return depth;
|
| - return kInvalidProtoDepth;
|
| + if (expected_receiver_type_->IsTemplateFor(holder->map())) return object;
|
| + return Handle<JSObject>::null();
|
| }
|
|
|
|
|
|
|