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

Unified Diff: src/objects-inl.h

Issue 2674593003: [TypeFeedbackVector] Root feedback vectors at function literal site. (Closed)
Patch Set: REBASE. Created 3 years, 11 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
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index db3c1c2b0f05b304675f71e72253ea7ffa2ece29..d1d3f99af805b173c5c0006c124ed09e936ec21d 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -5655,8 +5655,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)
@@ -6481,6 +6480,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;
@@ -6588,6 +6591,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));

Powered by Google App Engine
This is Rietveld 408576698