Index: src/arm/stub-cache-arm.cc |
diff --git a/src/arm/stub-cache-arm.cc b/src/arm/stub-cache-arm.cc |
index aec937d626f4b991e8848e2f563980ea1faabc58..e182bede76f39499a963be6dfa2b0299a3ae86da 100644 |
--- a/src/arm/stub-cache-arm.cc |
+++ b/src/arm/stub-cache-arm.cc |
@@ -837,6 +837,11 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object, |
// -- lr : return address |
// ----------------------------------- |
+ // 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); |
@@ -886,6 +891,11 @@ Object* CallStubCompiler::CompileArrayPopCall(Object* object, |
// -- lr : return address |
// ----------------------------------- |
+ // 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); |
@@ -938,7 +948,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; |