[JAEGER] Clean up x86_64 port. VMFrame::inlineCallCount is now uint32.

This commit is contained in:
Sean Stangl 2010-07-24 23:22:30 -07:00
parent 26459a9067
commit 6bef627293
7 changed files with 40 additions and 41 deletions

View File

@ -249,13 +249,6 @@ public:
m_assembler.subq_rr(scratchRegister, dest); m_assembler.subq_rr(scratchRegister, dest);
} }
void subPtr(ImmPtr imm, Address address)
{
loadPtr(address, scratchRegister);
subPtr(imm, scratchRegister);
storePtr(scratchRegister, address);
}
void xorPtr(RegisterID src, RegisterID dest) void xorPtr(RegisterID src, RegisterID dest)
{ {
m_assembler.xorq_rr(src, dest); m_assembler.xorq_rr(src, dest);

View File

@ -1574,14 +1574,7 @@ mjit::Compiler::emitReturn()
masm.loadPtr(FrameAddress(offsetof(VMFrame, cx)), Registers::ArgReg1); masm.loadPtr(FrameAddress(offsetof(VMFrame, cx)), Registers::ArgReg1);
masm.storePtr(Registers::ReturnReg, FrameAddress(offsetof(VMFrame, fp))); masm.storePtr(Registers::ReturnReg, FrameAddress(offsetof(VMFrame, fp)));
masm.storePtr(Registers::ReturnReg, Address(Registers::ArgReg1, offsetof(JSContext, fp))); masm.storePtr(Registers::ReturnReg, Address(Registers::ArgReg1, offsetof(JSContext, fp)));
#if defined(JS_CPU_X86) or defined(JS_CPU_ARM) masm.sub32(Imm32(1), FrameAddress(offsetof(VMFrame, inlineCallCount)));
masm.subPtr(ImmIntPtr(1), FrameAddress(offsetof(VMFrame, inlineCallCount)));
#elif defined (JS_CPU_X64)
/* Register is clobbered later, so it's safe to use. */
masm.loadPtr(FrameAddress(offsetof(VMFrame, inlineCallCount)), JSReturnReg_Data);
masm.subPtr(ImmIntPtr(1), JSReturnReg_Data);
masm.storePtr(JSReturnReg_Data, FrameAddress(offsetof(VMFrame, inlineCallCount)));
#endif
JS_STATIC_ASSERT(Registers::ReturnReg != JSReturnReg_Data); JS_STATIC_ASSERT(Registers::ReturnReg != JSReturnReg_Data);
JS_STATIC_ASSERT(Registers::ReturnReg != JSReturnReg_Type); JS_STATIC_ASSERT(Registers::ReturnReg != JSReturnReg_Type);
@ -2794,7 +2787,7 @@ mjit::Compiler::iterNext()
Jump notFast = masm.branchPtr(Assembler::NotEqual, T1, ImmPtr(&js_IteratorClass.base)); Jump notFast = masm.branchPtr(Assembler::NotEqual, T1, ImmPtr(&js_IteratorClass.base));
stubcc.linkExit(notFast, Uses(1)); stubcc.linkExit(notFast, Uses(1));
/* Get private from iter obj. :FIXME: X64 */ /* Get private from iter obj. */
masm.loadFunctionPrivate(reg, T1); masm.loadFunctionPrivate(reg, T1);
RegisterID T3 = frame.allocReg(); RegisterID T3 = frame.allocReg();
@ -2850,7 +2843,7 @@ mjit::Compiler::iterMore()
Jump notFast = masm.branchPtr(Assembler::NotEqual, T1, ImmPtr(&js_IteratorClass.base)); Jump notFast = masm.branchPtr(Assembler::NotEqual, T1, ImmPtr(&js_IteratorClass.base));
stubcc.linkExit(notFast, Uses(1)); stubcc.linkExit(notFast, Uses(1));
/* Get private from iter obj. :FIXME: X64 */ /* Get private from iter obj. */
masm.loadFunctionPrivate(reg, T1); masm.loadFunctionPrivate(reg, T1);
/* Get props_cursor, test */ /* Get props_cursor, test */

View File

@ -80,7 +80,7 @@ struct VMFrame
JSFrameRegs regs; JSFrameRegs regs;
JSStackFrame *fp; JSStackFrame *fp;
JSContext *cx; JSContext *cx;
uintptr_t inlineCallCount; uint32 inlineCallCount;
#if defined(JS_CPU_X86) #if defined(JS_CPU_X86)
void *savedEBX; void *savedEBX;
@ -89,21 +89,21 @@ struct VMFrame
void *savedEBP; void *savedEBP;
void *savedEIP; void *savedEIP;
#ifdef JS_NO_FASTCALL # ifdef JS_NO_FASTCALL
inline void** returnAddressLocation() { inline void** returnAddressLocation() {
return reinterpret_cast<void**>(this) - 3; return reinterpret_cast<void**>(this) - 3;
} }
#else # else
inline void** returnAddressLocation() { inline void** returnAddressLocation() {
return reinterpret_cast<void**>(this) - 1; return reinterpret_cast<void**>(this) - 1;
} }
#endif # endif
#elif defined(JS_CPU_X64) #elif defined(JS_CPU_X64)
void *savedRBX; void *savedRBX;
#ifdef _MSC_VER # ifdef _MSC_VER
void *savedRSI; void *savedRSI;
void *savedRDI; void *savedRDI;
#endif # endif
void *savedR15; void *savedR15;
void *savedR14; void *savedR14;
void *savedR13; void *savedR13;
@ -111,15 +111,15 @@ struct VMFrame
void *savedRBP; void *savedRBP;
void *savedRIP; void *savedRIP;
#ifdef _MSC_VER # ifdef _MSC_VER
inline void** returnAddressLocation() { inline void** returnAddressLocation() {
return reinterpret_cast<void**>(this) - 5; return reinterpret_cast<void**>(this) - 5;
} }
#else # else
inline void** returnAddressLocation() { inline void** returnAddressLocation() {
return reinterpret_cast<void**>(this) - 1; return reinterpret_cast<void**>(this) - 1;
} }
#endif # endif
#elif defined(JS_CPU_ARM) #elif defined(JS_CPU_ARM)
void *savedR4; void *savedR4;

View File

@ -1,4 +1,7 @@
/* ***** BEGIN LICENSE BLOCK ***** /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set ts=4 sw=4 et tw=99:
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
* *
* The contents of this file are subject to the Mozilla Public License Version * The contents of this file are subject to the Mozilla Public License Version
@ -36,6 +39,7 @@
* ***** END LICENSE BLOCK ***** */ * ***** END LICENSE BLOCK ***** */
#ifdef JS_METHODJIT #ifdef JS_METHODJIT
#include "Retcon.h" #include "Retcon.h"
#include "MethodJIT.h" #include "MethodJIT.h"
#include "Compiler.h" #include "Compiler.h"
@ -201,4 +205,5 @@ CallStackIterator::bottom() const {
} /* namespace mjit */ } /* namespace mjit */
} /* namespace js */ } /* namespace js */
#endif #endif /* JS_METHODJIT */

View File

@ -1,4 +1,7 @@
/* ***** BEGIN LICENSE BLOCK ***** /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set ts=4 sw=4 et tw=99:
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
* *
* The contents of this file are subject to the Mozilla Public License Version * The contents of this file are subject to the Mozilla Public License Version
@ -40,8 +43,8 @@
* or reinterpretation of established facts. * or reinterpretation of established facts.
*/ */
#if !defined retcon_h___ && defined JS_METHODJIT #if !defined jsjaeger_retcon_h__ && defined JS_METHODJIT
#define retcon_h___ #define jsjaeger_retcon_h__
#include "jscntxt.h" #include "jscntxt.h"
#include "jsscript.h" #include "jsscript.h"
@ -137,3 +140,4 @@ private:
} /* namespace js */ } /* namespace js */
#endif #endif

View File

@ -1,4 +1,7 @@
/* ***** BEGIN LICENSE BLOCK ***** /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set ts=4 sw=4 et tw=99:
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
* *
* The contents of this file are subject to the Mozilla Public License Version * The contents of this file are subject to the Mozilla Public License Version
@ -34,6 +37,7 @@
* the terms of any one of the MPL, the GPL or the LGPL. * the terms of any one of the MPL, the GPL or the LGPL.
* *
* ***** END LICENSE BLOCK ***** */ * ***** END LICENSE BLOCK ***** */
#include "TrampolineCompiler.h" #include "TrampolineCompiler.h"
#include "StubCalls.h" #include "StubCalls.h"
#include "assembler/assembler/LinkBuffer.h" #include "assembler/assembler/LinkBuffer.h"
@ -132,14 +136,7 @@ TrampolineCompiler::generateForceReturn(Assembler &masm)
masm.loadPtr(FrameAddress(offsetof(VMFrame, cx)), Registers::ArgReg1); masm.loadPtr(FrameAddress(offsetof(VMFrame, cx)), Registers::ArgReg1);
masm.storePtr(Registers::ReturnReg, FrameAddress(offsetof(VMFrame, fp))); masm.storePtr(Registers::ReturnReg, FrameAddress(offsetof(VMFrame, fp)));
masm.storePtr(Registers::ReturnReg, Address(Registers::ArgReg1, offsetof(JSContext, fp))); masm.storePtr(Registers::ReturnReg, Address(Registers::ArgReg1, offsetof(JSContext, fp)));
#if defined(JS_CPU_X86) or defined(JS_CPU_ARM) masm.sub32(Imm32(1), FrameAddress(offsetof(VMFrame, inlineCallCount)));
masm.subPtr(ImmIntPtr(1), FrameAddress(offsetof(VMFrame, inlineCallCount)));
#elif defined (JS_CPU_X64)
/* Register is clobbered later, so it's safe to use. */
masm.loadPtr(FrameAddress(offsetof(VMFrame, inlineCallCount)), JSReturnReg_Data);
masm.subPtr(ImmIntPtr(1), JSReturnReg_Data);
masm.storePtr(JSReturnReg_Data, FrameAddress(offsetof(VMFrame, inlineCallCount)));
#endif
Address rval(JSFrameReg, offsetof(JSStackFrame, rval)); Address rval(JSFrameReg, offsetof(JSStackFrame, rval));
masm.loadPayload(rval, JSReturnReg_Data); masm.loadPayload(rval, JSReturnReg_Data);
@ -161,3 +158,4 @@ TrampolineCompiler::generateForceReturn(Assembler &masm)
} /* namespace mjit */ } /* namespace mjit */
} /* namespace js */ } /* namespace js */

View File

@ -1,4 +1,7 @@
/* ***** BEGIN LICENSE BLOCK ***** /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set ts=4 sw=4 et tw=99:
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
* *
* The contents of this file are subject to the Mozilla Public License Version * The contents of this file are subject to the Mozilla Public License Version
@ -34,6 +37,7 @@
* the terms of any one of the MPL, the GPL or the LGPL. * the terms of any one of the MPL, the GPL or the LGPL.
* *
* ***** END LICENSE BLOCK ***** */ * ***** END LICENSE BLOCK ***** */
#if !defined trampolines_h__ && defined JS_METHODJIT #if !defined trampolines_h__ && defined JS_METHODJIT
#define trampolines_h__ #define trampolines_h__
@ -48,6 +52,7 @@ class TrampolineCompiler
typedef Assembler::Label Label; typedef Assembler::Label Label;
typedef Assembler::Jump Jump; typedef Assembler::Jump Jump;
typedef Assembler::ImmPtr ImmPtr; typedef Assembler::ImmPtr ImmPtr;
typedef Assembler::Imm32 Imm32;
typedef Assembler::Address Address; typedef Assembler::Address Address;
typedef bool (*TrampolineGenerator)(Assembler &masm); typedef bool (*TrampolineGenerator)(Assembler &masm);
@ -74,3 +79,4 @@ private:
} /* namespace js */ } /* namespace js */
#endif #endif