From c61124bdeaae94f977ffc36ac69535e792c226f2 Mon Sep 17 00:00:00 2001 From: Sebastien Hertz Date: Tue, 10 Sep 2013 11:44:19 +0200 Subject: Cleanup invoke in interpreter. Some cleanup in invocation stuff: - Get the number of invoke arguments from instruction (vA) rather than get it from its code item. This benefits to native invoke since we no longer need to parse the method's shorty. Also pass the low 16 bits of instructions to avoid fetching it twice when reading vA. - Remove "is_static" tests by taking advantage of invoke type template argument rather than testing method's access flags. - Ensure Instruction::GetArgs is inlined. - Check exception when initializing method's class when transitioning from interpreter to compiled code (artInterpreterToCompiledCodeBridge). - Move UnstartedRuntimeInvoke function to interpreter_common.cc and make it static as it's only used by DoInvoke and DoInvokeVirtualQuick functions. - Avoid duplicating code in ShadowFrame::Create. Performance remains the same according to benchmarks. Hopefully, this should be addressed in next CLs, especially by improving new shadow frame initialization. Bug: 10668955 Change-Id: I514b8f098d0ef3e35921ceb770383aac1a9c7902 --- runtime/stack.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'runtime/stack.h') diff --git a/runtime/stack.h b/runtime/stack.h index 2bf3340..700b7f1 100644 --- a/runtime/stack.h +++ b/runtime/stack.h @@ -68,8 +68,7 @@ class ShadowFrame { static ShadowFrame* Create(uint32_t num_vregs, ShadowFrame* link, mirror::ArtMethod* method, uint32_t dex_pc) { uint8_t* memory = new uint8_t[ComputeSize(num_vregs)]; - ShadowFrame* sf = new (memory) ShadowFrame(num_vregs, link, method, dex_pc, true); - return sf; + return Create(num_vregs, link, method, dex_pc, memory); } // Create ShadowFrame for interpreter using provided memory. -- cgit v1.1