Commit 24cd6676 authored by ishell's avatar ishell Committed by Commit bot

[crankshaft] Added checks to tail call instructions that we don't have to restore caller doubles.

TBR=bmeurer@chromium.org
BUG=v8:4698
LOG=N

Review URL: https://codereview.chromium.org/1773173005

Cr-Commit-Position: refs/heads/master@{#34613}
parent 6b340ded
......@@ -3188,6 +3188,7 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
InvokeFlag flag = CALL_FUNCTION;
if (instr->hydrogen()->tail_call_mode() == TailCallMode::kAllow) {
DCHECK(!info()->saves_caller_doubles());
// TODO(ishell): drop current frame before pushing arguments to the stack.
flag = JUMP_FUNCTION;
ParameterCount actual(r0);
......@@ -3638,6 +3639,7 @@ void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
bool is_tail_call = hinstr->tail_call_mode() == TailCallMode::kAllow;
if (is_tail_call) {
DCHECK(!info()->saves_caller_doubles());
ParameterCount actual(instr->arity());
// It is safe to use r3, r4 and r5 as scratch registers here given that
// 1) we are not going to return to caller function anyway,
......
......@@ -1532,6 +1532,7 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
InvokeFlag flag = CALL_FUNCTION;
if (instr->hydrogen()->tail_call_mode() == TailCallMode::kAllow) {
DCHECK(!info()->saves_caller_doubles());
// TODO(ishell): drop current frame before pushing arguments to the stack.
flag = JUMP_FUNCTION;
ParameterCount actual(x0);
......@@ -2869,6 +2870,7 @@ void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
bool is_tail_call = hinstr->tail_call_mode() == TailCallMode::kAllow;
if (is_tail_call) {
DCHECK(!info()->saves_caller_doubles());
ParameterCount actual(instr->arity());
// It is safe to use x3, x4 and x5 as scratch registers here given that
// 1) we are not going to return to caller function anyway,
......
......@@ -2931,6 +2931,7 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
InvokeFlag flag = CALL_FUNCTION;
if (instr->hydrogen()->tail_call_mode() == TailCallMode::kAllow) {
DCHECK(!info()->saves_caller_doubles());
// TODO(ishell): drop current frame before pushing arguments to the stack.
flag = JUMP_FUNCTION;
ParameterCount actual(eax);
......@@ -3483,6 +3484,7 @@ void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
bool is_tail_call = hinstr->tail_call_mode() == TailCallMode::kAllow;
if (is_tail_call) {
DCHECK(!info()->saves_caller_doubles());
ParameterCount actual(instr->arity());
// It is safe to use ebx, ecx and edx as scratch registers here given that
// 1) we are not going to return to caller function anyway,
......
......@@ -3121,6 +3121,7 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
InvokeFlag flag = CALL_FUNCTION;
if (instr->hydrogen()->tail_call_mode() == TailCallMode::kAllow) {
DCHECK(!info()->saves_caller_doubles());
// TODO(ishell): drop current frame before pushing arguments to the stack.
flag = JUMP_FUNCTION;
ParameterCount actual(a0);
......@@ -3617,6 +3618,7 @@ void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
bool is_tail_call = hinstr->tail_call_mode() == TailCallMode::kAllow;
if (is_tail_call) {
DCHECK(!info()->saves_caller_doubles());
ParameterCount actual(instr->arity());
// It is safe to use t0, t1 and t2 as scratch registers here given that
// we are not going to return to caller function anyway.
......
......@@ -3304,6 +3304,7 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
InvokeFlag flag = CALL_FUNCTION;
if (instr->hydrogen()->tail_call_mode() == TailCallMode::kAllow) {
DCHECK(!info()->saves_caller_doubles());
// TODO(ishell): drop current frame before pushing arguments to the stack.
flag = JUMP_FUNCTION;
ParameterCount actual(a0);
......@@ -3816,6 +3817,7 @@ void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
bool is_tail_call = hinstr->tail_call_mode() == TailCallMode::kAllow;
if (is_tail_call) {
DCHECK(!info()->saves_caller_doubles());
ParameterCount actual(instr->arity());
// It is safe to use t0, t1 and t2 as scratch registers here given that
// we are not going to return to caller function anyway.
......
......@@ -3351,6 +3351,7 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
InvokeFlag flag = CALL_FUNCTION;
if (instr->hydrogen()->tail_call_mode() == TailCallMode::kAllow) {
DCHECK(!info()->saves_caller_doubles());
// TODO(ishell): drop current frame before pushing arguments to the stack.
flag = JUMP_FUNCTION;
ParameterCount actual(r3);
......@@ -3841,6 +3842,7 @@ void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
bool is_tail_call = hinstr->tail_call_mode() == TailCallMode::kAllow;
if (is_tail_call) {
DCHECK(!info()->saves_caller_doubles());
ParameterCount actual(instr->arity());
// It is safe to use r6, r7 and r8 as scratch registers here given that
// 1) we are not going to return to caller function anyway,
......
......@@ -3134,6 +3134,7 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
InvokeFlag flag = CALL_FUNCTION;
if (instr->hydrogen()->tail_call_mode() == TailCallMode::kAllow) {
DCHECK(!info()->saves_caller_doubles());
// TODO(ishell): drop current frame before pushing arguments to the stack.
flag = JUMP_FUNCTION;
ParameterCount actual(rax);
......@@ -3687,6 +3688,7 @@ void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
bool is_tail_call = hinstr->tail_call_mode() == TailCallMode::kAllow;
if (is_tail_call) {
DCHECK(!info()->saves_caller_doubles());
ParameterCount actual(instr->arity());
// It is safe to use rbx, rcx and r8 as scratch registers here given that
// 1) we are not going to return to caller function anyway,
......
......@@ -3210,6 +3210,7 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
InvokeFlag flag = CALL_FUNCTION;
if (instr->hydrogen()->tail_call_mode() == TailCallMode::kAllow) {
DCHECK(!info()->saves_caller_doubles());
// TODO(ishell): drop current frame before pushing arguments to the stack.
flag = JUMP_FUNCTION;
ParameterCount actual(eax);
......@@ -3844,6 +3845,7 @@ void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
bool is_tail_call = hinstr->tail_call_mode() == TailCallMode::kAllow;
if (is_tail_call) {
DCHECK(!info()->saves_caller_doubles());
ParameterCount actual(instr->arity());
// It is safe to use ebx, ecx and edx as scratch registers here given that
// 1) we are not going to return to caller function anyway,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment