[vmkit-commits] [PATCH] Don't try to emit methods from primitive classes' VT, they're bogus.
Will Dietz
wdietz2 at illinois.edu
Tue Nov 8 13:15:48 PST 2011
On Tue, Nov 8, 2011 at 2:41 PM, Nicolas Geoffray
<nicolas.geoffray at gmail.com> wrote:
> That's ok to apply. Indeed it does look strange, do you have an error
> message?
The error manifests itself as an assertion failure in getMethodOrStub
when checking "isStatic", but the whole JavaMethod* is bogus. This is
during the precompile stage.
> In any case, the fact that primitive classes have a VT should disappear. I
> haven't gone to doing that cleanup yet.
>
Okay, sounds good.
> 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()) {
FWIW I'm going to re-order this check since if the class is primitive,
we shouldn't very well be derefefencing it as a JavaMethod :).
>> 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
>
>
Thanks!
~Will
More information about the vmkit-commits
mailing list