test/hotspot/jtreg/serviceability/sa/TestCpoolForInvokeDynamic.java
author jgeorge
Fri, 01 Dec 2017 18:19:39 +0530
changeset 48181 61a14b5cb1c6
parent 47216 71c04702a3d5
child 50791 b1e90a8a876c
permissions -rw-r--r--
8191538: SA: tests for clhsdb commands: vmstructsdump, field, symboltable and symbol Summary: Create tests for the clhsdb commands: vmstructsdump, field, symboltable and symbol Reviewed-by: sspitsyn, sballal
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
42087
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
     1
/*
43949
907b469266c8 8174798: Mis-merge left serviceability/sa/TestCpoolForInvokeDynamic.java ignored
dholmes
parents: 42646
diff changeset
     2
 * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
42087
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
     4
 *
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
     7
 * published by the Free Software Foundation.
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
     8
 *
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    13
 * accompanied this code).
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    14
 *
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    18
 *
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    21
 * questions.
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    22
 */
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    23
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    24
import java.util.ArrayList;
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    25
import java.util.List;
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    26
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    27
import sun.jvm.hotspot.HotSpotAgent;
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    28
import sun.jvm.hotspot.utilities.SystemDictionaryHelper;
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    29
import sun.jvm.hotspot.oops.InstanceKlass;
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    30
import sun.jvm.hotspot.debugger.*;
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    31
import sun.jvm.hotspot.oops.Method;
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    32
import sun.jvm.hotspot.utilities.MethodArray;
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    33
import sun.jvm.hotspot.ui.classbrowser.HTMLGenerator;
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    34
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    35
import jdk.test.lib.apps.LingeredApp;
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    36
import jdk.test.lib.JDKToolLauncher;
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    37
import jdk.test.lib.JDKToolFinder;
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    38
import jdk.test.lib.Platform;
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    39
import jdk.test.lib.process.ProcessTools;
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    40
import jdk.test.lib.process.OutputAnalyzer;
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    41
import jdk.test.lib.Utils;
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    42
import jdk.test.lib.Asserts;
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    43
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    44
/*
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    45
 * @test
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    46
 * @library /test/lib
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    47
 * @requires os.family != "mac"
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    48
 * @modules java.base/jdk.internal.misc
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    49
 *          jdk.hotspot.agent/sun.jvm.hotspot
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    50
 *          jdk.hotspot.agent/sun.jvm.hotspot.utilities
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    51
 *          jdk.hotspot.agent/sun.jvm.hotspot.oops
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    52
 *          jdk.hotspot.agent/sun.jvm.hotspot.debugger
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    53
 *          jdk.hotspot.agent/sun.jvm.hotspot.ui.classbrowser
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    54
 * @run main/othervm TestCpoolForInvokeDynamic
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    55
 */
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    56
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    57
public class TestCpoolForInvokeDynamic {
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    58
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    59
    private static LingeredAppWithInvokeDynamic theApp = null;
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    60
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    61
    private static void printBytecodes(String pid,
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    62
                                       String[] instanceKlassNames) {
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    63
        HotSpotAgent agent = new HotSpotAgent();
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    64
        try {
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    65
            agent.attach(Integer.parseInt(pid));
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    66
        }
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    67
        catch (DebuggerException e) {
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    68
            System.out.println(e.getMessage());
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    69
            System.err.println("Unable to connect to process ID: " + pid);
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    70
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    71
            agent.detach();
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    72
            e.printStackTrace();
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    73
        }
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    74
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    75
        for (String instanceKlassName : instanceKlassNames) {
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    76
            InstanceKlass iKlass = SystemDictionaryHelper.findInstanceKlass(instanceKlassName);
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    77
            MethodArray methods = iKlass.getMethods();
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    78
            for (int i = 0; i < methods.length(); i++) {
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    79
                Method m = methods.at(i);
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    80
                System.out.println("Method: " + m.getName().asString() +
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    81
                                   " in instance klass: " + instanceKlassName);
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    82
                HTMLGenerator gen = new HTMLGenerator(false);
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    83
                System.out.println(gen.genHTML(m));
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    84
            }
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    85
        }
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    86
        agent.detach();
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    87
    }
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    88
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    89
    private static void createAnotherToAttach(
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    90
                            String[] instanceKlassNames,
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    91
                            long lingeredAppPid) throws Exception {
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    92
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    93
        String[] toolArgs = {
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    94
            "--add-modules=jdk.hotspot.agent",
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    95
            "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED",
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    96
            "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.utilities=ALL-UNNAMED",
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    97
            "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.oops=ALL-UNNAMED",
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    98
            "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.debugger=ALL-UNNAMED",
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    99
            "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.ui.classbrowser=ALL-UNNAMED",
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   100
            "TestCpoolForInvokeDynamic",
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   101
            Long.toString(lingeredAppPid)
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   102
        };
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   103
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   104
        // Start a new process to attach to the lingered app
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   105
        ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(toolArgs);
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   106
        OutputAnalyzer SAOutput = ProcessTools.executeProcess(processBuilder);
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   107
        SAOutput.shouldHaveExitValue(0);
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   108
        System.out.println(SAOutput.getOutput());
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   109
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   110
        SAOutput.shouldContain("invokedynamic");
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   111
        SAOutput.shouldContain("Name and Type");
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   112
        SAOutput.shouldContain("run:()Ljava.lang.Runnable");
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   113
        SAOutput.shouldContain("compare:()LTestComparator");
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   114
        SAOutput.shouldNotContain("Corrupted constant pool");
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   115
    }
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   116
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   117
    public static void main (String... args) throws Exception {
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   118
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   119
        String[] instanceKlassNames = new String[] {
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   120
                                          "LingeredAppWithInvokeDynamic"
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   121
                                      };
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   122
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   123
        if (!Platform.shouldSAAttach()) {
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   124
            System.out.println(
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   125
               "SA attach not expected to work - test skipped.");
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   126
            return;
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   127
        }
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   128
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   129
        if (args == null || args.length == 0) {
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   130
            try {
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   131
                List<String> vmArgs = new ArrayList<String>();
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   132
                vmArgs.add("-XX:+UsePerfData");
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   133
                vmArgs.addAll(Utils.getVmOptions());
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   134
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   135
                theApp = new LingeredAppWithInvokeDynamic();
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   136
                LingeredApp.startApp(vmArgs, theApp);
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   137
                createAnotherToAttach(instanceKlassNames,
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   138
                                      theApp.getPid());
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   139
            } finally {
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   140
                LingeredApp.stopApp(theApp);
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   141
            }
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   142
        } else {
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   143
            printBytecodes(args[0], instanceKlassNames);
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   144
        }
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   145
    }
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
   146
}