Hi Will,<div><br></div><div>I'd rather not set canBeDirect if meth is null. There's no point in calling something directly if it's not there :)</div><div><br></div><div>Other than that, the change looks good to me. Feel free to apply w/ or w/o my suggestion.</div>
<div><br></div><div>Cheers,</div><div>Nicolas<br><br><div class="gmail_quote">On Tue, Nov 29, 2011 at 4:17 PM, Will Dietz <span dir="ltr"><<a href="mailto:wdietz2@illinois.edu">wdietz2@illinois.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Inlined below.<br>
<br>
I'm not sure about this, but if you look higher in the code we set<br>
"canBeDirect" in the case that we a)got a class for the method and<br>
b)that class is final.<br>
<br>
This doesn't necessarily mean the method is non-null (potentially<br>
because the class isn't resolved?), and as such we shouldn't call<br>
canBeInlined on the method.<br>
<br>
~Will<br>
<br>
>From 12dbeb52ee9bb07d226dc98fa114e36099fdd1a8 Mon Sep 17 00:00:00 2001<br>
From: Will Dietz <<a href="mailto:w@wdtz.org">w@wdtz.org</a>><br>
Date: Mon, 21 Nov 2011 12:10:53 -0600<br>
Subject: [PATCH 1/2] Fix logic assumption that having the class for a method<br>
 means its resolved.<br>
<br>
---<br>
 lib/j3/Compiler/JavaJIT.cpp |    4 ++--<br>
 1 files changed, 2 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/lib/j3/Compiler/JavaJIT.cpp b/lib/j3/Compiler/JavaJIT.cpp<br>
index 56cf094..39fa148 100644<br>
--- a/lib/j3/Compiler/JavaJIT.cpp<br>
+++ b/lib/j3/Compiler/JavaJIT.cpp<br>
@@ -192,11 +192,11 @@ void JavaJIT::invokeVirtual(uint16 index) {<br>
   llvm::Type* retType = virtualType->getReturnType();<br>
<br>
   bool needsInit = false;<br>
-  if (canBeDirect && canBeInlined(meth, customized)) {<br>
+  if (canBeDirect && meth && canBeInlined(meth, customized)) {<br>
     makeArgs(it, index, args, signature->nbArguments + 1);<br>
     if (!thisReference) JITVerifyNull(args[0]);<br>
     val = invokeInline(meth, args, customized);<br>
-  } else if (canBeDirect &&<br>
+  } else if (canBeDirect && meth &&<br>
       !TheCompiler->needsCallback(meth, customized ? customizeFor :<br>
NULL, &needsInit)) {<br>
     makeArgs(it, index, args, signature->nbArguments + 1);<br>
     if (!thisReference) JITVerifyNull(args[0]);<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.5.1<br>
_______________________________________________<br>
vmkit-commits mailing list<br>
<a href="mailto:vmkit-commits@cs.uiuc.edu">vmkit-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits</a><br>
</font></span></blockquote></div><br></div>