Revision: 13331
Author:   [email protected]
Date:     Tue Jan  8 02:22:12 2013
Log:      Test fix: missing check for JSArray.

BUG=

Review URL: https://codereview.chromium.org/11801036
http://code.google.com/p/v8/source/detail?r=13331

Modified:
 /branches/bleeding_edge/src/objects.cc

=======================================
--- /branches/bleeding_edge/src/objects.cc      Tue Jan  8 01:03:16 2013
+++ /branches/bleeding_edge/src/objects.cc      Tue Jan  8 02:22:12 2013
@@ -9861,7 +9861,7 @@
         : FAST_DOUBLE_ELEMENTS;

     MaybeObject* trans = PossiblyTransitionArrayBoilerplate(to_kind);
-    if (trans != NULL && trans->IsFailure()) return trans;
+    if (trans->IsFailure()) return trans;

     MaybeObject* maybe =
         SetFastDoubleElementsCapacityAndLength(new_capacity, array_length);
@@ -10406,15 +10406,16 @@

 MaybeObject* JSObject::PossiblyTransitionArrayBoilerplate(
     ElementsKind to_kind) {
-  ASSERT(IsJSArray());
   MaybeObject* ret = NULL;
-  AllocationSiteInfo* info = AllocationSiteInfo::FindForJSObject(this);
-  if (info != NULL) {
-    JSObject* payload = JSObject::cast(info->payload());
-    if (payload->GetElementsKind() != to_kind) {
-      if (IsMoreGeneralElementsKindTransition(payload->GetElementsKind(),
-                                              to_kind)) {
-        ret = payload->TransitionElementsKind(to_kind);
+  if (IsJSArray()) {
+    AllocationSiteInfo* info = AllocationSiteInfo::FindForJSObject(this);
+    if (info != NULL) {
+      JSObject* payload = JSObject::cast(info->payload());
+      if (payload->GetElementsKind() != to_kind) {
+        if (IsMoreGeneralElementsKindTransition(payload->GetElementsKind(),
+                                                to_kind)) {
+          ret = payload->TransitionElementsKind(to_kind);
+        }
       }
     }
   }
@@ -10433,7 +10434,7 @@
   if (from_kind == to_kind) return this;

   MaybeObject* trans = PossiblyTransitionArrayBoilerplate(to_kind);
-  if (trans != NULL && trans->IsFailure()) return trans;
+  if (trans->IsFailure()) return trans;

   Isolate* isolate = GetIsolate();
   if (elements() == isolate->heap()->empty_fixed_array() ||

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

Reply via email to