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

Unified Diff: src/objects-inl.h

Issue 2642933003: Revert of Revert [TypeFeedbackVector] Root literal arrays in function literal slots (Closed)
Patch Set: 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
« 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 21278929c4f145df795179598b0dd66ca5bacfb3..65f12cadfb318271696cc9c192ecfee5a0a0e7db 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -3453,12 +3453,16 @@
return reinterpret_cast<LiteralsArray*>(object);
}
+bool LiteralsArray::has_feedback_vector() const {
+ return !get(kVectorIndex)->IsUndefined(this->GetIsolate());
+}
TypeFeedbackVector* LiteralsArray::feedback_vector() const {
- if (length() == 0) {
+ if (length() == 0 || !has_feedback_vector()) {
return TypeFeedbackVector::cast(
- const_cast<FixedArray*>(FixedArray::cast(this)));
- }
+ this->GetIsolate()->heap()->empty_type_feedback_vector());
+ }
+
return TypeFeedbackVector::cast(get(kVectorIndex));
}
@@ -6594,6 +6598,13 @@
}
}
+bool JSFunction::has_literals_array() const {
+ SharedFunctionInfo* shared = this->shared();
+
+ return (literals() != shared->GetIsolate()->heap()->empty_literals_array() ||
+ (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/runtime/runtime-interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698