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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/compiler/ast-loop-assignment-analyzer.h" | 9 #include "src/compiler/ast-loop-assignment-analyzer.h" |
10 #include "src/compiler/control-builders.h" | 10 #include "src/compiler/control-builders.h" |
(...skipping 2551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2562 } | 2562 } |
2563 | 2563 |
2564 | 2564 |
2565 void AstGraphBuilder::VisitCallRuntime(CallRuntime* expr) { | 2565 void AstGraphBuilder::VisitCallRuntime(CallRuntime* expr) { |
2566 // Handle calls to runtime functions implemented in JavaScript separately as | 2566 // Handle calls to runtime functions implemented in JavaScript separately as |
2567 // the call follows JavaScript ABI and the callee is statically unknown. | 2567 // the call follows JavaScript ABI and the callee is statically unknown. |
2568 if (expr->is_jsruntime()) { | 2568 if (expr->is_jsruntime()) { |
2569 return VisitCallJSRuntime(expr); | 2569 return VisitCallJSRuntime(expr); |
2570 } | 2570 } |
2571 | 2571 |
2572 const Runtime::Function* function = expr->function(); | |
2573 | |
2574 // TODO(mstarzinger): This bailout is a gigantic hack, the owner is ashamed. | |
2575 if (function->function_id == Runtime::kInlineGeneratorNext || | |
2576 function->function_id == Runtime::kInlineGeneratorReturn || | |
2577 function->function_id == Runtime::kInlineGeneratorThrow) { | |
2578 ast_context()->ProduceValue(jsgraph()->TheHoleConstant()); | |
2579 return SetStackOverflow(); | |
2580 } | |
2581 | |
2582 // Evaluate all arguments to the runtime call. | 2572 // Evaluate all arguments to the runtime call. |
2583 ZoneList<Expression*>* args = expr->arguments(); | 2573 ZoneList<Expression*>* args = expr->arguments(); |
2584 VisitForValues(args); | 2574 VisitForValues(args); |
2585 | 2575 |
2586 // Create node to perform the runtime call. | 2576 // Create node to perform the runtime call. |
2587 Runtime::FunctionId functionId = function->function_id; | 2577 Runtime::FunctionId functionId = expr->function()->function_id; |
2588 const Operator* call = javascript()->CallRuntime(functionId, args->length()); | 2578 const Operator* call = javascript()->CallRuntime(functionId, args->length()); |
2589 FrameStateBeforeAndAfter states(this, expr->CallId()); | 2579 FrameStateBeforeAndAfter states(this, expr->CallId()); |
2590 Node* value = ProcessArguments(call, args->length()); | 2580 Node* value = ProcessArguments(call, args->length()); |
2591 states.AddToNode(value, expr->id(), ast_context()->GetStateCombine()); | 2581 states.AddToNode(value, expr->id(), ast_context()->GetStateCombine()); |
2592 ast_context()->ProduceValue(value); | 2582 ast_context()->ProduceValue(value); |
2593 } | 2583 } |
2594 | 2584 |
2595 | 2585 |
2596 void AstGraphBuilder::VisitUnaryOperation(UnaryOperation* expr) { | 2586 void AstGraphBuilder::VisitUnaryOperation(UnaryOperation* expr) { |
2597 switch (expr->op()) { | 2587 switch (expr->op()) { |
(...skipping 1785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4383 // Phi does not exist yet, introduce one. | 4373 // Phi does not exist yet, introduce one. |
4384 value = NewPhi(inputs, value, control); | 4374 value = NewPhi(inputs, value, control); |
4385 value->ReplaceInput(inputs - 1, other); | 4375 value->ReplaceInput(inputs - 1, other); |
4386 } | 4376 } |
4387 return value; | 4377 return value; |
4388 } | 4378 } |
4389 | 4379 |
4390 } // namespace compiler | 4380 } // namespace compiler |
4391 } // namespace internal | 4381 } // namespace internal |
4392 } // namespace v8 | 4382 } // namespace v8 |
OLD | NEW |