diff --git a/hphp/runtime/vm/jit/translator-x64-internal.h b/hphp/runtime/vm/jit/translator-x64-internal.h index 7650d15ef..dc6bd21d3 100644 --- a/hphp/runtime/vm/jit/translator-x64-internal.h +++ b/hphp/runtime/vm/jit/translator-x64-internal.h @@ -217,7 +217,7 @@ typedef CondBlock localNames()[l.offset]; - assert(ret->isStatic()); - return ret; -} - static_assert(sizeof(DataType) == 4 || sizeof(DataType) == 1, "Your DataType has an unsupported size."); static inline Reg8 toByte(const Reg32& x) { return rbyte(x); } @@ -335,35 +300,18 @@ emitStoreTVType(X64Assembler& a, OpndType tvOp, DestType dest) { } } -// emitDispDeref -- // emitDeref -- // emitStoreTypedValue -- // emitStoreUninitNull -- -// emitStoreNull -- // // Helpers for common cell operations. // // Dereference the var in the cell whose address lives in src into // dest. -static inline void -emitDispDeref(X64Assembler &a, Reg64 src, int disp, Reg64 dest) { - // src is a RefData, dest will be m_data field of inner gizmoom. - a. loadq (src[disp + TVOFF(m_data)], dest); -} - static inline void emitDeref(X64Assembler &a, PhysReg src, PhysReg dest) { - emitDispDeref(a, src, 0, dest); -} - -static inline void -emitDerefRef(X64Assembler &a, Reg64 src, int disp, Reg64 dest) { - emitDispDeref(a, src, disp + RefData::tvOffset(), dest); -} - -static inline void -emitDerefRef(X64Assembler &a, Reg64 src, Reg64 dest) { - emitDerefRef(a, src, 0, dest); + // src is a RefData, dest will be m_data field of inner gizmoom. + a. loadq (src[TVOFF(m_data)], dest); } static inline void @@ -393,18 +341,6 @@ emitStoreTypedValue(X64Assembler& a, DataType type, PhysReg val, } } -static inline void -emitStoreToRefData(X64Assembler& a, DataType type, PhysReg val, - int disp, PhysReg dest) { - emitStoreTypedValue(a, type, val, disp + RefData::tvOffset(), dest); -} - -static inline void -emitStoreInvalid(X64Assembler& a, int disp, PhysReg dest) { - a. storeq (0xfacefacefaceface, dest[disp + TVOFF(m_data)]); - emitStoreTVType(a, KindOfInvalid, dest[disp + TVOFF(m_type)]); -} - static inline void emitStoreUninitNull(X64Assembler& a, int disp, @@ -413,22 +349,6 @@ emitStoreUninitNull(X64Assembler& a, emitStoreTVType(a, KindOfUninit, dest[disp + TVOFF(m_type)]); } -static inline void -emitStoreNull(X64Assembler& a, - int disp, - PhysReg dest) { - emitStoreTVType(a, KindOfNull, dest[disp + TVOFF(m_type)]); - // It's ok to leave garbage in m_data, m_aux for KindOfNull. -} - -static inline void -emitStoreNull(X64Assembler& a, const Location& where) { - PhysReg base; - int disp; - locToRegDisp(where, &base, &disp); - emitStoreNull(a, disp, base); -} - static inline void emitCopyTo(X64Assembler& a, Reg64 src, @@ -446,60 +366,11 @@ emitCopyTo(X64Assembler& a, emitStoreTVType(a, s32, dest[destOff + TVOFF(m_type)]); } -/* - * Version of emitCopyTo where both the source and dest are known to - * be 16-byte aligned. In this case we can use xmm. - */ -inline void emitCopyToAligned(X64Assembler& a, - Reg64 src, - int srcOff, - Reg64 dest, - int destOff) { - using namespace reg; - - static_assert(sizeof(TypedValue) == 16, - "emitCopyToAligned assumes sizeof(TypedValue) is 128 bits"); - a. movdqa (src[srcOff], xmm0); - a. movdqa (xmm0, dest[destOff]); -} - -// supportedPlan -- -// nativePlan -- -// simplePlan -- -// Some helpers for analyze* methods. -static inline TXFlags -plan(bool cond, TXFlags successFlags, TXFlags fallbackFlags=Interp) { - return cond ? successFlags : fallbackFlags; -} - -static inline TXFlags simplePlan(bool cond) { return plan(cond, Simple); } -static inline TXFlags simpleOrSupportedPlan(bool cond) { - return plan(cond, Simple, Supported); -} -static inline TXFlags supportedPlan(bool cond) { return plan(cond, Supported); } -static inline TXFlags nativePlan(bool cond) { return plan(cond, Native); } - -static inline TXFlags planHingesOnRefcounting(DataType type) { - return !IS_REFCOUNTED_TYPE(type) ? Native : - !typeReentersOnRelease(type) ? Simple : - Supported; -} - static inline const char* getContextName() { Class* ctx = arGetContextClass(curFrame()); return ctx ? ctx->name()->data() : ":anonymous:"; } -template -struct Deleter : private boost::noncopyable { - explicit Deleter(T** p) : p(p) {} - ~Deleter() { - delete *p; - *p = nullptr; - } - T** p; -}; - }} #endif diff --git a/hphp/runtime/vm/jit/translator-x64.cpp b/hphp/runtime/vm/jit/translator-x64.cpp index 4efd1c9ac..ca8716b1d 100644 --- a/hphp/runtime/vm/jit/translator-x64.cpp +++ b/hphp/runtime/vm/jit/translator-x64.cpp @@ -248,24 +248,6 @@ void TranslatorX64::SEGVHandler(int signum, siginfo_t *info, void *ctx) { } } -/* - * Copy a heap cell from memory to the stack. - * - * Use emitCopyToStack when you can safely change the state of the - * register map. When using emitCopyToStackRegSafe, you'll need to - * invalidate the stack location manually at an appropriate time. - */ - -void -TranslatorX64::emitCopyToStackRegSafe(X64Assembler& a, - const NormalizedInstruction& ni, - PhysReg src, - int off, - PhysReg tmpReg) { - assert(off % sizeof(Cell) == 0); - emitCopyTo(a, src, 0, rVmSp, vstackOffset(ni, off), tmpReg); -} - // Logical register move: ensures the value in src will be in dest // after execution, but might do so in strange ways. Do not count on // being able to smash dest to a different register in the future, e.g. diff --git a/hphp/runtime/vm/jit/translator-x64.h b/hphp/runtime/vm/jit/translator-x64.h index 231f1fadd..baaddd77a 100644 --- a/hphp/runtime/vm/jit/translator-x64.h +++ b/hphp/runtime/vm/jit/translator-x64.h @@ -218,11 +218,6 @@ private: void emitIncRefGenericRegSafe(PhysReg base, int disp, PhysReg tmp); static CppCall getDtorCall(DataType type); void emitCopy(PhysReg srcCell, int disp, PhysReg destCell); - void emitCopyToStackRegSafe(Asm& a, - const NormalizedInstruction& ni, - PhysReg src, - int off, - PhysReg tmpReg); void emitThisCheck(const NormalizedInstruction& i, PhysReg reg);