Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: src/x64/macro-assembler-x64.h

Issue 21123008: Introduce StackArgumentsAccessor class for X64 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed danno's comments Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« src/x64/code-stubs-x64.cc ('K') | « src/x64/ic-x64.cc ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698