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

Unified Diff: runtime/vm/constants_x64.h

Issue 317773002: Fix Win64 build of Dart VM. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address comments Created 6 years, 6 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
« no previous file with comments | « runtime/vm/bigint_operations.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/constants_x64.h
diff --git a/runtime/vm/constants_x64.h b/runtime/vm/constants_x64.h
index f5e76ef27e9bc4b9f18177d2ff8bbd028ce516ad..7874083341e79484072c8b15ad8fd8de6a2d7749 100644
--- a/runtime/vm/constants_x64.h
+++ b/runtime/vm/constants_x64.h
@@ -138,6 +138,62 @@ enum Condition {
NOT_CARRY = ABOVE_EQUAL
};
+#define R(reg) (1 << (reg))
+
+#if defined(_WIN64)
+class CallingConventions {
+ public:
+ static const Register kArg1Reg = RCX;
+ static const Register kArg2Reg = RDX;
+ static const Register kArg3Reg = R8;
+ static const Register kArg4Reg = R9;
+ static const intptr_t kShadowSpaceBytes = 4 * kWordSize;
+
+ static const intptr_t kVolatileCpuRegisters =
+ R(RAX) | R(RCX) | R(RDX) | R(R8) | R(R9) | R(R10) | R(R11);
+
+ static const intptr_t kVolatileXmmRegisters =
+ R(XMM0) | R(XMM1) | R(XMM2) | R(XMM3) | R(XMM4) | R(XMM5);
+
+ static const intptr_t kCalleeSaveCpuRegisters =
+ R(RBX) | R(RSI) | R(RDI) | R(R12) | R(R13) | R(R14) | R(R15);
+
+ static const intptr_t kCalleeSaveXmmRegisters =
+ R(XMM6) | R(XMM7) | R(XMM8) | R(XMM9) | R(XMM10) | R(XMM11) | R(XMM12) |
+ R(XMM13) | R(XMM14) | R(XMM15);
+
+ // Windows x64 ABI specifies that small objects are passed in registers.
+ // Otherwise they are passed by reference.
+ static const size_t kRegisterTransferLimit = 16;
+};
+#else
+class CallingConventions {
+ public:
+ static const Register kArg1Reg = RDI;
+ static const Register kArg2Reg = RSI;
+ static const Register kArg3Reg = RDX;
+ static const Register kArg4Reg = RCX;
+ static const Register kArg5Reg = R8;
+ static const Register kArg6Reg = R9;
+ static const intptr_t kShadowSpaceBytes = 0;
+
+ static const intptr_t kVolatileCpuRegisters =
+ R(RAX) | R(RCX) | R(RDX) | R(RSI) | R(RDI) |
+ R(R8) | R(R9) | R(R10) | R(R11);
+
+ static const intptr_t kVolatileXmmRegisters =
+ R(XMM0) | R(XMM1) | R(XMM2) | R(XMM3) | R(XMM4) |
+ R(XMM5) | R(XMM6) | R(XMM7) | R(XMM8) | R(XMM9) |
+ R(XMM10) | R(XMM11) | R(XMM12) | R(XMM13) | R(XMM14) | R(XMM15);
+
+ static const intptr_t kCalleeSaveCpuRegisters =
+ R(RBX) | R(R12) | R(R13) | R(R14) | R(R15);
+
+ static const intptr_t kCalleeSaveXmmRegisters = 0;
+};
+#endif
+
+#undef R
class Instr {
public:
« no previous file with comments | « runtime/vm/bigint_operations.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698