[vmkit-commits] [PATCH] Fix logic assumption that having the class for a method means its resolved.

Nicolas Geoffray nicolas.geoffray at gmail.com
Tue Nov 29 11:52:56 PST 2011


Hi Will,

I'd rather not set canBeDirect if meth is null. There's no point in calling
something directly if it's not there :)

Other than that, the change looks good to me. Feel free to apply w/ or w/o
my suggestion.

Cheers,
Nicolas

On Tue, Nov 29, 2011 at 4:17 PM, Will Dietz <wdietz2 at illinois.edu> wrote:

> Inlined below.
>
> I'm not sure about this, but if you look higher in the code we set
> "canBeDirect" in the case that we a)got a class for the method and
> b)that class is final.
>
> This doesn't necessarily mean the method is non-null (potentially
> because the class isn't resolved?), and as such we shouldn't call
> canBeInlined on the method.
>
> ~Will
>
> >From 12dbeb52ee9bb07d226dc98fa114e36099fdd1a8 Mon Sep 17 00:00:00 2001
> From: Will Dietz <w at wdtz.org>
> Date: Mon, 21 Nov 2011 12:10:53 -0600
> Subject: [PATCH 1/2] Fix logic assumption that having the class for a
> method
>  means its resolved.
>
> ---
>  lib/j3/Compiler/JavaJIT.cpp |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/j3/Compiler/JavaJIT.cpp b/lib/j3/Compiler/JavaJIT.cpp
> index 56cf094..39fa148 100644
> --- a/lib/j3/Compiler/JavaJIT.cpp
> +++ b/lib/j3/Compiler/JavaJIT.cpp
> @@ -192,11 +192,11 @@ void JavaJIT::invokeVirtual(uint16 index) {
>   llvm::Type* retType = virtualType->getReturnType();
>
>   bool needsInit = false;
> -  if (canBeDirect && canBeInlined(meth, customized)) {
> +  if (canBeDirect && meth && canBeInlined(meth, customized)) {
>     makeArgs(it, index, args, signature->nbArguments + 1);
>     if (!thisReference) JITVerifyNull(args[0]);
>     val = invokeInline(meth, args, customized);
> -  } else if (canBeDirect &&
> +  } else if (canBeDirect && meth &&
>       !TheCompiler->needsCallback(meth, customized ? customizeFor :
> NULL, &needsInit)) {
>     makeArgs(it, index, args, signature->nbArguments + 1);
>     if (!thisReference) JITVerifyNull(args[0]);
> --
> 1.7.5.1
> _______________________________________________
> vmkit-commits mailing list
> vmkit-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/vmkit-commits/attachments/20111129/73b046fa/attachment.html>


More information about the vmkit-commits mailing list