Chromium Code Reviews| Index: src/arm/macro-assembler-arm.h |
| diff --git a/src/arm/macro-assembler-arm.h b/src/arm/macro-assembler-arm.h |
| index 8b9fa2b22162bf0e1b1e1d8343bb3ebd1771fa10..021ba0e2593ae0bac836a7d698b4807957bc1e13 100644 |
| --- a/src/arm/macro-assembler-arm.h |
| +++ b/src/arm/macro-assembler-arm.h |
| @@ -62,6 +62,14 @@ enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK }; |
| enum LinkRegisterStatus { kLRHasNotBeenSaved, kLRHasBeenSaved }; |
| +Register GetRegisterThatIsNotOneOf(Register reg1, |
| + Register reg2 = no_reg, |
| + Register reg3 = no_reg, |
| + Register reg4 = no_reg, |
| + Register reg5 = no_reg, |
| + Register reg6 = no_reg); |
| + |
| + |
| #ifdef DEBUG |
| bool AreAliased(Register reg1, |
| Register reg2, |
| @@ -491,19 +499,6 @@ class MacroAssembler: public Assembler { |
| void VmovLow(Register dst, DwVfpRegister src); |
| void VmovLow(DwVfpRegister dst, Register src); |
| - // Converts the smi or heap number in object to an int32 using the rules |
| - // for ToInt32 as described in ECMAScript 9.5.: the value is truncated |
| - // and brought into the range -2^31 .. +2^31 - 1. |
| - void ConvertNumberToInt32(Register object, |
| - Register dst, |
| - Register heap_number_map, |
| - Register scratch1, |
| - Register scratch2, |
| - Register scratch3, |
| - DwVfpRegister double_scratch1, |
| - LowDwVfpRegister double_scratch2, |
| - Label* not_int32); |
| - |
| // Loads the number from object into dst register. |
| // If |object| is neither smi nor heap number, |not_number| is jumped to |
| // with |object| still intact. |
| @@ -989,15 +984,33 @@ class MacroAssembler: public Assembler { |
| Label* exact); |
| // Performs a truncating conversion of a floating point number as used by |
| + // the JS bitwise operations. Goes to 'done' if it succeeds, otherwise falls |
| + // through if result is saturated. On return 'result' either holds answer, or |
| + // is clobbered on fall through. |
| + void TryInlineTruncateDoubleToI(Register result, |
|
danno
2013/08/16 12:18:19
Perhaps make this a private member?
rmcilroy_google
2013/08/16 14:43:54
I did this originally, but then needed to call the
Benedikt Meurer
2013/08/19 07:48:01
If there's no easy way to make this private, you s
rmcilroy
2013/08/19 12:35:24
Done.
|
| + DwVfpRegister input, |
| + Label* done); |
| + |
| + // Performs a truncating conversion of a floating point number as used by |
| // the JS bitwise operations. See ECMA-262 9.5: ToInt32. |
| - // Double_scratch must be between d0 and d15. |
| - // Exits with 'result' holding the answer and all other registers clobbered. |
| - void ECMAToInt32(Register result, |
| - DwVfpRegister double_input, |
| - Register scratch, |
| - Register scratch_high, |
| - Register scratch_low, |
| - LowDwVfpRegister double_scratch); |
| + // Exits with 'result' holding the answer. |
| + void TruncateDoubleToI(Register result, DwVfpRegister double_input); |
| + |
| + // Performs a truncating conversion of a floating point number located at the |
| + // 'offset' from the address in 'input'. See ECMA-262 9.5: ToInt32. |
| + // 'result' and 'input' must be different registers. Exits with 'result' |
| + // holding the answer. |
| + void TruncateDoubleToI(Register result, Register input, int offset); |
|
danno
2013/08/16 12:18:19
Consider calling this TruncateHeapNumberToI like t
rmcilroy
2013/08/19 12:35:24
Done.
|
| + |
| + // Converts the smi or heap number in object to an int32 using the rules |
| + // for ToInt32 as described in ECMAScript 9.5.: the value is truncated |
| + // and brought into the range -2^31 .. +2^31 - 1. 'result' and 'input' must be |
| + // different registers. |
| + void TruncateNumberToI(Register object, |
| + Register result, |
| + Register heap_number_map, |
| + Register scratch1, |
| + Label* not_int32); |
| // Check whether d16-d31 are available on the CPU. The result is given by the |
| // Z condition flag: Z==0 if d16-d31 available, Z==1 otherwise. |