This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: The "--no-inline" option caused Kawa to generate invalid bytecode
- From: Per Bothner <per at bothner dot com>
- To: Kay Zheng <l04m33 at gmail dot com>, Kawa mailing list <kawa at sourceware dot org>
- Date: Mon, 4 Sep 2017 20:28:09 -0700
- Subject: Re: The "--no-inline" option caused Kawa to generate invalid bytecode
- Authentication-results: sourceware.org; auth=none
- References: <CAJCc8OwD+ea+e29=dPhGoZ9W8fZms_i-aOOLcxHrKgPZYANyrg@mail.gmail.com>
On 09/04/2017 03:25 AM, Kay Zheng wrote:
Hi Per,
I think I hit a bug regarding "(define-early-constant ...)" and the
"--no-inline" option.
I was able to reproduce the problem.
I then disassembled kawa-test.class (the result is appended at the end
of this email), and found that there was a "aload_0" instruction in
the static initialization block. I'm not familiar with the JVM, but
search results said the instruction was to read the argument array,
yet there was no argument list for the static initialization block at
all.
aload_0 does not necessarily means to read the argument array.
It means to push the contents of local variable 0 (which must
be a reference to an object or null) onto the operand stack.
The first few local variables are commonly used for parameters,
but <clinit> takes no parameters, not even the implicit 'this'.
In this case I'm guessing a bug in the Compilation.loadCallContext method.
--
--Per Bothner
per@bothner.com http://per.bothner.com/