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 3585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3596 mov(scratch1, FieldOperand(current, Map::kBitField2Offset)); | 3596 mov(scratch1, FieldOperand(current, Map::kBitField2Offset)); |
3597 and_(scratch1, Map::kElementsKindMask); | 3597 and_(scratch1, Map::kElementsKindMask); |
3598 shr(scratch1, Map::kElementsKindShift); | 3598 shr(scratch1, Map::kElementsKindShift); |
3599 cmp(scratch1, Immediate(DICTIONARY_ELEMENTS)); | 3599 cmp(scratch1, Immediate(DICTIONARY_ELEMENTS)); |
3600 j(equal, found); | 3600 j(equal, found); |
3601 mov(current, FieldOperand(current, Map::kPrototypeOffset)); | 3601 mov(current, FieldOperand(current, Map::kPrototypeOffset)); |
3602 cmp(current, Immediate(factory->null_value())); | 3602 cmp(current, Immediate(factory->null_value())); |
3603 j(not_equal, &loop_again); | 3603 j(not_equal, &loop_again); |
3604 } | 3604 } |
3605 | 3605 |
3606 | |
3607 void MacroAssembler::FlooringDiv(Register dividend, int32_t divisor) { | |
3608 ASSERT(!dividend.is(eax)); | |
3609 ASSERT(!dividend.is(edx)); | |
3610 MultiplierAndShift ms(divisor); | |
3611 mov(eax, Immediate(ms.multiplier())); | |
3612 imul(dividend); | |
3613 if (divisor > 0 && ms.multiplier() < 0) add(edx, dividend); | |
3614 if (divisor < 0 && ms.multiplier() > 0) sub(edx, dividend); | |
3615 if (ms.shift() > 0) sar(edx, ms.shift()); | |
3616 mov(eax, dividend); | |
3617 shr(eax, 31); | |
3618 add(edx, eax); | |
3619 } | |
3620 | |
3621 | |
3622 } } // namespace v8::internal | 3606 } } // namespace v8::internal |
3623 | 3607 |
3624 #endif // V8_TARGET_ARCH_IA32 | 3608 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |