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

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

Issue 1472423002: Revert of [turbofan] Introduce proper JSCreateLiteralRegExp operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 | « no previous file | src/compiler/js-generic-lowering.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/linkage.h" 10 #include "src/compiler/linkage.h"
(...skipping 1678 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 const Operator* op = javascript()->CreateLiteralRegExp( 1699 Node* literal_index = jsgraph()->Constant(expr->literal_index());
1700 expr->pattern(), expr->flags(), expr->literal_index()); 1700 Node* pattern = jsgraph()->Constant(expr->pattern());
1701 Node* literal = NewNode(op, closure); 1701 Node* flags = jsgraph()->Constant(expr->flags());
1702 const Operator* op =
1703 javascript()->CallRuntime(Runtime::kCreateRegExpLiteral, 4);
1704 Node* literal = NewNode(op, closure, literal_index, pattern, flags);
1702 PrepareFrameState(literal, expr->id(), ast_context()->GetStateCombine()); 1705 PrepareFrameState(literal, expr->id(), ast_context()->GetStateCombine());
1703 ast_context()->ProduceValue(literal); 1706 ast_context()->ProduceValue(literal);
1704 } 1707 }
1705 1708
1706 1709
1707 void AstGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) { 1710 void AstGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
1708 Node* closure = GetFunctionClosure(); 1711 Node* closure = GetFunctionClosure();
1709 1712
1710 // Create node to deep-copy the literal boilerplate. 1713 // Create node to deep-copy the literal boilerplate.
1711 const Operator* op = javascript()->CreateLiteralObject( 1714 const Operator* op = javascript()->CreateLiteralObject(
(...skipping 2593 matching lines...) Expand 10 before | Expand all | Expand 10 after
4305 // Phi does not exist yet, introduce one. 4308 // Phi does not exist yet, introduce one.
4306 value = NewPhi(inputs, value, control); 4309 value = NewPhi(inputs, value, control);
4307 value->ReplaceInput(inputs - 1, other); 4310 value->ReplaceInput(inputs - 1, other);
4308 } 4311 }
4309 return value; 4312 return value;
4310 } 4313 }
4311 4314
4312 } // namespace compiler 4315 } // namespace compiler
4313 } // namespace internal 4316 } // namespace internal
4314 } // namespace v8 4317 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698