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

Unified Diff: src/objects.cc

Issue 709123002: Revert "Avoid some unnecessary fast-properties map creations." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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 | src/runtime/runtime-object.cc » ('j') | 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 8303489701dd5522e758866856d7ac5d599fa5f9..63b7312c5108b3a4bc7953fbe450d7bdacbfa7c0 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -9505,17 +9505,13 @@ void JSObject::OptimizeAsPrototype(Handle<JSObject> object,
JSObject::NormalizeProperties(object, KEEP_INOBJECT_PROPERTIES, 0,
"NormalizeAsPrototype");
}
- bool has_just_copied_map = false;
if (!object->HasFastProperties()) {
JSObject::MigrateSlowToFast(object, 0, "OptimizeAsPrototype");
- has_just_copied_map = true;
}
if (mode == FAST_PROTOTYPE && object->HasFastProperties() &&
!object->map()->is_prototype_map()) {
- if (!has_just_copied_map) {
- Handle<Map> new_map = Map::Copy(handle(object->map()), "CopyAsPrototype");
- JSObject::MigrateToMap(object, new_map);
- }
+ Handle<Map> new_map = Map::Copy(handle(object->map()), "CopyAsPrototype");
+ JSObject::MigrateToMap(object, new_map);
object->map()->set_is_prototype_map(true);
}
}
« no previous file with comments | « no previous file | src/runtime/runtime-object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698