Path: blob/master/jcl/src/java.base/share/classes/java/lang/invoke/Insert3Handle.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 Insert3Handle extends InsertHandle {25final Object value_1;26final Object value_2;27final Object value_3;2829Insert3Handle(MethodType type, MethodHandle next, int insertionIndex, Object values[]) {30super(type, next, insertionIndex, values);31this.value_1 = values[0];32this.value_2 = values[1];33this.value_3 = values[2];34}3536Insert3Handle(Insert3Handle originalHandle, MethodType nextType) {37super(originalHandle, nextType);38this.value_1 = originalHandle.value_1;39this.value_2 = originalHandle.value_2;40this.value_3 = originalHandle.value_3;41}4243@Override44MethodHandle cloneWithNewType(MethodType newType) {45return new Insert3Handle(this, newType);46}4748// {{{ JIT support49private static final ThunkTable _thunkTable = new ThunkTable();50protected final ThunkTable thunkTable(){ return _thunkTable; }5152protected final ThunkTuple computeThunks(Object arg) {53int[] info = (int[])arg;54return thunkTable().get(new ThunkKeyWithIntArray(ThunkKey.computeThunkableType(type()), info));55}5657@FrameIteratorSkip58private final int invokeExact_thunkArchetype_X(int argPlaceholder) {59if (ILGenMacros.isShareableThunk()) {60undoCustomizationLogic(next);61}62if (!ILGenMacros.isCustomThunk()) {63doCustomizationLogic();64}65return ILGenMacros.invokeExact_X(next, ILGenMacros.placeholder(66ILGenMacros.firstN(numPrefixArgs(), argPlaceholder),67value_1,68value_2,69value_3,70ILGenMacros.lastN(numSuffixArgs(), argPlaceholder)));71}7273// }}} JIT support74}75767778