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 1455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1466 // Build a new shared function info if we cannot find one in the baseline | 1466 // Build a new shared function info if we cannot find one in the baseline |
1467 // code. We also have a stack overflow if the recursive compilation did. | 1467 // code. We also have a stack overflow if the recursive compilation did. |
1468 expr->InitializeSharedInfo(handle(info()->shared_info()->code())); | 1468 expr->InitializeSharedInfo(handle(info()->shared_info()->code())); |
1469 Handle<SharedFunctionInfo> shared_info = expr->shared_info(); | 1469 Handle<SharedFunctionInfo> shared_info = expr->shared_info(); |
1470 if (shared_info.is_null()) { | 1470 if (shared_info.is_null()) { |
1471 shared_info = Compiler::BuildFunctionInfo(expr, info()->script(), info()); | 1471 shared_info = Compiler::BuildFunctionInfo(expr, info()->script(), info()); |
1472 CHECK(!shared_info.is_null()); // TODO(mstarzinger): Set stack overflow? | 1472 CHECK(!shared_info.is_null()); // TODO(mstarzinger): Set stack overflow? |
1473 } | 1473 } |
1474 | 1474 |
1475 // Create node to instantiate a new closure. | 1475 // Create node to instantiate a new closure. |
1476 Node* info = jsgraph()->Constant(shared_info); | 1476 PretenureFlag pretenure = expr->pretenure() ? TENURED : NOT_TENURED; |
1477 Node* pretenure = jsgraph()->BooleanConstant(expr->pretenure()); | 1477 const Operator* op = javascript()->CreateClosure(shared_info, pretenure); |
1478 const Operator* op = javascript()->CallRuntime(Runtime::kNewClosure, 3); | 1478 Node* value = NewNode(op, context); |
1479 Node* value = NewNode(op, context, info, pretenure); | |
1480 ast_context()->ProduceValue(value); | 1479 ast_context()->ProduceValue(value); |
1481 } | 1480 } |
1482 | 1481 |
1483 | 1482 |
1484 void AstGraphBuilder::VisitClassLiteral(ClassLiteral* expr) { | 1483 void AstGraphBuilder::VisitClassLiteral(ClassLiteral* expr) { |
1485 if (expr->scope() == NULL) { | 1484 if (expr->scope() == NULL) { |
1486 // Visit class literal in the same scope, no declarations. | 1485 // Visit class literal in the same scope, no declarations. |
1487 VisitClassLiteralContents(expr); | 1486 VisitClassLiteralContents(expr); |
1488 } else { | 1487 } else { |
1489 // Visit declarations and class literal in a block scope. | 1488 // Visit declarations and class literal in a block scope. |
(...skipping 2089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3579 // Phi does not exist yet, introduce one. | 3578 // Phi does not exist yet, introduce one. |
3580 value = NewPhi(inputs, value, control); | 3579 value = NewPhi(inputs, value, control); |
3581 value->ReplaceInput(inputs - 1, other); | 3580 value->ReplaceInput(inputs - 1, other); |
3582 } | 3581 } |
3583 return value; | 3582 return value; |
3584 } | 3583 } |
3585 | 3584 |
3586 } // namespace compiler | 3585 } // namespace compiler |
3587 } // namespace internal | 3586 } // namespace internal |
3588 } // namespace v8 | 3587 } // namespace v8 |
OLD | NEW |