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

Unified Diff: src/ast.cc

Issue 1405503002: VectorICs: use a vector slot to aid in array literal processing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Code comments. Created 5 years, 2 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/ast.h ('k') | src/ast-numbering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.cc
diff --git a/src/ast.cc b/src/ast.cc
index 91b5c30dff26266a422addb6f75f2f59e8559563..f94e370f3c87aca452398881a3dd12c851eff8bf 100644
--- a/src/ast.cc
+++ b/src/ast.cc
@@ -547,6 +547,27 @@ void ArrayLiteral::BuildConstantElements(Isolate* isolate) {
}
+void ArrayLiteral::AssignFeedbackVectorSlots(Isolate* isolate,
+ FeedbackVectorSpec* spec,
+ FeedbackVectorSlotCache* cache) {
+ if (!FLAG_vector_stores) return;
+
+ // This logic that computes the number of slots needed for vector store
+ // ics must mirror FullCodeGenerator::VisitArrayLiteral.
+ int array_index = 0;
+ for (; array_index < values()->length(); array_index++) {
+ Expression* subexpr = values()->at(array_index);
+ if (subexpr->IsSpread()) break;
+ if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue;
+
+ // We'll reuse the same literal slot for all of the non-constant
+ // subexpressions that use a keyed store IC.
+ literal_slot_ = spec->AddKeyedStoreICSlot();
+ return;
+ }
+}
+
+
Handle<Object> MaterializedLiteral::GetBoilerplateValue(Expression* expression,
Isolate* isolate) {
if (expression->IsLiteral()) {
« no previous file with comments | « src/ast.h ('k') | src/ast-numbering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698