Skip to content

Commit b7337b9

Browse files
committed
8374497: C2: assert(verify(phase)) failed: missing Value() optimization with -XX:+StressReflectiveCode
1 parent d0841c6 commit b7337b9

2 files changed

Lines changed: 43 additions & 1 deletion

File tree

src/hotspot/share/opto/subtypenode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ bool SubTypeCheckNode::verify(PhaseGVN* phase) {
177177
return true;
178178
}
179179
const Type* cached_t = Value(phase); // cache the type to validate consistency
180-
switch (C->static_subtype_check(superk, subk)) {
180+
switch (C->static_subtype_check(superk, subk, false)) {
181181
case Compile::SSC_easy_test: {
182182
return verify_helper(phase, load_klass(phase), cached_t);
183183
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*/
23+
24+
/**
25+
* @test
26+
* @bug 8374497
27+
* @summary SubTypeCheckNode::verify fails when StressReflectiveCode skips
28+
* static_subtype_check in verify() but not in sub()
29+
* @run main/othervm -Xcomp -XX:CompileCommand=compileonly,*TimeZone::*
30+
* -XX:+IgnoreUnrecognizedVMOptions -XX:+StressReflectiveCode
31+
* ${test.main.class}
32+
*/
33+
34+
package compiler.types;
35+
36+
import java.util.TimeZone;
37+
38+
public class TestSubTypeCheckStressReflectiveCode {
39+
public static void main(String[] args) {
40+
TimeZone.getDefault();
41+
}
42+
}

0 commit comments

Comments
 (0)