/* * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package jit.graph; import java.util.*; import nsk.share.TestFailure; import nsk.share.test.StressOptions; class CGT extends Thread { private static StressOptions stressOptions = new StressOptions(); private final static String version = "1.0"; private static String ClistPath = ""; private static long finishTime; public CGT( String[] args ) { parse (args); Globals.initialize(ClistPath); outputStats (args); } public static void main( String[] args ) { stressOptions.parseCommandLine(args); CGT jnimt = new CGT(args); jnimt.start(); } public void outputStats( String[] args ) { System.out.println("CGT command line options:"); for (int i=0; i < args.length; ++i ) System.out.println("# " + args[i] ); System.out.println(); System.out.println("CGT parameters"); System.out.println("Seed: " +Globals.RANDOM_SEED); System.out.println("Number of Threads: " +Globals.NUM_THREADS); System.out.println("Number of Random Loop iterations: " + Globals.RANDOM_LOOP); System.out.println("Number of Static Loop iterations: " + Globals.STATIC_LOOP); System.out.println("Max number of Methods in the Graph: " + Globals.NUM_TEST_CLASSES); System.out.println("Verbose function calls: " + Globals.VERBOSE); System.out.println(); } public void run() { finishTime = System.currentTimeMillis() + stressOptions.getTime() * 1000; for (int i = 0; i< Globals.NUM_THREADS; i++) new CGTThread("CGT Thread " + i).start(); } public static boolean shouldFinish() { return System.currentTimeMillis() >= finishTime; } public void parse (String args[]) { for (int i = 0; i required, argument so program can find classes"); } public void version () { throw new TestFailure("CGT version = " + version); } }