[vmkit-commits] [PATCH] Don't try to emit methods from primitive classes' VT, they're bogus.

Nicolas Geoffray nicolas.geoffray at gmail.com
Tue Nov 8 12:41:49 PST 2011


That's ok to apply. Indeed it does look strange, do you have an error
message?

In any case, the fact that primitive classes have a VT should disappear. I
haven't gone to doing that cleanup yet.

On Mon, Nov 7, 2011 at 4:04 AM, Will Dietz <wdietz2 at illinois.edu> wrote:

> Inlined below.
>
> I honestly don't know why this didn't cause problems before, since we
> explicitly attempt to emit the VT for primitive classes (while
> precompiling) in a few places.  However, this is needed for the "emit
> null for j.l.Class" patch to work, which was a bit unexpected :).
>
> Thanks!
>
> ~Will
>
> >From 8a795a7a5f6c69ef97407ef9582d8b8a524ba456 Mon Sep 17 00:00:00 2001
> From: Will Dietz <w at wdtz.org>
> Date: Sun, 6 Nov 2011 20:16:44 -0600
> Subject: [PATCH 8/8] Don't try to emit methods from primitive classes' VT,
>  they're bogus.
>
> ---
>  lib/J3/Compiler/JavaAOTCompiler.cpp |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/lib/J3/Compiler/JavaAOTCompiler.cpp
> b/lib/J3/Compiler/JavaAOTCompiler.cpp
> index 2ae8973..c4dc364 100644
> --- a/lib/J3/Compiler/JavaAOTCompiler.cpp
> +++ b/lib/J3/Compiler/JavaAOTCompiler.cpp
> @@ -1775,7 +1775,10 @@ Constant*
> JavaAOTCompiler::CreateConstantFromVT(JavaVirtualTable* VT) {
>   // methods
>   for (uint32 i = JavaVirtualTable::getFirstJavaMethodIndex(); i < size;
> ++i) {
>     JavaMethod* meth = ((JavaMethod**)RealVT)[i];
> -    if (isAbstract(meth->access)) {
> +    // Primitive classes don't have methods--abstract or otherwise.
> +    // (But we do have placeholders for j.l.Object methods in their VTs,
> +    // so just emit NULL's here)
> +    if (isAbstract(meth->access) || classDef->isPrimitive()) {
>       Elemts.push_back(Constant::getNullValue(PTy));
>     } else {
>       Function* F = getMethodOrStub(meth, maybeCustomize);
> --
> 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/20111108/67c84d6c/attachment.html>


More information about the vmkit-commits mailing list