OSDN Git Service

invoke-direct-empty doesn't actually invoke anything.
authorDan Bornstein <danfuzz@android.com>
Tue, 30 Nov 2010 22:58:53 +0000 (14:58 -0800)
committerDan Bornstein <danfuzz@android.com>
Tue, 30 Nov 2010 23:25:30 +0000 (15:25 -0800)
Update bytecode.txt as well as a couple bits in the JIT in recognition
of this fact.

Change-Id: I989556d39b40a879021eaf841404e015076073be

libdex/InstrUtils.c
opcode-gen/bytecode.txt
vm/compiler/Frontend.c
vm/compiler/InlineTransformation.c
vm/interp/Jit.c

index 9c2b48f..c194bc3 100644 (file)
@@ -297,7 +297,7 @@ static InstructionFlags gOpcodeFlagsTable[kNumDalvikInstructions] = {
     kInstrCanThrow,
     kInstrCanContinue|kInstrCanThrow,
     kInstrCanContinue|kInstrCanThrow,
-    kInstrCanContinue|kInstrCanThrow|kInstrInvoke,
+    kInstrCanContinue,
     kInstrCanReturn,
     kInstrCanContinue|kInstrCanThrow,
     kInstrCanContinue|kInstrCanThrow,
index b24e611..773a1f7 100644 (file)
@@ -74,7 +74,10 @@ format 3rms
 #     switch        -- is a switch
 #     throw         -- might throw an exception
 #     return        -- is a return from method
-#     invoke        -- is a method invoke
+#     invoke        -- is a method invoke; this is only used for true
+#                      method invokes and notably *not* vm-implemented
+#                      execute-inline nor the nop-equivalent
+#                      invoke-direct-empty
 
 # Regular opcodes (with a couple holes)
 op   00 nop                         10x  n none          continue
@@ -316,7 +319,7 @@ op   ec ^breakpoint                 00x  n unknown       optimized
 op   ed ^throw-verification-error   20bc n varies        optimized|throw
 op   ee +execute-inline             35mi n inline-method optimized|continue|throw
 op   ef +execute-inline/range       3rmi n inline-method optimized|continue|throw
-op   f0 +invoke-direct-empty        35c  n method-ref    optimized|continue|throw|invoke
+op   f0 +invoke-direct-empty        35c  n method-ref    optimized|continue
 op   f1 +return-void-barrier        10x  n none          optimized|return
 op   f2 +iget-quick                 22cs y field-offset  optimized|continue|throw
 op   f3 +iget-wide-quick            22cs y field-offset  optimized|continue|throw
index 4e5a882..c2ee496 100644 (file)
@@ -208,8 +208,7 @@ static int analyzeInlineTarget(DecodedInstruction *dalvikInsn, int attributes,
     int flags = dexGetInstrFlags(dalvikInsn->opCode);
     int dalvikOpCode = dalvikInsn->opCode;
 
-    if ((flags & kInstrInvoke) &&
-        (dalvikOpCode != OP_INVOKE_DIRECT_EMPTY)) {
+    if (flags & kInstrInvoke) {
         attributes &= ~METHOD_IS_LEAF;
     }
 
@@ -572,8 +571,7 @@ bool dvmCompileTrace(JitTraceDescription *desc, int numMaxInsts,
 
         int flags = dexGetInstrFlags(insn->dalvikInsn.opCode);
 
-        if ((flags & kInstrInvoke) &&
-            (insn->dalvikInsn.opCode != OP_INVOKE_DIRECT_EMPTY)) {
+        if (flags & kInstrInvoke) {
             assert(numInsts == 1);
             CallsiteInfo *callsiteInfo =
                 dvmCompilerNew(sizeof(CallsiteInfo), true);
@@ -673,13 +671,10 @@ bool dvmCompileTrace(JitTraceDescription *desc, int numMaxInsts,
          * currently only due to trace length constraint. In this case we need
          * to generate an explicit branch at the end of the block to jump to
          * the chaining cell.
-         *
-         * NOTE: INVOKE_DIRECT_EMPTY is actually not an invoke but a nop
          */
         curBB->needFallThroughBranch =
             ((flags & (kInstrCanBranch | kInstrCanSwitch | kInstrCanReturn |
-                       kInstrInvoke)) == 0) ||
-            (lastInsn->dalvikInsn.opCode == OP_INVOKE_DIRECT_EMPTY);
+                       kInstrInvoke)) == 0);
 
         /* Only form a loop if JIT_OPT_NO_LOOP is not set */
         if (curBB->taken == NULL &&
index 92488b1..243d16b 100644 (file)
@@ -302,10 +302,6 @@ void dvmCompilerInlineMIR(CompilationUnit *cUnit)
         if ((flags & kInstrInvoke) == 0)
             continue;
 
-        /* Not a real invoke - continue */
-        if (opCode == OP_INVOKE_DIRECT_EMPTY)
-            continue;
-
         /*
          * If the invoke itself is selected for single stepping, don't bother
          * to inline it.
index 151e66f..cd5bfbd 100644 (file)
@@ -784,8 +784,6 @@ int dvmCheckJit(const u2* pc, Thread* self, InterpState* interpState,
             }
 
             if (!dexIsGoto(flags) &&
-                  /* don't end trace on INVOKE_DIRECT_EMPTY  */
-                  (decInsn.opCode != OP_INVOKE_DIRECT_EMPTY) &&
                   ((flags & (kInstrCanBranch |
                              kInstrCanSwitch |
                              kInstrCanReturn |