Index: src/x64/macro-assembler-x64.h |
diff --git a/src/x64/macro-assembler-x64.h b/src/x64/macro-assembler-x64.h |
index e611c8ae27999a9520d0aa07bfa050b51a0bb831..d003c8d1382584bc556e3297b137a5ec1aeeee62 100644 |
--- a/src/x64/macro-assembler-x64.h |
+++ b/src/x64/macro-assembler-x64.h |
@@ -1523,6 +1523,41 @@ inline Operand StackOperandForReturnAddress(int32_t disp) { |
} |
+// Computes the argument address from the argument 0 (might be receiver) |
+// at rsp + disp + kPCOnStackSize + (total - 1) * kPointerSize, disp is the |
+// displacement between the rsp and the return address. |
+inline Operand StackOperandForArgument(int index, int total, int disp = 0) { |
+ return Operand(rsp, disp + kPCOnStackSize + |
+ (total - 1 - index) * kPointerSize); |
+} |
+ |
+ |
+// Computes the argument address in reverse order, i.e., from the last argument |
+// at rsp + disp + kPCOnStackSize, disp is the displacement between the rsp |
+// and the return address. |
+inline Operand StackOperandForReversedArgument(int index, int disp = 0) { |
+ return Operand(rsp, disp + kPCOnStackSize + index * kPointerSize); |
+} |
+ |
+ |
+inline Operand StackOperandForReversedArgument(Register index, |
+ int offset, |
+ int disp = 0) { |
+ return Operand(rsp, index, times_pointer_size, |
+ disp + kPCOnStackSize + offset * kPointerSize); |
+} |
+ |
+ |
+inline Operand StackOperandForReceiver(int index, int disp = 0) { |
+ return StackOperandForReversedArgument(index, disp); |
+} |
+ |
+ |
+inline Operand StackOperandForReceiver(Register index, int disp = 0) { |
+ return StackOperandForReversedArgument(index, 0, disp); |
+} |
+ |
+ |
#ifdef GENERATED_CODE_COVERAGE |
extern void LogGeneratedCodeCoverage(const char* file_line); |
#define CODE_COVERAGE_STRINGIFY(x) #x |