jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
changeset 31802 cb6542e7d329
parent 31253 5efb78c8a07d
child 32649 2ee9017c7597
equal deleted inserted replaced
31801:1297473ab237 31802:cb6542e7d329
     1 /*
     1 /*
     2  * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    59     private static final String MH_SIG  = "L" + MH + ";";
    59     private static final String MH_SIG  = "L" + MH + ";";
    60     private static final String LF_SIG  = "L" + LF + ";";
    60     private static final String LF_SIG  = "L" + LF + ";";
    61     private static final String LFN_SIG = "L" + LFN + ";";
    61     private static final String LFN_SIG = "L" + LFN + ";";
    62     private static final String LL_SIG  = "(L" + OBJ + ";)L" + OBJ + ";";
    62     private static final String LL_SIG  = "(L" + OBJ + ";)L" + OBJ + ";";
    63     private static final String LLV_SIG = "(L" + OBJ + ";L" + OBJ + ";)V";
    63     private static final String LLV_SIG = "(L" + OBJ + ";L" + OBJ + ";)V";
    64     private static final String CLL_SIG = "(L" + CLS + ";L" + OBJ + ";)L" + OBJ + ";";
       
    65 
    64 
    66     /** Name of its super class*/
    65     /** Name of its super class*/
    67     private static final String superName = OBJ;
    66     private static final String superName = OBJ;
    68 
    67 
    69     /** Name of new class */
    68     /** Name of new class */
   569             mv.visitTypeInsn(Opcodes.CHECKCAST, sig);
   568             mv.visitTypeInsn(Opcodes.CHECKCAST, sig);
   570         } else {
   569         } else {
   571             mv.visitLdcInsn(constantPlaceholder(cls));
   570             mv.visitLdcInsn(constantPlaceholder(cls));
   572             mv.visitTypeInsn(Opcodes.CHECKCAST, CLS);
   571             mv.visitTypeInsn(Opcodes.CHECKCAST, CLS);
   573             mv.visitInsn(Opcodes.SWAP);
   572             mv.visitInsn(Opcodes.SWAP);
   574             mv.visitMethodInsn(Opcodes.INVOKESTATIC, MHI, "castReference", CLL_SIG, false);
   573             mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, CLS, "cast", LL_SIG, false);
   575             if (Object[].class.isAssignableFrom(cls))
   574             if (Object[].class.isAssignableFrom(cls))
   576                 mv.visitTypeInsn(Opcodes.CHECKCAST, OBJARY);
   575                 mv.visitTypeInsn(Opcodes.CHECKCAST, OBJARY);
   577             else if (PROFILE_LEVEL > 0)
   576             else if (PROFILE_LEVEL > 0)
   578                 mv.visitTypeInsn(Opcodes.CHECKCAST, OBJ);
   577                 mv.visitTypeInsn(Opcodes.CHECKCAST, OBJ);
   579         }
   578         }