OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 3609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3620 and_(scratch1, Map::kElementsKindMask); | 3620 and_(scratch1, Map::kElementsKindMask); |
3621 shr(scratch1, Map::kElementsKindShift); | 3621 shr(scratch1, Map::kElementsKindShift); |
3622 cmp(scratch1, Immediate(DICTIONARY_ELEMENTS)); | 3622 cmp(scratch1, Immediate(DICTIONARY_ELEMENTS)); |
3623 j(equal, found); | 3623 j(equal, found); |
3624 mov(current, FieldOperand(current, Map::kPrototypeOffset)); | 3624 mov(current, FieldOperand(current, Map::kPrototypeOffset)); |
3625 cmp(current, Immediate(factory->null_value())); | 3625 cmp(current, Immediate(factory->null_value())); |
3626 j(not_equal, &loop_again); | 3626 j(not_equal, &loop_again); |
3627 } | 3627 } |
3628 | 3628 |
3629 | 3629 |
3630 void MacroAssembler::FlooringDiv(Register dividend, int32_t divisor) { | 3630 void MacroAssembler::TruncatingDiv(Register dividend, int32_t divisor) { |
3631 ASSERT(!dividend.is(eax)); | 3631 ASSERT(!dividend.is(eax)); |
3632 ASSERT(!dividend.is(edx)); | 3632 ASSERT(!dividend.is(edx)); |
3633 MultiplierAndShift ms(divisor); | 3633 MultiplierAndShift ms(divisor); |
3634 mov(eax, Immediate(ms.multiplier())); | 3634 mov(eax, Immediate(ms.multiplier())); |
3635 imul(dividend); | 3635 imul(dividend); |
3636 if (divisor > 0 && ms.multiplier() < 0) add(edx, dividend); | 3636 if (divisor > 0 && ms.multiplier() < 0) add(edx, dividend); |
3637 if (divisor < 0 && ms.multiplier() > 0) sub(edx, dividend); | 3637 if (divisor < 0 && ms.multiplier() > 0) sub(edx, dividend); |
3638 if (ms.shift() > 0) sar(edx, ms.shift()); | 3638 if (ms.shift() > 0) sar(edx, ms.shift()); |
| 3639 mov(eax, dividend); |
| 3640 shr(eax, 31); |
| 3641 add(edx, eax); |
3639 } | 3642 } |
3640 | 3643 |
3641 | 3644 |
3642 } } // namespace v8::internal | 3645 } } // namespace v8::internal |
3643 | 3646 |
3644 #endif // V8_TARGET_ARCH_IA32 | 3647 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |