From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 93170 invoked by alias); 5 Sep 2017 03:28:23 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 93157 invoked by uid 89); 5 Sep 2017 03:28:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: aibo.runbox.com Received: from aibo.runbox.com (HELO aibo.runbox.com) (91.220.196.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 05 Sep 2017 03:28:18 +0000 Received: from [10.9.9.210] (helo=mailfront10.runbox.com) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1dp4X9-0004KV-RY; Tue, 05 Sep 2017 05:28:15 +0200 Received: from [64.239.132.75] (helo=localhost.localdomain) by mailfront10.runbox.com with esmtpsa (uid:757155 ) (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.82) id 1dp4X6-0005Qn-7X; Tue, 05 Sep 2017 05:28:12 +0200 Subject: Re: The "--no-inline" option caused Kawa to generate invalid bytecode To: Kay Zheng , Kawa mailing list References: From: Per Bothner Message-ID: <471ca916-1ba1-6ed4-4ff6-0966da00c7cc@bothner.com> Date: Tue, 05 Sep 2017 03:28:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-q3/txt/msg00033.txt.bz2 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 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/