summaryrefslogtreecommitdiff
path: root/src/compiler_llvm/jni_compiler.cc
diff options
context:
space:
mode:
author TDYa127 <tdy@google.com> 2012-04-17 20:55:08 -0700
committer Shih-wei Liao <sliao@google.com> 2012-04-18 22:00:20 -0700
commit0200d0739c8ca560a2166b185fda39a63fb37851 (patch)
treed51a93cbbdd3c429fb8ffdc56b33891fa30d9b10 /src/compiler_llvm/jni_compiler.cc
parent264675757a1d1ba43f53634d1301b7d6b79fe02c (diff)
Compilation_unit experiment. Fix because of no long_call.
Change-Id: Id8ab9c50317ade34f80be6e72784db00c0b23f6b
Diffstat (limited to 'src/compiler_llvm/jni_compiler.cc')
-rw-r--r--src/compiler_llvm/jni_compiler.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/compiler_llvm/jni_compiler.cc b/src/compiler_llvm/jni_compiler.cc
index 7855be09d9..198cd1a3f6 100644
--- a/src/compiler_llvm/jni_compiler.cc
+++ b/src/compiler_llvm/jni_compiler.cc
@@ -296,6 +296,12 @@ CompiledMethod* JniCompiler::Compile() {
// Verify the generated bitcode
llvm::verifyFunction(*func_, llvm::PrintMessageAction);
+ // Add the memory usage approximation of the compilation unit
+ cunit_->AddMemUsageApproximation((sirt_size * 4 + 50) * 50);
+ // NOTE: We will emit 4 LLVM instructions per object argument,
+ // And about 50 instructions for other operations. (Some runtime support will be inlined.)
+ // Beside, we guess that we have to use 50 bytes to represent one LLVM instruction.
+
CompiledMethod* compiled_method =
new CompiledMethod(cunit_->GetInstructionSet(),
cunit_->GetElfIndex(),