Bug 512409 - nanojit support for Windows x64. r=dvander

This commit is contained in:
Makoto Kato 2009-09-28 18:16:41 +09:00
Родитель 1eca248002
Коммит 0754d4e955
1 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -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<<RSP | 1<<RBP);
@ -1316,7 +1316,7 @@ namespace nanojit
}
Register Assembler::nRegisterAllocFromSet(RegisterMask set) {
#if defined _WIN64
#if defined _MSC_VER
DWORD tr;
_BitScanForward(&tr, set);
_allocator.free &= ~rmask((Register)tr);