Commit 651e1e50 authored by Jakob Gruber's avatar Jakob Gruber Committed by V8 LUCI CQ

[compiler] Take stability dependency on primitive wrapper map

The stability dependency should be taken on the primitive wrapper map,
not the primitive map (which is guaranteed to remain stable).

Note that the primitive wrapper map itself *also* stays stable; but
changing the position of the call here avoids having to think deeply
about this at all in the future.

Bug: v8:7790
Change-Id: I9b79b9df0d8d49f0c6249c6cd906142bda1ff5cd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3053578Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75906}
parent 40522a48
...@@ -873,7 +873,6 @@ void CompilationDependencies::DependOnStablePrototypeChains( ...@@ -873,7 +873,6 @@ void CompilationDependencies::DependOnStablePrototypeChains(
ZoneVector<MapRef> const& receiver_maps, WhereToStart start, ZoneVector<MapRef> const& receiver_maps, WhereToStart start,
base::Optional<JSObjectRef> last_prototype) { base::Optional<JSObjectRef> last_prototype) {
for (MapRef receiver_map : receiver_maps) { for (MapRef receiver_map : receiver_maps) {
if (start == kStartAtReceiver) DependOnStableMap(receiver_map);
if (receiver_map.IsPrimitiveMap()) { if (receiver_map.IsPrimitiveMap()) {
// Perform the implicit ToObject for primitives here. // Perform the implicit ToObject for primitives here.
// Implemented according to ES6 section 7.3.2 GetV (V, P). // Implemented according to ES6 section 7.3.2 GetV (V, P).
...@@ -883,6 +882,7 @@ void CompilationDependencies::DependOnStablePrototypeChains( ...@@ -883,6 +882,7 @@ void CompilationDependencies::DependOnStablePrototypeChains(
CHECK(constructor.has_value()); CHECK(constructor.has_value());
receiver_map = constructor->initial_map(this); receiver_map = constructor->initial_map(this);
} }
if (start == kStartAtReceiver) DependOnStableMap(receiver_map);
DependOnStablePrototypeChain(this, receiver_map, last_prototype); DependOnStablePrototypeChain(this, receiver_map, last_prototype);
} }
} }
......
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