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; |