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

Unified Diff: src/arm/builtins-arm.cc

Issue 1837513002: [es6] Add a flag to the Isolate that defines whether ES2015 tail call elimination is enabled or not. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: New changes Created 4 years, 9 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 | « no previous file | src/arm64/builtins-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/builtins-arm.cc
diff --git a/src/arm/builtins-arm.cc b/src/arm/builtins-arm.cc
index 5fdc7d1f832f573b6467f455cfe6ad5e16ae5381..1fffcb67e596dd76147c9b4808358b491c90722e 100644
--- a/src/arm/builtins-arm.cc
+++ b/src/arm/builtins-arm.cc
@@ -1933,6 +1933,16 @@ void PrepareForTailCall(MacroAssembler* masm, Register args_reg,
DCHECK(!AreAliased(args_reg, scratch1, scratch2, scratch3));
Comment cmnt(masm, "[ PrepareForTailCall");
+ // Prepare for tail call only if ES2015 tail call elimination is enabled.
+ Label done;
+ ExternalReference is_tail_call_elimination_enabled =
+ ExternalReference::is_tail_call_elimination_enabled_address(
+ masm->isolate());
+ __ mov(scratch1, Operand(is_tail_call_elimination_enabled));
+ __ ldrb(scratch1, MemOperand(scratch1));
+ __ cmp(scratch1, Operand(0));
+ __ b(eq, &done);
+
// Drop possible interpreter handler/stub frame.
{
Label no_interpreter_frame;
@@ -1976,6 +1986,7 @@ void PrepareForTailCall(MacroAssembler* masm, Register args_reg,
ParameterCount callee_args_count(args_reg);
__ PrepareForTailCall(callee_args_count, caller_args_count_reg, scratch2,
scratch3);
+ __ bind(&done);
}
} // namespace
« no previous file with comments | « no previous file | src/arm64/builtins-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698