lambda-repo workaround [was Re: Can't get lambda forest to work]

Andrew John Hughes ahughes at redhat.com
Thu Jun 17 05:06:54 PDT 2010


On 17 June 2010 13:03, Maurizio Cimadamore
<maurizio.cimadamore at oracle.com> wrote:
> On 17/06/10 12:59, Peter Levart wrote:
>> Hello, World!42
>>
>> It works!
>>
> Phew! Thanks for the test!
>
> Maurizio
>> Peter
>>
>> On 06/17/10, Maurizio Cimadamore wrote:
>>
>>> Hi
>>> as you might now, there are problems in compiling and running code
>>> containing lambda. Those problems are not due to the lambda prototype
>>> itself; rather, they are caused by some missing bits in the jdk
>>> repository that we are going to push soon (those are required for
>>> hotspot to work correctly). As a result, any hotspot build>= b94 will
>>> fail with the following message:
>>>
>>> Invalid layout of java.dyn.CallSite at target
>>> #
>>> # A fatal error has been detected by the Java Runtime Environment:
>>> #
>>> #  Internal Error (javaClasses.cpp:48), pid=10544, tid=140152714426128
>>> #  fatal error: Invalid layout of preloaded class
>>> #
>>> # JRE version: 7.0
>>> # Java VM: OpenJDK 64-Bit Server VM (19.0-b01 mixed mode linux-amd64 )
>>> # An error report file with more information is saved as:
>>> # /home/aph/hs_err_pid10544.log
>>> #
>>> # If you would like to submit a bug report, please visit:
>>> #http://java.sun.com/webapps/bugreport/crash.jsp
>>> #
>>>
>>>
>>> In order to get rid of this problem, an earlier hotspot (b93) needs to
>>> be used. A simple way to workaround this issue is to follow the
>>> procedure below:
>>>
>>> *) 'cd' to the 'hotspot' folder of the lambda repository
>>> *) type 'hg update jdk7-b93'
>>> *) now 'cd' to the root of the lambda repository
>>> *) start a full build (ensure that the build parameter 'BUILD_HOTSPOT'
>>> is set to 'true')
>>>
>>> When the build completes you will have a full working lambda repository.
>>>
>>> I hope this helps.
>>> Maurizio
>>>
>>>
>>> Aborted
>>>
>>>
>>>
>>>
>
>
>

Worked for me too with that simple example, but still needs some work.
 The following crashes javac:


public static void main(String[] args)
  {
    #int(int) square = #(int x)(x * x);
    #int() fortyTwo = #()(42);
    Integer y = Integer.parseInt(args[0]);
    System.out.println("Hello, the meaning of life is " + fortyTwo.());
    System.out.println(y + " squared is " + square.(y));

An exception has occurred in the compiler (1.7.0-internal). Please
file a bug at the Java Developer Connection
(http://java.sun.com/webapps/bugreport)  after checking the Bug Parade
for duplicates. Include your program and the following diagnostic in
your report.  Thank you.
java.lang.AssertionError
        at com.sun.tools.javac.comp.Resolve.findImplicitMethod(Resolve.java:963)
        at com.sun.tools.javac.comp.Resolve.resolveQualifiedMethod(Resolve.java:1362)
        at com.sun.tools.javac.comp.Attr.selectSym(Attr.java:2342)

  }


Making y an int works.  Seems it doesn't like having to unbox y.
--
Andrew :-)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net

PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint: F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8


More information about the lambda-dev mailing list