summaryrefslogtreecommitdiff
path: root/src/compiler_llvm/method_compiler.h
diff options
context:
space:
mode:
author TDYa127 <tdy@google.com> 2012-05-26 01:01:48 -0700
committer Shih-wei Liao <sliao@google.com> 2012-05-31 21:48:44 -0700
commit526643e38c344701d96068f351548a393c67b6be (patch)
treeaabe346bdca4957185bf8cd2102bdc6bb583a92e /src/compiler_llvm/method_compiler.h
parentbd050618b502031a00294ebb652b5bc159a7388b (diff)
Remove unnecessary exception and suspend checks.
1. Post exception check, when 2 consecutive branches are return and exception unwind, respectively, merge these 2 branches as the caller doesn't care the return value when an exception is pending.. 2. If the method is leaf, we can elide the suspend check. 3. Also, move suspend checks to be before pushing shadow frame for the sake of "1" and for reducing code size (Multiple returns). Change-Id: I18f38f97f4e7714eadab4a1d6a568aa6e2c982ae
Diffstat (limited to 'src/compiler_llvm/method_compiler.h')
-rw-r--r--src/compiler_llvm/method_compiler.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/compiler_llvm/method_compiler.h b/src/compiler_llvm/method_compiler.h
index c912397e1b..9e4c81b5b8 100644
--- a/src/compiler_llvm/method_compiler.h
+++ b/src/compiler_llvm/method_compiler.h
@@ -286,11 +286,11 @@ class MethodCompiler {
llvm::FunctionType* GetFunctionType(uint32_t method_idx, bool is_static);
- void EmitGuard_ExceptionLandingPad(uint32_t dex_pc);
+ void EmitGuard_ExceptionLandingPad(uint32_t dex_pc, bool can_skip_unwind);
void EmitBranchExceptionLandingPad(uint32_t dex_pc);
- void EmitGuard_GarbageCollectionSuspend(uint32_t dex_pc);
+ void EmitGuard_GarbageCollectionSuspend();
llvm::Value* EmitCompareResultSelection(llvm::Value* cmp_eq,
llvm::Value* cmp_lt);
@@ -422,6 +422,8 @@ class MethodCompiler {
bool EmitInlinedStringLength(const std::vector<llvm::Value*>& args,
llvm::BasicBlock* after_invoke);
+ bool IsInstructionDirectToReturn(uint32_t dex_pc);
+
struct MethodInfo {
int64_t this_reg_idx;
bool this_will_not_be_null;
@@ -459,7 +461,6 @@ class MethodCompiler {
std::vector<int32_t> reg_to_shadow_frame_index_;
UniquePtr<DalvikReg> retval_reg_;
- llvm::BasicBlock* basic_block_stack_overflow_;
llvm::BasicBlock* basic_block_alloca_;
llvm::BasicBlock* basic_block_shadow_frame_;
llvm::BasicBlock* basic_block_reg_arg_init_;