Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1115)

Unified Diff: src/objects.cc

Issue 333903003: Avoid adjusting live bytes in JSObject::MigrateFastToFast() if the size delta is zero. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 6a437d6b0a8b04d671ad493d1111e84af8dafdbe..aab918e231badf963241cf7e08c564180bdb5e86 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -2248,12 +2248,6 @@ void JSObject::MigrateFastToFast(Handle<JSObject> object, Handle<Map> new_map) {
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();
// If there are properties in the new backing store, trim it to the correct
@@ -2263,8 +2257,17 @@ void JSObject::MigrateFastToFast(Handle<JSObject> object, Handle<Map> new_map) {
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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698