diff options
Diffstat (limited to 'src/compiler_llvm')
| -rw-r--r-- | src/compiler_llvm/art_module.ll | 2 | ||||
| -rw-r--r-- | src/compiler_llvm/jni_compiler.cc | 2 | ||||
| -rw-r--r-- | src/compiler_llvm/method_compiler.cc | 14 | ||||
| -rw-r--r-- | src/compiler_llvm/method_compiler.h | 2 | ||||
| -rw-r--r-- | src/compiler_llvm/runtime_support_builder.cc | 13 | ||||
| -rw-r--r-- | src/compiler_llvm/runtime_support_builder.h | 2 | ||||
| -rw-r--r-- | src/compiler_llvm/runtime_support_llvm.cc | 6 | ||||
| -rw-r--r-- | src/compiler_llvm/runtime_support_llvm.h | 3 |
8 files changed, 27 insertions, 17 deletions
diff --git a/src/compiler_llvm/art_module.ll b/src/compiler_llvm/art_module.ll index af2fcc4e19..3c3c90bfe0 100644 --- a/src/compiler_llvm/art_module.ll +++ b/src/compiler_llvm/art_module.ll @@ -44,7 +44,7 @@ declare void @art_unlock_object_from_code(%JavaObject*, %JavaObject*) declare void @art_test_suspend_from_code(%JavaObject*) declare %ShadowFrame* @art_push_shadow_frame_from_code(%JavaObject*, %ShadowFrame*, - %JavaObject*, i32) + %JavaObject*, i16, i16) declare void @art_pop_shadow_frame_from_code(%ShadowFrame*) diff --git a/src/compiler_llvm/jni_compiler.cc b/src/compiler_llvm/jni_compiler.cc index 5bc3bfcbe7..7001ec3051 100644 --- a/src/compiler_llvm/jni_compiler.cc +++ b/src/compiler_llvm/jni_compiler.cc @@ -113,7 +113,7 @@ CompiledMethod* JniCompiler::Compile() { // Push the shadow frame llvm::Value* shadow_frame_upcast = irb_.CreateConstGEP2_32(shadow_frame_, 0, 0); llvm::Value* old_shadow_frame = - irb_.Runtime().EmitPushShadowFrame(shadow_frame_upcast, method_object_addr, sirt_size); + irb_.Runtime().EmitPushShadowFrame(shadow_frame_upcast, method_object_addr, sirt_size, 0); // Get JNIEnv llvm::Value* jni_env_object_addr = diff --git a/src/compiler_llvm/method_compiler.cc b/src/compiler_llvm/method_compiler.cc index ca9cbdf410..1737b70282 100644 --- a/src/compiler_llvm/method_compiler.cc +++ b/src/compiler_llvm/method_compiler.cc @@ -69,7 +69,7 @@ MethodCompiler::MethodCompiler(CompilationUnit* cunit, basic_block_landing_pads_(code_item_->tries_size_, NULL), basic_block_unwind_(NULL), shadow_frame_(NULL), old_shadow_frame_(NULL), - already_pushed_shadow_frame_(NULL), shadow_frame_size_(0) { + already_pushed_shadow_frame_(NULL), num_shadow_frame_refs_(0) { } @@ -268,7 +268,7 @@ void MethodCompiler::EmitPrologueAllocShadowFrame() { irb_.SetInsertPoint(basic_block_alloca_); // Allocate the shadow frame now! - shadow_frame_size_ = 0; + num_shadow_frame_refs_ = 0; uint16_t arg_reg_start = code_item_->registers_size_ - code_item_->ins_size_; if (method_info_.need_shadow_frame_entry) { for (uint32_t i = 0, num_of_regs = code_item_->registers_size_; i < num_of_regs; ++i) { @@ -279,12 +279,12 @@ void MethodCompiler::EmitPrologueAllocShadowFrame() { } if (IsRegCanBeObject(i)) { - reg_to_shadow_frame_index_[i] = shadow_frame_size_++; + reg_to_shadow_frame_index_[i] = num_shadow_frame_refs_++; } } } - llvm::StructType* shadow_frame_type = irb_.getShadowFrameTy(shadow_frame_size_); + llvm::StructType* shadow_frame_type = irb_.getShadowFrameTy(num_shadow_frame_refs_); shadow_frame_ = irb_.CreateAlloca(shadow_frame_type); // Alloca a pointer to old shadow frame @@ -3819,11 +3819,11 @@ void MethodCompiler::EmitPushShadowFrame(bool is_inline) { llvm::Value* result; if (is_inline) { result = irb_.Runtime().EmitPushShadowFrame(shadow_frame_upcast, method_object_addr, - shadow_frame_size_); + num_shadow_frame_refs_, 0); } else { - DCHECK(shadow_frame_size_ == 0); + DCHECK(num_shadow_frame_refs_ == 0); result = irb_.Runtime().EmitPushShadowFrameNoInline(shadow_frame_upcast, method_object_addr, - shadow_frame_size_); + num_shadow_frame_refs_); } irb_.CreateStore(result, old_shadow_frame_, kTBAARegister); } diff --git a/src/compiler_llvm/method_compiler.h b/src/compiler_llvm/method_compiler.h index 15b8558da1..0b6fcfd79d 100644 --- a/src/compiler_llvm/method_compiler.h +++ b/src/compiler_llvm/method_compiler.h @@ -475,7 +475,7 @@ class MethodCompiler { llvm::Value* old_shadow_frame_; llvm::Value* already_pushed_shadow_frame_; - uint32_t shadow_frame_size_; + uint16_t num_shadow_frame_refs_; uint16_t elf_func_idx_; }; diff --git a/src/compiler_llvm/runtime_support_builder.cc b/src/compiler_llvm/runtime_support_builder.cc index b51a82298a..2effdddfa1 100644 --- a/src/compiler_llvm/runtime_support_builder.cc +++ b/src/compiler_llvm/runtime_support_builder.cc @@ -86,7 +86,8 @@ llvm::Value* RuntimeSupportBuilder::EmitSetCurrentThread(llvm::Value* thread) { /* ShadowFrame */ llvm::Value* RuntimeSupportBuilder::EmitPushShadowFrame(llvm::Value* new_shadow_frame, - llvm::Value* method, uint32_t size) { + llvm::Value* method, uint16_t num_refs, + uint16_t num_vregs) { Value* old_shadow_frame = EmitLoadFromThreadOffset(Thread::TopShadowFrameOffset().Int32Value(), irb_.getArtFrameTy()->getPointerTo(), kTBAARuntimeInfo); @@ -100,10 +101,16 @@ llvm::Value* RuntimeSupportBuilder::EmitPushShadowFrame(llvm::Value* new_shadow_ method, kTBAAShadowFrame); - // Store the number of the pointer slots + // Store the number of the reference slots irb_.StoreToObjectOffset(new_shadow_frame, ShadowFrame::NumberOfReferencesOffset(), - irb_.getInt32(size), + irb_.getInt16(num_refs), + kTBAAShadowFrame); + + // Store the number of vregs + irb_.StoreToObjectOffset(new_shadow_frame, + ShadowFrame::NumberOfVRegsOffset(), + irb_.getInt16(num_vregs), kTBAAShadowFrame); // Store the link to previous shadow frame diff --git a/src/compiler_llvm/runtime_support_builder.h b/src/compiler_llvm/runtime_support_builder.h index ab076bb5b0..b8123a55ca 100644 --- a/src/compiler_llvm/runtime_support_builder.h +++ b/src/compiler_llvm/runtime_support_builder.h @@ -51,7 +51,7 @@ class RuntimeSupportBuilder { /* ShadowFrame */ virtual llvm::Value* EmitPushShadowFrame(llvm::Value* new_shadow_frame, - llvm::Value* method, uint32_t size); + llvm::Value* method, uint16_t num_refs, uint16_t num_vregs); virtual llvm::Value* EmitPushShadowFrameNoInline(llvm::Value* new_shadow_frame, llvm::Value* method, uint32_t size); virtual void EmitPopShadowFrame(llvm::Value* old_shadow_frame); diff --git a/src/compiler_llvm/runtime_support_llvm.cc b/src/compiler_llvm/runtime_support_llvm.cc index d7e146ac39..668712f6e7 100644 --- a/src/compiler_llvm/runtime_support_llvm.cc +++ b/src/compiler_llvm/runtime_support_llvm.cc @@ -90,10 +90,12 @@ void art_test_suspend_from_code(Thread* thread) } ShadowFrame* art_push_shadow_frame_from_code(Thread* thread, ShadowFrame* new_shadow_frame, - AbstractMethod* method, uint32_t size) { + AbstractMethod* method, uint16_t num_refs, + uint16_t num_vregs) { ShadowFrame* old_frame = thread->PushShadowFrame(new_shadow_frame); new_shadow_frame->SetMethod(method); - new_shadow_frame->SetNumberOfReferences(size); + new_shadow_frame->SetNumberOfReferences(num_refs); + new_shadow_frame->SetNumberOfVRegs(num_vregs); return old_frame; } diff --git a/src/compiler_llvm/runtime_support_llvm.h b/src/compiler_llvm/runtime_support_llvm.h index 626fe4f85b..c52b7f992f 100644 --- a/src/compiler_llvm/runtime_support_llvm.h +++ b/src/compiler_llvm/runtime_support_llvm.h @@ -26,7 +26,8 @@ namespace art { //---------------------------------------------------------------------------- ShadowFrame* art_push_shadow_frame_from_code(Thread* thread, ShadowFrame* new_shadow_frame, - AbstractMethod* method, uint32_t size); + AbstractMethod* method, uint16_t num_refs, + uint16_t num_vregs); void art_pop_shadow_frame_from_code(void*); |