Lazy pushing shadow frame.
Function:
aget v0, v1, v2
return v0
Original:
push shadow frame;
if (null pointer) { throw; pop shadow frame; unwind; }
if (index out of bounds) { throw; pop shadow frame; unwind; }
load from array;
pop shadow frame;
return;
New:
if (null pointer) { push shadow frame; throw; pop shadow frame; unwind; }
if (index out of bounds) { push shadow frame; throw; pop shadow frame; unwind; }
load from array;
return;
Change-Id: I7fc0ff12b9a5454f8e1491b9ce1cdef3afcbed23
diff --git a/src/compiler_llvm/method_compiler.h b/src/compiler_llvm/method_compiler.h
index 9e4c81b..44ab863 100644
--- a/src/compiler_llvm/method_compiler.h
+++ b/src/compiler_llvm/method_compiler.h
@@ -264,6 +264,7 @@
void EmitMarkGCCard(llvm::Value* value, llvm::Value* target_addr);
// Shadow frame helper function
+ void EmitPushShadowFrame(bool is_inline);
void EmitPopShadowFrame();
void EmitUpdateDexPC(uint32_t dex_pc);
@@ -430,6 +431,7 @@
bool has_invoke;
bool need_shadow_frame_entry;
bool need_shadow_frame;
+ bool lazy_push_shadow_frame;
};
MethodInfo method_info_;
@@ -474,6 +476,9 @@
llvm::AllocaInst* jvalue_temp_;
llvm::Value* old_shadow_frame_;
+ llvm::Value* already_pushed_shadow_frame_;
+ uint32_t shadow_frame_size_;
+
uint16_t elf_func_idx_;
};