Implement LLVM version of jni_compiler to pass 17 jni_compiler tests.
Because we now have both shadow_frame and sirt (which is just for SirtRef<>
in the LLVM version), we define a new function NumStackReferences() as follows:
NumStackReferences() = NumSirtReferences() + NumShadowFrameReferences().
(cherry picked from commit 18fe89a14d212da9ec6841f4d19d08482a9610b7)
Change-Id: Idd95ee4276801b1555be87934cd9c4f33ab8a88a
diff --git a/src/compiler_llvm/jni_compiler.h b/src/compiler_llvm/jni_compiler.h
index a6cdd9c..98129d1 100644
--- a/src/compiler_llvm/jni_compiler.h
+++ b/src/compiler_llvm/jni_compiler.h
@@ -33,10 +33,14 @@
}
namespace llvm {
+ class AllocaInst;
class Function;
class FunctionType;
+ class BasicBlock;
class LLVMContext;
class Module;
+ class Type;
+ class Value;
}
namespace art {
@@ -57,9 +61,14 @@
void CreateFunction();
llvm::FunctionType* GetFunctionType(uint32_t method_idx,
- bool is_static);
+ bool is_static, bool is_target_function);
private:
+ llvm::Value* LoadFromObjectOffset(llvm::Value* object_addr, int32_t offset, llvm::Type* type);
+
+ void StoreToObjectOffset(llvm::Value* object_addr, int32_t offset,
+ llvm::Type* type, llvm::Value* value);
+
CompilationUnit* cunit_;
Compiler const* compiler_;
@@ -77,6 +86,9 @@
DexFile const* dex_file_;
Method* method_;
+ llvm::BasicBlock* basic_block_;
+ llvm::AllocaInst* shadow_frame_;
+
llvm::Function* func_;
};