Skip to content

Commit d8e2be4

Browse files
committed
GH-484 'root.instance' can be null; performance improvement - value for 'id' and 'referrer' is computed only when needed
1 parent e1d56b9 commit d8e2be4

File tree

1 file changed

+2
-2
lines changed
  • visualvm/libs.profiler/profiler.oql/src/org/graalvm/visualvm/lib/profiler/oql/engine/api/impl

1 file changed

+2
-2
lines changed

visualvm/libs.profiler/profiler.oql/src/org/graalvm/visualvm/lib/profiler/oql/engine/api/impl/hat.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ var emptyEnumeration = new java.util.Enumeration() {
167167
function wrapRoot(root) {
168168
if (root) {
169169
return {
170-
id: root.instance.getInstanceId(),
170+
get id() { return i = root.instance; return (i) ? i.getInstanceId() : 0; },
171171
description: "Reference " + root.kind,
172-
referrer: wrapJavaValue(root.instance),
172+
get referrer() { return wrapJavaValue(root.instance); },
173173
type: root.kind,
174174
wrapped: root
175175
};

0 commit comments

Comments
 (0)