Index: src/arm/assembler-arm-inl.h |
diff --git a/src/arm/assembler-arm-inl.h b/src/arm/assembler-arm-inl.h |
index 02dc907fcc0ce559deffb2ce73f542e1b9e52f84..af29bb8cf0a010ee4f2b3ce8122972f708e19f66 100644 |
--- a/src/arm/assembler-arm-inl.h |
+++ b/src/arm/assembler-arm-inl.h |
@@ -58,7 +58,7 @@ int Register::NumAllocatableRegisters() { |
int DwVfpRegister::NumRegisters() { |
if (CpuFeatures::IsSupported(VFP2)) { |
- return DwVfpRegister::kNumRegisters; |
+ return CpuFeatures::IsSupported(VFP32DREGS) ? 32 : 16; |
} else { |
return 1; |
} |
@@ -67,7 +67,7 @@ int DwVfpRegister::NumRegisters() { |
int DwVfpRegister::NumAllocatableRegisters() { |
if (CpuFeatures::IsSupported(VFP2)) { |
- return DwVfpRegister::kMaxNumAllocatableRegisters; |
+ return NumRegisters() - kNumReservedRegisters; |
} else { |
return 1; |
} |
@@ -77,10 +77,24 @@ int DwVfpRegister::NumAllocatableRegisters() { |
int DwVfpRegister::ToAllocationIndex(DwVfpRegister reg) { |
ASSERT(!reg.is(kDoubleRegZero)); |
ASSERT(!reg.is(kScratchDoubleReg)); |
+ if (reg.code() > kDoubleRegZero.code()) { |
+ return reg.code() - kNumReservedRegisters; |
+ } |
return reg.code(); |
} |
+DwVfpRegister DwVfpRegister::FromAllocationIndex(int index) { |
+ ASSERT(index >= 0 && index < NumAllocatableRegisters()); |
+ ASSERT(kScratchDoubleReg.code() - kDoubleRegZero.code() == |
+ kNumReservedRegisters - 1); |
+ if (index >= kDoubleRegZero.code()) { |
+ return from_code(index + kNumReservedRegisters); |
+ } |
+ return from_code(index); |
+} |
+ |
+ |
void RelocInfo::apply(intptr_t delta) { |
if (RelocInfo::IsInternalReference(rmode_)) { |
// absolute code pointer inside code object moves with the code object. |