Revision: 18051
Author:   [email protected]
Date:     Mon Nov 25 13:27:36 2013 UTC
Log:      Fix failing test test-api/CheckCOWArraysCreatedRuntimeCounter

[email protected]

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

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

=======================================
--- /branches/bleeding_edge/src/objects.cc      Mon Nov 25 12:41:27 2013 UTC
+++ /branches/bleeding_edge/src/objects.cc      Mon Nov 25 13:27:36 2013 UTC
@@ -5737,6 +5737,13 @@
   }

   ASSERT(copying || copy.is_identical_to(object));
+
+  ElementsKind kind = copy->GetElementsKind();
+  if (copying && IsFastSmiOrObjectElementsKind(kind) &&
+      FixedArray::cast(copy->elements())->map() ==
+        isolate->heap()->fixed_cow_array_map()) {
+    isolate->counters()->cow_arrays_created_runtime()->Increment();
+  }

   if (!shallow) {
     HandleScope scope(isolate);
@@ -5793,16 +5800,13 @@
     // Deep copy local elements.
     // Pixel elements cannot be created using an object literal.
     ASSERT(!copy->HasExternalArrayElements());
-    switch (copy->GetElementsKind()) {
+    switch (kind) {
       case FAST_SMI_ELEMENTS:
       case FAST_ELEMENTS:
       case FAST_HOLEY_SMI_ELEMENTS:
       case FAST_HOLEY_ELEMENTS: {
         Handle<FixedArray> elements(FixedArray::cast(copy->elements()));
         if (elements->map() == isolate->heap()->fixed_cow_array_map()) {
-          if (copying) {
-            isolate->counters()->cow_arrays_created_runtime()->Increment();
-          }
 #ifdef DEBUG
           for (int i = 0; i < elements->length(); i++) {
             ASSERT(!elements->get(i)->IsJSObject());

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to