13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 package jdk.test.lib.jittester.factories;
25
26 import jdk.test.lib.Pair;
27 import jdk.test.lib.jittester.IRNode;
28 import jdk.test.lib.jittester.ProductionFailedException;
29 import jdk.test.lib.jittester.SymbolTable;
30 import jdk.test.lib.jittester.TernaryOperator;
31 import jdk.test.lib.jittester.Type;
32 import jdk.test.lib.jittester.TypeList;
33 import jdk.test.lib.jittester.TypeUtil;
34 import jdk.test.lib.jittester.types.TypeKlass;
35 import jdk.test.lib.jittester.types.TypeBoolean;
36 import jdk.test.lib.jittester.utils.PseudoRandom;
37
38 class TernaryOperatorFactory extends OperatorFactory {
39 protected final Type resultType;
40 protected final TypeKlass ownerClass;
41
42 TernaryOperatorFactory(long complexityLimit, int operatorLimit, TypeKlass ownerClass,
43 Type resultType, boolean exceptionSafe, boolean noconsts) {
44 super(2, complexityLimit, operatorLimit, exceptionSafe, noconsts);
45 this.resultType = resultType;
46 this.ownerClass = ownerClass;
47 }
48
49 private Pair<Type, Type> generateTypes() {
50 Pair<Type, Type> types = new Pair<>(resultType, PseudoRandom.randomElement(
51 TypeUtil.getImplicitlyCastable(TypeList.getAll(), resultType)));
52 if (PseudoRandom.randomBoolean())
53 types = new Pair<>(types.second, types.first);
|
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 package jdk.test.lib.jittester.factories;
25
26 import jdk.test.lib.Pair;
27 import jdk.test.lib.jittester.IRNode;
28 import jdk.test.lib.jittester.ProductionFailedException;
29 import jdk.test.lib.jittester.SymbolTable;
30 import jdk.test.lib.jittester.TernaryOperator;
31 import jdk.test.lib.jittester.Type;
32 import jdk.test.lib.jittester.TypeList;
33 import jdk.test.lib.jittester.utils.TypeUtil;
34 import jdk.test.lib.jittester.types.TypeKlass;
35 import jdk.test.lib.jittester.types.TypeBoolean;
36 import jdk.test.lib.jittester.utils.PseudoRandom;
37
38 class TernaryOperatorFactory extends OperatorFactory {
39 protected final Type resultType;
40 protected final TypeKlass ownerClass;
41
42 TernaryOperatorFactory(long complexityLimit, int operatorLimit, TypeKlass ownerClass,
43 Type resultType, boolean exceptionSafe, boolean noconsts) {
44 super(2, complexityLimit, operatorLimit, exceptionSafe, noconsts);
45 this.resultType = resultType;
46 this.ownerClass = ownerClass;
47 }
48
49 private Pair<Type, Type> generateTypes() {
50 Pair<Type, Type> types = new Pair<>(resultType, PseudoRandom.randomElement(
51 TypeUtil.getImplicitlyCastable(TypeList.getAll(), resultType)));
52 if (PseudoRandom.randomBoolean())
53 types = new Pair<>(types.second, types.first);
|