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 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1503 | 1503 |
1504 void AstGraphBuilder::VisitDebuggerStatement(DebuggerStatement* stmt) { | 1504 void AstGraphBuilder::VisitDebuggerStatement(DebuggerStatement* stmt) { |
1505 Node* node = | 1505 Node* node = |
1506 NewNode(javascript()->CallRuntime(Runtime::kHandleDebuggerStatement, 0)); | 1506 NewNode(javascript()->CallRuntime(Runtime::kHandleDebuggerStatement, 0)); |
1507 PrepareFrameState(node, stmt->DebugBreakId()); | 1507 PrepareFrameState(node, stmt->DebugBreakId()); |
1508 environment()->MarkAllLocalsLive(); | 1508 environment()->MarkAllLocalsLive(); |
1509 } | 1509 } |
1510 | 1510 |
1511 | 1511 |
1512 void AstGraphBuilder::VisitFunctionLiteral(FunctionLiteral* expr) { | 1512 void AstGraphBuilder::VisitFunctionLiteral(FunctionLiteral* expr) { |
1513 Node* context = current_context(); | |
1514 | |
1515 // Find or build a shared function info. | 1513 // Find or build a shared function info. |
1516 Handle<SharedFunctionInfo> shared_info = | 1514 Handle<SharedFunctionInfo> shared_info = |
1517 Compiler::GetSharedFunctionInfo(expr, info()->script(), info()); | 1515 Compiler::GetSharedFunctionInfo(expr, info()->script(), info()); |
1518 CHECK(!shared_info.is_null()); // TODO(mstarzinger): Set stack overflow? | 1516 CHECK(!shared_info.is_null()); // TODO(mstarzinger): Set stack overflow? |
1519 | 1517 |
1520 // Create node to instantiate a new closure. | 1518 // Create node to instantiate a new closure. |
1521 PretenureFlag pretenure = expr->pretenure() ? TENURED : NOT_TENURED; | 1519 PretenureFlag pretenure = expr->pretenure() ? TENURED : NOT_TENURED; |
1522 const Operator* op = javascript()->CreateClosure(shared_info, pretenure); | 1520 const Operator* op = javascript()->CreateClosure(shared_info, pretenure); |
1523 Node* value = NewNode(op, context); | 1521 Node* value = NewNode(op); |
1524 ast_context()->ProduceValue(value); | 1522 ast_context()->ProduceValue(value); |
1525 } | 1523 } |
1526 | 1524 |
1527 | 1525 |
1528 void AstGraphBuilder::VisitClassLiteral(ClassLiteral* expr) { | 1526 void AstGraphBuilder::VisitClassLiteral(ClassLiteral* expr) { |
1529 if (expr->scope() == NULL) { | 1527 if (expr->scope() == NULL) { |
1530 // Visit class literal in the same scope, no declarations. | 1528 // Visit class literal in the same scope, no declarations. |
1531 VisitClassLiteralContents(expr); | 1529 VisitClassLiteralContents(expr); |
1532 } else { | 1530 } else { |
1533 // Visit declarations and class literal in a block scope. | 1531 // Visit declarations and class literal in a block scope. |
(...skipping 2732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4266 // Phi does not exist yet, introduce one. | 4264 // Phi does not exist yet, introduce one. |
4267 value = NewPhi(inputs, value, control); | 4265 value = NewPhi(inputs, value, control); |
4268 value->ReplaceInput(inputs - 1, other); | 4266 value->ReplaceInput(inputs - 1, other); |
4269 } | 4267 } |
4270 return value; | 4268 return value; |
4271 } | 4269 } |
4272 | 4270 |
4273 } // namespace compiler | 4271 } // namespace compiler |
4274 } // namespace internal | 4272 } // namespace internal |
4275 } // namespace v8 | 4273 } // namespace v8 |
OLD | NEW |