Index: src/arm/macro-assembler-arm.cc |
=================================================================== |
--- src/arm/macro-assembler-arm.cc (revision 3712) |
+++ src/arm/macro-assembler-arm.cc (working copy) |
@@ -1024,6 +1024,19 @@ |
} |
+void MacroAssembler::GetLeastBitsFromSmi(Register dst, |
+ Register src, |
+ int num_least_bits) { |
+ if (CpuFeatures::IsSupported(ARMv7)) { |
+ // UBFX r2, r0, #kSmiTagSize, #(num_least_bits-1) |
+ ubfx(dst, src, Operand(kSmiTagSize), Operand(num_least_bits - 1)); |
+ } else { |
+ mov(dst, Operand(src, ASR, kSmiTagSize)); |
+ and_(dst, dst, Operand((1 << num_least_bits) - 1)); |
+ } |
+} |
+ |
+ |
void MacroAssembler::CallRuntime(Runtime::Function* f, int num_arguments) { |
// All parameters are on the stack. r0 has the return value after call. |