OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 // src1: higher (exponent) part of the double value. | 865 // src1: higher (exponent) part of the double value. |
866 // src2: lower (mantissa) part of the double value. | 866 // src2: lower (mantissa) part of the double value. |
867 // scratch: unbiased exponent. | 867 // scratch: unbiased exponent. |
868 | 868 |
869 // Fast cases. Check for obvious non 32-bit integer values. | 869 // Fast cases. Check for obvious non 32-bit integer values. |
870 // Negative exponent cannot yield 32-bit integers. | 870 // Negative exponent cannot yield 32-bit integers. |
871 __ b(mi, not_int32); | 871 __ b(mi, not_int32); |
872 // Exponent greater than 31 cannot yield 32-bit integers. | 872 // Exponent greater than 31 cannot yield 32-bit integers. |
873 // Also, a positive value with an exponent equal to 31 is outside of the | 873 // Also, a positive value with an exponent equal to 31 is outside of the |
874 // signed 32-bit integer range. | 874 // signed 32-bit integer range. |
875 __ tst(src1, Operand(HeapNumber::kSignMask)); | 875 // Another way to put it is that if (exponent - signbit) > 30 then the |
876 __ cmp(scratch, Operand(30), eq); // Executed for positive. If exponent is 30 | 876 // number cannot be represented as an int32. |
877 // the gt condition will be "correct" and | 877 Register tmp = dst; |
878 // the next instruction will be skipped. | 878 __ sub(tmp, scratch, Operand(src1, LSR, 31)); |
879 __ cmp(scratch, Operand(31), ne); // Executed for negative and positive where | 879 __ cmp(tmp, Operand(30)); |
880 // exponent is not 30. | |
881 __ b(gt, not_int32); | 880 __ b(gt, not_int32); |
882 // - Bits [21:0] in the mantissa are not null. | 881 // - Bits [21:0] in the mantissa are not null. |
883 __ tst(src2, Operand(0x3fffff)); | 882 __ tst(src2, Operand(0x3fffff)); |
884 __ b(ne, not_int32); | 883 __ b(ne, not_int32); |
885 | 884 |
886 // Otherwise the exponent needs to be big enough to shift left all the | 885 // Otherwise the exponent needs to be big enough to shift left all the |
887 // non zero bits left. So we need the (30 - exponent) last bits of the | 886 // non zero bits left. So we need the (30 - exponent) last bits of the |
888 // 31 higher bits of the mantissa to be null. | 887 // 31 higher bits of the mantissa to be null. |
889 // Because bits [21:0] are null, we can check instead that the | 888 // Because bits [21:0] are null, we can check instead that the |
890 // (32 - exponent) last bits of the 32 higher bits of the mantisssa are null. | 889 // (32 - exponent) last bits of the 32 higher bits of the mantisssa are null. |
(...skipping 5987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6878 __ strb(untagged_value, MemOperand(external_pointer, untagged_key)); | 6877 __ strb(untagged_value, MemOperand(external_pointer, untagged_key)); |
6879 __ Ret(); | 6878 __ Ret(); |
6880 } | 6879 } |
6881 | 6880 |
6882 | 6881 |
6883 #undef __ | 6882 #undef __ |
6884 | 6883 |
6885 } } // namespace v8::internal | 6884 } } // namespace v8::internal |
6886 | 6885 |
6887 #endif // V8_TARGET_ARCH_ARM | 6886 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |