1 /* 2 * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. 3 */ 4 /* 5 * Licensed to the Apache Software Foundation (ASF) under one or more 6 * contributor license agreements. See the NOTICE file distributed with 7 * this work for additional information regarding copyright ownership. 8 * The ASF licenses this file to You under the Apache License, Version 2.0 9 * (the "License"); you may not use this file except in compliance with 10 * the License. You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, software 15 * distributed under the License is distributed on an "AS IS" BASIS, 16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 * See the License for the specific language governing permissions and 18 * limitations under the License. 19 */ 20 21 package com.sun.org.apache.bcel.internal.generic; 22 23 import java.io.DataOutputStream; 24 import java.io.IOException; 25 26 import com.sun.org.apache.bcel.internal.Const; 27 import com.sun.org.apache.bcel.internal.ExceptionConst; 28 import com.sun.org.apache.bcel.internal.classfile.ConstantInvokeDynamic; 29 import com.sun.org.apache.bcel.internal.classfile.ConstantNameAndType; 30 import com.sun.org.apache.bcel.internal.classfile.ConstantPool; 31 import com.sun.org.apache.bcel.internal.util.ByteSequence; 32 33 /** 34 * Class for INVOKEDYNAMIC. Not an instance of InvokeInstruction, since that class 35 * expects to be able to get the class of the method. Ignores the bootstrap 36 * mechanism entirely. 37 * 38 * @version $Id: InvokeInstruction.java 1152072 2011-07-29 01:54:05Z dbrosius $ 39 * @see 40 * <a href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-6.html#jvms-6.5.invokedynamic"> 41 * The invokedynamic instruction in The Java Virtual Machine Specification</a> 42 * @since 6.0 43 * @LastModified: Jun 2019 44 */ 45 public class INVOKEDYNAMIC extends InvokeInstruction { 46 47 /** 48 * Empty constructor needed for Instruction.readInstruction. 49 * Not to be used otherwise. 50 */ 51 INVOKEDYNAMIC() { 52 } 53 54 55 public INVOKEDYNAMIC(final int index) { 56 super(Const.INVOKEDYNAMIC, index); 57 } 58 59 60 /** 61 * Dump instruction as byte code to stream out. 62 * @param out Output stream 63 */ | 1 /* 2 * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. 3 */ 4 /* 5 * Licensed to the Apache Software Foundation (ASF) under one or more 6 * contributor license agreements. See the NOTICE file distributed with 7 * this work for additional information regarding copyright ownership. 8 * The ASF licenses this file to You under the Apache License, Version 2.0 9 * (the "License"); you may not use this file except in compliance with 10 * the License. You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, software 15 * distributed under the License is distributed on an "AS IS" BASIS, 16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 * See the License for the specific language governing permissions and 18 * limitations under the License. 19 */ 20 21 package com.sun.org.apache.bcel.internal.generic; 22 23 import java.io.DataOutputStream; 24 import java.io.IOException; 25 26 import com.sun.org.apache.bcel.internal.Const; 27 import com.sun.org.apache.bcel.internal.ExceptionConst; 28 import com.sun.org.apache.bcel.internal.classfile.ConstantInvokeDynamic; 29 import com.sun.org.apache.bcel.internal.classfile.ConstantNameAndType; 30 import com.sun.org.apache.bcel.internal.classfile.ConstantPool; 31 import com.sun.org.apache.bcel.internal.util.ByteSequence; 32 33 /** 34 * Class for INVOKEDYNAMIC. Not an instance of InvokeInstruction, since that class 35 * expects to be able to get the class of the method. Ignores the bootstrap 36 * mechanism entirely. 37 * 38 * @see 39 * <a href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-6.html#jvms-6.5.invokedynamic"> 40 * The invokedynamic instruction in The Java Virtual Machine Specification</a> 41 * @since 6.0 42 * @LastModified: Jan 2020 43 */ 44 public class INVOKEDYNAMIC extends InvokeInstruction { 45 46 /** 47 * Empty constructor needed for Instruction.readInstruction. 48 * Not to be used otherwise. 49 */ 50 INVOKEDYNAMIC() { 51 } 52 53 54 public INVOKEDYNAMIC(final int index) { 55 super(Const.INVOKEDYNAMIC, index); 56 } 57 58 59 /** 60 * Dump instruction as byte code to stream out. 61 * @param out Output stream 62 */ |