2 * Copyright (C) 2014, United States Government, as represented by the
3 * Administrator of the National Aeronautics and Space Administration.
6 * The Java Pathfinder core (jpf-core) platform is licensed under the
7 * Apache License, Version 2.0 (the "License"); you may not use this file except
8 * in compliance with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0.
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 package gov.nasa.jpf.vm;
21 * @author Nastaran Shafiei <nastaran.shafiei@gmail.com>
23 * For now, this is only used to capture boostrap methods for lambda expression,
24 * which link the method representing the lambda body to a single abstract method
25 * (SAM) declared in a functional interface. References to bootstrap methods are
26 * provided by the invokedynamic bytecode instruction.
28 public class BootstrapMethodInfo {
32 // method capturing lambda body to be linked to the function method of function object
33 MethodInfo lambdaBody;
35 // class containing lamabda expression
36 ClassInfo enclosingClass;
38 // descriptor of a SAM declared within the functional interface
41 public BootstrapMethodInfo(int lambdaRefKind, ClassInfo enclosingClass, MethodInfo lambdaBody, String samDescriptor) {
42 this.lambdaRefKind = lambdaRefKind;
43 this.enclosingClass = enclosingClass;
44 this.lambdaBody = lambdaBody;
45 this.samDescriptor = samDescriptor;
49 public String toString() {
50 return "BootstrapMethodInfo[" + enclosingClass.getName() + "." + lambdaBody.getBaseName() +
51 "[SAM descriptor:" + samDescriptor + "]]";
54 public MethodInfo getLambdaBody() {
58 public String getSamDescriptor() {
62 public int getLambdaRefKind () {