summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMJITInfo.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-11-08 01:31:27 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-11-08 01:31:27 +0000
commitffdd91e3b81020c601f7d99f7f61701f4d7de4b6 (patch)
tree958a1ceaeda72588f4e6cd5fad35c3b02732c2b0 /llvm/lib/Target/ARM/ARMJITInfo.cpp
parentb12642253390f6257f7177e7bf474b6608a6585c (diff)
downloadbcm5719-llvm-ffdd91e3b81020c601f7d99f7f61701f4d7de4b6.tar.gz
bcm5719-llvm-ffdd91e3b81020c601f7d99f7f61701f4d7de4b6.zip
Handle ARM machine constantpool entry with non-lazy ptr.
llvm-svn: 58882
Diffstat (limited to 'llvm/lib/Target/ARM/ARMJITInfo.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMJITInfo.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/llvm/lib/Target/ARM/ARMJITInfo.cpp b/llvm/lib/Target/ARM/ARMJITInfo.cpp
index c0b878251ba..4118d6de211 100644
--- a/llvm/lib/Target/ARM/ARMJITInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMJITInfo.cpp
@@ -133,14 +133,21 @@ ARMJITInfo::getLazyResolverFunction(JITCompilerFn F) {
return ARMCompilationCallback;
}
+void *ARMJITInfo::emitGlobalValueNonLazyPtr(const GlobalValue *GV, void *Ptr,
+ MachineCodeEmitter &MCE) {
+ MCE.startFunctionStub(GV, 4, 4); // FIXME: Rename this.
+ MCE.emitWordLE((intptr_t)Ptr);
+ return MCE.finishFunctionStub(GV);
+}
+
void *ARMJITInfo::emitFunctionStub(const Function* F, void *Fn,
MachineCodeEmitter &MCE) {
unsigned addr = (intptr_t)Fn;
// If this is just a call to an external function, emit a branch instead of a
// call. The code is the same except for one bit of the last instruction.
if (Fn != (void*)(intptr_t)ARMCompilationCallback) {
- // branch to the corresponding function addr
- // the stub is 8-byte size and 4-aligned
+ // Branch to the corresponding function addr.
+ // The stub is 8-byte size and 4-aligned.
MCE.startFunctionStub(F, 8, 4);
MCE.emitWordLE(0xe51ff004); // LDR PC, [PC,#-4]
MCE.emitWordLE(addr); // addr of function
@@ -150,8 +157,8 @@ void *ARMJITInfo::emitFunctionStub(const Function* F, void *Fn,
// This stub sets the return address to restart the stub, so that
// the new branch will be invoked when we come back.
//
- // branch and link to the compilation callback.
- // the stub is 16-byte size and 4-byte aligned.
+ // Branch and link to the compilation callback.
+ // The stub is 16-byte size and 4-byte aligned.
MCE.startFunctionStub(F, 16, 4);
// Save LR so the callback can determine which stub called it.
// The compilation callback is responsible for popping this prior
OpenPOWER on IntegriCloud