Index: src/ia32/macro-assembler-ia32.cc |
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc |
index cc0f392f185212826144898536c1945fef233d7f..2e5b8351c6299f6e1f45b9b4ef3587a8b815c790 100644 |
--- a/src/ia32/macro-assembler-ia32.cc |
+++ b/src/ia32/macro-assembler-ia32.cc |
@@ -3603,6 +3603,19 @@ void MacroAssembler::JumpIfDictionaryInPrototypeChain( |
j(not_equal, &loop_again); |
} |
+ |
+void MacroAssembler::FlooringDiv(Register dividend, int32_t divisor) { |
+ ASSERT(!dividend.is(eax)); |
+ ASSERT(!dividend.is(edx)); |
+ MultiplierAndShift ms(divisor); |
+ mov(eax, Immediate(ms.multiplier())); |
+ imul(dividend); |
+ if (divisor > 0 && ms.multiplier() < 0) add(edx, dividend); |
+ if (divisor < 0 && ms.multiplier() > 0) sub(edx, dividend); |
+ if (ms.shift() > 0) sar(edx, ms.shift()); |
+} |
+ |
+ |
} } // namespace v8::internal |
#endif // V8_TARGET_ARCH_IA32 |