diff options
author | Lang Hames <lhames@gmail.com> | 2016-02-06 00:55:08 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2016-02-06 00:55:08 +0000 |
commit | 120a9b418bd136ff2bdc033dfa4c1f07d2f2d996 (patch) | |
tree | bc5fd5ce9cb080d933e104b1411c6732087fb631 /llvm/lib/ExecutionEngine/Orc/OrcArchitectureSupport.cpp | |
parent | ca14ce0f1d9921f5f079675fae346a8982266e70 (diff) | |
download | bcm5719-llvm-120a9b418bd136ff2bdc033dfa4c1f07d2f2d996.tar.gz bcm5719-llvm-120a9b418bd136ff2bdc033dfa4c1f07d2f2d996.zip |
[Orc] Slightly improve the x86-64 resolver block machine code.
Replace leaq + movq of a pointer with a single movabsq.
llvm-svn: 259968
Diffstat (limited to 'llvm/lib/ExecutionEngine/Orc/OrcArchitectureSupport.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/Orc/OrcArchitectureSupport.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/llvm/lib/ExecutionEngine/Orc/OrcArchitectureSupport.cpp b/llvm/lib/ExecutionEngine/Orc/OrcArchitectureSupport.cpp index 054fdadc800..606b5616f59 100644 --- a/llvm/lib/ExecutionEngine/Orc/OrcArchitectureSupport.cpp +++ b/llvm/lib/ExecutionEngine/Orc/OrcArchitectureSupport.cpp @@ -38,11 +38,14 @@ void OrcX86_64::writeResolverCode(uint8_t *ResolverMem, JITReentryFn ReentryFn, 0x41, 0x57, // 0x18: pushq %r15 0x48, 0x81, 0xec, 0x08, 0x02, 0x00, 0x00, // 0x1a: subq 0x208, %rsp 0x48, 0x0f, 0xae, 0x04, 0x24, // 0x21: fxsave64 (%rsp) - 0x48, 0x8d, 0x3d, 0x43, 0x00, 0x00, 0x00, // 0x26: leaq 67(%rip), %rdi - 0x48, 0x8b, 0x3f, // 0x2d: movq (%rdi), %rdi + 0x48, 0xbf, // 0x26: movabsq <CBMgr>, %rdi + + // 0x28: Callback manager addr. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x48, 0x8b, 0x75, 0x08, // 0x30: movq 8(%rbp), %rsi 0x48, 0x83, 0xee, 0x06, // 0x34: subq $6, %rsi - 0x48, 0xb8, // 0x38: movabsq $0, %rax + 0x48, 0xb8, // 0x38: movabsq <REntry>, %rax // 0x3a: JIT re-entry fn addr: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -67,14 +70,10 @@ void OrcX86_64::writeResolverCode(uint8_t *ResolverMem, JITReentryFn ReentryFn, 0x58, // 0x69: popq %rax 0x5d, // 0x6a: popq %rbp 0xc3, // 0x6b: retq - 0x00, 0x00, 0x00, 0x00, // 0x6c: <padding> - - // 0x70: Callback mgr address. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; const unsigned ReentryFnAddrOffset = 0x3a; - const unsigned CallbackMgrAddrOffset = 0x70; + const unsigned CallbackMgrAddrOffset = 0x28; memcpy(ResolverMem, ResolverCode, sizeof(ResolverCode)); memcpy(ResolverMem + ReentryFnAddrOffset, &ReentryFn, sizeof(ReentryFn)); |