hotspot/test/runtime/7116786/Test7116786.java
author kamg
Mon, 06 Aug 2012 15:54:45 -0400
changeset 13476 471200fb94fd
child 16589 0610b22182fb
permissions -rw-r--r--
7116786: RFE: Detailed information on VerifyErrors Summary: Provide additional detail in VerifyError messages Reviewed-by: sspitsyn, acorn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
     1
/*
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
     2
 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
     4
 *
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
     7
 * published by the Free Software Foundation.
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
     8
 *
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    13
 * accompanied this code).
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    14
 *
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    18
 *
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    21
 * questions.
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    22
 *
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    23
 */
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    24
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    25
/*
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    26
 * @test Test7116786
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    27
 * @summary verify that VerifyError messages are as expected
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    28
 * @library testcases.jar
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    29
 * @run main/othervm -Xverify:all Test7116786
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    30
 */
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    31
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    32
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    33
/**
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    34
 * This class contains information regarding when a VerifyError is thrown
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    35
 * in the verifier.  Most of the data is informational-only, and can be
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    36
 * used to track down where and why VerifyErrors are thrown.  As such it
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    37
 * is possible the information may go out-of-date.
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    38
 *
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    39
 * The only fields used for the purpose of testing is the 'caseName' and
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    40
 * the 'message'.  The 'caseName' corresponds to a classfile which exhibits
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    41
 * the VerifyError, and the 'message' is a regular expression which we expect
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    42
 * to match the verify error message.  If the 'message' doesn't match what
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    43
 * we expect, it warrents investigation to see if we are still triggering
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    44
 * the VerifyError that we expect.  It could simply just be that the message
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    45
 * changed, which is fine.
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    46
 *
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    47
 * Some cases are not testable, either because the code is probably unreachable
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    48
 * or the test classfile would be too onerous to create.  These cases are
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    49
 * marked with 'testable' == false, and the test runner will skip them.
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    50
 */
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    51
class Case {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    52
    private String caseName;    // Name of the case
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    53
    private String file;        // Source file where VerifyError is thrown
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    54
    private String location;    // enclosing function or switch case
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    55
    private String description; // What causes this VerifyError
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    56
    private String message;     // The VerifyError message used.
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    57
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    58
    private boolean testable;   // Whether this case is testable or not.
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    59
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    60
    public Case(String caseName, String file, boolean testable,
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    61
                String location, String description, String message) {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    62
        this.caseName = caseName;
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    63
        this.file = file;
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    64
        this.testable = testable;
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    65
        this.location = location;
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    66
        this.description = description;
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    67
        this.message = message;
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    68
    }
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    69
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    70
    String getCaseName() { return this.caseName; }
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    71
    String getFile() { return this.file; }
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    72
    String getLocation() { return this.location; }
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    73
    String getDescription() { return this.description; }
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    74
    String getMessage() { return this.message; }
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    75
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    76
    boolean isTestable() { return this.testable; }
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    77
}
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    78
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    79
/**
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    80
 * These are the locations in the source code where VerifyErrors are thrown
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    81
 * as of today, 2012/07/18.  These may change as the verification code is
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    82
 * modified, which is ok.  This test is trying to provide coverage for all
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    83
 * VerifyErrors (just to make sure there are no crashes) and it's probably
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    84
 * not necessary to update it every time the VM changes.
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    85
 */
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    86
class VerifyErrorCases {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    87
    public static final Case[] cases = {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    88
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    89
        new Case("case00", "stackMapFrame.cpp", true, "pop_stack_ex",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    90
                 "stack underflow",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    91
                 "Operand stack underflow"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    92
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    93
        new Case("case01", "stackMapFrame.cpp", true, "pop_stack_ex",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    94
                 "stack pop not assignable to expected",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    95
                 "Bad type on operand stack"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    96
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    97
        new Case("case02", "stackMapFrame.cpp", true, "get_local",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    98
                 "local index out-of-bounds",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
    99
                 "Local variable table overflow"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   100
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   101
        new Case("case03", "stackMapFrame.cpp", true, "get_local",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   102
                 "local not assignable to expected",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   103
                 "Bad local variable type"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   104
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   105
        new Case("case04", "stackMapFrame.cpp", true, "get_local_2",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   106
                 "local index out-of-bounds [type2]",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   107
                 "get long/double overflows locals"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   108
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   109
        new Case("case05", "stackMapFrame.cpp", true, "get_local_2",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   110
                 "local not assignabled to expected [type2]",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   111
                 "Bad local variable type"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   112
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   113
        /* Unreachable: Can't split long/double on stack */
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   114
        new Case("case06", "stackMapFrame.cpp", false, "get_local_2",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   115
                 "local second-word not assignabled to expected",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   116
                 "Bad local variable type"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   117
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   118
        new Case("case07", "stackMapFrame.cpp", true, "set_local",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   119
                 "local index out-of-bounds",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   120
                 "Local variable table overflow"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   121
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   122
        new Case("case08", "stackMapFrame.cpp", true, "set_local_2",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   123
                 "local index out-of-bounds [type2]",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   124
                 "Local variable table overflow"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   125
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   126
        new Case("case09", "stackMapFrame.hpp", true, "push_stack",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   127
                 "stack overflow",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   128
                 "Operand stack overflow"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   129
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   130
        new Case("case10", "stackMapFrame.hpp", true, "push_stack_2",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   131
                 "stack overflow [type2]",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   132
                 "Operand stack overflow"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   133
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   134
        new Case("case11", "stackMapFrame.hpp", true, "pop_stack",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   135
                 "stack underflow",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   136
                 "Operand stack underflow"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   137
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   138
        new Case("case12", "stackMapTable.cpp", true, "StackMapTable ctor",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   139
                 "stackmap offset beyond code size",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   140
                 "StackMapTable error: bad offset"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   141
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   142
        new Case("case13", "stackMapTable.cpp", true, "match_stackmap",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   143
                 "no stackmap frame at expected location",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   144
                 "Expecting a stackmap frame at branch target "),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   145
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   146
        new Case("case14", "stackMapTable.cpp", true, "check_jump_target",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   147
                 "no stackmap frame at jump location or bad jump",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   148
                 "Inconsistent stackmap frames at branch target "),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   149
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   150
        new Case("case15", "stackMapTable.cpp", true, "check_new_object",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   151
                 "backward jump with uninit",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   152
                 "Uninitialized object exists on backward branch "),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   153
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   154
        /* Unreachable: wide instructions verified during bytecode analysis */
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   155
        new Case("case16", "verifier.cpp", false, "loop header",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   156
                 "bad op in wide instruction",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   157
                 "Bad wide instruction"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   158
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   159
        new Case("case17", "verifier.cpp", true, "case iaload",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   160
                 "TOS not X array",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   161
                 "Bad type on operand stack in iaload"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   162
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   163
        new Case("case18", "verifier.cpp", true, "case baload",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   164
                 "TOS not X array",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   165
                 "Bad type on operand stack in baload"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   166
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   167
        new Case("case19", "verifier.cpp", true, "case caload",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   168
                 "TOS not X array",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   169
                 "Bad type on operand stack in caload"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   170
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   171
        new Case("case20", "verifier.cpp", true, "case saload",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   172
                 "TOS not X array",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   173
                 "Bad type on operand stack in saload"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   174
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   175
        new Case("case21", "verifier.cpp", true, "case laload",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   176
                 "TOS not X array",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   177
                 "Bad type on operand stack in laload"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   178
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   179
        new Case("case22", "verifier.cpp", true, "case faload",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   180
                 "TOS not X array",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   181
                 "Bad type on operand stack in faload"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   182
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   183
        new Case("case23", "verifier.cpp", true, "case daload",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   184
                 "TOS not X array",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   185
                 "Bad type on operand stack in daload"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   186
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   187
        new Case("case24", "verifier.cpp", true, "case aaload",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   188
                 "TOS not X array",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   189
                 "Bad type on operand stack in aaload"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   190
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   191
        new Case("case25", "verifier.cpp", true, "case iastore",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   192
                 "TOS not int array",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   193
                 "Bad type on operand stack in iastore"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   194
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   195
        new Case("case26", "verifier.cpp", true, "case bastore",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   196
                 "TOS not byte array",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   197
                 "Bad type on operand stack in bastore"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   198
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   199
        new Case("case27", "verifier.cpp", true, "case castore",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   200
                 "TOS not char array",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   201
                 "Bad type on operand stack in castore"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   202
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   203
        new Case("case28", "verifier.cpp", true, "case sastore",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   204
                 "TOS not short array",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   205
                 "Bad type on operand stack in sastore"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   206
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   207
        new Case("case29", "verifier.cpp", true, "case lastore",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   208
                 "TOS not long array",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   209
                 "Bad type on operand stack in lastore"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   210
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   211
        new Case("case30", "verifier.cpp", true, "case fastore",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   212
                 "TOS not float array",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   213
                 "Bad type on operand stack in fastore"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   214
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   215
        new Case("case31", "verifier.cpp", true, "case dastore",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   216
                 "TOS not double array",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   217
                 "Bad type on operand stack in dastore"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   218
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   219
        new Case("case32", "verifier.cpp", true, "case aastore",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   220
                 "TOS not object array",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   221
                 "Bad type on operand stack in aastore"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   222
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   223
        /* Unreachable: In order to hit this case, we would need a
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   224
         * category2_1st at TOS which is not possible. */
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   225
        new Case("case33", "verifier.cpp", false, "case pop2",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   226
                 "TOS is category2_1st (would split)",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   227
                 "Bad type on operand stack in pop2"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   228
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   229
        /* Unreachable: In order to hit this case, we would need a
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   230
         * category2_1st at stack depth 2 with category_1 on TOS which is not
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   231
         * possible. */
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   232
        new Case("case34", "verifier.cpp", false, "case dup_x2",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   233
                 "TOS-1 is category2_1st (would split)",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   234
                 "Bad type on operand stack in dup_x2"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   235
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   236
        /* Unreachable: In order to hit this case, we would need a
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   237
         * category2_1st at TOS which is not possible. */
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   238
        new Case("case35", "verifier.cpp", false, "case dup2",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   239
                 "TOS-1 is category2_1st (would split)",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   240
                 "Bad type on operand stack in dup2"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   241
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   242
        /* Unreachable: In order to hit this case, we would need a
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   243
         * category2_1st at TOS which is not possible. */
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   244
        new Case("case36", "verifier.cpp", false, "case dup2_x1",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   245
                 "TOS-1 is category2_1st (would split)",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   246
                 "Bad type on operand stack in dup2_x1"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   247
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   248
        /* Unreachable: In order to hit this case, we would need a
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   249
         * category2_1st at TOS which is not possible. */
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   250
        new Case("case37", "verifier.cpp", false, "case dup2_x2",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   251
                 "TOS-1 is category2_1st (would split)",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   252
                 "Bad type on operand stack in dup2_x2"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   253
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   254
        /* Unreachable: In order to hit this case, we would need a
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   255
         * category2_1st at stack depth 3 with either 2 category_1 or 1
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   256
         * category_2 on TOS, which is not possible. */
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   257
        new Case("case38", "verifier.cpp", false, "case dup2_x2",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   258
                 "TOS-3 is category2_1st (would split)",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   259
                 "Bad type on operand stack in dup2_x2"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   260
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   261
        new Case("case39", "verifier.cpp", true, "case return",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   262
                 "return type of method is not void",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   263
                 "Method expects a return value"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   264
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   265
        new Case("case40", "verifier.cpp", true, "case return",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   266
                 "return with uninitialized this ",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   267
                 "Constructor must call super() or this() before return"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   268
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   269
        new Case("case41", "verifier.cpp", true, "case new",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   270
                 "cp index not a class type",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   271
                 "Illegal new instruction"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   272
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   273
        new Case("case42", "verifier.cpp", true, "case arraylength",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   274
                 "TOS is not an array",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   275
                 "Bad type on operand stack in arraylength"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   276
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   277
        new Case("case43", "verifier.cpp", true, "case multianewarray",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   278
                 "CP index does not refer to array type",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   279
                 "Illegal constant pool index in multianewarray instruction"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   280
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   281
        new Case("case44", "verifier.cpp", true, "case multianewarray",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   282
                 "Bad dimension (<1) or does not match CP signature",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   283
                 "Illegal dimension in multianewarray instruction: "),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   284
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   285
        new Case("case45", "verifier.cpp", true, "case default",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   286
                 "Unrecognized bytecode",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   287
                 "Bad instruction: "),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   288
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   289
        new Case("case46", "verifier.cpp", true, "loop end",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   290
                 "control flow falls off method",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   291
                 "Control flow falls through code end"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   292
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   293
        new Case("case47", "verifier.cpp", true, "generate_code_data",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   294
                 "illegal bytecode via RawBytecodeStream (breakpoint)",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   295
                 "Bad instruction"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   296
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   297
        new Case("case48", "verifier.cpp", true, "generate_code_data",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   298
                 "illegal bytecode via RawBytecodeStream (other illegal)",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   299
                 "Bad instruction"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   300
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   301
        new Case("case49", "verifier.cpp", true,
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   302
                 "verify_exception_handler_table",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   303
                 "catch_type is not throwable",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   304
                 "Catch type is not a subclass of Throwable in " +
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   305
                 "exception handler "),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   306
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   307
        new Case("case50", "verifier.cpp", true, "verify_stackmap_table",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   308
                 "missing a stack map frame @ target location (mid table)",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   309
                 "Expecting a stack map frame"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   310
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   311
        new Case("case51", "verifier.cpp", true, "verify_stackmap_table",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   312
                 "stack map does not match?",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   313
                 "Instruction type does not match stack map"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   314
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   315
        new Case("case52", "verifier.cpp", true, "verify_stackmap_table",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   316
                 "missing a stack map frame @ target location (end of table)",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   317
                 "Expecting a stack map frame"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   318
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   319
        new Case("case53", "verifier.cpp", true,
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   320
                 "verify_exception_handler_targets",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   321
                 "stackmap mismatch at exception handler",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   322
                 "Stack map does not match the one at exception handler "),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   323
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   324
        new Case("case54", "verifier.cpp", true, "verify_cp_index",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   325
                 "constant pool index is out-of-bounds",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   326
                 "Illegal constant pool index "),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   327
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   328
        new Case("case55", "verifier.cpp", true, "verify_cp_type",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   329
                 "constant pool entry is not expected type",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   330
                 "Illegal type at constant pool entry "),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   331
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   332
        new Case("case56", "verifier.cpp", true, "verify_cp_class_type",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   333
                 "constant pool entry is not an object type",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   334
                 "Illegal type at constant pool entry "),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   335
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   336
        /* Unreachable: verify_cp_type gates this case */
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   337
        new Case("case57", "verifier.cpp", false, "verify_ldc",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   338
                 "invalid constant pool index in ldc",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   339
                 "Invalid index in ldc"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   340
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   341
        new Case("case58", "verifier.cpp", true, "verify_switch",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   342
                 "bad switch padding",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   343
                 "Nonzero padding byte in lookswitch or tableswitch"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   344
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   345
        new Case("case59", "verifier.cpp", true, "verify_switch",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   346
                 "tableswitch low is greater than high",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   347
                 "low must be less than or equal to high in tableswitch"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   348
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   349
        /* Unreachable on 64-bit?  Only way to get here is to overflow
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   350
         * the 'keys' variable which can't happen on 64-bit since we're dealing
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   351
         * with 32-bit values.  Perhaps reachable on 32-bit but the
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   352
         * triggering class would be quite large */
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   353
        new Case("case60", "verifier.cpp", false, "verify_switch",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   354
                 "high - low + 1 < 0 (overflow?)",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   355
                 "too many keys in tableswitch"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   356
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   357
        /* Would have to create a 16G classfile to trip this.  Possible but
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   358
         * not reasonable to do in a test.  */
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   359
        new Case("case61", "verifier.cpp", false, "verify_switch",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   360
                 "lookupswitch keys < 0",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   361
                 "number of keys in lookupswitch less than 0"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   362
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   363
        new Case("case62", "verifier.cpp", true, "verify_switch",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   364
                 "lookupswitch keys out-of-order",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   365
                 "Bad lookupswitch instruction"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   366
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   367
        /* Unreachable: Class file parser verifies Fieldref contents */
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   368
        new Case("case63", "verifier.cpp", false, "verify_field_instructions",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   369
                 "referenced class is not an CP object",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   370
                 "Expecting reference to class in class "),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   371
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   372
        new Case("case64", "verifier.cpp", true, "verify_field_instructions",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   373
                 "TOS not assignable to field type in putfield",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   374
                 "Bad type on operand stack in putfield"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   375
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   376
        new Case("case65", "verifier.cpp", true, "verify_field_instructions",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   377
                 "TOS not assignable to class when accessing protected field",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   378
                 "Bad access to protected data in getfield"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   379
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   380
        new Case("case66", "verifier.cpp", true, "verify_invoke_init",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   381
                 "Uninit_this is not of the current type or it's supertype",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   382
                 "Bad <init> method call"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   383
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   384
        /* Unreachable:  Stack map parsing ensures valid type and new
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   385
         * instructions have a valid BCI. */
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   386
        new Case("case67", "verifier.cpp", false, "verify_invoke_init",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   387
                 "Uninit type with bad new instruction index",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   388
                 "Expecting new instruction"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   389
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   390
        new Case("case68", "verifier.cpp", true, "verify_invoke_init",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   391
                 "calling other class's <init> method",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   392
                 "Call to wrong <init> method"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   393
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   394
        new Case("case69", "verifier.cpp", true, "verify_invoke_init",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   395
                 "Calling protected <init> and type unassignable from current",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   396
                 "Bad access to protected <init> method"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   397
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   398
        new Case("case70", "verifier.cpp", true, "verify_invoke_init",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   399
                 "TOS is not an uninitialized (or Uninit_this) type",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   400
                 "Bad operand type when invoking <init>"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   401
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   402
        new Case("case71", "verifier.cpp", true, "verify_invoke_instructions",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   403
                 "Arg count in instruction doesn't match signature",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   404
                 "Inconsistent args count operand in invokeinterface"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   405
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   406
        new Case("case72", "verifier.cpp", true, "verify_invoke_instructions",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   407
                 "Non-zero pad in invokeinterface",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   408
                 "Fourth operand byte of invokeinterface must be zero"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   409
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   410
        new Case("case73", "verifier.cpp", true, "verify_invoke_instructions",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   411
                 "Non-zero pad in invokedynamic",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   412
                 "Third and fourth operand bytes of " +
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   413
                 "invokedynamic must be zero"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   414
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   415
        new Case("case74", "verifier.cpp", true, "verify_invoke_instructions",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   416
                 "Non-invokespecial trying to invoke a '<' method",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   417
                 "Illegal call to internal method"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   418
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   419
        new Case("case75", "verifier.cpp", true, "verify_invoke_instructions",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   420
                 "invokespecial and current unassignable from referenced type",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   421
                 "Bad invokespecial instruction: current class isn't " +
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   422
                 "assignable to reference class."),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   423
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   424
        new Case("case76", "verifier.cpp", true, "verify_invoke_instructions",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   425
                 "TOS not assignable to current when calling protected method",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   426
                 "Bad access to protected data in invokevirtual"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   427
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   428
        /* Unreachable:  class file parser enforces void signature */
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   429
        new Case("case77", "verifier.cpp", false, "verify_invoke_instructions",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   430
                 "<init> method is not void return",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   431
                 "Return type must be void in <init> method"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   432
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   433
        new Case("case78", "verifier.cpp", true, "get_newarray_type",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   434
                 "newarray type invalid",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   435
                 "Illegal newarray instruction"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   436
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   437
        new Case("case79", "verifier.cpp", true, "verify_return_value",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   438
                 "void return from method which has a return value",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   439
                 "Method expects a return value"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   440
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   441
        new Case("case80", "verifier.cpp", true, "verify_return_value",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   442
                 "TOS type does not match signature",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   443
                 "Bad return type"),
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   444
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   445
        new Case("case81", "verifier.cpp", true, "verify_stackmap_table",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   446
                 "stack map does not match (flags)",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   447
                 "Instruction type does not match stack map")
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   448
    };
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   449
}
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   450
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   451
public class Test7116786 {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   452
    public static void main(String argv[]) throws Exception {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   453
        for (Case c : VerifyErrorCases.cases) {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   454
            System.out.println("******** " + c.getCaseName() + " ********");
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   455
            if (c.isTestable()) {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   456
                try {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   457
                    ClassLoader cl = Test7116786.class.getClassLoader();
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   458
                    Class<?> cls = Class.forName(c.getCaseName(), true, cl);
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   459
                    throw new RuntimeException(
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   460
                        "++ FAIL: No verify error encountered");
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   461
                } catch (VerifyError ve) {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   462
                    String message = c.getMessage();
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   463
                    String veMessage = ve.getMessage();
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   464
                    System.out.print(veMessage);
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   465
                    if (!veMessage.startsWith(message)) {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   466
                        // We're not seeing the message we expect.  Could be
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   467
                        // that we've gotten the wrong VerifyError case, or
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   468
                        // maybe the message changed.
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   469
                        System.out.println("++ FAIL? " +
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   470
                            "Message does not match what was expected: " +
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   471
                            message);
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   472
                        continue;
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   473
                    }
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   474
                    if (!veMessage.contains("Exception Details:") &&
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   475
                        !veMessage.contains("Reason:")) {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   476
                        System.out.println("++ FAIL: No details found");
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   477
                        throw new RuntimeException("FAIL: No details found");
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   478
                    }
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   479
                    System.out.println("++ PASS");
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   480
                }
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   481
            } else {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   482
               System.out.println("++ SKIPPED");
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   483
            }
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   484
        }
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   485
    }
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents:
diff changeset
   486
}