From 59e2c49744e5dbe968a36d45811a5eda4e4ba207 Mon Sep 17 00:00:00 2001 From: Makoto Kato Date: Mon, 28 Sep 2009 18:16:41 +0900 Subject: [PATCH] Bug 512409 - nanojit support for Windows x64. r=dvander --- js/src/nanojit/NativeX64.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/js/src/nanojit/NativeX64.cpp b/js/src/nanojit/NativeX64.cpp index 5e5b50741a0..338b852143a 100644 --- a/js/src/nanojit/NativeX64.cpp +++ b/js/src/nanojit/NativeX64.cpp @@ -70,7 +70,7 @@ tracing namespace nanojit { const Register Assembler::retRegs[] = { RAX }; -#ifdef _MSC_VER +#ifdef _WIN64 const Register Assembler::argRegs[] = { RCX, RDX, R8, R9 }; const Register Assembler::savedRegs[] = { RBX, RSI, RDI, R12, R13, R14, R15 }; #else @@ -588,7 +588,7 @@ namespace nanojit emit(X64_callrax); } - #ifdef _MSC_VER + #ifdef _WIN64 int stk_used = 32; // always reserve 32byte shadow area #else int stk_used = 0; @@ -604,7 +604,7 @@ namespace nanojit asm_regarg(sz, arg, argRegs[arg_index]); arg_index++; } - #ifdef _MSC_VER + #ifdef _WIN64 else if (sz == ARGSIZE_F && arg_index < NumArgRegs) { // double goes in XMM reg # based on overall arg_index asm_regarg(sz, arg, Register(XMM0+arg_index)); @@ -1153,8 +1153,8 @@ namespace nanojit uint32_t kind = ins->paramKind(); if (kind == 0) { // ordinary param - // first six args always in registers for mac x64 - if (a < 6) { + // first four or six args always in registers for x86_64 ABI + if (a < NumArgRegs) { // incoming arg in register prepResultReg(ins, rmask(argRegs[a])); } else { @@ -1281,7 +1281,7 @@ namespace nanojit void Assembler::nRegisterResetAll(RegAlloc &a) { // add scratch registers to our free list for the allocator a.clear(); -#ifdef _MSC_VER +#ifdef _WIN64 a.free = 0x001fffcf; // rax-rbx, rsi, rdi, r8-r15, xmm0-xmm5 #else a.free = 0xffffffff & ~(1<