Path: blob/master/jcl/src/java.base/share/classes/java/lang/invoke/Insert2Handle.java
12521 views
/*[INCLUDE-IF Sidecar17 & !OPENJDK_METHODHANDLES]*/1/*******************************************************************************2* Copyright (c) 2011, 2020 IBM Corp. and others3*4* This program and the accompanying materials are made available under5* the terms of the Eclipse Public License 2.0 which accompanies this6* distribution and is available at https://www.eclipse.org/legal/epl-2.0/7* or the Apache License, Version 2.0 which accompanies this distribution and8* is available at https://www.apache.org/licenses/LICENSE-2.0.9*10* This Source Code may also be made available under the following11* Secondary Licenses when the conditions for such availability set12* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU13* General Public License, version 2 with the GNU Classpath14* Exception [1] and GNU General Public License, version 2 with the15* OpenJDK Assembly Exception [2].16*17* [1] https://www.gnu.org/software/classpath/license.html18* [2] http://openjdk.java.net/legal/assembly-exception.html19*20* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception21*******************************************************************************/22package java.lang.invoke;2324final class Insert2Handle extends InsertHandle {25final Object value_1;26final Object value_2;2728Insert2Handle(MethodType type, MethodHandle next, int insertionIndex, Object values[]) {29super(type, next, insertionIndex, values);30this.value_1 = values[0];31this.value_2 = values[1];32}3334Insert2Handle(Insert2Handle originalHandle, MethodType nextType) {35super(originalHandle, nextType);36this.value_1 = originalHandle.value_1;37this.value_2 = originalHandle.value_2;38}3940@Override41MethodHandle cloneWithNewType(MethodType newType) {42return new Insert2Handle(this, newType);43}4445// {{{ JIT support46private static final ThunkTable _thunkTable = new ThunkTable();47protected final ThunkTable thunkTable(){ return _thunkTable; }4849protected final ThunkTuple computeThunks(Object arg) {50int[] info = (int[])arg;51return thunkTable().get(new ThunkKeyWithIntArray(ThunkKey.computeThunkableType(type()), info));52}5354@FrameIteratorSkip55private final int invokeExact_thunkArchetype_X(int argPlaceholder) {56if (ILGenMacros.isShareableThunk()) {57undoCustomizationLogic(next);58}59if (!ILGenMacros.isCustomThunk()) {60doCustomizationLogic();61}62return ILGenMacros.invokeExact_X(next, ILGenMacros.placeholder(63ILGenMacros.firstN(numPrefixArgs(), argPlaceholder),64value_1,65value_2,66ILGenMacros.lastN(numSuffixArgs(), argPlaceholder)));67}6869// }}} JIT support70}71727374