OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/ppc/lithium-codegen-ppc.h" | 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.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/hydrogen-osr.h" | 10 #include "src/crankshaft/hydrogen-osr.h" |
(...skipping 3333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3344 __ ShiftLeftImm(r0, length, Operand(kPointerSizeLog2)); | 3344 __ ShiftLeftImm(r0, length, Operand(kPointerSizeLog2)); |
3345 __ LoadPX(scratch, MemOperand(elements, r0)); | 3345 __ LoadPX(scratch, MemOperand(elements, r0)); |
3346 __ push(scratch); | 3346 __ push(scratch); |
3347 __ addi(length, length, Operand(-1)); | 3347 __ addi(length, length, Operand(-1)); |
3348 __ bdnz(&loop); | 3348 __ bdnz(&loop); |
3349 | 3349 |
3350 __ bind(&invoke); | 3350 __ bind(&invoke); |
3351 | 3351 |
3352 InvokeFlag flag = CALL_FUNCTION; | 3352 InvokeFlag flag = CALL_FUNCTION; |
3353 if (instr->hydrogen()->tail_call_mode() == TailCallMode::kAllow) { | 3353 if (instr->hydrogen()->tail_call_mode() == TailCallMode::kAllow) { |
| 3354 DCHECK(!info()->saves_caller_doubles()); |
3354 // TODO(ishell): drop current frame before pushing arguments to the stack. | 3355 // TODO(ishell): drop current frame before pushing arguments to the stack. |
3355 flag = JUMP_FUNCTION; | 3356 flag = JUMP_FUNCTION; |
3356 ParameterCount actual(r3); | 3357 ParameterCount actual(r3); |
3357 // It is safe to use r6, r7 and r8 as scratch registers here given that | 3358 // It is safe to use r6, r7 and r8 as scratch registers here given that |
3358 // 1) we are not going to return to caller function anyway, | 3359 // 1) we are not going to return to caller function anyway, |
3359 // 2) r6 (new.target) will be initialized below. | 3360 // 2) r6 (new.target) will be initialized below. |
3360 PrepareForTailCall(actual, r6, r7, r8); | 3361 PrepareForTailCall(actual, r6, r7, r8); |
3361 } | 3362 } |
3362 | 3363 |
3363 DCHECK(instr->HasPointerMap()); | 3364 DCHECK(instr->HasPointerMap()); |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3834 | 3835 |
3835 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { | 3836 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { |
3836 HInvokeFunction* hinstr = instr->hydrogen(); | 3837 HInvokeFunction* hinstr = instr->hydrogen(); |
3837 DCHECK(ToRegister(instr->context()).is(cp)); | 3838 DCHECK(ToRegister(instr->context()).is(cp)); |
3838 DCHECK(ToRegister(instr->function()).is(r4)); | 3839 DCHECK(ToRegister(instr->function()).is(r4)); |
3839 DCHECK(instr->HasPointerMap()); | 3840 DCHECK(instr->HasPointerMap()); |
3840 | 3841 |
3841 bool is_tail_call = hinstr->tail_call_mode() == TailCallMode::kAllow; | 3842 bool is_tail_call = hinstr->tail_call_mode() == TailCallMode::kAllow; |
3842 | 3843 |
3843 if (is_tail_call) { | 3844 if (is_tail_call) { |
| 3845 DCHECK(!info()->saves_caller_doubles()); |
3844 ParameterCount actual(instr->arity()); | 3846 ParameterCount actual(instr->arity()); |
3845 // It is safe to use r6, r7 and r8 as scratch registers here given that | 3847 // It is safe to use r6, r7 and r8 as scratch registers here given that |
3846 // 1) we are not going to return to caller function anyway, | 3848 // 1) we are not going to return to caller function anyway, |
3847 // 2) r6 (new.target) will be initialized below. | 3849 // 2) r6 (new.target) will be initialized below. |
3848 PrepareForTailCall(actual, r6, r7, r8); | 3850 PrepareForTailCall(actual, r6, r7, r8); |
3849 } | 3851 } |
3850 | 3852 |
3851 Handle<JSFunction> known_function = hinstr->known_function(); | 3853 Handle<JSFunction> known_function = hinstr->known_function(); |
3852 if (known_function.is_null()) { | 3854 if (known_function.is_null()) { |
3853 LPointerMap* pointers = instr->pointer_map(); | 3855 LPointerMap* pointers = instr->pointer_map(); |
(...skipping 1906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5760 | 5762 |
5761 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { | 5763 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { |
5762 Register context = ToRegister(instr->context()); | 5764 Register context = ToRegister(instr->context()); |
5763 __ StoreP(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 5765 __ StoreP(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
5764 } | 5766 } |
5765 | 5767 |
5766 | 5768 |
5767 #undef __ | 5769 #undef __ |
5768 } // namespace internal | 5770 } // namespace internal |
5769 } // namespace v8 | 5771 } // namespace v8 |
OLD | NEW |