Commit 6003457c authored by Marja Hölttä's avatar Marja Hölttä Committed by Commit Bot

[objects] Minor cleanup (remove condition which is always true).

Bug: 
Change-Id: I8f82cba33f19c56b169f6bb641bf16301d578a0a
Reviewed-on: https://chromium-review.googlesource.com/758368Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49264}
parent 9eb92da6
...@@ -12371,17 +12371,14 @@ void JSObject::OptimizeAsPrototype(Handle<JSObject> object) { ...@@ -12371,17 +12371,14 @@ void JSObject::OptimizeAsPrototype(Handle<JSObject> object) {
JSObject::NormalizeProperties(object, KEEP_INOBJECT_PROPERTIES, 0, JSObject::NormalizeProperties(object, KEEP_INOBJECT_PROPERTIES, 0,
"NormalizeAsPrototype"); "NormalizeAsPrototype");
} }
Handle<Map> previous_map(object->map());
if (object->map()->is_prototype_map()) { if (object->map()->is_prototype_map()) {
if (object->map()->should_be_fast_prototype_map() && if (object->map()->should_be_fast_prototype_map() &&
!object->HasFastProperties()) { !object->HasFastProperties()) {
JSObject::MigrateSlowToFast(object, 0, "OptimizeAsPrototype"); JSObject::MigrateSlowToFast(object, 0, "OptimizeAsPrototype");
} }
} else { } else {
if (object->map() == *previous_map) {
Handle<Map> new_map = Map::Copy(handle(object->map()), "CopyAsPrototype"); Handle<Map> new_map = Map::Copy(handle(object->map()), "CopyAsPrototype");
JSObject::MigrateToMap(object, new_map); JSObject::MigrateToMap(object, new_map);
}
object->map()->set_is_prototype_map(true); object->map()->set_is_prototype_map(true);
// Replace the pointer to the exact constructor with the Object function // Replace the pointer to the exact constructor with the Object function
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment