Index: src/x64/macro-assembler-x64.cc |
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
index 6b84b0bc1aad2a8377890cc09140d7e0eec7fca9..fe65f9454232aa4c17ab9f936206a454d4b68d8f 100644 |
--- a/src/x64/macro-assembler-x64.cc |
+++ b/src/x64/macro-assembler-x64.cc |
@@ -4992,7 +4992,7 @@ void MacroAssembler::JumpIfDictionaryInPrototypeChain( |
} |
-void MacroAssembler::FlooringDiv(Register dividend, int32_t divisor) { |
+void MacroAssembler::TruncatingDiv(Register dividend, int32_t divisor) { |
ASSERT(!dividend.is(rax)); |
ASSERT(!dividend.is(rdx)); |
MultiplierAndShift ms(divisor); |
@@ -5001,6 +5001,9 @@ void MacroAssembler::FlooringDiv(Register dividend, int32_t divisor) { |
if (divisor > 0 && ms.multiplier() < 0) addl(rdx, dividend); |
if (divisor < 0 && ms.multiplier() > 0) subl(rdx, dividend); |
if (ms.shift() > 0) sarl(rdx, Immediate(ms.shift())); |
+ movl(rax, dividend); |
+ shrl(rax, Immediate(31)); |
+ addl(rdx, rax); |
} |