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

Unified Diff: src/x87/builtins-x87.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 | « src/x64/builtins-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x87/builtins-x87.cc
diff --git a/src/x87/builtins-x87.cc b/src/x87/builtins-x87.cc
index 82d8c983b71062373104716fc48c0d0dac874850..9e13172c852ef516fdb1442eaf7a9e747ef843e5 100644
--- a/src/x87/builtins-x87.cc
+++ b/src/x87/builtins-x87.cc
@@ -1912,6 +1912,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());
+ __ movzx_b(scratch1,
+ Operand::StaticVariable(is_tail_call_elimination_enabled));
+ __ cmp(scratch1, Immediate(0));
+ __ j(equal, &done, Label::kNear);
+
// Drop possible interpreter handler/stub frame.
{
Label no_interpreter_frame;
@@ -1952,6 +1962,7 @@ void PrepareForTailCall(MacroAssembler* masm, Register args_reg,
ParameterCount callee_args_count(args_reg);
__ PrepareForTailCall(callee_args_count, caller_args_count_reg, scratch2,
scratch3, ReturnAddressState::kOnStack, 0);
+ __ bind(&done);
}
} // namespace
« no previous file with comments | « src/x64/builtins-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698