Commit 29691f80 authored by Yang Guo's avatar Yang Guo Committed by Commit Bot

[snapshot] correctly clear feedback vector before serialization.

R=jgruber@chromium.org

Bug: v8:6422
Change-Id: Ib1075259325627451060b3a0a41cad5c917dc30e
Reviewed-on: https://chromium-review.googlesource.com/650246Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47814}
parent 75bbd19f
...@@ -341,9 +341,7 @@ void FeedbackVector::EvictOptimizedCodeMarkedForDeoptimization( ...@@ -341,9 +341,7 @@ void FeedbackVector::EvictOptimizedCodeMarkedForDeoptimization(
} }
} }
void FeedbackVector::ClearSlots(JSFunction* host_function) { bool FeedbackVector::ClearSlots(Isolate* isolate) {
Isolate* isolate = GetIsolate();
Object* uninitialized_sentinel = Object* uninitialized_sentinel =
FeedbackVector::RawUninitializedSentinel(isolate); FeedbackVector::RawUninitializedSentinel(isolate);
...@@ -442,9 +440,7 @@ void FeedbackVector::ClearSlots(JSFunction* host_function) { ...@@ -442,9 +440,7 @@ void FeedbackVector::ClearSlots(JSFunction* host_function) {
} }
} }
} }
if (feedback_updated) { return feedback_updated;
IC::OnFeedbackChanged(isolate, this, host_function);
}
} }
Handle<FixedArray> FeedbackNexus::EnsureArrayOfSize(int length) { Handle<FixedArray> FeedbackNexus::EnsureArrayOfSize(int length) {
......
...@@ -224,8 +224,8 @@ class FeedbackVector : public HeapObject { ...@@ -224,8 +224,8 @@ class FeedbackVector : public HeapObject {
DECL_PRINTER(FeedbackVector) DECL_PRINTER(FeedbackVector)
DECL_VERIFIER(FeedbackVector) DECL_VERIFIER(FeedbackVector)
// Clears the vector slots. // Clears the vector slots. Return true if feedback has changed.
void ClearSlots(JSFunction* host_function); bool ClearSlots(Isolate* isolate);
// The object that indicates an uninitialized cache. // The object that indicates an uninitialized cache.
static inline Handle<Symbol> UninitializedSentinel(Isolate* isolate); static inline Handle<Symbol> UninitializedSentinel(Isolate* isolate);
......
...@@ -14157,7 +14157,10 @@ int AbstractCode::SourceStatementPosition(int offset) { ...@@ -14157,7 +14157,10 @@ int AbstractCode::SourceStatementPosition(int offset) {
void JSFunction::ClearTypeFeedbackInfo() { void JSFunction::ClearTypeFeedbackInfo() {
if (feedback_vector_cell()->value()->IsFeedbackVector()) { if (feedback_vector_cell()->value()->IsFeedbackVector()) {
FeedbackVector* vector = feedback_vector(); FeedbackVector* vector = feedback_vector();
vector->ClearSlots(this); Isolate* isolate = GetIsolate();
if (vector->ClearSlots(isolate)) {
IC::OnFeedbackChanged(isolate, vector, this);
}
} }
} }
......
...@@ -95,11 +95,8 @@ void PartialSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code, ...@@ -95,11 +95,8 @@ void PartialSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code,
FlushSkip(skip); FlushSkip(skip);
// Clear literal boilerplates. // Clear literal boilerplates and feedback.
if (obj->IsJSFunction()) { if (obj->IsFeedbackVector()) FeedbackVector::cast(obj)->ClearSlots(isolate_);
JSFunction* function = JSFunction::cast(obj);
function->ClearTypeFeedbackInfo();
}
if (obj->IsJSObject()) { if (obj->IsJSObject()) {
JSObject* jsobj = JSObject::cast(obj); JSObject* jsobj = JSObject::cast(obj);
......
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