hg: valhalla/valhalla: 8222711: [lworld] Initial skeletal implementation of inline class instance construction via <init>
Srikanth
srikanth.adayapalam at oracle.com
Sat Apr 20 15:19:21 UTC 2019
JVM folk:
I have raised https://bugs.openjdk.java.net/browse/JDK-8222787 ([lworld]
JVM should be enhanced to work with static <init> factory methods for
inline types) in connection with this.
I have pushed an initial implementation for JDK-8222711 that alters the
way code is generated by javac for inline classes. Rather than emit
synthetic $makeValue$ methods that embody the construction, now with the
option -XDstaticInitValueFactory emits source level constructors into
class file level static factories that
- have the name <init>
- are static methods
- have a return type that matches the class
- are invoked via invokestatic at the new V() construction site.
All 4 are potential irritants to the JVM and need to be addressed before
JDK-8222711 can be tested at all.
I have eyeballed the code generated by this changeset and it passes
muster, but real testing is possible only after the VM stops choking with:
Error: LinkageError occurred while loading main class X
java.lang.ClassFormatError: Method "<init>" in class X has illegal
signature "(Ljava/lang/String;)QX;"
Thanks for looking into this.
Srikanth
On 20/04/19 8:35 PM, srikanth.adayapalam at oracle.com wrote:
> Changeset: cc473d393abf
> Author: sadayapalam
> Date: 2019-04-20 20:35 +0530
> URL: http://hg.openjdk.java.net/valhalla/valhalla/rev/cc473d393abf
>
> 8222711: [lworld] Initial skeletal implementation of inline class instance construction via <init>
>
> ! src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java
> ! src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java
> ! src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/TransValues.java
> ! src/jdk.jdeps/share/classes/com/sun/tools/javap/ClassWriter.java
>
More information about the valhalla-dev
mailing list