Commit 43098ecb authored by Deepti Gandluri's avatar Deepti Gandluri Committed by Commit Bot

Revert "[CloneObjectIC] overwrite monomorphic/polymorphic feedback if deprecated"

This reverts commit 670fa86f.

Reason for revert: Causes gc-stress bots to fail - 
https://logs.chromium.org/logs/v8/buildbucket/cr-buildbucket.appspot.com/8939819990688690880/+/steps/Check_-_d8/0/logs/object-spread-ic/0
https://logs.chromium.org/logs/v8/buildbucket/cr-buildbucket.appspot.com/8939819696982258192/+/steps/Check_-_d8/0/logs/object-spread-ic/0

Original change's description:
> [CloneObjectIC] overwrite monomorphic/polymorphic feedback if deprecated
> 
> An object with a deprecated Map which has already been cached in
> CloneObjectIC feedback is still a valid Map for fast cloning --- but
> to be consistent with other ICs, deprecated maps are ignored, and are
> expected to be transitioned away from.
> 
> If the source object has a deprecated map, the instance is migrated.
> 
> BUG=v8:7611, chromium:867958
> R=​jkummerow@chromium.org, mvstanton@chromium.org
> 
> Change-Id: I9771b00400fb4dda45a62e874a31d9b50630d847
> Reviewed-on: https://chromium-review.googlesource.com/1152414
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Commit-Queue: Caitlin Potter <caitp@igalia.com>
> Cr-Commit-Position: refs/heads/master@{#54758}

TBR=jkummerow@chromium.org,mvstanton@chromium.org,caitp@igalia.com

Change-Id: Id17652ad6f3f09adb43848069549ad146d48b2d7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7611, chromium:867958
Reviewed-on: https://chromium-review.googlesource.com/1153747Reviewed-by: 's avatarDeepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54760}
parent 6cd560b2
...@@ -756,14 +756,13 @@ void FeedbackNexus::ConfigureCloneObject(Handle<Map> source_map, ...@@ -756,14 +756,13 @@ void FeedbackNexus::ConfigureCloneObject(Handle<Map> source_map,
SetFeedbackExtra(*result_map); SetFeedbackExtra(*result_map);
break; break;
case MONOMORPHIC: case MONOMORPHIC:
if (maybe_feedback->IsClearedWeakHeapObject() || if (maybe_feedback->IsClearedWeakHeapObject()) {
Map::cast(*feedback)->is_deprecated()) {
// Remain in MONOMORPHIC state if previous feedback has been collected. // Remain in MONOMORPHIC state if previous feedback has been collected.
SetFeedback(HeapObjectReference::Weak(*source_map)); SetFeedback(HeapObjectReference::Weak(*source_map));
SetFeedbackExtra(*result_map); SetFeedbackExtra(*result_map);
} else { } else {
// Transition to POLYMORPHIC. // Transition to POLYMORPHIC.
DCHECK(!source_map.is_identical_to(feedback)); DCHECK_NE(*source_map, *feedback);
Handle<WeakFixedArray> array = Handle<WeakFixedArray> array =
EnsureArrayOfSize(2 * kCloneObjectPolymorphicEntrySize); EnsureArrayOfSize(2 * kCloneObjectPolymorphicEntrySize);
array->Set(0, maybe_feedback); array->Set(0, maybe_feedback);
...@@ -779,12 +778,10 @@ void FeedbackNexus::ConfigureCloneObject(Handle<Map> source_map, ...@@ -779,12 +778,10 @@ void FeedbackNexus::ConfigureCloneObject(Handle<Map> source_map,
Handle<WeakFixedArray> array = Handle<WeakFixedArray>::cast(feedback); Handle<WeakFixedArray> array = Handle<WeakFixedArray>::cast(feedback);
int i = 0; int i = 0;
for (; i < array->length(); i += kCloneObjectPolymorphicEntrySize) { for (; i < array->length(); i += kCloneObjectPolymorphicEntrySize) {
MaybeObjectHandle feedback(array->Get(i), isolate); if (array->Get(i)->IsClearedWeakHeapObject()) {
if (feedback->IsClearedWeakHeapObject() ||
Map::cast(*feedback.object())->is_deprecated()) {
break; break;
} }
DCHECK(!feedback.object().is_identical_to(source_map)); DCHECK_NE(array->Get(i)->GetHeapObject(), *source_map);
} }
if (i >= array->length()) { if (i >= array->length()) {
......
...@@ -2549,9 +2549,6 @@ RUNTIME_FUNCTION(Runtime_CloneObjectIC_Miss) { ...@@ -2549,9 +2549,6 @@ RUNTIME_FUNCTION(Runtime_CloneObjectIC_Miss) {
DCHECK_EQ(4, args.length()); DCHECK_EQ(4, args.length());
Handle<HeapObject> source = args.at<HeapObject>(0); Handle<HeapObject> source = args.at<HeapObject>(0);
int flags = args.smi_at(1); int flags = args.smi_at(1);
MigrateDeprecated(source);
FeedbackSlot slot = FeedbackVector::ToSlot(args.smi_at(2)); FeedbackSlot slot = FeedbackVector::ToSlot(args.smi_at(2));
Handle<FeedbackVector> vector = args.at<FeedbackVector>(3); Handle<FeedbackVector> vector = args.at<FeedbackVector>(3);
......
// Copyright 2018 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.
// Check that encountering deprecated Maps does not cause CloneObjectIC to
// crash.
var obj1 = { x: 1 };
var obj2 = { x: 2 }; // same map
obj2.x = null; // deprecate map
function f() { return { ...obj1 } };
assertEquals({ x: 1 }, f()); // missed, object migrated to cached new map
assertEquals({ x: 1 }, f()); // monomorphic cache-hit
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