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

Side by Side Diff: src/crankshaft/mips64/lithium-codegen-mips64.cc

Issue 1773173005: [crankshaft] Added checks to tail call instructions that we don't have to restore caller doubles. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@tco-turbo-3
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « src/crankshaft/mips/lithium-codegen-mips.cc ('k') | src/crankshaft/ppc/lithium-codegen-ppc.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/crankshaft/mips64/lithium-codegen-mips64.h" 5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h"
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/crankshaft/hydrogen-osr.h" 9 #include "src/crankshaft/hydrogen-osr.h"
10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" 10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h"
(...skipping 3286 matching lines...) Expand 10 before | Expand all | Expand 10 after
3297 __ ld(scratch, MemOperand(scratch)); 3297 __ ld(scratch, MemOperand(scratch));
3298 __ push(scratch); 3298 __ push(scratch);
3299 __ Dsubu(length, length, Operand(1)); 3299 __ Dsubu(length, length, Operand(1));
3300 __ Branch(USE_DELAY_SLOT, &loop, ne, length, Operand(zero_reg)); 3300 __ Branch(USE_DELAY_SLOT, &loop, ne, length, Operand(zero_reg));
3301 __ dsll(scratch, length, kPointerSizeLog2); 3301 __ dsll(scratch, length, kPointerSizeLog2);
3302 3302
3303 __ bind(&invoke); 3303 __ bind(&invoke);
3304 3304
3305 InvokeFlag flag = CALL_FUNCTION; 3305 InvokeFlag flag = CALL_FUNCTION;
3306 if (instr->hydrogen()->tail_call_mode() == TailCallMode::kAllow) { 3306 if (instr->hydrogen()->tail_call_mode() == TailCallMode::kAllow) {
3307 DCHECK(!info()->saves_caller_doubles());
3307 // TODO(ishell): drop current frame before pushing arguments to the stack. 3308 // TODO(ishell): drop current frame before pushing arguments to the stack.
3308 flag = JUMP_FUNCTION; 3309 flag = JUMP_FUNCTION;
3309 ParameterCount actual(a0); 3310 ParameterCount actual(a0);
3310 // It is safe to use t0, t1 and t2 as scratch registers here given that 3311 // It is safe to use t0, t1 and t2 as scratch registers here given that
3311 // we are not going to return to caller function anyway. 3312 // we are not going to return to caller function anyway.
3312 PrepareForTailCall(actual, t0, t1, t2); 3313 PrepareForTailCall(actual, t0, t1, t2);
3313 } 3314 }
3314 3315
3315 DCHECK(instr->HasPointerMap()); 3316 DCHECK(instr->HasPointerMap());
3316 LPointerMap* pointers = instr->pointer_map(); 3317 LPointerMap* pointers = instr->pointer_map();
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
3809 3810
3810 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { 3811 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
3811 HInvokeFunction* hinstr = instr->hydrogen(); 3812 HInvokeFunction* hinstr = instr->hydrogen();
3812 DCHECK(ToRegister(instr->context()).is(cp)); 3813 DCHECK(ToRegister(instr->context()).is(cp));
3813 DCHECK(ToRegister(instr->function()).is(a1)); 3814 DCHECK(ToRegister(instr->function()).is(a1));
3814 DCHECK(instr->HasPointerMap()); 3815 DCHECK(instr->HasPointerMap());
3815 3816
3816 bool is_tail_call = hinstr->tail_call_mode() == TailCallMode::kAllow; 3817 bool is_tail_call = hinstr->tail_call_mode() == TailCallMode::kAllow;
3817 3818
3818 if (is_tail_call) { 3819 if (is_tail_call) {
3820 DCHECK(!info()->saves_caller_doubles());
3819 ParameterCount actual(instr->arity()); 3821 ParameterCount actual(instr->arity());
3820 // It is safe to use t0, t1 and t2 as scratch registers here given that 3822 // It is safe to use t0, t1 and t2 as scratch registers here given that
3821 // we are not going to return to caller function anyway. 3823 // we are not going to return to caller function anyway.
3822 PrepareForTailCall(actual, t0, t1, t2); 3824 PrepareForTailCall(actual, t0, t1, t2);
3823 } 3825 }
3824 3826
3825 Handle<JSFunction> known_function = hinstr->known_function(); 3827 Handle<JSFunction> known_function = hinstr->known_function();
3826 if (known_function.is_null()) { 3828 if (known_function.is_null()) {
3827 LPointerMap* pointers = instr->pointer_map(); 3829 LPointerMap* pointers = instr->pointer_map();
3828 SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt); 3830 SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt);
(...skipping 1937 matching lines...) Expand 10 before | Expand all | Expand 10 after
5766 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { 5768 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) {
5767 Register context = ToRegister(instr->context()); 5769 Register context = ToRegister(instr->context());
5768 __ sd(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); 5770 __ sd(context, MemOperand(fp, StandardFrameConstants::kContextOffset));
5769 } 5771 }
5770 5772
5771 5773
5772 #undef __ 5774 #undef __
5773 5775
5774 } // namespace internal 5776 } // namespace internal
5775 } // namespace v8 5777 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/mips/lithium-codegen-mips.cc ('k') | src/crankshaft/ppc/lithium-codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698