< prev index next >

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

Print this page

  1 /*
  2  * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  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
  7  * published by the Free Software Foundation.  Oracle designates this
  8  * particular file as subject to the "Classpath" exception as provided
  9  * by Oracle in the LICENSE file that accompanied this code.
 10  *
 11  * This code is distributed in the hope that it will be useful, but WITHOUT
 12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 14  * version 2 for more details (a copy is included in the LICENSE file that
 15  * accompanied this code).
 16  *
 17  * You should have received a copy of the GNU General Public License version
 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.vm.annotation.Stable;
 29 import sun.invoke.util.ValueConversions;
 30 
 31 import java.util.ArrayList;
 32 import java.util.List;
 33 
 34 import static java.lang.invoke.LambdaForm.BasicType;
 35 import static java.lang.invoke.LambdaForm.BasicType.*;
 36 import static java.lang.invoke.LambdaForm.BasicType.V_TYPE_NUM;
 37 import static java.lang.invoke.LambdaForm.BasicType.V_TYPE_NUM;
 38 import static java.lang.invoke.LambdaForm.BasicType.V_TYPE_NUM;
 39 import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
 40 import static java.lang.invoke.MethodHandleNatives.Constants.*;
 41 import static java.lang.invoke.MethodHandleStatics.newInternalError;
 42 import static java.lang.invoke.MethodHandleStatics.uncaughtException;
 43 
 44 /**
 45  * The flavor of method handle which emulates an invoke instruction
 46  * on a predetermined argument.  The JVM dispatches to the correct method
 47  * when the handle is created, not when it is invoked.
 48  *
 49  * All bound arguments are encapsulated in dedicated species.
 50  */
 51 /*non-public*/
 52 abstract class BoundMethodHandle extends MethodHandle {
 53 
 54     /*non-public*/
 55     BoundMethodHandle(MethodType type, LambdaForm form) {
 56         super(type, form);
 57         assert(speciesData() == speciesDataFor(form));
 58     }

  1 /*
  2  * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  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
  7  * published by the Free Software Foundation.  Oracle designates this
  8  * particular file as subject to the "Classpath" exception as provided
  9  * by Oracle in the LICENSE file that accompanied this code.
 10  *
 11  * This code is distributed in the hope that it will be useful, but WITHOUT
 12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 14  * version 2 for more details (a copy is included in the LICENSE file that
 15  * accompanied this code).
 16  *
 17  * You should have received a copy of the GNU General Public License version
 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.vm.annotation.Stable;
 29 import sun.invoke.util.ValueConversions;
 30 
 31 import java.util.ArrayList;
 32 import java.util.List;
 33 
 34 import static java.lang.invoke.LambdaForm.BasicType;
 35 import static java.lang.invoke.LambdaForm.BasicType.*;
 36 import static java.lang.invoke.LambdaForm.BasicType.V_TYPE_NUM;


 37 import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
 38 import static java.lang.invoke.MethodHandleNatives.Constants.*;
 39 import static java.lang.invoke.MethodHandleStatics.newInternalError;
 40 import static java.lang.invoke.MethodHandleStatics.uncaughtException;
 41 
 42 /**
 43  * The flavor of method handle which emulates an invoke instruction
 44  * on a predetermined argument.  The JVM dispatches to the correct method
 45  * when the handle is created, not when it is invoked.
 46  *
 47  * All bound arguments are encapsulated in dedicated species.
 48  */
 49 /*non-public*/
 50 abstract class BoundMethodHandle extends MethodHandle {
 51 
 52     /*non-public*/
 53     BoundMethodHandle(MethodType type, LambdaForm form) {
 54         super(type, form);
 55         assert(speciesData() == speciesDataFor(form));
 56     }
< prev index next >