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

Unified Diff: src/compiler/x64/linkage-x64.cc

Issue 436623002: TF: Clear upper bits of ConvertFloat64ToUint32 because Win64. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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
« no previous file with comments | « src/compiler/x64/code-generator-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/x64/linkage-x64.cc
diff --git a/src/compiler/x64/linkage-x64.cc b/src/compiler/x64/linkage-x64.cc
index 3a92bb16c7a1a8abef0faa1f714f5c3de259a65c..7d34ef2cfae42b602fe2ce5105f790897c52cc92 100644
--- a/src/compiler/x64/linkage-x64.cc
+++ b/src/compiler/x64/linkage-x64.cc
@@ -14,6 +14,12 @@ namespace v8 {
namespace internal {
namespace compiler {
+#ifdef _WIN64
+const bool kWin64 = true;
+#else
+const bool kWin64 = false;
+#endif
+
struct LinkageHelperTraits {
static Register ReturnValueReg() { return rax; }
static Register ReturnValue2Reg() { return rdx; }
@@ -21,26 +27,24 @@ struct LinkageHelperTraits {
static Register ContextReg() { return rsi; }
static Register RuntimeCallFunctionReg() { return rbx; }
static Register RuntimeCallArgCountReg() { return rax; }
-#ifdef _WIN64
static RegList CCalleeSaveRegisters() {
- return rbx.bit() | rdi.bit() | rsi.bit() | r12.bit() | r13.bit() |
- r14.bit() | r15.bit();
+ if (kWin64) {
+ return rbx.bit() | rdi.bit() | rsi.bit() | r12.bit() | r13.bit() |
+ r14.bit() | r15.bit();
+ } else {
+ return rbx.bit() | r12.bit() | r13.bit() | r14.bit() | r15.bit();
+ }
}
static Register CRegisterParameter(int i) {
- static Register register_parameters[] = {rcx, rdx, r8, r9};
- return register_parameters[i];
+ if (kWin64) {
+ static Register register_parameters[] = {rcx, rdx, r8, r9};
+ return register_parameters[i];
+ } else {
+ static Register register_parameters[] = {rdi, rsi, rdx, rcx, r8, r9};
+ return register_parameters[i];
+ }
}
- static int CRegisterParametersLength() { return 4; }
-#else
- static RegList CCalleeSaveRegisters() {
- return rbx.bit() | r12.bit() | r13.bit() | r14.bit() | r15.bit();
- }
- static Register CRegisterParameter(int i) {
- static Register register_parameters[] = {rdi, rsi, rdx, rcx, r8, r9};
- return register_parameters[i];
- }
- static int CRegisterParametersLength() { return 6; }
-#endif
+ static int CRegisterParametersLength() { return kWin64 ? 4 : 6; }
};
« no previous file with comments | « src/compiler/x64/code-generator-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698