| 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 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 // src1: higher (exponent) part of the double value. | 866 // src1: higher (exponent) part of the double value. |
| 867 // src2: lower (mantissa) part of the double value. | 867 // src2: lower (mantissa) part of the double value. |
| 868 // scratch: unbiased exponent. | 868 // scratch: unbiased exponent. |
| 869 | 869 |
| 870 // Fast cases. Check for obvious non 32-bit integer values. | 870 // Fast cases. Check for obvious non 32-bit integer values. |
| 871 // Negative exponent cannot yield 32-bit integers. | 871 // Negative exponent cannot yield 32-bit integers. |
| 872 __ b(mi, not_int32); | 872 __ b(mi, not_int32); |
| 873 // Exponent greater than 31 cannot yield 32-bit integers. | 873 // Exponent greater than 31 cannot yield 32-bit integers. |
| 874 // Also, a positive value with an exponent equal to 31 is outside of the | 874 // Also, a positive value with an exponent equal to 31 is outside of the |
| 875 // signed 32-bit integer range. | 875 // signed 32-bit integer range. |
| 876 __ tst(src1, Operand(HeapNumber::kSignMask)); | 876 // Another way to put it is that if (exponent - signbit) > 30 then the |
| 877 __ cmp(scratch, Operand(30), eq); // Executed for positive. If exponent is 30 | 877 // number cannot be represented as an int32. |
| 878 // the gt condition will be "correct" and | 878 Register tmp = dst; |
| 879 // the next instruction will be skipped. | 879 __ sub(tmp, scratch, Operand(src1, LSR, 31)); |
| 880 __ cmp(scratch, Operand(31), ne); // Executed for negative and positive where | 880 __ cmp(tmp, Operand(30)); |
| 881 // exponent is not 30. | |
| 882 __ b(gt, not_int32); | 881 __ b(gt, not_int32); |
| 883 // - Bits [21:0] in the mantissa are not null. | 882 // - Bits [21:0] in the mantissa are not null. |
| 884 __ tst(src2, Operand(0x3fffff)); | 883 __ tst(src2, Operand(0x3fffff)); |
| 885 __ b(ne, not_int32); | 884 __ b(ne, not_int32); |
| 886 | 885 |
| 887 // Otherwise the exponent needs to be big enough to shift left all the | 886 // Otherwise the exponent needs to be big enough to shift left all the |
| 888 // non zero bits left. So we need the (30 - exponent) last bits of the | 887 // non zero bits left. So we need the (30 - exponent) last bits of the |
| 889 // 31 higher bits of the mantissa to be null. | 888 // 31 higher bits of the mantissa to be null. |
| 890 // Because bits [21:0] are null, we can check instead that the | 889 // Because bits [21:0] are null, we can check instead that the |
| 891 // (32 - exponent) last bits of the 32 higher bits of the mantisssa are null. | 890 // (32 - exponent) last bits of the 32 higher bits of the mantisssa are null. |
| (...skipping 6002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6894 __ strb(untagged_value, MemOperand(external_pointer, untagged_key)); | 6893 __ strb(untagged_value, MemOperand(external_pointer, untagged_key)); |
| 6895 __ Ret(); | 6894 __ Ret(); |
| 6896 } | 6895 } |
| 6897 | 6896 |
| 6898 | 6897 |
| 6899 #undef __ | 6898 #undef __ |
| 6900 | 6899 |
| 6901 } } // namespace v8::internal | 6900 } } // namespace v8::internal |
| 6902 | 6901 |
| 6903 #endif // V8_TARGET_ARCH_ARM | 6902 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |