hg: valhalla/valhalla: 8215259: [lworld]: Evolve the byte code API library to handle Q type forms

Srikanth srikanth.adayapalam at oracle.com
Wed Dec 12 08:08:43 UTC 2018


Consumers: Please take note of the new/changed APIs:

CodeBuilder:

(public class CodeBuilder<S, T, E, C extends CodeBuilder<S, T, E, C>> 
extends AttributeBuilder<S, T, E, C> {})

     o In order for the library to emit Constant_class_info structures 
with Q form strings to denote that the element type of an array is a 
value type, a new API has been introduced:

      public C anewvaluearray(S array) { ... }

     o Likewise, in order to signal that the target type of a checkcast 
is a value type (that should then encode the Q form in the CCi), a new 
API has been introduced:

     public C checkvaluecast(S target) { ... }

PoolHelper:
(public interface PoolHelper<S, T, R> {})

     o A new API

      int putValueClass(S symbol);
has been introduced akin to int putClass(S symbol) { ... }

TypeHelper: (public interface TypeHelper<S, T> {})

     o Two new convenience methods have been introduced:

     /**
      * Return true if the parameter is a value type.
      *
      * @param t the type descreiptor
      * @return true if the given type is a value type
      */
     boolean isValue(T t);

     /**
      * For a symbol that corresponds to a value type, return the type 
descriptor.
      *
      * @param s the symbol
      * @return the type descriptor
      */
     default T valueType(S s) {
         return type(s);
     }

Thanks!
Srikanth



On 12/12/18 1:12 PM, srikanth.adayapalam at oracle.com wrote:
> Changeset: a2d1bb5a17dc
> Author:    sadayapalam
> Date:      2018-12-12 13:12 +0530
> URL:       http://hg.openjdk.java.net/valhalla/valhalla/rev/a2d1bb5a17dc
>
> 8215259: [lworld]: Evolve the byte code API library to handle Q type forms
>
> ! src/java.base/share/classes/java/lang/invoke/LambdaFormBuilder.java
> ! src/java.base/share/classes/jdk/experimental/bytecode/BasicTypeHelper.java
> ! src/java.base/share/classes/jdk/experimental/bytecode/BytePoolHelper.java
> ! src/java.base/share/classes/jdk/experimental/bytecode/CodeBuilder.java
> ! src/java.base/share/classes/jdk/experimental/bytecode/IsolatedMethodBuilder.java
> ! src/java.base/share/classes/jdk/experimental/bytecode/Pool.java
> ! src/java.base/share/classes/jdk/experimental/bytecode/PoolHelper.java
> ! src/java.base/share/classes/jdk/experimental/bytecode/TypeHelper.java
> ! src/java.base/share/classes/jdk/experimental/bytecode/TypedCodeBuilder.java
> ! src/java.base/share/classes/jdk/experimental/value/MethodHandleBuilder.java
>



More information about the valhalla-dev mailing list