[vmkit-commits] [vmkit] r144858 - /vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp

Will Dietz wdietz2 at illinois.edu
Wed Nov 16 14:54:05 PST 2011


Author: wdietz2
Date: Wed Nov 16 16:54:04 2011
New Revision: 144858

URL: http://llvm.org/viewvc/llvm-project?rev=144858&view=rev
Log:
Better handle virtual calls through casted 'this' pointers.

* Being a 'thisReference' doesn't mean we don't need to dynamically resolve
* Only customize if the call is valid for the current customization class.
    This is checked by "if(customizeFor instanceof calleeClass)"

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

Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=144858&r1=144857&r2=144858&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Wed Nov 16 16:54:04 2011
@@ -121,10 +121,10 @@
   bool customized = false;
   bool thisReference =
     isThisReference(stackSize() - signature->getNumberOfSlots() - 1);
-  if (thisReference) {
-    assert(meth != NULL);
+  if (thisReference && meth) {
     isCustomizable = true;
-    if (customizeFor != NULL) {
+    if ((customizeFor != NULL)
+        && cl->isAssignableFrom(customizeFor)) {
       meth = customizeFor->lookupMethodDontThrow(
           meth->name, meth->type, false, true, NULL);
       assert(meth);





More information about the vmkit-commits mailing list