diff options
Diffstat (limited to 'src/compiler_llvm')
| -rw-r--r-- | src/compiler_llvm/gbc_expander.cc | 15 | ||||
| -rw-r--r-- | src/compiler_llvm/generated/art_module.cc | 3 | ||||
| -rw-r--r-- | src/compiler_llvm/method_compiler.cc | 2 | ||||
| -rw-r--r-- | src/compiler_llvm/runtime_support_builder.cc | 10 | ||||
| -rw-r--r-- | src/compiler_llvm/runtime_support_builder.h | 2 |
5 files changed, 20 insertions, 12 deletions
diff --git a/src/compiler_llvm/gbc_expander.cc b/src/compiler_llvm/gbc_expander.cc index 8750c0bed2..484dd77e3a 100644 --- a/src/compiler_llvm/gbc_expander.cc +++ b/src/compiler_llvm/gbc_expander.cc @@ -60,7 +60,7 @@ class GBCExpanderPass : public llvm::FunctionPass { private: llvm::AllocaInst* shadow_frame_; llvm::Value* old_shadow_frame_; - uint32_t shadow_frame_size_; + uint16_t num_shadow_frame_refs_; private: art::Compiler* compiler_; @@ -326,7 +326,7 @@ class GBCExpanderPass : public llvm::FunctionPass { GBCExpanderPass(const IntrinsicHelper& intrinsic_helper, IRBuilder& irb) : llvm::FunctionPass(ID), intrinsic_helper_(intrinsic_helper), irb_(irb), context_(irb.getContext()), rtb_(irb.Runtime()), - shadow_frame_(NULL), old_shadow_frame_(NULL), shadow_frame_size_(0), + shadow_frame_(NULL), old_shadow_frame_(NULL), num_shadow_frame_refs_(0), compiler_(NULL), dex_file_(NULL), code_item_(NULL), oat_compilation_unit_(NULL), method_idx_(-1u), func_(NULL), changed_(false) @@ -336,7 +336,7 @@ class GBCExpanderPass : public llvm::FunctionPass { art::Compiler* compiler, art::OatCompilationUnit* oat_compilation_unit) : llvm::FunctionPass(ID), intrinsic_helper_(intrinsic_helper), irb_(irb), context_(irb.getContext()), rtb_(irb.Runtime()), - shadow_frame_(NULL), old_shadow_frame_(NULL), shadow_frame_size_(0), + shadow_frame_(NULL), old_shadow_frame_(NULL), num_shadow_frame_refs_(0), compiler_(compiler), dex_file_(oat_compilation_unit->GetDexFile()), code_item_(oat_compilation_unit->GetCodeItem()), @@ -366,7 +366,7 @@ bool GBCExpanderPass::runOnFunction(llvm::Function& func) { // Setup rewrite context shadow_frame_ = NULL; old_shadow_frame_ = NULL; - shadow_frame_size_ = 0; + num_shadow_frame_refs_ = 0; func_ = &func; changed_ = false; // Assume unchanged @@ -1095,11 +1095,11 @@ llvm::Value* GBCExpanderPass::Expand_DivRem(llvm::CallInst& call_inst, void GBCExpanderPass::Expand_AllocaShadowFrame(llvm::Value* num_entry_value) { // Most of the codes refer to MethodCompiler::EmitPrologueAllocShadowFrame and // MethodCompiler::EmitPushShadowFrame - shadow_frame_size_ = + num_shadow_frame_refs_ = llvm::cast<llvm::ConstantInt>(num_entry_value)->getZExtValue(); llvm::StructType* shadow_frame_type = - irb_.getShadowFrameTy(shadow_frame_size_); + irb_.getShadowFrameTy(num_shadow_frame_refs_); shadow_frame_ = irb_.CreateAlloca(shadow_frame_type); @@ -1126,7 +1126,8 @@ void GBCExpanderPass::Expand_AllocaShadowFrame(llvm::Value* num_entry_value) { llvm::Value* result = rtb_.EmitPushShadowFrame(shadow_frame_upcast, method_object_addr, - shadow_frame_size_); + num_shadow_frame_refs_, + 0); irb_.CreateStore(result, old_shadow_frame_, kTBAARegister); diff --git a/src/compiler_llvm/generated/art_module.cc b/src/compiler_llvm/generated/art_module.cc index 872701d054..e118646a82 100644 --- a/src/compiler_llvm/generated/art_module.cc +++ b/src/compiler_llvm/generated/art_module.cc @@ -93,7 +93,8 @@ std::vector<Type*>FuncTy_7_args; FuncTy_7_args.push_back(PointerTy_1); FuncTy_7_args.push_back(PointerTy_2); FuncTy_7_args.push_back(PointerTy_1); -FuncTy_7_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_7_args.push_back(IntegerType::get(mod->getContext(), 16)); +FuncTy_7_args.push_back(IntegerType::get(mod->getContext(), 16)); FunctionType* FuncTy_7 = FunctionType::get( /*Result=*/PointerTy_2, /*Params=*/FuncTy_7_args, diff --git a/src/compiler_llvm/method_compiler.cc b/src/compiler_llvm/method_compiler.cc index 1737b70282..f91694efc8 100644 --- a/src/compiler_llvm/method_compiler.cc +++ b/src/compiler_llvm/method_compiler.cc @@ -3823,7 +3823,7 @@ void MethodCompiler::EmitPushShadowFrame(bool is_inline) { } else { DCHECK(num_shadow_frame_refs_ == 0); result = irb_.Runtime().EmitPushShadowFrameNoInline(shadow_frame_upcast, method_object_addr, - num_shadow_frame_refs_); + num_shadow_frame_refs_, 0); } irb_.CreateStore(result, old_shadow_frame_, kTBAARegister); } diff --git a/src/compiler_llvm/runtime_support_builder.cc b/src/compiler_llvm/runtime_support_builder.cc index 2effdddfa1..dbcbe89034 100644 --- a/src/compiler_llvm/runtime_support_builder.cc +++ b/src/compiler_llvm/runtime_support_builder.cc @@ -124,10 +124,16 @@ llvm::Value* RuntimeSupportBuilder::EmitPushShadowFrame(llvm::Value* new_shadow_ llvm::Value* RuntimeSupportBuilder::EmitPushShadowFrameNoInline(llvm::Value* new_shadow_frame, - llvm::Value* method, uint32_t size) { + llvm::Value* method, uint16_t num_refs, + uint16_t num_vregs) { Function* func = GetRuntimeSupportFunction(runtime_support::PushShadowFrame); llvm::CallInst* call_inst = - irb_.CreateCall4(func, EmitGetCurrentThread(), new_shadow_frame, method, irb_.getInt32(size)); + irb_.CreateCall5(func, + EmitGetCurrentThread(), + new_shadow_frame, + method, + irb_.getInt16(num_refs), + irb_.getInt16(num_vregs)); irb_.SetTBAA(call_inst, kTBAARuntimeInfo); return call_inst; } diff --git a/src/compiler_llvm/runtime_support_builder.h b/src/compiler_llvm/runtime_support_builder.h index b8123a55ca..ba512af66a 100644 --- a/src/compiler_llvm/runtime_support_builder.h +++ b/src/compiler_llvm/runtime_support_builder.h @@ -53,7 +53,7 @@ class RuntimeSupportBuilder { virtual llvm::Value* EmitPushShadowFrame(llvm::Value* new_shadow_frame, 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); + llvm::Value* method, uint16_t num_refs, uint16_t num_vregs); virtual void EmitPopShadowFrame(llvm::Value* old_shadow_frame); /* Exception */ |