Index: src/x64/macro-assembler-x64.cc |
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
index 9c9b1620e586ce5872bbc46de2eaf515266716a0..b0830c2b1963298194c5dc9964f024f708562fcf 100644 |
--- a/src/x64/macro-assembler-x64.cc |
+++ b/src/x64/macro-assembler-x64.cc |
@@ -2222,6 +2222,30 @@ void MacroAssembler::AddSmiField(Register dst, const Operand& src) { |
} |
+void MacroAssembler::PushInt64AsTwoSmis(Register src, Register scratch) { |
+ movq(scratch, src); |
+ // High bits. |
+ shr(src, Immediate(64 - kSmiShift)); |
+ shl(src, Immediate(kSmiShift)); |
+ push(src); |
+ // Low bits. |
+ shl(scratch, Immediate(kSmiShift)); |
+ push(scratch); |
+} |
+ |
+ |
+void MacroAssembler::PopInt64AsTwoSmis(Register dst, Register scratch) { |
+ pop(scratch); |
+ // Low bits. |
+ shr(scratch, Immediate(kSmiShift)); |
+ pop(dst); |
+ shr(dst, Immediate(kSmiShift)); |
+ // High bits. |
+ shl(dst, Immediate(64 - kSmiShift)); |
+ or_(dst, scratch); |
+} |
+ |
+ |
void MacroAssembler::JumpIfNotString(Register object, |
Register object_map, |
Label* not_string, |