Skip to content

Commit d71b1b5

Browse files
committed
Fix NPE in graph dumping if profiling info is absent
1 parent 809500b commit d71b1b5

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/StructuredGraph.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2025, 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
@@ -504,11 +504,13 @@ public void getDebugProperties(Map<Object, Object> properties) {
504504
properties.put("assumptions", String.valueOf(getAssumptions()));
505505
if (method() != null && profileProvider != null) {
506506
ProfilingInfo profilingInfo = profileProvider.getProfilingInfo(method());
507-
for (DeoptimizationReason reason : DeoptimizationReason.values()) {
508-
if (reason != DeoptimizationReason.None) {
509-
int count = profilingInfo.getDeoptimizationCount(reason);
510-
if (count != 0) {
511-
properties.put("DeoptimizationCount-" + reason, count);
507+
if (profilingInfo != null) {
508+
for (DeoptimizationReason reason : DeoptimizationReason.values()) {
509+
if (reason != DeoptimizationReason.None) {
510+
int count = profilingInfo.getDeoptimizationCount(reason);
511+
if (count != 0) {
512+
properties.put("DeoptimizationCount-" + reason, count);
513+
}
512514
}
513515
}
514516
}

0 commit comments

Comments
 (0)