OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |