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

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

Issue 1609893003: [es6] Tail calls support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Support for CS and TF compilers added Created 4 years, 11 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
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/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 2458 matching lines...) Expand 10 before | Expand all | Expand 10 after
2469 NewNode(op, callee, source, function, language, position); 2469 NewNode(op, callee, source, function, language, position);
2470 PrepareFrameState(new_callee, expr->EvalId(), 2470 PrepareFrameState(new_callee, expr->EvalId(),
2471 OutputFrameStateCombine::PokeAt(arg_count + 1)); 2471 OutputFrameStateCombine::PokeAt(arg_count + 1));
2472 2472
2473 // Patch callee on the environment. 2473 // Patch callee on the environment.
2474 environment()->Poke(arg_count + 1, new_callee); 2474 environment()->Poke(arg_count + 1, new_callee);
2475 } 2475 }
2476 2476
2477 // Create node to perform the function call. 2477 // Create node to perform the function call.
2478 VectorSlotPair feedback = CreateVectorSlotPair(expr->CallFeedbackICSlot()); 2478 VectorSlotPair feedback = CreateVectorSlotPair(expr->CallFeedbackICSlot());
2479 const Operator* call = javascript()->CallFunction( 2479 const Operator* call =
2480 args->length() + 2, language_mode(), feedback, receiver_hint); 2480 javascript()->CallFunction(args->length() + 2, language_mode(), feedback,
2481 receiver_hint, expr->tail_call_mode());
2481 FrameStateBeforeAndAfter states(this, expr->CallId()); 2482 FrameStateBeforeAndAfter states(this, expr->CallId());
2482 Node* value = ProcessArguments(call, args->length() + 2); 2483 Node* value = ProcessArguments(call, args->length() + 2);
2483 environment()->Push(value->InputAt(0)); // The callee passed to the call. 2484 environment()->Push(value->InputAt(0)); // The callee passed to the call.
2484 states.AddToNode(value, expr->ReturnId(), OutputFrameStateCombine::Push()); 2485 states.AddToNode(value, expr->ReturnId(), OutputFrameStateCombine::Push());
2485 environment()->Drop(1); 2486 environment()->Drop(1);
2486 ast_context()->ProduceValue(value); 2487 ast_context()->ProduceValue(value);
2487 } 2488 }
2488 2489
2489 2490
2490 void AstGraphBuilder::VisitCallSuper(Call* expr) { 2491 void AstGraphBuilder::VisitCallSuper(Call* expr) {
(...skipping 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after
4338 // Phi does not exist yet, introduce one. 4339 // Phi does not exist yet, introduce one.
4339 value = NewPhi(inputs, value, control); 4340 value = NewPhi(inputs, value, control);
4340 value->ReplaceInput(inputs - 1, other); 4341 value->ReplaceInput(inputs - 1, other);
4341 } 4342 }
4342 return value; 4343 return value;
4343 } 4344 }
4344 4345
4345 } // namespace compiler 4346 } // namespace compiler
4346 } // namespace internal 4347 } // namespace internal
4347 } // namespace v8 4348 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698