author | iignatyev |
Fri, 11 Oct 2019 09:43:41 -0700 | |
changeset 58564 | 218a1a642c6f |
parent 50366 | 4d85990f9c4a |
permissions | -rw-r--r-- |
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
1 |
/* |
58564 | 2 |
* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved. |
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
4 |
* |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
8 |
* |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
13 |
* accompanied this code). |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
14 |
* |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
18 |
* |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
21 |
* questions. |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
22 |
*/ |
58564 | 23 |
|
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
24 |
package jit.graph; |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
25 |
|
58564 | 26 |
import java.lang.reflect.InvocationTargetException; |
27 |
import java.util.Vector; |
|
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
28 |
|
58564 | 29 |
class test4 extends test2 { |
30 |
private final int[] MethodID = {Globals.MethodID_Array[1], Globals.MethodID_Array[5], Globals.MethodID_Array[6]}; |
|
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
31 |
|
58564 | 32 |
// this method verifies that a child can make a call to its parent |
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
33 |
public void CallCallMe(Vector summation, Vector ID, Long functionDepth, Integer staticFunctionDepth) |
58564 | 34 |
throws InvocationTargetException { |
35 |
Globals.appendSumToSummationVector(MethodID[1], summation); |
|
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
36 |
|
58564 | 37 |
if (CGT.shouldFinish()) { |
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
38 |
return; |
58564 | 39 |
} |
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
40 |
|
58564 | 41 |
if (Globals.VERBOSE) { |
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
42 |
System.out.println("test4.CallCallMe"); |
58564 | 43 |
} |
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
44 |
|
58564 | 45 |
if ((functionDepth.longValue() <= 0) && (staticFunctionDepth.intValue() <= 0)) { |
46 |
return; |
|
47 |
} |
|
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
48 |
|
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
49 |
MethodData methodCallStr; |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
50 |
Long numFcalls; |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
51 |
Integer staticFcalls; |
58564 | 52 |
if (staticFunctionDepth.intValue() > 0) { |
53 |
numFcalls = functionDepth; |
|
54 |
staticFcalls = new Integer(staticFunctionDepth.intValue() - 1); |
|
55 |
methodCallStr = Globals.returnNextStaticMethod(MethodID[1]); |
|
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
56 |
|
58564 | 57 |
Globals.addFunctionIDToVector(methodCallStr.id, ID); |
58 |
} else { |
|
59 |
numFcalls = new Long(functionDepth.longValue() - 1); |
|
60 |
staticFcalls = staticFunctionDepth; |
|
61 |
Globals.addFunctionIDToVector(MethodID[0], ID); |
|
62 |
super.callMe(summation, ID, numFcalls, staticFcalls); |
|
63 |
return; |
|
64 |
} |
|
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
65 |
|
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
66 |
|
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
67 |
Globals.callMethod(methodCallStr, summation, ID, numFcalls, staticFcalls); |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
68 |
} |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
69 |
|
58564 | 70 |
// this method makes a Y fork in the method call structure |
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
71 |
public void callMe(Vector summation, Vector ID, Long functionDepth, Integer staticFunctionDepth) |
58564 | 72 |
throws InvocationTargetException { |
73 |
Globals.appendSumToSummationVector(MethodID[2], summation); |
|
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
74 |
|
58564 | 75 |
if (CGT.shouldFinish()) { |
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
76 |
return; |
58564 | 77 |
} |
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
78 |
|
58564 | 79 |
if (Globals.VERBOSE) { |
80 |
System.out.println("test4.callMe"); |
|
81 |
} |
|
82 |
||
83 |
if ((functionDepth.longValue() <= 0) && (staticFunctionDepth.intValue() <= 0)) { |
|
84 |
return; |
|
85 |
} |
|
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
86 |
|
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
87 |
MethodData methodCallStr; |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
88 |
Long numFcalls; |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
89 |
Integer staticFcalls; |
58564 | 90 |
if (staticFunctionDepth.intValue() > 0) { |
91 |
numFcalls = functionDepth; |
|
92 |
staticFcalls = new Integer(staticFunctionDepth.intValue() - 1); |
|
93 |
methodCallStr = Globals.returnNextStaticMethod(MethodID[2]); |
|
94 |
} else { |
|
95 |
long temp = functionDepth.longValue() - 2; |
|
96 |
numFcalls = new Long(temp / 2); |
|
97 |
staticFcalls = staticFunctionDepth; |
|
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
98 |
|
58564 | 99 |
if (Globals.VERBOSE) { |
100 |
System.out.println(" test4.callMe - Starting Branch 1"); |
|
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
101 |
} |
58564 | 102 |
methodCallStr = Globals.nextRandomMethod(); |
103 |
Globals.addFunctionIDToVector(methodCallStr.id, ID); |
|
104 |
Globals.callMethod(methodCallStr, summation, ID, numFcalls, staticFcalls); |
|
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
105 |
|
58564 | 106 |
if (CGT.shouldFinish()) { |
107 |
return; |
|
108 |
} |
|
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
109 |
|
58564 | 110 |
temp -= temp / 2; |
111 |
if (temp < 0) { |
|
112 |
if (Globals.VERBOSE) { |
|
113 |
System.out.println(" test4.callMe - Skipping Branch 2"); |
|
114 |
} |
|
115 |
return; |
|
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
116 |
} |
58564 | 117 |
if (Globals.VERBOSE) { |
118 |
System.out.println(" test4.callMe - Starting Branch 2"); |
|
119 |
} |
|
120 |
numFcalls = new Long(temp); |
|
121 |
methodCallStr = Globals.nextRandomMethod(); |
|
122 |
} |
|
50366
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
123 |
Globals.addFunctionIDToVector(methodCallStr.id, ID); |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
124 |
Globals.callMethod(methodCallStr, summation, ID, numFcalls, staticFcalls); |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
125 |
} |
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
126 |
|
4d85990f9c4a
8202812: [TESTBUG] Open source VM testbase compiler tests
iignatyev
parents:
diff
changeset
|
127 |
} |