Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Unified Diff: src/arm/macro-assembler-arm.h

Issue 12567004: ARM: Optimsisation of ECMA ToInt32. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/arm/macro-assembler-arm.h
diff --git a/src/arm/macro-assembler-arm.h b/src/arm/macro-assembler-arm.h
index cf2f0457523a2e4fafc5a16f06f5f3fa235e7a1e..9fdbabd2686e833b8eace746e0f4d1965fddec78 100644
--- a/src/arm/macro-assembler-arm.h
+++ b/src/arm/macro-assembler-arm.h
@@ -933,17 +933,6 @@ class MacroAssembler: public Assembler {
Register scratch1,
SwVfpRegister scratch2);
- // Convert the HeapNumber pointed to by source to a 32bits signed integer
- // dest. If the HeapNumber does not fit into a 32bits signed integer branch
- // to not_int32 label. If VFP3 is available double_scratch is used but not
- // scratch2.
- void ConvertToInt32(Register source,
- Register dest,
- Register scratch,
- Register scratch2,
- DwVfpRegister double_scratch,
- Label *not_int32);
-
// Check if a double can be exactly represented as a signed 32-bit integer.
// Z flag set to one if true.
void TestDoubleIsInt32(DwVfpRegister double_input,
@@ -965,26 +954,34 @@ class MacroAssembler: public Assembler {
Label* done,
Label* exact);
- // Helper for EmitECMATruncate.
- // This will truncate a floating-point value outside of the signed 32bit
- // integer range to a 32bit signed integer.
- // Expects the double value loaded in input_high and input_low.
- // Exits with the answer in 'result'.
- // Note that this code does not work for values in the 32bit range!
- void EmitOutOfInt32RangeTruncate(Register result,
- Register input_high,
- Register input_low,
- Register scratch);
+ // 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 scratch,
+ Register input_high,
+ Register input_low,
+ 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.
// Exits with 'result' holding the answer and all other registers clobbered.
- void EmitECMATruncate(Register result,
- DwVfpRegister double_input,
- DwVfpRegister double_scratch,
+ void ECMAToInt32VFP(Register result,
+ DwVfpRegister double_input,
+ DwVfpRegister double_scratch,
+ Register scratch,
+ Register input_high,
+ Register input_low);
+
+ // Performs a truncating conversion of a floating point number as used by
+ // the JS bitwise operations. See ECMA-262 9.5: ToInt32.
+ // Exits with 'result' holding the answer.
+ void ECMAToInt32NoVFP(Register result,
Register scratch,
- Register scratch2,
- Register scratch3);
+ Register input_high,
+ Register input_low);
// Count leading zeros in a 32 bit word. On ARM5 and later it uses the clz
// instruction. On pre-ARM5 hardware this routine gives the wrong answer
@@ -1365,6 +1362,15 @@ class MacroAssembler: public Assembler {
// it. See the implementation for register usage.
void JumpToHandlerEntry();
+ // Helper for ECMAToInt32VFP and ECMAToInt32NoVFP.
ulan 2013/03/11 15:11:03 Description of preconditions for inputs would be h
Rodolph Perfetta 2013/03/12 11:24:45 Done.
+ 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);

Powered by Google App Engine
This is Rietveld 408576698