Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 094c7ded8dd718f0866898abfea094dfae343f1e..c7f7d4ff67a2fdaf9e3bc80516d41832adc7d632 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -6596,6 +6596,18 @@ bool JSFunction::has_feedback_vector() const { |
return !feedback_vector_cell()->value()->IsUndefined(GetIsolate()); |
} |
+JSFunction::FeedbackVectorState JSFunction::GetFeedbackVectorState( |
+ Isolate* isolate) const { |
+ Cell* cell = feedback_vector_cell(); |
+ if (cell == isolate->heap()->undefined_cell()) { |
+ return TOP_LEVEL_SCRIPT_NEEDS_VECTOR; |
+ } else if (cell->value() == isolate->heap()->undefined_value() || |
+ !has_feedback_vector()) { |
+ return NEEDS_VECTOR; |
+ } |
+ return HAS_VECTOR; |
+} |
+ |
Context* JSFunction::context() { |
return Context::cast(READ_FIELD(this, kContextOffset)); |
} |