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

Unified Diff: src/objects-inl.h

Issue 2674593003: [TypeFeedbackVector] Root feedback vectors at function literal site. (Closed)
Patch Set: REBASE+liveedit fix. 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/objects-printer.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 cb0e73b5dbdfa72dbb70f398b956bab3bae5aa20..1184423097d328492808776e15d7fd5f1609a08c 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -5654,8 +5654,7 @@ ACCESSORS(JSBoundFunction, bound_this, Object, kBoundThisOffset)
ACCESSORS(JSBoundFunction, bound_arguments, FixedArray, kBoundArgumentsOffset)
ACCESSORS(JSFunction, shared, SharedFunctionInfo, kSharedFunctionInfoOffset)
-ACCESSORS(JSFunction, feedback_vector, TypeFeedbackVector,
- kFeedbackVectorOffset)
+ACCESSORS(JSFunction, feedback_vector_cell, Cell, kFeedbackVectorOffset)
ACCESSORS(JSFunction, next_function_link, Object, kNextFunctionLinkOffset)
ACCESSORS(JSGlobalObject, native_context, Context, kNativeContextOffset)
@@ -6480,6 +6479,10 @@ bool SharedFunctionInfo::OptimizedCodeMapIsCleared() const {
return optimized_code_map() == GetHeap()->empty_fixed_array();
}
+TypeFeedbackVector* JSFunction::feedback_vector() const {
+ DCHECK(feedback_vector_cell()->value()->IsTypeFeedbackVector());
+ return TypeFeedbackVector::cast(feedback_vector_cell()->value());
+}
bool JSFunction::IsOptimized() {
return code()->kind() == Code::OPTIMIZED_FUNCTION;
@@ -6587,6 +6590,14 @@ void JSFunction::ReplaceCode(Code* code) {
}
}
+bool JSFunction::has_feedback_vector() const {
+ SharedFunctionInfo* shared = this->shared();
+
+ return (feedback_vector_cell()->value() !=
+ shared->GetIsolate()->heap()->empty_type_feedback_vector() ||
+ (shared->feedback_metadata()->slot_count() == 0 &&
+ shared->num_literals() == 0));
+}
Context* JSFunction::context() {
return Context::cast(READ_FIELD(this, kContextOffset));
« no previous file with comments | « src/objects.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698