hg: lambda/lambda/langtools: Initial push for the 'defender methods' feature. The compiler recognizes and attributes the syntax described in the strawman proposal; defender methods are decorated with a special bytecode attribute called 'Defender'. It is also possible (using the -XDemitDefenderMethodAnnos flag) to have the compiler automatically generate a non-standard annotation called @DefenderMethod which contains information about the default implementation attached to the defender method declaration.
maurizio.cimadamore at oracle.com
maurizio.cimadamore at oracle.com
Fri Jun 18 05:04:43 PDT 2010
Changeset: 9f79be8946c6
Author: mcimadamore
Date: 2010-06-18 13:02 +0100
URL: http://hg.openjdk.java.net/lambda/lambda/langtools/rev/9f79be8946c6
Initial push for the 'defender methods' feature. The compiler recognizes and attributes the syntax described in the strawman proposal; defender methods are decorated with a special bytecode attribute called 'Defender'. It is also possible (using the -XDemitDefenderMethodAnnos flag) to have the compiler automatically generate a non-standard annotation called @DefenderMethod which contains information about the default implementation attached to the defender method declaration.
Note: the current prototype doesn't commit to any of the implementation strategies described in the strawman; as such the code the compiler emits will not be executable (calling a defender method will result in an AbstractMethodError).
+ src/share/classes/com/sun/runtime/DefenderMethod.java
! src/share/classes/com/sun/tools/classfile/Attribute.java
! src/share/classes/com/sun/tools/classfile/ClassWriter.java
+ src/share/classes/com/sun/tools/classfile/Defender_attribute.java
! src/share/classes/com/sun/tools/javac/code/Flags.java
! src/share/classes/com/sun/tools/javac/code/Source.java
! src/share/classes/com/sun/tools/javac/code/Symbol.java
! src/share/classes/com/sun/tools/javac/code/Symtab.java
! src/share/classes/com/sun/tools/javac/comp/Attr.java
! src/share/classes/com/sun/tools/javac/comp/Check.java
! src/share/classes/com/sun/tools/javac/comp/Flow.java
! src/share/classes/com/sun/tools/javac/comp/Lower.java
! src/share/classes/com/sun/tools/javac/comp/MemberEnter.java
! src/share/classes/com/sun/tools/javac/comp/Resolve.java
! src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
! src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
! src/share/classes/com/sun/tools/javac/jvm/Gen.java
! src/share/classes/com/sun/tools/javac/jvm/Target.java
! src/share/classes/com/sun/tools/javac/parser/JavacParser.java
! src/share/classes/com/sun/tools/javac/resources/compiler.properties
! src/share/classes/com/sun/tools/javac/tree/JCTree.java
! src/share/classes/com/sun/tools/javac/util/Names.java
! src/share/classes/com/sun/tools/javap/AttributeWriter.java
+ test/tools/javac/defender/Neg01.java
+ test/tools/javac/defender/Neg01.out
+ test/tools/javac/defender/Pos01.java
+ test/tools/javac/defender/Pos02.java
More information about the lambda-dev
mailing list