Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Unified Diff: src/objects-inl.h

Issue 2681773004: [FeedbackVector] Clarify the way the feedback vector is installed. (Closed)
Patch Set: Code comments+REBASE. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.cc ('k') | src/runtime/runtime-interpreter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
}
« no previous file with comments | « src/objects.cc ('k') | src/runtime/runtime-interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698