Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1545)

Unified Diff: src/stub-cache.cc

Issue 142973005: Unify calling to GenerateFastApiCallBody before stubbing it (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();
}
« no previous file with comments | « src/stub-cache.h ('k') | src/x64/stub-cache-x64.cc » ('j') | src/x64/stub-cache-x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698