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

Side by Side Diff: src/compiler/ast-graph-builder.cc

Issue 1150323002: Move work to omit unnecessary ObjectLiteral stores to the numbering pass. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « src/ast-numbering.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/ast-graph-builder.h" 5 #include "src/compiler/ast-graph-builder.h"
6 6
7 #include "src/compiler.h" 7 #include "src/compiler.h"
8 #include "src/compiler/ast-loop-assignment-analyzer.h" 8 #include "src/compiler/ast-loop-assignment-analyzer.h"
9 #include "src/compiler/control-builders.h" 9 #include "src/compiler/control-builders.h"
10 #include "src/compiler/js-type-feedback.h" 10 #include "src/compiler/js-type-feedback.h"
(...skipping 1768 matching lines...) Expand 10 before | Expand all | Expand 10 after
1779 const Operator* op = 1779 const Operator* op =
1780 javascript()->CreateLiteralObject(expr->ComputeFlags(true)); 1780 javascript()->CreateLiteralObject(expr->ComputeFlags(true));
1781 Node* literal = NewNode(op, literals_array, literal_index, constants); 1781 Node* literal = NewNode(op, literals_array, literal_index, constants);
1782 PrepareFrameState(literal, expr->CreateLiteralId(), 1782 PrepareFrameState(literal, expr->CreateLiteralId(),
1783 OutputFrameStateCombine::Push()); 1783 OutputFrameStateCombine::Push());
1784 1784
1785 // The object is expected on the operand stack during computation of the 1785 // The object is expected on the operand stack during computation of the
1786 // property values and is the value of the entire expression. 1786 // property values and is the value of the entire expression.
1787 environment()->Push(literal); 1787 environment()->Push(literal);
1788 1788
1789 // Mark all computed expressions that are bound to a key that is shadowed by
1790 // a later occurrence of the same key. For the marked expressions, no store
1791 // code is emitted.
1792 expr->CalculateEmitStore(zone());
1793
1794 // Create nodes to store computed values into the literal. 1789 // Create nodes to store computed values into the literal.
1795 int property_index = 0; 1790 int property_index = 0;
1796 AccessorTable accessor_table(zone()); 1791 AccessorTable accessor_table(zone());
1797 for (; property_index < expr->properties()->length(); property_index++) { 1792 for (; property_index < expr->properties()->length(); property_index++) {
1798 ObjectLiteral::Property* property = expr->properties()->at(property_index); 1793 ObjectLiteral::Property* property = expr->properties()->at(property_index);
1799 if (property->is_computed_name()) break; 1794 if (property->is_computed_name()) break;
1800 if (property->IsCompileTimeValue()) continue; 1795 if (property->IsCompileTimeValue()) continue;
1801 1796
1802 Literal* key = property->key()->AsLiteral(); 1797 Literal* key = property->key()->AsLiteral();
1803 switch (property->kind()) { 1798 switch (property->kind()) {
(...skipping 1973 matching lines...) Expand 10 before | Expand all | Expand 10 after
3777 // Phi does not exist yet, introduce one. 3772 // Phi does not exist yet, introduce one.
3778 value = NewPhi(inputs, value, control); 3773 value = NewPhi(inputs, value, control);
3779 value->ReplaceInput(inputs - 1, other); 3774 value->ReplaceInput(inputs - 1, other);
3780 } 3775 }
3781 return value; 3776 return value;
3782 } 3777 }
3783 3778
3784 } // namespace compiler 3779 } // namespace compiler
3785 } // namespace internal 3780 } // namespace internal
3786 } // namespace v8 3781 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast-numbering.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698