[vmkit-commits] [vmkit] r140006 - /vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp

Nicolas Geoffray nicolas.geoffray at lip6.fr
Sun Sep 18 14:07:53 PDT 2011


Author: geoffray
Date: Sun Sep 18 16:07:53 2011
New Revision: 140006

URL: http://llvm.org/viewvc/llvm-project?rev=140006&view=rev
Log:
Also try to inline methods that do INVOKEVIRTUAL calls.

Modified:
    vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp

Modified: vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp?rev=140006&r1=140005&r2=140006&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp Sun Sep 18 16:07:53 2011
@@ -3314,9 +3314,20 @@
         break;
       }
 
-      case INVOKEVIRTUAL :
+      case INVOKEVIRTUAL : {
+        if (isStatic(compilingMethod->access)) return false;
+        uint16 index = reader.readU2();
+        CommonClass* cl = NULL;
+        JavaMethod* meth = NULL;
+        ctpInfo->infoOfMethod(index, ACC_VIRTUAL, cl, meth);
         i += 2;
-        return false;
+        if (meth == NULL) return false;
+        if (getReceiver(stack, meth->getSignature()) != ALOAD_0) return false;
+        if (!(isFinal(cl->access) || isFinal(meth->access))) return false;
+        if (!canBeInlined(meth)) return false;
+        updateStack(stack, meth->getSignature(), bytecode);
+        break;
+      }
 
       case INVOKESPECIAL : {
         if (isStatic(compilingMethod->access)) return false;





More information about the vmkit-commits mailing list