This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: interactive development and code re-loading
- From: Per Bothner <per at bothner dot com>
- To: Helmut Eller <eller dot helmut at gmail dot com>, kawa at sourceware dot org
- Date: Wed, 14 Oct 2015 18:59:46 -0700
- Subject: Re: interactive development and code re-loading
- Authentication-results: sourceware.org; auth=none
- References: <561AC459 dot 7030908 at bothner dot com> <m2oag4r0qv dot fsf at gmail dot com> <561C907D dot 7070605 at bothner dot com> <561DFF51 dot 8080007 at bothner dot com> <m26129956w dot fsf at gmail dot com>
On 10/14/2015 02:20 AM, Helmut Eller wrote:
On Wed, Oct 14 2015, Per Bothner wrote:
I checked in code that defines "interactive mode" as suggested
in these emails
Not sure if this was caused by those changes but:
kawa -e '(eval (call-with-input-string "(define (foo) (foo))" read))'
now gets stuck in an endless loop.
It doesn't appear to have anything with the recent changes.
The reason you have to use the convoluted eval+call-with-input-string
in the test-case is because otherwise line number "fixme" are generated
for the bytecode, and those line number notes "disrupt" the bug. If you
uncomment the code of CodeAttr#putLineNumber then you get the same
infinite compiler loop for plain:
kawa -e '(define (foo) (foo))'
The loop happens in processFixups when it is trying to optimize:
TRANSFER L1; ... L1: GOTO L2
to
TRANSFER L2; ... L1: GOTO L2
where TRANSFER is a GOTO, conditional goto or certain other instructions.
This optimization gets into an infinite loop when L1==L2.
So (you say): check for L1==L2 - but that doesn't handle longer cycles.
So use a counter to limit the loop to finite number of iterations.
Alas, that triggers a VerifyError - for CodeAttr.class. (I.e.
it's a bug either in javac or HotSpot.) I'm having trouble
finding a working fix. For example completely dropping the
"optimization", or only executing the loop at most once causes other problems.
--
--Per Bothner
per@bothner.com http://per.bothner.com/