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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_PPC | 7 #if V8_TARGET_ARCH_PPC |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 __ Move(ip, r15); | 1117 __ Move(ip, r15); |
1118 Register target = ip; | 1118 Register target = ip; |
1119 #else | 1119 #else |
1120 Register target = r15; | 1120 Register target = r15; |
1121 #endif | 1121 #endif |
1122 | 1122 |
1123 // To let the GC traverse the return address of the exit frames, we need to | 1123 // To let the GC traverse the return address of the exit frames, we need to |
1124 // know where the return address is. The CEntryStub is unmovable, so | 1124 // know where the return address is. The CEntryStub is unmovable, so |
1125 // we can store the address on the stack to be able to find it again and | 1125 // we can store the address on the stack to be able to find it again and |
1126 // we never have to restore it, because it will not change. | 1126 // we never have to restore it, because it will not change. |
1127 // Compute the return address in lr to return to after the jump below. Pc is | 1127 Label after_call; |
1128 // already at '+ 8' from the current instruction but return is after three | 1128 __ mov_label_addr(r0, &after_call); |
1129 // instructions so add another 4 to pc to get the return address. | 1129 __ StoreP(r0, MemOperand(sp, kStackFrameExtraParamSlot * kPointerSize)); |
1130 { | 1130 __ Call(target); |
1131 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm); | 1131 __ bind(&after_call); |
1132 Label here; | |
1133 __ b(&here, SetLK); | |
1134 __ bind(&here); | |
1135 __ mflr(r8); | |
1136 | |
1137 // Constant used below is dependent on size of Call() macro instructions | |
1138 __ addi(r0, r8, Operand(20)); | |
1139 | |
1140 __ StoreP(r0, MemOperand(sp, kStackFrameExtraParamSlot * kPointerSize)); | |
1141 __ Call(target); | |
1142 } | |
1143 | 1132 |
1144 #if !ABI_RETURNS_OBJECT_PAIRS_IN_REGS | 1133 #if !ABI_RETURNS_OBJECT_PAIRS_IN_REGS |
1145 // If return value is on the stack, pop it to registers. | 1134 // If return value is on the stack, pop it to registers. |
1146 if (result_size() > 1) { | 1135 if (result_size() > 1) { |
1147 __ LoadP(r4, MemOperand(r3, kPointerSize)); | 1136 __ LoadP(r4, MemOperand(r3, kPointerSize)); |
1148 __ LoadP(r3, MemOperand(r3)); | 1137 __ LoadP(r3, MemOperand(r3)); |
1149 } | 1138 } |
1150 #endif | 1139 #endif |
1151 | 1140 |
1152 // Runtime functions should not return 'the hole'. Allowing it to escape may | 1141 // Runtime functions should not return 'the hole'. Allowing it to escape may |
(...skipping 4200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5353 kStackUnwindSpace, NULL, | 5342 kStackUnwindSpace, NULL, |
5354 MemOperand(fp, 6 * kPointerSize), NULL); | 5343 MemOperand(fp, 6 * kPointerSize), NULL); |
5355 } | 5344 } |
5356 | 5345 |
5357 | 5346 |
5358 #undef __ | 5347 #undef __ |
5359 } | 5348 } |
5360 } // namespace v8::internal | 5349 } // namespace v8::internal |
5361 | 5350 |
5362 #endif // V8_TARGET_ARCH_PPC | 5351 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |