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

Side by Side Diff: src/crankshaft/arm/lithium-codegen-arm.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 | « no previous file | src/crankshaft/arm64/lithium-codegen-arm64.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/arm/lithium-codegen-arm.h" 5 #include "src/crankshaft/arm/lithium-codegen-arm.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h" 10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h"
(...skipping 3170 matching lines...) Expand 10 before | Expand all | Expand 10 after
3181 __ bind(&loop); 3181 __ bind(&loop);
3182 __ ldr(scratch, MemOperand(elements, length, LSL, 2)); 3182 __ ldr(scratch, MemOperand(elements, length, LSL, 2));
3183 __ push(scratch); 3183 __ push(scratch);
3184 __ sub(length, length, Operand(1), SetCC); 3184 __ sub(length, length, Operand(1), SetCC);
3185 __ b(ne, &loop); 3185 __ b(ne, &loop);
3186 3186
3187 __ bind(&invoke); 3187 __ bind(&invoke);
3188 3188
3189 InvokeFlag flag = CALL_FUNCTION; 3189 InvokeFlag flag = CALL_FUNCTION;
3190 if (instr->hydrogen()->tail_call_mode() == TailCallMode::kAllow) { 3190 if (instr->hydrogen()->tail_call_mode() == TailCallMode::kAllow) {
3191 DCHECK(!info()->saves_caller_doubles());
3191 // TODO(ishell): drop current frame before pushing arguments to the stack. 3192 // TODO(ishell): drop current frame before pushing arguments to the stack.
3192 flag = JUMP_FUNCTION; 3193 flag = JUMP_FUNCTION;
3193 ParameterCount actual(r0); 3194 ParameterCount actual(r0);
3194 // It is safe to use r3, r4 and r5 as scratch registers here given that 3195 // It is safe to use r3, r4 and r5 as scratch registers here given that
3195 // 1) we are not going to return to caller function anyway, 3196 // 1) we are not going to return to caller function anyway,
3196 // 2) r3 (new.target) will be initialized below. 3197 // 2) r3 (new.target) will be initialized below.
3197 PrepareForTailCall(actual, r3, r4, r5); 3198 PrepareForTailCall(actual, r3, r4, r5);
3198 } 3199 }
3199 3200
3200 DCHECK(instr->HasPointerMap()); 3201 DCHECK(instr->HasPointerMap());
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
3631 3632
3632 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { 3633 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
3633 HInvokeFunction* hinstr = instr->hydrogen(); 3634 HInvokeFunction* hinstr = instr->hydrogen();
3634 DCHECK(ToRegister(instr->context()).is(cp)); 3635 DCHECK(ToRegister(instr->context()).is(cp));
3635 DCHECK(ToRegister(instr->function()).is(r1)); 3636 DCHECK(ToRegister(instr->function()).is(r1));
3636 DCHECK(instr->HasPointerMap()); 3637 DCHECK(instr->HasPointerMap());
3637 3638
3638 bool is_tail_call = hinstr->tail_call_mode() == TailCallMode::kAllow; 3639 bool is_tail_call = hinstr->tail_call_mode() == TailCallMode::kAllow;
3639 3640
3640 if (is_tail_call) { 3641 if (is_tail_call) {
3642 DCHECK(!info()->saves_caller_doubles());
3641 ParameterCount actual(instr->arity()); 3643 ParameterCount actual(instr->arity());
3642 // It is safe to use r3, r4 and r5 as scratch registers here given that 3644 // It is safe to use r3, r4 and r5 as scratch registers here given that
3643 // 1) we are not going to return to caller function anyway, 3645 // 1) we are not going to return to caller function anyway,
3644 // 2) r3 (new.target) will be initialized below. 3646 // 2) r3 (new.target) will be initialized below.
3645 PrepareForTailCall(actual, r3, r4, r5); 3647 PrepareForTailCall(actual, r3, r4, r5);
3646 } 3648 }
3647 3649
3648 Handle<JSFunction> known_function = hinstr->known_function(); 3650 Handle<JSFunction> known_function = hinstr->known_function();
3649 if (known_function.is_null()) { 3651 if (known_function.is_null()) {
3650 LPointerMap* pointers = instr->pointer_map(); 3652 LPointerMap* pointers = instr->pointer_map();
(...skipping 1897 matching lines...) Expand 10 before | Expand all | Expand 10 after
5548 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { 5550 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) {
5549 Register context = ToRegister(instr->context()); 5551 Register context = ToRegister(instr->context());
5550 __ str(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); 5552 __ str(context, MemOperand(fp, StandardFrameConstants::kContextOffset));
5551 } 5553 }
5552 5554
5553 5555
5554 #undef __ 5556 #undef __
5555 5557
5556 } // namespace internal 5558 } // namespace internal
5557 } // namespace v8 5559 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/crankshaft/arm64/lithium-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698