Path: blob/master/test/hotspot/jtreg/vmTestbase/jit/graph/test2.java
40948 views
/*1* Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223package jit.graph;2425import nsk.share.TestFailure;2627import java.lang.reflect.InvocationTargetException;28import java.util.Vector;2930class test2 {31private final int[] MethodID = {Globals.MethodID_Array[1], Globals.MethodID_Array[2]};3233public void CallCallMe(Vector summation, Vector ID, Long functionDepth, Integer staticFunctionDepth)34throws InvocationTargetException {35Globals.appendSumToSummationVector(MethodID[1], summation);3637if (CGT.shouldFinish()) {38return;39}4041if (Globals.VERBOSE) {42System.out.println("test2.CallCallMe");43}4445if ((functionDepth.longValue() <= 0) && (staticFunctionDepth.intValue() <= 0)) {46return;47}4849MethodData methodCallStr;50Long numFcalls;51Integer staticFcalls;52if (staticFunctionDepth.intValue() > 0) {53numFcalls = functionDepth;54staticFcalls = Integer.valueOf(staticFunctionDepth.intValue() - 1);55methodCallStr = Globals.returnNextStaticMethod(MethodID[1]);5657Globals.addFunctionIDToVector(methodCallStr.id, ID);58} else {59numFcalls = Long.valueOf(functionDepth.longValue() - 1);60staticFcalls = staticFunctionDepth;61Globals.addFunctionIDToVector(MethodID[0], ID);62callMe(summation, ID, numFcalls, staticFcalls);63return;64}656667try {68methodCallStr.nextMethod.invoke(methodCallStr.instance,69new Object[]{summation, ID, numFcalls, staticFcalls});70} catch (IllegalAccessException iax) {71throw new TestFailure("Illegal Access Exception");72}73}7475public void callMe(Vector summation, Vector ID, Long functionDepth, Integer staticFunctionDepth)76throws InvocationTargetException {77Globals.appendSumToSummationVector(MethodID[0], summation);7879if (CGT.shouldFinish()) {80return;81}8283if (Globals.VERBOSE) {84System.out.println("test2.callMe");85}8687if ((functionDepth.longValue() <= 0) && (staticFunctionDepth.intValue() <= 0)) {88return;89}9091MethodData methodCallStr;92Long numFcalls;93Integer staticFcalls;94if (staticFunctionDepth.intValue() > 0) {95numFcalls = functionDepth;96staticFcalls = Integer.valueOf(staticFunctionDepth.intValue() - 1);97methodCallStr = Globals.returnNextStaticMethod(MethodID[0]);9899} else {100numFcalls = Long.valueOf(functionDepth.longValue() - 1);101staticFcalls = staticFunctionDepth;102methodCallStr = Globals.nextRandomMethod();103}104105Globals.addFunctionIDToVector(methodCallStr.id, ID);106107108try {109methodCallStr.nextMethod.invoke(methodCallStr.instance,110new Object[]{summation, ID, numFcalls, staticFcalls});111} catch (IllegalAccessException iax) {112throw new TestFailure("Illegal Access Exception");113}114115}116}117118119