test/hotspot/jtreg/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java
author chegar
Thu, 17 Oct 2019 20:54:25 +0100
branchdatagramsocketimpl-branch
changeset 58679 9c3209ff7550
parent 58678 9cf78a70fa4f
parent 55298 1fe17d2be502
permissions -rw-r--r--
datagramsocketimpl-branch: merge with default
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
     1
/*
55206
2fe2063fe567 8225019: Update JVMCI
kvn
parents: 47216
diff changeset
     2
 * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
     4
 *
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
     7
 * published by the Free Software Foundation.
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
     8
 *
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    13
 * accompanied this code).
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    14
 *
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    18
 *
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    21
 * questions.
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    22
 */
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    23
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    24
/*
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    25
 * @test
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    26
 * @bug 8136421
42607
acd91f1875d4 8170227: use vm.jvmci property in compiler/jvmci tests
iignatyev
parents: 41325
diff changeset
    27
 * @requires vm.jvmci
40631
ed82623d7831 8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents: 40362
diff changeset
    28
 * @library / /test/lib
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 35148
diff changeset
    29
 * @library ../common/patches
38152
80e5da81fb2c 8154258: [TESTBUG] Various serviceability tests fail compilation
dsamersoff
parents: 36508
diff changeset
    30
 * @modules java.base/jdk.internal.misc
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 35148
diff changeset
    31
 * @modules java.base/jdk.internal.org.objectweb.asm
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 35148
diff changeset
    32
 *          java.base/jdk.internal.org.objectweb.asm.tree
43972
1ade39b8381b 8174879: Rename jdk.vm.ci to jdk.internal.vm.ci
kvn
parents: 42607
diff changeset
    33
 *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
1ade39b8381b 8174879: Rename jdk.vm.ci to jdk.internal.vm.ci
kvn
parents: 42607
diff changeset
    34
 *          jdk.internal.vm.ci/jdk.vm.ci.code
1ade39b8381b 8174879: Rename jdk.vm.ci to jdk.internal.vm.ci
kvn
parents: 42607
diff changeset
    35
 *          jdk.internal.vm.ci/jdk.vm.ci.meta
1ade39b8381b 8174879: Rename jdk.vm.ci to jdk.internal.vm.ci
kvn
parents: 42607
diff changeset
    36
 *          jdk.internal.vm.ci/jdk.vm.ci.runtime
1ade39b8381b 8174879: Rename jdk.vm.ci to jdk.internal.vm.ci
kvn
parents: 42607
diff changeset
    37
 * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 35148
diff changeset
    38
 * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
55206
2fe2063fe567 8225019: Update JVMCI
kvn
parents: 47216
diff changeset
    39
 *                   -XX:-UseJVMCICompiler
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 35148
diff changeset
    40
 *                   compiler.jvmci.compilerToVM.FindUniqueConcreteMethodTest
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    41
 */
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    42
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    43
package compiler.jvmci.compilerToVM;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    44
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 39291
diff changeset
    45
import compiler.jvmci.common.CTVMUtilities;
40362
94addd7cfa10 8162477: [JVMCI] assert(wf.check_method_context(ctxk, m)) failed: proper context
never
parents: 40059
diff changeset
    46
import compiler.jvmci.common.testcases.DuplicateSimpleSingleImplementerInterface;
94addd7cfa10 8162477: [JVMCI] assert(wf.check_method_context(ctxk, m)) failed: proper context
never
parents: 40059
diff changeset
    47
import compiler.jvmci.common.testcases.SimpleSingleImplementerInterface;
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    48
import compiler.jvmci.common.testcases.MultipleImplementer1;
40362
94addd7cfa10 8162477: [JVMCI] assert(wf.check_method_context(ctxk, m)) failed: proper context
never
parents: 40059
diff changeset
    49
import compiler.jvmci.common.testcases.MultipleSuperImplementers;
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    50
import compiler.jvmci.common.testcases.SingleImplementer;
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 39291
diff changeset
    51
import compiler.jvmci.common.testcases.SingleImplementerInterface;
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    52
import compiler.jvmci.common.testcases.SingleSubclass;
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 39291
diff changeset
    53
import jdk.test.lib.Asserts;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 39291
diff changeset
    54
import jdk.test.lib.Utils;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 39291
diff changeset
    55
import jdk.vm.ci.hotspot.CompilerToVMHelper;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 39291
diff changeset
    56
import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 39291
diff changeset
    57
import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 39291
diff changeset
    58
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    59
import java.lang.reflect.Method;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    60
import java.util.HashSet;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    61
import java.util.Set;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    62
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    63
public class FindUniqueConcreteMethodTest {
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    64
    public static void main(String args[]) {
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    65
        FindUniqueConcreteMethodTest test = new FindUniqueConcreteMethodTest();
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    66
        try {
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    67
            for (TestCase tcase : createTestCases()) {
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    68
                test.runTest(tcase);
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    69
            }
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    70
        } catch (NoSuchMethodException e) {
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    71
            throw new Error("TEST BUG: can't find method", e);
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    72
        }
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    73
    }
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    74
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    75
    private static Set<TestCase> createTestCases() {
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    76
        Set<TestCase> result = new HashSet<>();
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    77
        // a public method
41325
050786119cb7 8165434: [JVMCI] remove uses of setAccessible
dnsimon
parents: 40631
diff changeset
    78
        result.add(new TestCase(true, SingleSubclass.class, "usualMethod"));
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    79
        // overriden method
41325
050786119cb7 8165434: [JVMCI] remove uses of setAccessible
dnsimon
parents: 40631
diff changeset
    80
        result.add(new TestCase(true, SingleSubclass.class, "overridenMethod"));
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    81
        // private method
55298
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
    82
        result.add(new TestCase(InternalError.class, SingleSubclass.class, "privateMethod"));
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    83
        // protected method
41325
050786119cb7 8165434: [JVMCI] remove uses of setAccessible
dnsimon
parents: 40631
diff changeset
    84
        result.add(new TestCase(true, SingleSubclass.class, "protectedMethod"));
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    85
        // default(package-private) method
41325
050786119cb7 8165434: [JVMCI] remove uses of setAccessible
dnsimon
parents: 40631
diff changeset
    86
        result.add(new TestCase(true, SingleSubclass.class, "defaultAccessMethod"));
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    87
        // default interface method redefined in implementer
41325
050786119cb7 8165434: [JVMCI] remove uses of setAccessible
dnsimon
parents: 40631
diff changeset
    88
        result.add(new TestCase(true, MultipleImplementer1.class, "defaultMethod"));
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    89
        // interface method
41325
050786119cb7 8165434: [JVMCI] remove uses of setAccessible
dnsimon
parents: 40631
diff changeset
    90
        result.add(new TestCase(true, MultipleImplementer1.class, "testMethod"));
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    91
        // default interface method not redefined in implementer
41325
050786119cb7 8165434: [JVMCI] remove uses of setAccessible
dnsimon
parents: 40631
diff changeset
    92
        // result.add(new TestCase(true, SingleImplementer.class,
050786119cb7 8165434: [JVMCI] remove uses of setAccessible
dnsimon
parents: 40631
diff changeset
    93
        //                         SingleImplementerInterface.class, "defaultMethod"));
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    94
        // static method
55298
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
    95
        result.add(new TestCase(InternalError.class, SingleSubclass.class, "staticMethod"));
40362
94addd7cfa10 8162477: [JVMCI] assert(wf.check_method_context(ctxk, m)) failed: proper context
never
parents: 40059
diff changeset
    96
        // interface method
94addd7cfa10 8162477: [JVMCI] assert(wf.check_method_context(ctxk, m)) failed: proper context
never
parents: 40059
diff changeset
    97
        result.add(new TestCase(false, MultipleSuperImplementers.class,
41325
050786119cb7 8165434: [JVMCI] remove uses of setAccessible
dnsimon
parents: 40631
diff changeset
    98
                                DuplicateSimpleSingleImplementerInterface.class, "interfaceMethod"));
40362
94addd7cfa10 8162477: [JVMCI] assert(wf.check_method_context(ctxk, m)) failed: proper context
never
parents: 40059
diff changeset
    99
        result.add(new TestCase(false, MultipleSuperImplementers.class,
41325
050786119cb7 8165434: [JVMCI] remove uses of setAccessible
dnsimon
parents: 40631
diff changeset
   100
                                SimpleSingleImplementerInterface.class, "interfaceMethod"));
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   101
        return result;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   102
    }
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   103
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   104
    private void runTest(TestCase tcase) throws NoSuchMethodException {
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   105
        System.out.println(tcase);
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   106
        Method method = tcase.holder.getDeclaredMethod(tcase.methodName);
41325
050786119cb7 8165434: [JVMCI] remove uses of setAccessible
dnsimon
parents: 40631
diff changeset
   107
        HotSpotResolvedJavaMethod testMethod = CTVMUtilities.getResolvedMethod(method);
050786119cb7 8165434: [JVMCI] remove uses of setAccessible
dnsimon
parents: 40631
diff changeset
   108
33632
038347770a9e 8139170: JVMCI refresh
twisti
parents: 33160
diff changeset
   109
        HotSpotResolvedObjectType resolvedType = CompilerToVMHelper
46972
3e88de95fccf 8186459: [JVMCI] ClassNotFoundException thrown by CompilerToVM.lookupType() should be converted to a LinkageError
dnsimon
parents: 44836
diff changeset
   110
                .lookupTypeHelper(Utils.toJVMTypeSignature(tcase.receiver), getClass(),
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   111
                /* resolve = */ true);
55298
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   112
        if (tcase.exception != null) {
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   113
            try {
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   114
                HotSpotResolvedJavaMethod concreteMethod = CompilerToVMHelper
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   115
                        .findUniqueConcreteMethod(resolvedType, testMethod);
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   116
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   117
                Asserts.fail("Exception " + tcase.exception.getName() + " not thrown for " + tcase.methodName);
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   118
            } catch (Throwable t) {
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   119
                Asserts.assertEQ(t.getClass(), tcase.exception, "Wrong exception thrown for " + tcase.methodName);
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   120
            }
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   121
        } else {
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   122
            HotSpotResolvedJavaMethod concreteMethod = CompilerToVMHelper
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   123
                    .findUniqueConcreteMethod(resolvedType, testMethod);
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   124
            Asserts.assertEQ(concreteMethod, tcase.isPositive ? testMethod : null,
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   125
                    "Unexpected concrete method for " + tcase.methodName);
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   126
        }
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   127
    }
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   128
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   129
    private static class TestCase {
33632
038347770a9e 8139170: JVMCI refresh
twisti
parents: 33160
diff changeset
   130
        public final Class<?> receiver;
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   131
        public final Class<?> holder;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   132
        public final String methodName;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   133
        public final boolean isPositive;
55298
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   134
        public final Class<?> exception;
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   135
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   136
        public TestCase(boolean isPositive, Class<?> clazz, Class<?> holder,
55298
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   137
                        String methodName, Class<?> exception) {
33632
038347770a9e 8139170: JVMCI refresh
twisti
parents: 33160
diff changeset
   138
            this.receiver = clazz;
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   139
            this.methodName = methodName;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   140
            this.isPositive = isPositive;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   141
            this.holder = holder;
55298
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   142
            this.exception = exception;
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   143
        }
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   144
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   145
        public TestCase(boolean isPositive, Class<?> clazz, Class<?> holder,
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   146
                        String methodName) {
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   147
            this(isPositive, clazz, holder, methodName, null);
40362
94addd7cfa10 8162477: [JVMCI] assert(wf.check_method_context(ctxk, m)) failed: proper context
never
parents: 40059
diff changeset
   148
        }
94addd7cfa10 8162477: [JVMCI] assert(wf.check_method_context(ctxk, m)) failed: proper context
never
parents: 40059
diff changeset
   149
41325
050786119cb7 8165434: [JVMCI] remove uses of setAccessible
dnsimon
parents: 40631
diff changeset
   150
        public TestCase(boolean isPositive, Class<?> clazz, String methodName) {
55298
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   151
            this(isPositive, clazz, clazz, methodName, null);
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   152
        }
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   153
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   154
        public TestCase(Class<?> exception, Class<?> clazz, String methodName) {
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   155
            this(false, clazz, clazz, methodName, exception);
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   156
        }
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   157
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   158
        @Override
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   159
        public String toString() {
55298
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   160
            return String.format("CASE: receiver=%s, holder=%s, method=%s, isPositive=%s, exception=%s",
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   161
                                 receiver.getName(), holder.getName(), methodName, isPositive,
1fe17d2be502 8223050: JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods
dlong
parents: 55206
diff changeset
   162
                                 exception == null ? "<none>" : exception.getName());
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   163
        }
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   164
    }
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   165
}