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

Side by Side Diff: src/crankshaft/mips/lithium-codegen-mips.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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved.7 1 // Copyright 2012 the V8 project authors. All rights reserved.7
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3103 matching lines...) Expand 10 before | Expand all | Expand 10 after
3114 __ lw(scratch, MemOperand(scratch)); 3114 __ lw(scratch, MemOperand(scratch));
3115 __ push(scratch); 3115 __ push(scratch);
3116 __ Subu(length, length, Operand(1)); 3116 __ Subu(length, length, Operand(1));
3117 __ Branch(USE_DELAY_SLOT, &loop, ne, length, Operand(zero_reg)); 3117 __ Branch(USE_DELAY_SLOT, &loop, ne, length, Operand(zero_reg));
3118 __ sll(scratch, length, 2); 3118 __ sll(scratch, length, 2);
3119 3119
3120 __ bind(&invoke); 3120 __ bind(&invoke);
3121 3121
3122 InvokeFlag flag = CALL_FUNCTION; 3122 InvokeFlag flag = CALL_FUNCTION;
3123 if (instr->hydrogen()->tail_call_mode() == TailCallMode::kAllow) { 3123 if (instr->hydrogen()->tail_call_mode() == TailCallMode::kAllow) {
3124 DCHECK(!info()->saves_caller_doubles());
3124 // TODO(ishell): drop current frame before pushing arguments to the stack. 3125 // TODO(ishell): drop current frame before pushing arguments to the stack.
3125 flag = JUMP_FUNCTION; 3126 flag = JUMP_FUNCTION;
3126 ParameterCount actual(a0); 3127 ParameterCount actual(a0);
3127 // It is safe to use t0, t1 and t2 as scratch registers here given that 3128 // It is safe to use t0, t1 and t2 as scratch registers here given that
3128 // we are not going to return to caller function anyway. 3129 // we are not going to return to caller function anyway.
3129 PrepareForTailCall(actual, t0, t1, t2); 3130 PrepareForTailCall(actual, t0, t1, t2);
3130 } 3131 }
3131 3132
3132 DCHECK(instr->HasPointerMap()); 3133 DCHECK(instr->HasPointerMap());
3133 LPointerMap* pointers = instr->pointer_map(); 3134 LPointerMap* pointers = instr->pointer_map();
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
3610 3611
3611 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { 3612 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
3612 HInvokeFunction* hinstr = instr->hydrogen(); 3613 HInvokeFunction* hinstr = instr->hydrogen();
3613 DCHECK(ToRegister(instr->context()).is(cp)); 3614 DCHECK(ToRegister(instr->context()).is(cp));
3614 DCHECK(ToRegister(instr->function()).is(a1)); 3615 DCHECK(ToRegister(instr->function()).is(a1));
3615 DCHECK(instr->HasPointerMap()); 3616 DCHECK(instr->HasPointerMap());
3616 3617
3617 bool is_tail_call = hinstr->tail_call_mode() == TailCallMode::kAllow; 3618 bool is_tail_call = hinstr->tail_call_mode() == TailCallMode::kAllow;
3618 3619
3619 if (is_tail_call) { 3620 if (is_tail_call) {
3621 DCHECK(!info()->saves_caller_doubles());
3620 ParameterCount actual(instr->arity()); 3622 ParameterCount actual(instr->arity());
3621 // It is safe to use t0, t1 and t2 as scratch registers here given that 3623 // It is safe to use t0, t1 and t2 as scratch registers here given that
3622 // we are not going to return to caller function anyway. 3624 // we are not going to return to caller function anyway.
3623 PrepareForTailCall(actual, t0, t1, t2); 3625 PrepareForTailCall(actual, t0, t1, t2);
3624 } 3626 }
3625 3627
3626 Handle<JSFunction> known_function = hinstr->known_function(); 3628 Handle<JSFunction> known_function = hinstr->known_function();
3627 if (known_function.is_null()) { 3629 if (known_function.is_null()) {
3628 LPointerMap* pointers = instr->pointer_map(); 3630 LPointerMap* pointers = instr->pointer_map();
3629 SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt); 3631 SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt);
(...skipping 1936 matching lines...) Expand 10 before | Expand all | Expand 10 after
5566 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { 5568 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) {
5567 Register context = ToRegister(instr->context()); 5569 Register context = ToRegister(instr->context());
5568 __ sw(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); 5570 __ sw(context, MemOperand(fp, StandardFrameConstants::kContextOffset));
5569 } 5571 }
5570 5572
5571 5573
5572 #undef __ 5574 #undef __
5573 5575
5574 } // namespace internal 5576 } // namespace internal
5575 } // namespace v8 5577 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/ia32/lithium-codegen-ia32.cc ('k') | src/crankshaft/mips64/lithium-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698