This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: interactive development and code re-loading




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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]