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

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

Issue 1259203002: [turbofan] Implement tail calls with differing stack parameter counts (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix bugs in frameless tail calls Created 5 years, 4 months 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/code-generator.h » ('j') | src/compiler/ia32/code-generator-ia32.cc » ('J')
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/js-type-feedback.h" 10 #include "src/compiler/js-type-feedback.h"
(...skipping 2583 matching lines...) Expand 10 before | Expand all | Expand 10 after
2594 ast_context()->ProduceValue(jsgraph()->TheHoleConstant()); 2594 ast_context()->ProduceValue(jsgraph()->TheHoleConstant());
2595 return SetStackOverflow(); 2595 return SetStackOverflow();
2596 } 2596 }
2597 2597
2598 // Evaluate all arguments to the runtime call. 2598 // Evaluate all arguments to the runtime call.
2599 ZoneList<Expression*>* args = expr->arguments(); 2599 ZoneList<Expression*>* args = expr->arguments();
2600 VisitForValues(args); 2600 VisitForValues(args);
2601 2601
2602 // Create node to perform the runtime call. 2602 // Create node to perform the runtime call.
2603 Runtime::FunctionId functionId = function->function_id; 2603 Runtime::FunctionId functionId = function->function_id;
2604 const Operator* call = javascript()->CallRuntime(functionId, args->length()); 2604 // Outer-most frame of calls into native function chains must have a frame in
2605 // the stack crawl.
2606 TailCallMode mode =
Benedikt Meurer 2015/07/30 06:47:24 IMHO this will be highly confusing and might be a
2607 info()->shared_info()->native() ? NO_TAIL_CALLS : ALLOW_TAIL_CALLS;
2608 const Operator* call =
2609 javascript()->CallRuntime(functionId, args->length(), mode);
2605 FrameStateBeforeAndAfter states(this, expr->CallId()); 2610 FrameStateBeforeAndAfter states(this, expr->CallId());
2606 Node* value = ProcessArguments(call, args->length()); 2611 Node* value = ProcessArguments(call, args->length());
2607 states.AddToNode(value, expr->id(), ast_context()->GetStateCombine()); 2612 states.AddToNode(value, expr->id(), ast_context()->GetStateCombine());
2608 ast_context()->ProduceValue(value); 2613 ast_context()->ProduceValue(value);
2609 } 2614 }
2610 2615
2611 2616
2612 void AstGraphBuilder::VisitUnaryOperation(UnaryOperation* expr) { 2617 void AstGraphBuilder::VisitUnaryOperation(UnaryOperation* expr) {
2613 switch (expr->op()) { 2618 switch (expr->op()) {
2614 case Token::DELETE: 2619 case Token::DELETE:
(...skipping 1701 matching lines...) Expand 10 before | Expand all | Expand 10 after
4316 // Phi does not exist yet, introduce one. 4321 // Phi does not exist yet, introduce one.
4317 value = NewPhi(inputs, value, control); 4322 value = NewPhi(inputs, value, control);
4318 value->ReplaceInput(inputs - 1, other); 4323 value->ReplaceInput(inputs - 1, other);
4319 } 4324 }
4320 return value; 4325 return value;
4321 } 4326 }
4322 4327
4323 } // namespace compiler 4328 } // namespace compiler
4324 } // namespace internal 4329 } // namespace internal
4325 } // namespace v8 4330 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/code-generator.h » ('j') | src/compiler/ia32/code-generator-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698