Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 4ae8bba8a31d93242a9a3c876e436e17e9ba8a42..2293a54566abbc30d65d5fbc4ff809daa7f823f3 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -3315,11 +3315,19 @@ LiteralsArray* LiteralsArray::cast(Object* object) { |
TypeFeedbackVector* LiteralsArray::feedback_vector() const { |
+ if (length() == 0) { |
+ return TypeFeedbackVector::cast( |
+ const_cast<FixedArray*>(FixedArray::cast(this))); |
+ } |
return TypeFeedbackVector::cast(get(kVectorIndex)); |
} |
void LiteralsArray::set_feedback_vector(TypeFeedbackVector* vector) { |
+ if (length() <= kVectorIndex) { |
+ DCHECK(vector->length() == 0); |
+ return; |
+ } |
set(kVectorIndex, vector); |
} |
@@ -3333,6 +3341,9 @@ void LiteralsArray::set_literal(int literal_index, Object* literal) { |
set(kFirstLiteralIndex + literal_index, literal); |
} |
+void LiteralsArray::set_literal_undefined(int literal_index) { |
+ set_undefined(kFirstLiteralIndex + literal_index); |
+} |
int LiteralsArray::literals_count() const { |
return length() - kFirstLiteralIndex; |
@@ -5589,8 +5600,8 @@ ACCESSORS(SharedFunctionInfo, name, Object, kNameOffset) |
ACCESSORS(SharedFunctionInfo, optimized_code_map, FixedArray, |
kOptimizedCodeMapOffset) |
ACCESSORS(SharedFunctionInfo, construct_stub, Code, kConstructStubOffset) |
-ACCESSORS(SharedFunctionInfo, feedback_vector, TypeFeedbackVector, |
- kFeedbackVectorOffset) |
+ACCESSORS(SharedFunctionInfo, feedback_metadata, TypeFeedbackMetadata, |
+ kFeedbackMetadataOffset) |
#if TRACE_MAPS |
SMI_ACCESSORS(SharedFunctionInfo, unique_id, kUniqueIdOffset) |
#endif |
@@ -6258,6 +6269,10 @@ bool JSFunction::is_compiled() { |
code() != builtins->builtin(Builtins::kCompileOptimizedConcurrent); |
} |
+TypeFeedbackVector* JSFunction::feedback_vector() { |
+ LiteralsArray* array = literals(); |
+ return array->feedback_vector(); |
+} |
ACCESSORS(JSProxy, target, JSReceiver, kTargetOffset) |
ACCESSORS(JSProxy, handler, Object, kHandlerOffset) |