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

Unified Diff: src/interpreter/bytecode-array-builder.cc

Issue 1698273003: [es6] [interpreter] Add tail calls support to Ignition. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@tco-turbo-2
Patch Set: Decreased number of iterations to fix timeouts Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/bytecode-array-builder.h ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-array-builder.cc
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc
index c0abbc85889a2a9f6cfeb1b8abe9a6909d4ca74f..9d20a7dd4cada674d7652032730dfac7e30aa13b 100644
--- a/src/interpreter/bytecode-array-builder.cc
+++ b/src/interpreter/bytecode-array-builder.cc
@@ -1083,20 +1083,25 @@ void BytecodeArrayBuilder::EnsureReturn(FunctionLiteral* literal) {
BytecodeArrayBuilder& BytecodeArrayBuilder::Call(Register callable,
Register receiver_args,
size_t receiver_args_count,
- int feedback_slot) {
+ int feedback_slot,
+ TailCallMode tail_call_mode) {
if (FitsInReg8Operand(callable) && FitsInReg8Operand(receiver_args) &&
FitsInIdx8Operand(receiver_args_count) &&
FitsInIdx8Operand(feedback_slot)) {
- Output(Bytecode::kCall, callable.ToRawOperand(),
- receiver_args.ToRawOperand(),
+ Bytecode bytecode = tail_call_mode == TailCallMode::kAllow
+ ? Bytecode::kTailCall
+ : Bytecode::kCall;
rmcilroy 2016/02/16 17:16:58 Could you move this to a BytecodeForTailCallMode()
Igor Sheludko 2016/02/17 14:07:08 Done.
+ Output(bytecode, callable.ToRawOperand(), receiver_args.ToRawOperand(),
static_cast<uint8_t>(receiver_args_count),
static_cast<uint8_t>(feedback_slot));
} else if (FitsInReg16Operand(callable) &&
FitsInReg16Operand(receiver_args) &&
FitsInIdx16Operand(receiver_args_count) &&
FitsInIdx16Operand(feedback_slot)) {
- Output(Bytecode::kCallWide, callable.ToRawOperand(),
- receiver_args.ToRawOperand(),
+ Bytecode bytecode = tail_call_mode == TailCallMode::kAllow
+ ? Bytecode::kTailCallWide
+ : Bytecode::kCallWide;
+ Output(bytecode, callable.ToRawOperand(), receiver_args.ToRawOperand(),
rmcilroy 2016/02/16 17:16:58 Please add kCall and kTailCall to BytecodeForWideO
Igor Sheludko 2016/02/17 14:07:08 Done.
static_cast<uint16_t>(receiver_args_count),
static_cast<uint16_t>(feedback_slot));
} else {
« no previous file with comments | « src/interpreter/bytecode-array-builder.h ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698