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

Unified Diff: src/x64/stub-cache-x64.cc

Issue 1694018: Add ability to bail out from custom call generators to x64 and ARM platforms. (Closed)
Patch Set: Created 10 years, 8 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
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/stub-cache-x64.cc
diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc
index a78f8b11b424bd2da551354c58aae1a61367116a..fcf2faaa69d56e42aed66fef7be4acef242ea1f7 100644
--- a/src/x64/stub-cache-x64.cc
+++ b/src/x64/stub-cache-x64.cc
@@ -689,6 +689,11 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object,
// rsp[(argc + 1) * 8] : argument 0 = receiver
// -----------------------------------
+ // If object is not an array, bail out to regular call.
+ if (!object->IsJSArray()) {
+ return Heap::undefined_value();
+ }
+
// TODO(639): faster implementation.
ASSERT(check == RECEIVER_MAP_CHECK);
@@ -745,6 +750,11 @@ Object* CallStubCompiler::CompileArrayPopCall(Object* object,
// rsp[(argc + 1) * 8] : argument 0 = receiver
// -----------------------------------
+ // If object is not an array, bail out to regular call.
+ if (!object->IsJSArray()) {
+ return Heap::undefined_value();
+ }
+
// TODO(642): faster implementation.
ASSERT(check == RECEIVER_MAP_CHECK);
@@ -805,7 +815,11 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
if (function_info->HasCustomCallGenerator()) {
CustomCallGenerator generator =
ToCData<CustomCallGenerator>(function_info->function_data());
- return generator(this, object, holder, function, name, check);
+ Object* result = generator(this, object, holder, function, name, check);
+ // undefined means bail out to regular compiler.
+ if (!result->IsUndefined()) {
+ return result;
+ }
}
Label miss;
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698