Index: src/arm/macro-assembler-arm.cc |
=================================================================== |
--- src/arm/macro-assembler-arm.cc (revision 4136) |
+++ src/arm/macro-assembler-arm.cc (working copy) |
@@ -1180,7 +1180,7 @@ |
// ARMv7 VFP3 instructions to implement integer to double conversion. |
mov(r7, Operand(inReg, ASR, kSmiTagSize)); |
vmov(s15, r7); |
- vcvt(d7, s15); |
+ vcvt_f64_s32(d7, s15); |
vmov(outLowReg, outHighReg, d7); |
} |
@@ -1443,6 +1443,58 @@ |
} |
+// Allocates a heap number or jumps to the need_gc label if the young space |
+// is full and a scavenge is needed. |
+void MacroAssembler::AllocateHeapNumber(Register result, |
+ Register scratch1, |
+ Register scratch2, |
+ Label* gc_required) { |
+ // Allocate an object in the heap for the heap number and tag it as a heap |
+ // object. |
+ AllocateInNewSpace(HeapNumber::kSize / kPointerSize, |
+ result, |
+ scratch1, |
+ scratch2, |
+ gc_required, |
+ TAG_OBJECT); |
+ |
+ // Get heap number map and store it in the allocated object. |
+ LoadRoot(scratch1, Heap::kHeapNumberMapRootIndex); |
+ str(scratch1, FieldMemOperand(result, HeapObject::kMapOffset)); |
+} |
+ |
+ |
+void MacroAssembler::CountLeadingZeros(Register source, |
+ Register scratch, |
+ Register zeros) { |
+#ifdef CAN_USE_ARMV5_INSTRUCTIONS |
+ clz(zeros, source); // This instruction is only supported after ARM5. |
+#else |
+ mov(zeros, Operand(0)); |
+ mov(scratch, source); |
+ // Top 16. |
+ tst(scratch, Operand(0xffff0000)); |
+ add(zeros, zeros, Operand(16), LeaveCC, eq); |
+ mov(scratch, Operand(scratch, LSL, 16), LeaveCC, eq); |
+ // Top 8. |
+ tst(scratch, Operand(0xff000000)); |
+ add(zeros, zeros, Operand(8), LeaveCC, eq); |
+ mov(scratch, Operand(scratch, LSL, 8), LeaveCC, eq); |
+ // Top 4. |
+ tst(scratch, Operand(0xf0000000)); |
+ add(zeros, zeros, Operand(4), LeaveCC, eq); |
+ mov(scratch, Operand(scratch, LSL, 4), LeaveCC, eq); |
+ // Top 2. |
+ tst(scratch, Operand(0xc0000000)); |
+ add(zeros, zeros, Operand(2), LeaveCC, eq); |
+ mov(scratch, Operand(scratch, LSL, 2), LeaveCC, eq); |
+ // Top bit. |
+ tst(scratch, Operand(0x80000000u)); |
+ add(zeros, zeros, Operand(1), LeaveCC, eq); |
+#endif |
+} |
+ |
+ |
void MacroAssembler::JumpIfBothInstanceTypesAreNotSequentialAscii( |
Register first, |
Register second, |