test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/BTreeGen.java
author jlahoda
Wed, 27 Nov 2019 09:00:01 +0100
changeset 59285 7799a51dbe30
parent 50154 d2d6bc39ea88
permissions -rw-r--r--
8231826: Implement javac changes for pattern matching for instanceof Reviewed-by: mcimadamore Contributed-by: brian.goetz@oracle.com, gavin.bierman@oracle.com, maurizio.cimadamore@oracle.com, srikanth.adayapalam@oracle.com, vicente.romero@oracle.com, jan.lahoda@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50154
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
     1
/*
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
     2
 * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
     4
 *
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
     7
 * published by the Free Software Foundation.
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
     8
 *
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    13
 * accompanied this code).
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    14
 *
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    18
 *
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    21
 * questions.
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    22
 */
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    23
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    24
package nsk.sysdict.share;
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    25
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    26
import java.io.*;
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    27
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    28
/**
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    29
 * This tools generates a binary tree of classes.
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    30
 * For more details, use:
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    31
 * <pre>
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    32
 *     java BTreeGen -help
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    33
 * </pre>
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    34
 */
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    35
public class BTreeGen {
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    36
    private static final int HEIGHT = 12;  // default tree height
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    37
    private static final int WEIGHT = 200; // as many longs in each node
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    38
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    39
    private static void explain(Object x) {
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    40
        System.err.println("# " + x);
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    41
    }
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    42
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    43
    public static void main(String args[]) {
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    44
        if (args.length < 1 || args[0].toLowerCase().startsWith("-h")) {
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    45
            explain("This tools generates a binary tree of classes:");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    46
            explain("");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    47
            explain("          BTree0");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    48
            explain("          /     \\");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    49
            explain("    BTree0L    BTree0R");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    50
            explain("     /   \\       /   \\");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    51
            explain("   ...   ...   ...   ...");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    52
            explain("");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    53
            explain("Use:");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    54
            explain("    java BTreeGen { $HEIGHT [ $WEIGHT ] | \"default\" }");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    55
            explain("");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    56
            explain("Generates:");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    57
            explain("    BTree.java class having HEIGHT constant.");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    58
            explain("    BTree0.java defining a classes tree.");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    59
            explain("");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    60
            explain("Here:");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    61
            explain("    HEIGHT and WEIGHT must be positive integers.");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    62
            explain("    Default HEIGHT is " + HEIGHT + " ("
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    63
                + ((1<<HEIGHT)-1) + " classes in a tree).");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    64
            explain("    Default WEIGHT is " + WEIGHT + ".");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    65
            System.exit(1);
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    66
        };
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    67
        int height = HEIGHT;
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    68
        int weight = WEIGHT;
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    69
        if (!args[0].toLowerCase().equals("default")) {
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    70
            height = Integer.parseInt(args[0]);
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    71
            if (args.length > 1)
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    72
                weight = Integer.parseInt(args[1]);
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    73
        };
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    74
        try {
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    75
            doit(height, weight);
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    76
        } catch (IOException exception) {
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    77
            exception.printStackTrace(System.err);
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    78
            System.exit(1);
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    79
        }
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    80
    }
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    81
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    82
    private static void doit(int height, int weight)
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    83
        throws FileNotFoundException
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    84
    {
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    85
        // Constant definition:
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    86
        PrintStream info;
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    87
        info = new PrintStream(new FileOutputStream(new File("BTreeInfo.java")));
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    88
        info.println("// This file is generated by: BTreeGen.java");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    89
        info.println("package nsk.sysdict.share;");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    90
        info.println("import nsk.share.*;");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    91
        info.println("public class BTreeInfo {");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    92
        info.println("    public static final int HEIGHT = " + height + ";");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    93
        info.println("    private static final int WEIGHT = " + weight + ";");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    94
        info.println("    public static final String rootName = \"BTree0\";");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    95
        info.println("    public static final Denotation nodesDenotation");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    96
        info.println("         = new TreeNodesDenotation(\"LR\");");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    97
        info.println("}");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    98
        info.close();
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
    99
        // Generate ta classes tree:
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   100
        PrintStream btree;
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   101
        btree = new PrintStream(new FileOutputStream(new File("BTree.java")));
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   102
        btree.println("// This file is generated by: BTreeGen.java");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   103
        btree.println("package nsk.sysdict.share;");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   104
        new BTreeGen(btree).generate(height,weight);
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   105
        btree.close();
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   106
    }
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   107
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   108
    private PrintStream stream;
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   109
    private BTreeGen(PrintStream stream) {
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   110
        this.stream = stream;
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   111
    }
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   112
    private void println(String s) {
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   113
        stream.println(s);
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   114
    }
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   115
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   116
    private void generate(int height, int weight) {
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   117
        if (height < 1)
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   118
            throw new IllegalArgumentException("bad height: " + height);
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   119
        if (weight < 1)
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   120
            throw new IllegalArgumentException("bad weight: " + weight);
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   121
        String basename = "BTree0";
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   122
        genClass(null,basename,weight);
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   123
        gen(basename,height,weight);
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   124
    }
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   125
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   126
    private void gen(String name, int height, int weight) {
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   127
        if (height == 1)
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   128
            return;
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   129
        String nameL = name + "L";
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   130
        String nameR = name + "R";
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   131
        genClass(name, nameL, weight);
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   132
        genClass(name, nameR, weight);
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   133
        gen(nameL, height-1, weight);
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   134
        gen(nameR, height-1, weight);
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   135
    }
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   136
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   137
    private void genClass(String baseName, String className, int weight) {
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   138
        println("class " + className
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   139
            + (baseName!=null? " extends " + baseName: "") + " {");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   140
        for (int w=1; w<=weight; w++)
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   141
            println("    static long fill_" + className + "_" + w + ";");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   142
        println("}");
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   143
    }
d2d6bc39ea88 8199252: [TESTBUG] Open source VM testbase system dictionary tests
mseledtsov
parents:
diff changeset
   144
}