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 f9f672bac6d084bbbad8fc6d6ea2a1cd3385f569..715a786745ea0245758ab64e271e545d489c652c 100644 |
| --- a/src/arm/macro-assembler-arm.h |
| +++ b/src/arm/macro-assembler-arm.h |
| @@ -495,6 +495,55 @@ class MacroAssembler: public Assembler { |
| const double imm, |
| const Register scratch = no_reg); |
| + // Convert the smi or heap number in object to an int32 using the rules |
|
ulan
2013/04/22 11:24:49
"Converts"
Rodolph Perfetta
2013/04/22 21:30:33
Done.
|
| + // 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, |
| + DwVfpRegister double_scratch2, |
| + Label* not_int32); |
| + |
| + // Loads the objects from |object| into floating point registers. |
| + // The value ends up either in |dst|. |
|
ulan
2013/04/22 11:24:49
"Loads the number from object into dst register."
Rodolph Perfetta
2013/04/22 21:30:33
Done.
|
| + // If |object| is neither smi nor heap number, |not_number| is jumped to |
| + // with |object| still intact. |
| + void LoadNumber(Register object, |
| + DwVfpRegister dst, |
| + Register heap_number_map, |
| + Register scratch, |
| + Label* not_number); |
| + |
| + // Load the number from object into double_dst in the double format. |
|
ulan
2013/04/22 11:24:49
"Loads"
Rodolph Perfetta
2013/04/22 21:30:33
Done.
|
| + // Control will jump to not_int32 if the value cannot be exactly represented |
| + // by a 32-bit integer. |
| + // Floating point value in the 32-bit integer range that are not exact integer |
| + // won't be loaded. |
| + void LoadNumberAsInt32Double(Register object, |
| + DwVfpRegister double_dst, |
| + Register heap_number_map, |
| + Register scratch, |
| + DwVfpRegister double_scratch, |
| + Label* not_int32); |
| + |
| + // Loads the number from object into dst as a 32-bit integer. |
| + // Control will jump to not_int32 if the object cannot be exactly represented |
| + // by a 32-bit integer. |
| + // Floating point value in the 32-bit integer range that are not exact integer |
| + // won't be converted. |
| + void LoadNumberAsInt32(Register object, |
| + Register dst, |
| + Register heap_number_map, |
| + Register scratch, |
| + DwVfpRegister double_scratch0, |
| + DwVfpRegister double_scratch1, |
| + Label* not_int32); |
| + |
| + |
| // Enter exit frame. |
| // stack_space - extra stack space, used for alignment before call to C. |
| void EnterExitFrame(bool save_doubles, int stack_space = 0); |
| @@ -831,16 +880,11 @@ class MacroAssembler: public Assembler { |
| // Check to see if maybe_number can be stored as a double in |
| // FastDoubleElements. If it can, store it at the index specified by key in |
| - // the FastDoubleElements array elements. Otherwise jump to fail, in which |
| - // case scratch2, scratch3 and scratch4 are unmodified. |
| + // the FastDoubleElements array elements. Otherwise jump to fail. |
| void StoreNumberToDoubleElements(Register value_reg, |
| Register key_reg, |
| - // All regs below here overwritten. |
| Register elements_reg, |
| Register scratch1, |
| - Register scratch2, |
| - Register scratch3, |
| - Register scratch4, |
| Label* fail, |
| int elements_offset = 0); |
| @@ -972,26 +1016,16 @@ class MacroAssembler: public Assembler { |
| Label* done, |
| Label* exact); |
| - // Performs a truncating conversion of a heap floating point number as used by |
| - // the JS bitwise operations. See ECMA-262 9.5: ToInt32. |
| - // Exits with 'result' holding the answer. |
| - void ECMAConvertNumberToInt32(Register source, |
| - Register result, |
| - Register input_low, |
| - Register input_high, |
| - Register scratch, |
| - DwVfpRegister double_scratch1, |
| - DwVfpRegister double_scratch2); |
| - |
| // 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, |
| - DwVfpRegister double_scratch, |
| Register scratch, |
| - Register input_high, |
| - Register input_low); |
| + Register scratch_high, |
| + Register scratch_low, |
| + DwVfpRegister double_scratch); |
| // 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. |
| @@ -1120,7 +1154,6 @@ class MacroAssembler: public Assembler { |
| // Calls Abort(msg) if the condition cond is not satisfied. |
| // Use --debug_code to enable. |
| void Assert(Condition cond, const char* msg); |
| - void AssertRegisterIsRoot(Register reg, Heap::RootListIndex index); |
| void AssertFastElements(Register elements); |
| // Like Assert(), but always enabled. |
| @@ -1230,11 +1263,9 @@ class MacroAssembler: public Assembler { |
| // Abort execution if argument is not a name, enabled via --debug-code. |
| void AssertName(Register object); |
| - // Abort execution if argument is not the root value with the given index, |
| + // Abort execution if reg is not the root value with the given index, |
| // enabled via --debug-code. |
| - void AssertRootValue(Register src, |
| - Heap::RootListIndex root_value_index, |
| - const char* message); |
| + void AssertIsRoot(Register reg, Heap::RootListIndex index); |
| // --------------------------------------------------------------------------- |
| // HeapNumber utilities |
| @@ -1365,16 +1396,6 @@ class MacroAssembler: public Assembler { |
| // it. See the implementation for register usage. |
| void JumpToHandlerEntry(); |
| - // Helper for ECMAToInt32VFP and ECMAToInt32NoVFP. |
| - // It is expected that 31 <= exponent <= 83, and scratch is exponent - 1. |
| - void ECMAToInt32Tail(Register result, |
| - Register scratch, |
| - Register input_high, |
| - Register input_low, |
| - Label* out_of_range, |
| - Label* negate, |
| - Label* done); |
| - |
| // Compute memory operands for safepoint stack slots. |
| static int SafepointRegisterStackIndex(int reg_code); |
| MemOperand SafepointRegisterSlot(Register reg); |