< prev index next >

src/java.base/share/classes/java/lang/invoke/TypeConvertingMethodAdapter.java

Print this page
rev 52456 : imported patch asm.additional


  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.lang.invoke;
  27 
  28 import jdk.internal.org.objectweb.asm.MethodVisitor;
  29 import jdk.internal.org.objectweb.asm.Opcodes;
  30 import jdk.internal.org.objectweb.asm.Type;
  31 import sun.invoke.util.BytecodeDescriptor;
  32 import sun.invoke.util.Wrapper;
  33 import static sun.invoke.util.Wrapper.*;
  34 
  35 class TypeConvertingMethodAdapter extends MethodVisitor {
  36 
  37     TypeConvertingMethodAdapter(MethodVisitor mv) {
  38         super(Opcodes.ASM5, mv);
  39     }
  40 
  41     private static final int NUM_WRAPPERS = Wrapper.COUNT;
  42 
  43     private static final String NAME_OBJECT = "java/lang/Object";
  44     private static final String WRAPPER_PREFIX = "Ljava/lang/";
  45 
  46     // Same for all primitives; name of the boxing method
  47     private static final String NAME_BOX_METHOD = "valueOf";
  48 
  49     // Table of opcodes for widening primitive conversions; NOP = no conversion
  50     private static final int[][] wideningOpcodes = new int[NUM_WRAPPERS][NUM_WRAPPERS];
  51 
  52     private static final Wrapper[] FROM_WRAPPER_NAME = new Wrapper[16];
  53 
  54     // Table of wrappers for primitives, indexed by ASM type sorts
  55     private static final Wrapper[] FROM_TYPE_SORT = new Wrapper[12];
  56 
  57     static {
  58         for (Wrapper w : Wrapper.values()) {




  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.lang.invoke;
  27 
  28 import jdk.internal.org.objectweb.asm.MethodVisitor;
  29 import jdk.internal.org.objectweb.asm.Opcodes;
  30 import jdk.internal.org.objectweb.asm.Type;
  31 import sun.invoke.util.BytecodeDescriptor;
  32 import sun.invoke.util.Wrapper;
  33 import static sun.invoke.util.Wrapper.*;
  34 
  35 class TypeConvertingMethodAdapter extends MethodVisitor {
  36 
  37     TypeConvertingMethodAdapter(MethodVisitor mv) {
  38         super(Opcodes.ASM7, mv);
  39     }
  40 
  41     private static final int NUM_WRAPPERS = Wrapper.COUNT;
  42 
  43     private static final String NAME_OBJECT = "java/lang/Object";
  44     private static final String WRAPPER_PREFIX = "Ljava/lang/";
  45 
  46     // Same for all primitives; name of the boxing method
  47     private static final String NAME_BOX_METHOD = "valueOf";
  48 
  49     // Table of opcodes for widening primitive conversions; NOP = no conversion
  50     private static final int[][] wideningOpcodes = new int[NUM_WRAPPERS][NUM_WRAPPERS];
  51 
  52     private static final Wrapper[] FROM_WRAPPER_NAME = new Wrapper[16];
  53 
  54     // Table of wrappers for primitives, indexed by ASM type sorts
  55     private static final Wrapper[] FROM_TYPE_SORT = new Wrapper[12];
  56 
  57     static {
  58         for (Wrapper w : Wrapper.values()) {


< prev index next >