mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-05 09:24:28 +00:00
Rename isGVLazyPtr to isGVNonLazyPtr relocation. This represents Mac OS X
indirect gv reference. Please don't call it lazy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58746 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -39,7 +39,7 @@ class MachineRelocation {
|
|||||||
enum AddressType {
|
enum AddressType {
|
||||||
isResult, // Relocation has be transformed into its result pointer.
|
isResult, // Relocation has be transformed into its result pointer.
|
||||||
isGV, // The Target.GV field is valid.
|
isGV, // The Target.GV field is valid.
|
||||||
isGVLazyPtr, // Relocation of a lazily resolved GV address.
|
isGVNonLazyPtr, // Relocation of a Mac OS X NonLazy indirect reference.
|
||||||
isBB, // Relocation of BB address.
|
isBB, // Relocation of BB address.
|
||||||
isExtSym, // The Target.ExtSym field is valid.
|
isExtSym, // The Target.ExtSym field is valid.
|
||||||
isConstPool, // Relocation of constant pool address.
|
isConstPool, // Relocation of constant pool address.
|
||||||
@ -56,7 +56,7 @@ class MachineRelocation {
|
|||||||
|
|
||||||
union {
|
union {
|
||||||
void *Result; // If this has been resolved to a resolved pointer
|
void *Result; // If this has been resolved to a resolved pointer
|
||||||
GlobalValue *GV; // If this is a pointer to a GV or a GV lazy ptr
|
GlobalValue *GV; // If this is a pointer to a GV or a GV nonlazy ptr
|
||||||
MachineBasicBlock *MBB; // If this is a pointer to a LLVM BB
|
MachineBasicBlock *MBB; // If this is a pointer to a LLVM BB
|
||||||
const char *ExtSym; // If this is a pointer to a named symbol
|
const char *ExtSym; // If this is a pointer to a named symbol
|
||||||
unsigned Index; // Constant pool / jump table index
|
unsigned Index; // Constant pool / jump table index
|
||||||
@ -96,9 +96,9 @@ public:
|
|||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// MachineRelocation::getGVLazyPtr - Return a relocation entry for a
|
/// MachineRelocation::getGVNonLazyPtr - Return a relocation entry for a
|
||||||
/// lazily resolved GlobalValue address.
|
/// Mac OS X non-lazy GlobalValue indirect reference.
|
||||||
static MachineRelocation getGVLazyPtr(intptr_t offset,
|
static MachineRelocation getGVNonLazyPtr(intptr_t offset,
|
||||||
unsigned RelocationType,
|
unsigned RelocationType,
|
||||||
GlobalValue *GV, intptr_t cst = 0,
|
GlobalValue *GV, intptr_t cst = 0,
|
||||||
bool NeedStub = 0,
|
bool NeedStub = 0,
|
||||||
@ -108,7 +108,7 @@ public:
|
|||||||
Result.Offset = offset;
|
Result.Offset = offset;
|
||||||
Result.ConstantVal = cst;
|
Result.ConstantVal = cst;
|
||||||
Result.TargetReloType = RelocationType;
|
Result.TargetReloType = RelocationType;
|
||||||
Result.AddrType = isGVLazyPtr;
|
Result.AddrType = isGVNonLazyPtr;
|
||||||
Result.NeedStub = NeedStub;
|
Result.NeedStub = NeedStub;
|
||||||
Result.GOTRelative = GOTrelative;
|
Result.GOTRelative = GOTrelative;
|
||||||
Result.TargetResolve = false;
|
Result.TargetResolve = false;
|
||||||
@ -221,10 +221,10 @@ public:
|
|||||||
return AddrType == isGV;
|
return AddrType == isGV;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// isGlobalValueVLazyPtr - Return true if this relocation is the address
|
/// isGlobalValueNonLazyPtr - Return true if this relocation is the address
|
||||||
/// of a lazily resolved GlobalValue.
|
/// of a Mac OS X non-lazy indirect reference.
|
||||||
bool isGlobalValueLazyPtr() const {
|
bool isGlobalValueNonLazyPtr() const {
|
||||||
return AddrType == isGVLazyPtr;
|
return AddrType == isGVNonLazyPtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// isBasicBlock - Return true if this relocation is a basic block reference.
|
/// isBasicBlock - Return true if this relocation is a basic block reference.
|
||||||
@ -274,7 +274,7 @@ public:
|
|||||||
/// getGlobalValue - If this is a global value reference, return the
|
/// getGlobalValue - If this is a global value reference, return the
|
||||||
/// referenced global.
|
/// referenced global.
|
||||||
GlobalValue *getGlobalValue() const {
|
GlobalValue *getGlobalValue() const {
|
||||||
assert((isGlobalValue() || isGlobalValueLazyPtr()) &&
|
assert((isGlobalValue() || isGlobalValueNonLazyPtr()) &&
|
||||||
"This is not a global value reference!");
|
"This is not a global value reference!");
|
||||||
return Target.GV;
|
return Target.GV;
|
||||||
}
|
}
|
||||||
|
@ -40,11 +40,12 @@ namespace llvm {
|
|||||||
///
|
///
|
||||||
virtual void replaceMachineCodeForFunction(void *Old, void *New) = 0;
|
virtual void replaceMachineCodeForFunction(void *Old, void *New) = 0;
|
||||||
|
|
||||||
/// emitGlobalValueLazyPtr - Use the specified MachineCodeEmitter object to
|
/// emitGlobalValueNonLazyPtr - Use the specified MachineCodeEmitter object
|
||||||
/// emit a lazy pointer which contains the address of the specified ptr.
|
/// to emit a Mac OS X non-lazy pointer which contains the address of the
|
||||||
virtual void *emitGlobalValueLazyPtr(const GlobalValue* GV, void *ptr,
|
/// specified ptr.
|
||||||
MachineCodeEmitter &MCE) {
|
virtual void *emitGlobalValueNonLazyPtr(const GlobalValue* GV, void *ptr,
|
||||||
assert(0 && "This target doesn't implement emitGlobalValueLazyPtr!");
|
MachineCodeEmitter &MCE) {
|
||||||
|
assert(0 && "This target doesn't implement emitGlobalValueNonLazyPtr!");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,9 +59,9 @@ namespace {
|
|||||||
/// corresponds to.
|
/// corresponds to.
|
||||||
std::map<void*, Function*> StubToFunctionMap;
|
std::map<void*, Function*> StubToFunctionMap;
|
||||||
|
|
||||||
/// GlobalToLazyPtrMap - Keep track of the lazy pointer created for a
|
/// GlobalToNonLazyPtrMap - Keep track of the lazy pointer created for a
|
||||||
/// particular GlobalVariable so that we can reuse them if necessary.
|
/// particular GlobalVariable so that we can reuse them if necessary.
|
||||||
std::map<GlobalValue*, void*> GlobalToLazyPtrMap;
|
std::map<GlobalValue*, void*> GlobalToNonLazyPtrMap;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
std::map<Function*, void*>& getFunctionToStubMap(const MutexGuard& locked) {
|
std::map<Function*, void*>& getFunctionToStubMap(const MutexGuard& locked) {
|
||||||
@ -75,9 +75,9 @@ namespace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::map<GlobalValue*, void*>&
|
std::map<GlobalValue*, void*>&
|
||||||
getGlobalToLazyPtrMap(const MutexGuard& locked) {
|
getGlobalToNonLazyPtrMap(const MutexGuard& locked) {
|
||||||
assert(locked.holds(TheJIT->lock));
|
assert(locked.holds(TheJIT->lock));
|
||||||
return GlobalToLazyPtrMap;
|
return GlobalToNonLazyPtrMap;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -120,9 +120,9 @@ namespace {
|
|||||||
/// specified address, created lazily on demand.
|
/// specified address, created lazily on demand.
|
||||||
void *getExternalFunctionStub(void *FnAddr);
|
void *getExternalFunctionStub(void *FnAddr);
|
||||||
|
|
||||||
/// getGlobalValueLazyPtr - Return a lazy pointer containing the specified
|
/// getGlobalValueNonLazyPtr - Return a non-lazy pointer containing the
|
||||||
/// GV address.
|
/// specified GV address.
|
||||||
void *getGlobalValueLazyPtr(GlobalValue *V, void *GVAddress);
|
void *getGlobalValueNonLazyPtr(GlobalValue *V, void *GVAddress);
|
||||||
|
|
||||||
/// AddCallbackAtLocation - If the target is capable of rewriting an
|
/// AddCallbackAtLocation - If the target is capable of rewriting an
|
||||||
/// instruction without the use of a stub, record the location of the use so
|
/// instruction without the use of a stub, record the location of the use so
|
||||||
@ -184,23 +184,23 @@ void *JITResolver::getFunctionStub(Function *F) {
|
|||||||
return Stub;
|
return Stub;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getGlobalValueLazyPtr - Return a lazy pointer containing the specified
|
/// getGlobalValueNonLazyPtr - Return a lazy pointer containing the specified
|
||||||
/// GV address.
|
/// GV address.
|
||||||
void *JITResolver::getGlobalValueLazyPtr(GlobalValue *GV, void *GVAddress) {
|
void *JITResolver::getGlobalValueNonLazyPtr(GlobalValue *GV, void *GVAddress) {
|
||||||
MutexGuard locked(TheJIT->lock);
|
MutexGuard locked(TheJIT->lock);
|
||||||
|
|
||||||
// If we already have a stub for this global variable, recycle it.
|
// If we already have a stub for this global variable, recycle it.
|
||||||
void *&LazyPtr = state.getGlobalToLazyPtrMap(locked)[GV];
|
void *&NonLazyPtr = state.getGlobalToNonLazyPtrMap(locked)[GV];
|
||||||
if (LazyPtr) return LazyPtr;
|
if (NonLazyPtr) return NonLazyPtr;
|
||||||
|
|
||||||
// Otherwise, codegen a new lazy pointer.
|
// Otherwise, codegen a new lazy pointer.
|
||||||
LazyPtr = TheJIT->getJITInfo().emitGlobalValueLazyPtr(GV, GVAddress,
|
NonLazyPtr = TheJIT->getJITInfo().emitGlobalValueNonLazyPtr(GV, GVAddress,
|
||||||
*TheJIT->getCodeEmitter());
|
*TheJIT->getCodeEmitter());
|
||||||
|
|
||||||
DOUT << "JIT: Stub emitted at [" << LazyPtr << "] for GV '"
|
DOUT << "JIT: Stub emitted at [" << NonLazyPtr << "] for GV '"
|
||||||
<< GV->getName() << "'\n";
|
<< GV->getName() << "'\n";
|
||||||
|
|
||||||
return LazyPtr;
|
return NonLazyPtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getExternalFunctionStub - Return a stub for the function at the
|
/// getExternalFunctionStub - Return a stub for the function at the
|
||||||
@ -570,8 +570,8 @@ namespace {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void *getPointerToGlobal(GlobalValue *GV, void *Reference, bool NoNeedStub);
|
void *getPointerToGlobal(GlobalValue *GV, void *Reference, bool NoNeedStub);
|
||||||
void *getPointerToGVLazyPtr(GlobalValue *V, void *Reference,
|
void *getPointerToGVNonLazyPtr(GlobalValue *V, void *Reference,
|
||||||
bool NoNeedStub);
|
bool NoNeedStub);
|
||||||
unsigned addSizeOfGlobal(const GlobalVariable *GV, unsigned Size);
|
unsigned addSizeOfGlobal(const GlobalVariable *GV, unsigned Size);
|
||||||
unsigned addSizeOfGlobalsInConstantVal(const Constant *C, unsigned Size);
|
unsigned addSizeOfGlobalsInConstantVal(const Constant *C, unsigned Size);
|
||||||
unsigned addSizeOfGlobalsInInitializer(const Constant *Init, unsigned Size);
|
unsigned addSizeOfGlobalsInInitializer(const Constant *Init, unsigned Size);
|
||||||
@ -613,13 +613,13 @@ void *JITEmitter::getPointerToGlobal(GlobalValue *V, void *Reference,
|
|||||||
return Resolver.getFunctionStub(F);
|
return Resolver.getFunctionStub(F);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *JITEmitter::getPointerToGVLazyPtr(GlobalValue *V, void *Reference,
|
void *JITEmitter::getPointerToGVNonLazyPtr(GlobalValue *V, void *Reference,
|
||||||
bool DoesntNeedStub) {
|
bool DoesntNeedStub) {
|
||||||
// Make sure GV is emitted first.
|
// Make sure GV is emitted first.
|
||||||
// FIXME: For now, if the GV is an external function we force the JIT to
|
// FIXME: For now, if the GV is an external function we force the JIT to
|
||||||
// compile it so the lazy pointer will contain the fully resolved address.
|
// compile it so the non-lazy pointer will contain the fully resolved address.
|
||||||
void *GVAddress = getPointerToGlobal(V, Reference, true);
|
void *GVAddress = getPointerToGlobal(V, Reference, true);
|
||||||
return Resolver.getGlobalValueLazyPtr(V, GVAddress);
|
return Resolver.getGlobalValueNonLazyPtr(V, GVAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned GetConstantPoolSizeInBytes(MachineConstantPool *MCP) {
|
static unsigned GetConstantPoolSizeInBytes(MachineConstantPool *MCP) {
|
||||||
@ -887,8 +887,8 @@ bool JITEmitter::finishFunction(MachineFunction &F) {
|
|||||||
ResultPtr = getPointerToGlobal(MR.getGlobalValue(),
|
ResultPtr = getPointerToGlobal(MR.getGlobalValue(),
|
||||||
BufferBegin+MR.getMachineCodeOffset(),
|
BufferBegin+MR.getMachineCodeOffset(),
|
||||||
MR.doesntNeedStub());
|
MR.doesntNeedStub());
|
||||||
} else if (MR.isGlobalValueLazyPtr()) {
|
} else if (MR.isGlobalValueNonLazyPtr()) {
|
||||||
ResultPtr = getPointerToGVLazyPtr(MR.getGlobalValue(),
|
ResultPtr = getPointerToGVNonLazyPtr(MR.getGlobalValue(),
|
||||||
BufferBegin+MR.getMachineCodeOffset(),
|
BufferBegin+MR.getMachineCodeOffset(),
|
||||||
MR.doesntNeedStub());
|
MR.doesntNeedStub());
|
||||||
} else if (MR.isBasicBlock()) {
|
} else if (MR.isBasicBlock()) {
|
||||||
|
@ -73,7 +73,7 @@ namespace {
|
|||||||
void emitPCRelativeBlockAddress(MachineBasicBlock *MBB);
|
void emitPCRelativeBlockAddress(MachineBasicBlock *MBB);
|
||||||
void emitGlobalAddress(GlobalValue *GV, unsigned Reloc,
|
void emitGlobalAddress(GlobalValue *GV, unsigned Reloc,
|
||||||
intptr_t Disp = 0, intptr_t PCAdj = 0,
|
intptr_t Disp = 0, intptr_t PCAdj = 0,
|
||||||
bool NeedStub = false, bool IsLazy = false);
|
bool NeedStub = false, bool IsNonLazy = false);
|
||||||
void emitExternalSymbolAddress(const char *ES, unsigned Reloc);
|
void emitExternalSymbolAddress(const char *ES, unsigned Reloc);
|
||||||
void emitConstPoolAddress(unsigned CPI, unsigned Reloc, intptr_t Disp = 0,
|
void emitConstPoolAddress(unsigned CPI, unsigned Reloc, intptr_t Disp = 0,
|
||||||
intptr_t PCAdj = 0);
|
intptr_t PCAdj = 0);
|
||||||
@ -94,7 +94,7 @@ namespace {
|
|||||||
|
|
||||||
unsigned getX86RegNum(unsigned RegNo) const;
|
unsigned getX86RegNum(unsigned RegNo) const;
|
||||||
|
|
||||||
bool gvNeedsLazyPtr(const GlobalValue *GV);
|
bool gvNeedsNonLazyPtr(const GlobalValue *GV);
|
||||||
};
|
};
|
||||||
char Emitter::ID = 0;
|
char Emitter::ID = 0;
|
||||||
}
|
}
|
||||||
@ -155,15 +155,15 @@ void Emitter::emitGlobalAddress(GlobalValue *GV, unsigned Reloc,
|
|||||||
intptr_t Disp /* = 0 */,
|
intptr_t Disp /* = 0 */,
|
||||||
intptr_t PCAdj /* = 0 */,
|
intptr_t PCAdj /* = 0 */,
|
||||||
bool NeedStub /* = false */,
|
bool NeedStub /* = false */,
|
||||||
bool isLazy /* = false */) {
|
bool isNonLazy /* = false */) {
|
||||||
intptr_t RelocCST = 0;
|
intptr_t RelocCST = 0;
|
||||||
if (Reloc == X86::reloc_picrel_word)
|
if (Reloc == X86::reloc_picrel_word)
|
||||||
RelocCST = PICBaseOffset;
|
RelocCST = PICBaseOffset;
|
||||||
else if (Reloc == X86::reloc_pcrel_word)
|
else if (Reloc == X86::reloc_pcrel_word)
|
||||||
RelocCST = PCAdj;
|
RelocCST = PCAdj;
|
||||||
MachineRelocation MR = isLazy
|
MachineRelocation MR = isNonLazy
|
||||||
? MachineRelocation::getGVLazyPtr(MCE.getCurrentPCOffset(), Reloc,
|
? MachineRelocation::getGVNonLazyPtr(MCE.getCurrentPCOffset(), Reloc,
|
||||||
GV, RelocCST, NeedStub)
|
GV, RelocCST, NeedStub)
|
||||||
: MachineRelocation::getGV(MCE.getCurrentPCOffset(), Reloc,
|
: MachineRelocation::getGV(MCE.getCurrentPCOffset(), Reloc,
|
||||||
GV, RelocCST, NeedStub);
|
GV, RelocCST, NeedStub);
|
||||||
MCE.addRelocation(MR);
|
MCE.addRelocation(MR);
|
||||||
@ -263,8 +263,8 @@ static bool isDisp8(int Value) {
|
|||||||
return Value == (signed char)Value;
|
return Value == (signed char)Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Emitter::gvNeedsLazyPtr(const GlobalValue *GV) {
|
bool Emitter::gvNeedsNonLazyPtr(const GlobalValue *GV) {
|
||||||
// For Darwin, simulate the linktime GOT by using the same lazy-pointer
|
// For Darwin, simulate the linktime GOT by using the same non-lazy-pointer
|
||||||
// mechanism as 32-bit mode.
|
// mechanism as 32-bit mode.
|
||||||
return (!Is64BitMode || TM.getSubtarget<X86Subtarget>().isTargetDarwin()) &&
|
return (!Is64BitMode || TM.getSubtarget<X86Subtarget>().isTargetDarwin()) &&
|
||||||
TM.getSubtarget<X86Subtarget>().GVRequiresExtraLoad(GV, TM, false);
|
TM.getSubtarget<X86Subtarget>().GVRequiresExtraLoad(GV, TM, false);
|
||||||
@ -289,9 +289,9 @@ void Emitter::emitDisplacementField(const MachineOperand *RelocOp,
|
|||||||
unsigned rt = Is64BitMode ? X86::reloc_pcrel_word
|
unsigned rt = Is64BitMode ? X86::reloc_pcrel_word
|
||||||
: (IsPIC ? X86::reloc_picrel_word : X86::reloc_absolute_word);
|
: (IsPIC ? X86::reloc_picrel_word : X86::reloc_absolute_word);
|
||||||
bool NeedStub = isa<Function>(RelocOp->getGlobal());
|
bool NeedStub = isa<Function>(RelocOp->getGlobal());
|
||||||
bool isLazy = gvNeedsLazyPtr(RelocOp->getGlobal());
|
bool isNonLazy = gvNeedsNonLazyPtr(RelocOp->getGlobal());
|
||||||
emitGlobalAddress(RelocOp->getGlobal(), rt, RelocOp->getOffset(),
|
emitGlobalAddress(RelocOp->getGlobal(), rt, RelocOp->getOffset(),
|
||||||
PCAdj, NeedStub, isLazy);
|
PCAdj, NeedStub, isNonLazy);
|
||||||
} else if (RelocOp->isCPI()) {
|
} else if (RelocOp->isCPI()) {
|
||||||
unsigned rt = Is64BitMode ? X86::reloc_pcrel_word : X86::reloc_picrel_word;
|
unsigned rt = Is64BitMode ? X86::reloc_pcrel_word : X86::reloc_picrel_word;
|
||||||
emitConstPoolAddress(RelocOp->getIndex(), rt,
|
emitConstPoolAddress(RelocOp->getIndex(), rt,
|
||||||
@ -610,9 +610,9 @@ void Emitter::emitInstruction(const MachineInstr &MI,
|
|||||||
rt = X86::reloc_absolute_dword; // FIXME: add X86II flag?
|
rt = X86::reloc_absolute_dword; // FIXME: add X86II flag?
|
||||||
if (MO1.isGlobal()) {
|
if (MO1.isGlobal()) {
|
||||||
bool NeedStub = isa<Function>(MO1.getGlobal());
|
bool NeedStub = isa<Function>(MO1.getGlobal());
|
||||||
bool isLazy = gvNeedsLazyPtr(MO1.getGlobal());
|
bool isNonLazy = gvNeedsNonLazyPtr(MO1.getGlobal());
|
||||||
emitGlobalAddress(MO1.getGlobal(), rt, MO1.getOffset(), 0,
|
emitGlobalAddress(MO1.getGlobal(), rt, MO1.getOffset(), 0,
|
||||||
NeedStub, isLazy);
|
NeedStub, isNonLazy);
|
||||||
} else if (MO1.isSymbol())
|
} else if (MO1.isSymbol())
|
||||||
emitExternalSymbolAddress(MO1.getSymbolName(), rt);
|
emitExternalSymbolAddress(MO1.getSymbolName(), rt);
|
||||||
else if (MO1.isCPI())
|
else if (MO1.isCPI())
|
||||||
@ -688,9 +688,9 @@ void Emitter::emitInstruction(const MachineInstr &MI,
|
|||||||
rt = X86::reloc_absolute_word; // FIXME: add X86II flag?
|
rt = X86::reloc_absolute_word; // FIXME: add X86II flag?
|
||||||
if (MO1.isGlobal()) {
|
if (MO1.isGlobal()) {
|
||||||
bool NeedStub = isa<Function>(MO1.getGlobal());
|
bool NeedStub = isa<Function>(MO1.getGlobal());
|
||||||
bool isLazy = gvNeedsLazyPtr(MO1.getGlobal());
|
bool isNonLazy = gvNeedsNonLazyPtr(MO1.getGlobal());
|
||||||
emitGlobalAddress(MO1.getGlobal(), rt, MO1.getOffset(), 0,
|
emitGlobalAddress(MO1.getGlobal(), rt, MO1.getOffset(), 0,
|
||||||
NeedStub, isLazy);
|
NeedStub, isNonLazy);
|
||||||
} else if (MO1.isSymbol())
|
} else if (MO1.isSymbol())
|
||||||
emitExternalSymbolAddress(MO1.getSymbolName(), rt);
|
emitExternalSymbolAddress(MO1.getSymbolName(), rt);
|
||||||
else if (MO1.isCPI())
|
else if (MO1.isCPI())
|
||||||
@ -726,9 +726,9 @@ void Emitter::emitInstruction(const MachineInstr &MI,
|
|||||||
rt = X86::reloc_absolute_word; // FIXME: add X86II flag?
|
rt = X86::reloc_absolute_word; // FIXME: add X86II flag?
|
||||||
if (MO.isGlobal()) {
|
if (MO.isGlobal()) {
|
||||||
bool NeedStub = isa<Function>(MO.getGlobal());
|
bool NeedStub = isa<Function>(MO.getGlobal());
|
||||||
bool isLazy = gvNeedsLazyPtr(MO.getGlobal());
|
bool isNonLazy = gvNeedsNonLazyPtr(MO.getGlobal());
|
||||||
emitGlobalAddress(MO.getGlobal(), rt, MO.getOffset(), 0,
|
emitGlobalAddress(MO.getGlobal(), rt, MO.getOffset(), 0,
|
||||||
NeedStub, isLazy);
|
NeedStub, isNonLazy);
|
||||||
} else if (MO.isSymbol())
|
} else if (MO.isSymbol())
|
||||||
emitExternalSymbolAddress(MO.getSymbolName(), rt);
|
emitExternalSymbolAddress(MO.getSymbolName(), rt);
|
||||||
else if (MO.isCPI())
|
else if (MO.isCPI())
|
||||||
|
@ -413,8 +413,8 @@ X86JITInfo::getLazyResolverFunction(JITCompilerFn F) {
|
|||||||
return X86CompilationCallback;
|
return X86CompilationCallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *X86JITInfo::emitGlobalValueLazyPtr(const GlobalValue* GV, void *ptr,
|
void *X86JITInfo::emitGlobalValueNonLazyPtr(const GlobalValue* GV, void *ptr,
|
||||||
MachineCodeEmitter &MCE) {
|
MachineCodeEmitter &MCE) {
|
||||||
#if defined (X86_64_JIT)
|
#if defined (X86_64_JIT)
|
||||||
MCE.startFunctionStub(GV, 8, 8);
|
MCE.startFunctionStub(GV, 8, 8);
|
||||||
MCE.emitWordLE((unsigned)(intptr_t)ptr);
|
MCE.emitWordLE((unsigned)(intptr_t)ptr);
|
||||||
|
@ -37,10 +37,11 @@ namespace llvm {
|
|||||||
///
|
///
|
||||||
virtual void replaceMachineCodeForFunction(void *Old, void *New);
|
virtual void replaceMachineCodeForFunction(void *Old, void *New);
|
||||||
|
|
||||||
/// emitGlobalValueLazyPtr - Use the specified MachineCodeEmitter object to
|
/// emitGlobalValueNonLazyPtr - Use the specified MachineCodeEmitter object
|
||||||
/// emit a lazy pointer which contains the address of the specified ptr.
|
/// to emit a Mac OS X non-lazy pointer which contains the address of the
|
||||||
virtual void *emitGlobalValueLazyPtr(const GlobalValue* GV, void *ptr,
|
/// specified ptr.
|
||||||
MachineCodeEmitter &MCE);
|
virtual void *emitGlobalValueNonLazyPtr(const GlobalValue* GV, void *ptr,
|
||||||
|
MachineCodeEmitter &MCE);
|
||||||
|
|
||||||
/// emitFunctionStub - Use the specified MachineCodeEmitter object to emit a
|
/// emitFunctionStub - Use the specified MachineCodeEmitter object to emit a
|
||||||
/// small native function that simply calls the function at the specified
|
/// small native function that simply calls the function at the specified
|
||||||
|
Reference in New Issue
Block a user