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

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

Issue 1165463007: Build ObjectLiteral constant properties in the numbering phase. (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 1678 matching lines...) Expand 10 before | Expand all | Expand 10 after
1689 Node* literal = NewNode(op, literals_array, literal_index, pattern, flags); 1689 Node* literal = NewNode(op, literals_array, literal_index, pattern, flags);
1690 PrepareFrameState(literal, expr->id(), ast_context()->GetStateCombine()); 1690 PrepareFrameState(literal, expr->id(), ast_context()->GetStateCombine());
1691 ast_context()->ProduceValue(literal); 1691 ast_context()->ProduceValue(literal);
1692 } 1692 }
1693 1693
1694 1694
1695 void AstGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) { 1695 void AstGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
1696 Node* closure = GetFunctionClosure(); 1696 Node* closure = GetFunctionClosure();
1697 1697
1698 // Create node to deep-copy the literal boilerplate. 1698 // Create node to deep-copy the literal boilerplate.
1699 expr->BuildConstantProperties(isolate());
1700 Node* literals_array = 1699 Node* literals_array =
1701 BuildLoadObjectField(closure, JSFunction::kLiteralsOffset); 1700 BuildLoadObjectField(closure, JSFunction::kLiteralsOffset);
1702 Node* literal_index = jsgraph()->Constant(expr->literal_index()); 1701 Node* literal_index = jsgraph()->Constant(expr->literal_index());
1703 Node* constants = jsgraph()->Constant(expr->constant_properties()); 1702 Node* constants = jsgraph()->Constant(expr->constant_properties());
1704 const Operator* op = 1703 const Operator* op =
1705 javascript()->CreateLiteralObject(expr->ComputeFlags(true)); 1704 javascript()->CreateLiteralObject(expr->ComputeFlags(true));
1706 Node* literal = NewNode(op, literals_array, literal_index, constants); 1705 Node* literal = NewNode(op, literals_array, literal_index, constants);
1707 PrepareFrameState(literal, expr->CreateLiteralId(), 1706 PrepareFrameState(literal, expr->CreateLiteralId(),
1708 OutputFrameStateCombine::Push()); 1707 OutputFrameStateCombine::Push());
1709 1708
(...skipping 2062 matching lines...) Expand 10 before | Expand all | Expand 10 after
3772 // Phi does not exist yet, introduce one. 3771 // Phi does not exist yet, introduce one.
3773 value = NewPhi(inputs, value, control); 3772 value = NewPhi(inputs, value, control);
3774 value->ReplaceInput(inputs - 1, other); 3773 value->ReplaceInput(inputs - 1, other);
3775 } 3774 }
3776 return value; 3775 return value;
3777 } 3776 }
3778 3777
3779 } // namespace compiler 3778 } // namespace compiler
3780 } // namespace internal 3779 } // namespace internal
3781 } // namespace v8 3780 } // 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