Fix IGET/IPUT slow path code generation.
Two bugs are fixed in this commit:
1. IGET instructions is calling Set*Instance runtime
function, which should be changed to Get*Instance.
2. We should pass the object address to the runtime
function for IGET and IPUT.
Change-Id: I10c317e5c2d093966d8a0f2fd422f9bb5d2b34ba
diff --git a/src/compiler_llvm/method_compiler.cc b/src/compiler_llvm/method_compiler.cc
index 3af60f4..4694777 100644
--- a/src/compiler_llvm/method_compiler.cc
+++ b/src/compiler_llvm/method_compiler.cc
@@ -2305,11 +2305,11 @@
llvm::Function* runtime_func;
if (field_jty == kObject) {
- runtime_func = irb_.GetRuntime(SetObjectInstance);
+ runtime_func = irb_.GetRuntime(GetObjectInstance);
} else if (field_jty == kLong || field_jty == kDouble) {
- runtime_func = irb_.GetRuntime(Set64Instance);
+ runtime_func = irb_.GetRuntime(Get64Instance);
} else {
- runtime_func = irb_.GetRuntime(Set32Instance);
+ runtime_func = irb_.GetRuntime(Get32Instance);
}
llvm::ConstantInt* field_idx_value = irb_.getInt32(field_idx);
@@ -2318,8 +2318,8 @@
EmitUpdateLineNumFromDexPC(dex_pc);
- field_value = irb_.CreateCall2(runtime_func, field_idx_value,
- method_object_addr);
+ field_value = irb_.CreateCall3(runtime_func, field_idx_value,
+ method_object_addr, object_addr);
EmitGuard_ExceptionLandingPad(dex_pc);
@@ -2378,8 +2378,8 @@
EmitUpdateLineNumFromDexPC(dex_pc);
- irb_.CreateCall3(runtime_func, field_idx_value,
- method_object_addr, new_value);
+ irb_.CreateCall4(runtime_func, field_idx_value,
+ method_object_addr, object_addr, new_value);
EmitGuard_ExceptionLandingPad(dex_pc);