Skip to content

Commit b1f935c

Browse files
Tobias HolensteinTobiHartmann
authored andcommitted
8277055: Assert "missing inlining msg" with -XX:+PrintIntrinsics
Reviewed-by: roland, thartmann
1 parent 2da6777 commit b1f935c

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/hotspot/share/opto/callGenerator.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,12 +526,20 @@ bool LateInlineVirtualCallGenerator::do_late_inline_check(Compile* C, JVMState*
526526
Node* receiver = jvms->map()->argument(jvms, 0);
527527
const Type* recv_type = C->initial_gvn()->type(receiver);
528528
if (recv_type->maybe_null()) {
529+
if (C->print_inlining() || C->print_intrinsics()) {
530+
C->print_inlining(method(), jvms->depth()-1, call_node()->jvms()->bci(),
531+
"late call devirtualization failed (receiver may be null)");
532+
}
529533
return false;
530534
}
531535
// Even if inlining is not allowed, a virtual call can be strength-reduced to a direct call.
532536
bool allow_inline = C->inlining_incrementally();
533537
if (!allow_inline && _callee->holder()->is_interface()) {
534538
// Don't convert the interface call to a direct call guarded by an interface subtype check.
539+
if (C->print_inlining() || C->print_intrinsics()) {
540+
C->print_inlining(method(), jvms->depth()-1, call_node()->jvms()->bci(),
541+
"late call devirtualization failed (interface call)");
542+
}
535543
return false;
536544
}
537545
CallGenerator* cg = C->call_generator(_callee,

test/hotspot/jtreg/compiler/print/PrintInlining.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,14 @@
2323

2424
/*
2525
* @test
26-
* @bug 8022585
26+
* @bug 8022585 8277055
2727
* @summary VM crashes when ran with -XX:+PrintInlining
2828
* @run main/othervm -Xcomp -XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining
2929
* compiler.print.PrintInlining
30-
*
30+
* @run main/othervm -Xcomp -XX:-TieredCompilation -XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining
31+
* compiler.print.PrintInlining
32+
* @run main/othervm -Xcomp -XX:-TieredCompilation -XX:+UnlockDiagnosticVMOptions -XX:+PrintIntrinsics
33+
* compiler.print.PrintInlining
3134
*/
3235

3336
package compiler.print;

0 commit comments

Comments
 (0)