Commit f690334b authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[ic] Fix accessor set after map update transitioning to dict

Bug: chromium:979023
Change-Id: Ief42ed100478c0b741051a5ca123dc807e2a6dca
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1687671
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62501}
parent 89d93e38
...@@ -2217,12 +2217,12 @@ Handle<Map> Map::TransitionToAccessorProperty(Isolate* isolate, Handle<Map> map, ...@@ -2217,12 +2217,12 @@ Handle<Map> Map::TransitionToAccessorProperty(Isolate* isolate, Handle<Map> map,
DCHECK(!getter->IsNull(isolate) || !setter->IsNull(isolate)); DCHECK(!getter->IsNull(isolate) || !setter->IsNull(isolate));
DCHECK(name->IsUniqueName()); DCHECK(name->IsUniqueName());
// Dictionary maps can always have additional data properties.
if (map->is_dictionary_map()) return map;
// Migrate to the newest map before transitioning to the new property. // Migrate to the newest map before transitioning to the new property.
map = Update(isolate, map); map = Update(isolate, map);
// Dictionary maps can always have additional data properties.
if (map->is_dictionary_map()) return map;
PropertyNormalizationMode mode = map->is_prototype_map() PropertyNormalizationMode mode = map->is_prototype_map()
? KEEP_INOBJECT_PROPERTIES ? KEEP_INOBJECT_PROPERTIES
: CLEAR_INOBJECT_PROPERTIES; : CLEAR_INOBJECT_PROPERTIES;
......
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
function foo(arg) {
var ret = { x: arg };
Object.defineProperty(ret, "y", {
get: function () { },
configurable: true
});
return ret;
}
let v0 = foo(10);
let v1 = foo(10.5);
Object.defineProperty(v0, "y", {
get: function () { },
configurable: true
});
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