8312596: Null pointer access in Compile::TracePhase::~TracePhase after JDK-8311976
Reviewed-by: chagedorn, dlong, shade
This commit is contained in:
parent
ec2f38fd38
commit
7ba8c69a2c
@ -4332,10 +4332,13 @@ void Compile::record_failure(const char* reason) {
|
|||||||
|
|
||||||
Compile::TracePhase::TracePhase(const char* name, elapsedTimer* accumulator)
|
Compile::TracePhase::TracePhase(const char* name, elapsedTimer* accumulator)
|
||||||
: TraceTime(name, accumulator, CITime, CITimeVerbose),
|
: TraceTime(name, accumulator, CITime, CITimeVerbose),
|
||||||
_compile(nullptr), _log(nullptr), _phase_name(name), _dolog(CITimeVerbose)
|
_compile(Compile::current()),
|
||||||
|
_log(nullptr),
|
||||||
|
_phase_name(name),
|
||||||
|
_dolog(CITimeVerbose)
|
||||||
{
|
{
|
||||||
|
assert(_compile != nullptr, "sanity check");
|
||||||
if (_dolog) {
|
if (_dolog) {
|
||||||
_compile = Compile::current();
|
|
||||||
_log = _compile->log();
|
_log = _compile->log();
|
||||||
}
|
}
|
||||||
if (_log != nullptr) {
|
if (_log != nullptr) {
|
||||||
@ -4353,7 +4356,7 @@ Compile::TracePhase::~TracePhase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (VerifyIdealNodeCount) {
|
if (VerifyIdealNodeCount) {
|
||||||
Compile::current()->print_missing_nodes();
|
_compile->print_missing_nodes();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
37
test/hotspot/jtreg/compiler/c2/TestPrintIdealNodeCount.java
Normal file
37
test/hotspot/jtreg/compiler/c2/TestPrintIdealNodeCount.java
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @test
|
||||||
|
* @bug 8312596
|
||||||
|
* @requires vm.debug == true & vm.compiler2.enabled
|
||||||
|
* @summary Run with -Xcomp -XX:-TieredCompilation to force C2 compilations to test -XX:+PrintIdealNodeCount in debug builds.
|
||||||
|
*
|
||||||
|
* @run main/othervm -Xcomp -XX:-TieredCompilation -XX:+PrintIdealNodeCount compiler.c2.TestPrintIdealNodeCount
|
||||||
|
*/
|
||||||
|
package compiler.c2;
|
||||||
|
|
||||||
|
public class TestPrintIdealNodeCount {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user