public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Per Bothner <per@bothner.com>
To: Kay Zheng <l04m33@gmail.com>, Kawa mailing list <kawa@sourceware.org>
Subject: Re: The "--no-inline" option caused Kawa to generate invalid bytecode
Date: Tue, 05 Sep 2017 03:28:00 -0000	[thread overview]
Message-ID: <471ca916-1ba1-6ed4-4ff6-0966da00c7cc@bothner.com> (raw)
In-Reply-To: <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/

  reply	other threads:[~2017-09-05  3:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-04 10:25 Kay Zheng
2017-09-05  3:28 ` Per Bothner [this message]
2017-09-05 16:51   ` Kay Zheng
2017-10-05  6:29 ` Per Bothner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=471ca916-1ba1-6ed4-4ff6-0966da00c7cc@bothner.com \
    --to=per@bothner.com \
    --cc=kawa@sourceware.org \
    --cc=l04m33@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).