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/linkage.h" | 10 #include "src/compiler/linkage.h" |
(...skipping 1678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1689 void AstGraphBuilder::VisitLiteral(Literal* expr) { | 1689 void AstGraphBuilder::VisitLiteral(Literal* expr) { |
1690 Node* value = jsgraph()->Constant(expr->value()); | 1690 Node* value = jsgraph()->Constant(expr->value()); |
1691 ast_context()->ProduceValue(value); | 1691 ast_context()->ProduceValue(value); |
1692 } | 1692 } |
1693 | 1693 |
1694 | 1694 |
1695 void AstGraphBuilder::VisitRegExpLiteral(RegExpLiteral* expr) { | 1695 void AstGraphBuilder::VisitRegExpLiteral(RegExpLiteral* expr) { |
1696 Node* closure = GetFunctionClosure(); | 1696 Node* closure = GetFunctionClosure(); |
1697 | 1697 |
1698 // Create node to materialize a regular expression literal. | 1698 // Create node to materialize a regular expression literal. |
1699 Node* literal_index = jsgraph()->Constant(expr->literal_index()); | 1699 const Operator* op = javascript()->CreateLiteralRegExp( |
1700 Node* pattern = jsgraph()->Constant(expr->pattern()); | 1700 expr->pattern(), expr->flags(), expr->literal_index()); |
1701 Node* flags = jsgraph()->Constant(expr->flags()); | 1701 Node* literal = NewNode(op, closure); |
1702 const Operator* op = | |
1703 javascript()->CallRuntime(Runtime::kCreateRegExpLiteral, 4); | |
1704 Node* literal = NewNode(op, closure, literal_index, pattern, flags); | |
1705 PrepareFrameState(literal, expr->id(), ast_context()->GetStateCombine()); | 1702 PrepareFrameState(literal, expr->id(), ast_context()->GetStateCombine()); |
1706 ast_context()->ProduceValue(literal); | 1703 ast_context()->ProduceValue(literal); |
1707 } | 1704 } |
1708 | 1705 |
1709 | 1706 |
1710 void AstGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) { | 1707 void AstGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) { |
1711 Node* closure = GetFunctionClosure(); | 1708 Node* closure = GetFunctionClosure(); |
1712 | 1709 |
1713 // Create node to deep-copy the literal boilerplate. | 1710 // Create node to deep-copy the literal boilerplate. |
1714 const Operator* op = javascript()->CreateLiteralObject( | 1711 const Operator* op = javascript()->CreateLiteralObject( |
(...skipping 2593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4308 // Phi does not exist yet, introduce one. | 4305 // Phi does not exist yet, introduce one. |
4309 value = NewPhi(inputs, value, control); | 4306 value = NewPhi(inputs, value, control); |
4310 value->ReplaceInput(inputs - 1, other); | 4307 value->ReplaceInput(inputs - 1, other); |
4311 } | 4308 } |
4312 return value; | 4309 return value; |
4313 } | 4310 } |
4314 | 4311 |
4315 } // namespace compiler | 4312 } // namespace compiler |
4316 } // namespace internal | 4313 } // namespace internal |
4317 } // namespace v8 | 4314 } // namespace v8 |
OLD | NEW |