diff options
| author | 2012-04-10 18:59:11 +0800 | |
|---|---|---|
| committer | 2012-04-10 15:53:28 -0700 | |
| commit | 7e7fabccba62ec3d7c04b33e9b8fdb7981bdc833 (patch) | |
| tree | 46e71fc90706676e51c76194c292b50c98bbeca4 /src/compiler_llvm/method_compiler.h | |
| parent | 754caaab12e1288b3be98417ca17c3931bb69ea8 (diff) | |
Fix 065 and 066 tests (slow path). Refactor invoke-* instructions.
Refactor invoke-static, invoke-direct, invoke-virtual,
invoke-super, and invoke-interface and implement the
slow path for invoke-static and invoke-direct.
Change-Id: I21ce11ad2ce62a0660f26f16373572493d9bf2d3
Diffstat (limited to 'src/compiler_llvm/method_compiler.h')
| -rw-r--r-- | src/compiler_llvm/method_compiler.h | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/src/compiler_llvm/method_compiler.h b/src/compiler_llvm/method_compiler.h index e20a80ae18..74c55f0a11 100644 --- a/src/compiler_llvm/method_compiler.h +++ b/src/compiler_llvm/method_compiler.h @@ -129,6 +129,11 @@ class MethodCompiler { kFPArithm_Rem, }; + enum InvokeArgFmt { + kArgReg, + kArgRange, + }; + #define GEN_INSN_ARGS uint32_t dex_pc, Instruction const* insn // NOP, PAYLOAD (unreachable) instructions @@ -203,17 +208,20 @@ class MethodCompiler { uint32_t dex_method_idx, bool is_virtual); - void EmitInsn_InvokeVirtual(GEN_INSN_ARGS, bool is_range); - void EmitInsn_InvokeSuper(GEN_INSN_ARGS, bool is_range); - void EmitInsn_InvokeVirtualSuperSlow(uint32_t dex_pc, - DecodedInstruction &dec_insn, - bool is_range, - uint32_t callee_method_idx, - bool is_virtual); - void EmitInsn_InvokeStaticDirect(GEN_INSN_ARGS, - InvokeType invoke_type, - bool is_range); - void EmitInsn_InvokeInterface(GEN_INSN_ARGS, bool is_range); + void EmitInsn_Invoke(GEN_INSN_ARGS, + InvokeType invoke_type, + InvokeArgFmt arg_fmt); + + llvm::Value* EmitLoadSDCalleeMethodObjectAddr(uint32_t callee_method_idx); + + llvm::Value* EmitLoadVirtualCalleeMethodObjectAddr(int vtable_idx, + llvm::Value* this_addr); + + llvm::Value* EmitCallRuntimeForCalleeMethodObjectAddr(uint32_t callee_method_idx, + InvokeType invoke_type, + llvm::Value* this_addr, + uint32_t dex_pc, + bool is_fast_path); // Unary instructions void EmitInsn_Neg(GEN_INSN_ARGS, JType op_jty); @@ -338,12 +346,10 @@ class MethodCompiler { llvm::Value* EmitLoadStaticStorage(uint32_t dex_pc, uint32_t type_idx); - llvm::Value* EmitLoadCalleeThis(DecodedInstruction const& di, bool is_range); - void EmitLoadActualParameters(std::vector<llvm::Value*>& args, uint32_t callee_method_idx, DecodedInstruction const& di, - bool is_range, + InvokeArgFmt arg_fmt, bool is_static); void EmitGuard_DivZeroException(uint32_t dex_pc, @@ -363,8 +369,6 @@ class MethodCompiler { RegCategory GetInferredRegCategory(uint32_t dex_pc, uint16_t reg); - Method* ResolveMethod(uint32_t method_idx); - Field* ResolveField(uint32_t field_idx); Field* FindFieldAndDeclaringTypeIdx(uint32_t field_idx, |