Revision: 4549
Author: [email protected]
Date: Thu Apr 29 06:58:39 2010
Log: Add ability to bail out from custom call generators to x64 and ARM platforms.

http://code.google.com/p/v8/source/detail?r=4503 added this functionality to ia32.

Review URL: http://codereview.chromium.org/1694018
http://code.google.com/p/v8/source/detail?r=4549

Modified:
 /branches/bleeding_edge/src/arm/stub-cache-arm.cc
 /branches/bleeding_edge/src/x64/stub-cache-x64.cc

=======================================
--- /branches/bleeding_edge/src/arm/stub-cache-arm.cc Wed Apr 28 07:06:35 2010 +++ /branches/bleeding_edge/src/arm/stub-cache-arm.cc Thu Apr 29 06:58:39 2010
@@ -1086,6 +1086,11 @@
   //  -- r2    : name
   //  -- 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);
@@ -1135,6 +1140,11 @@
   //  -- r2    : name
   //  -- 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);
@@ -1188,7 +1198,11 @@
   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_in_smi_check;
=======================================
--- /branches/bleeding_edge/src/x64/stub-cache-x64.cc Wed Apr 28 07:06:35 2010 +++ /branches/bleeding_edge/src/x64/stub-cache-x64.cc Thu Apr 29 06:58:39 2010
@@ -868,6 +868,11 @@
   // rsp[argc * 8]       : argument 1
   // 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);
@@ -924,6 +929,11 @@
   // rsp[argc * 8]       : argument 1
   // 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);
@@ -985,7 +995,11 @@
   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_in_smi_check;

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to