aboutsummaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/JIT/JITEmitter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-06-16 18:09:26 +0000
committerChris Lattner <sabre@nondot.org>2006-06-16 18:09:26 +0000
commita827953c32e420740c281b4a38a056d15b180932 (patch)
treed1f4fb3722c06d8301d08e4276963cd3888d26ff /lib/ExecutionEngine/JIT/JITEmitter.cpp
parent276f4b523564d205e59c8049a12c75705dd24b78 (diff)
Only count instructions as code size, not constant pools and other per-function stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28827 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/JIT/JITEmitter.cpp')
-rw-r--r--lib/ExecutionEngine/JIT/JITEmitter.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/ExecutionEngine/JIT/JITEmitter.cpp b/lib/ExecutionEngine/JIT/JITEmitter.cpp
index c8056613f0..4300b17737 100644
--- a/lib/ExecutionEngine/JIT/JITEmitter.cpp
+++ b/lib/ExecutionEngine/JIT/JITEmitter.cpp
@@ -760,8 +760,14 @@ bool JITEmitter::finishFunction(MachineFunction &F) {
emitJumpTableInfo(F.getJumpTableInfo());
- MemMgr.endFunctionBody(F.getFunction(), BufferBegin, CurBufferPtr);
- NumBytes += getCurrentPCOffset();
+ // FnStart is the start of the text, not the start of the constant pool and
+ // other per-function data.
+ unsigned char *FnStart =
+ (unsigned char *)TheJIT->getPointerToGlobalIfAvailable(F.getFunction());
+ unsigned char *FnEnd = CurBufferPtr;
+
+ MemMgr.endFunctionBody(F.getFunction(), BufferBegin, FnEnd);
+ NumBytes += FnEnd-FnStart;
if (!Relocations.empty()) {
NumRelos += Relocations.size();
@@ -815,11 +821,9 @@ bool JITEmitter::finishFunction(MachineFunction &F) {
}
}
- DEBUG(void *FnStart = TheJIT->getPointerToGlobalIfAvailable(F.getFunction());
- char *FnEnd = (char*)getCurrentPCOffset();
- std::cerr << "JIT: Finished CodeGen of [" << FnStart
+ DEBUG(std::cerr << "JIT: Finished CodeGen of [" << (void*)FnStart
<< "] Function: " << F.getFunction()->getName()
- << ": " << (FnEnd-(char*)FnStart) << " bytes of text, "
+ << ": " << (FnEnd-FnStart) << " bytes of text, "
<< Relocations.size() << " relocations\n");
Relocations.clear();
return false;