Revision: 22031
Author:   [email protected]
Date:     Thu Jun 26 08:34:34 2014 UTC
Log: Avoid adjusting live bytes in JSObject::MigrateFastToFast() if the size delta is zero.

BUG=chromium:388880
LOG=N
[email protected]

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

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

=======================================
--- /branches/bleeding_edge/src/objects.cc      Thu Jun 26 00:40:45 2014 UTC
+++ /branches/bleeding_edge/src/objects.cc      Thu Jun 26 08:34:34 2014 UTC
@@ -2247,12 +2247,6 @@
     FieldIndex index = FieldIndex::ForPropertyIndex(*new_map, i);
     object->FastPropertyAtPut(index, array->get(external + i));
   }
-
-  // Create filler object past the new instance size.
-  int new_instance_size = new_map->instance_size();
-  int instance_size_delta = old_map->instance_size() - new_instance_size;
-  ASSERT(instance_size_delta >= 0);
-  Address address = object->address() + new_instance_size;

   Heap* heap = isolate->heap();

@@ -2263,8 +2257,17 @@
     object->set_properties(*array);
   }

-  heap->CreateFillerObjectAt(address, instance_size_delta);
-  heap->AdjustLiveBytes(address, -instance_size_delta, Heap::FROM_MUTATOR);
+  // Create filler object past the new instance size.
+  int new_instance_size = new_map->instance_size();
+  int instance_size_delta = old_map->instance_size() - new_instance_size;
+  ASSERT(instance_size_delta >= 0);
+
+  if (instance_size_delta > 0) {
+    Address address = object->address();
+    heap->CreateFillerObjectAt(
+        address + new_instance_size, instance_size_delta);
+ heap->AdjustLiveBytes(address, -instance_size_delta, Heap::FROM_MUTATOR);
+  }

// We are storing the new map using release store after creating a filler for
   // the left-over space to avoid races with the sweeper thread.

--
--
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/d/optout.

Reply via email to