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); |
} |
} |