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 <assert.h> // For assert | 5 #include <assert.h> // For assert |
6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 6 #include <limits.h> // For LONG_MIN, LONG_MAX. |
7 | 7 |
8 #if V8_TARGET_ARCH_PPC | 8 #if V8_TARGET_ARCH_PPC |
9 | 9 |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 } | 1185 } |
1186 li(r0, Operand::Zero()); | 1186 li(r0, Operand::Zero()); |
1187 StorePU(r0, MemOperand(sp, -kNumRequiredStackFrameSlots * kPointerSize)); | 1187 StorePU(r0, MemOperand(sp, -kNumRequiredStackFrameSlots * kPointerSize)); |
1188 | 1188 |
1189 // Set the exit frame sp value to point just before the return address | 1189 // Set the exit frame sp value to point just before the return address |
1190 // location. | 1190 // location. |
1191 addi(r8, sp, Operand((kStackFrameExtraParamSlot + 1) * kPointerSize)); | 1191 addi(r8, sp, Operand((kStackFrameExtraParamSlot + 1) * kPointerSize)); |
1192 StoreP(r8, MemOperand(fp, ExitFrameConstants::kSPOffset)); | 1192 StoreP(r8, MemOperand(fp, ExitFrameConstants::kSPOffset)); |
1193 } | 1193 } |
1194 | 1194 |
1195 | |
1196 void MacroAssembler::InitializeNewString(Register string, Register length, | |
1197 Heap::RootListIndex map_index, | |
1198 Register scratch1, Register scratch2) { | |
1199 SmiTag(scratch1, length); | |
1200 LoadRoot(scratch2, map_index); | |
1201 StoreP(scratch1, FieldMemOperand(string, String::kLengthOffset), r0); | |
1202 li(scratch1, Operand(String::kEmptyHashField)); | |
1203 StoreP(scratch2, FieldMemOperand(string, HeapObject::kMapOffset), r0); | |
1204 StoreP(scratch1, FieldMemOperand(string, String::kHashFieldSlot), r0); | |
1205 } | |
1206 | |
1207 | |
1208 int MacroAssembler::ActivationFrameAlignment() { | 1195 int MacroAssembler::ActivationFrameAlignment() { |
1209 #if !defined(USE_SIMULATOR) | 1196 #if !defined(USE_SIMULATOR) |
1210 // Running on the real platform. Use the alignment as mandated by the local | 1197 // Running on the real platform. Use the alignment as mandated by the local |
1211 // environment. | 1198 // environment. |
1212 // Note: This will break if we ever start generating snapshots on one PPC | 1199 // Note: This will break if we ever start generating snapshots on one PPC |
1213 // platform for another PPC platform with a different alignment. | 1200 // platform for another PPC platform with a different alignment. |
1214 return base::OS::ActivationFrameAlignment(); | 1201 return base::OS::ActivationFrameAlignment(); |
1215 #else // Simulated | 1202 #else // Simulated |
1216 // If we are using the simulator then we should always align to the expected | 1203 // If we are using the simulator then we should always align to the expected |
1217 // alignment. As the simulator is used to generate snapshots we do not know | 1204 // alignment. As the simulator is used to generate snapshots we do not know |
(...skipping 3176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4394 } | 4381 } |
4395 if (mag.shift > 0) srawi(result, result, mag.shift); | 4382 if (mag.shift > 0) srawi(result, result, mag.shift); |
4396 ExtractBit(r0, dividend, 31); | 4383 ExtractBit(r0, dividend, 31); |
4397 add(result, result, r0); | 4384 add(result, result, r0); |
4398 } | 4385 } |
4399 | 4386 |
4400 } // namespace internal | 4387 } // namespace internal |
4401 } // namespace v8 | 4388 } // namespace v8 |
4402 | 4389 |
4403 #endif // V8_TARGET_ARCH_PPC | 4390 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |