Index: src/ia32/macro-assembler-ia32.cc |
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc |
index ae6b50c92fdde011c547a5c37e0ad15dc6723dc1..4682b37b16e409c23b9e962f326198fd66d183a8 100644 |
--- a/src/ia32/macro-assembler-ia32.cc |
+++ b/src/ia32/macro-assembler-ia32.cc |
@@ -3627,7 +3627,7 @@ void MacroAssembler::JumpIfDictionaryInPrototypeChain( |
} |
-void MacroAssembler::FlooringDiv(Register dividend, int32_t divisor) { |
+void MacroAssembler::TruncatingDiv(Register dividend, int32_t divisor) { |
ASSERT(!dividend.is(eax)); |
ASSERT(!dividend.is(edx)); |
MultiplierAndShift ms(divisor); |
@@ -3636,6 +3636,9 @@ void MacroAssembler::FlooringDiv(Register dividend, int32_t divisor) { |
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()); |
+ mov(eax, dividend); |
+ shr(eax, 31); |
+ add(edx, eax); |
} |