Index: src/x64/macro-assembler-x64.cc |
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
index 95f17247a975896330620d443d7069d154018194..3191199271613443a6dfe3ebdff826e22c28da5c 100644 |
--- a/src/x64/macro-assembler-x64.cc |
+++ b/src/x64/macro-assembler-x64.cc |
@@ -4979,6 +4979,18 @@ void MacroAssembler::JumpIfDictionaryInPrototypeChain( |
} |
+void MacroAssembler::FlooringDiv(Register dividend, int32_t divisor) { |
+ ASSERT(!dividend.is(rax)); |
+ ASSERT(!dividend.is(rdx)); |
+ MultiplierAndShift ms(divisor); |
+ movl(rax, Immediate(ms.multiplier())); |
+ imull(dividend); |
+ 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())); |
+} |
+ |
+ |
} } // namespace v8::internal |
#endif // V8_TARGET_ARCH_X64 |