|
40 | 40 | import org.graalvm.visualvm.heapviewer.model.HeapViewerNodeFilter;
|
41 | 41 | import org.graalvm.visualvm.heapviewer.model.HeapViewerNodeWrapper;
|
42 | 42 | import org.graalvm.visualvm.heapviewer.model.Progress;
|
| 43 | +import org.graalvm.visualvm.heapviewer.model.RootNode; |
43 | 44 | import org.graalvm.visualvm.heapviewer.model.TextNode;
|
44 | 45 | import org.graalvm.visualvm.heapviewer.truffle.nodes.TruffleObjectReferenceNode;
|
45 | 46 | import org.graalvm.visualvm.heapviewer.ui.HeapViewerRenderer;
|
@@ -99,7 +100,7 @@ protected HeapViewerNode[] getNodes(HeapViewerNode parent, String viewID, HeapVi
|
99 | 100 |
|
100 | 101 | final Map<Long, Integer> values = new HashMap();
|
101 | 102 | FieldValue refFV = null;
|
102 |
| - |
| 103 | + |
103 | 104 | progress.setupKnownSteps(objectsCount());
|
104 | 105 |
|
105 | 106 | Iterator<O> objectsI = objectsIterator();
|
@@ -243,28 +244,15 @@ protected Object getValue(DataType type, Heap heap) {
|
243 | 244 | }
|
244 | 245 |
|
245 | 246 |
|
246 |
| -// private static class MergedObjectReferenceNodeRenderer extends HeapViewerRendererWrapper { |
247 |
| -// |
248 |
| -// @Override |
249 |
| -// protected HeapViewerNode getNode(Object value) { |
250 |
| -// return ((TruffleObjectMergedReferences.MergedObjectReferenceNode)value).getNode(); |
251 |
| -// } |
252 |
| -// |
253 |
| -// @Override |
254 |
| -// protected HeapViewerRenderer getRenderer(HeapViewerNode node) { |
255 |
| -// return TruffleObjectPropertyPlugin.resolveRenderer(node); |
256 |
| -// } |
257 |
| -// |
258 |
| -// } |
259 |
| - |
260 |
| - private static class MergedObjectReferenceNodeRenderer2 extends NormalBoldGrayRenderer implements HeapViewerRenderer { |
| 247 | + private static class MergedObjectReferenceNodeRenderer extends NormalBoldGrayRenderer implements HeapViewerRenderer { |
261 | 248 |
|
262 | 249 | private HeapViewerRenderer renderer;
|
263 | 250 |
|
264 | 251 | @Override
|
265 | 252 | public void setValue(Object value, int row) {
|
266 |
| - HeapViewerNode node = ((TruffleObjectMergedReferences.MergedObjectReferenceNode)value).getNode(); |
267 |
| - renderer = TruffleObjectPropertyPlugin.resolveRenderer(node); |
| 253 | + TruffleObjectMergedReferences.MergedObjectReferenceNode vnode = (TruffleObjectMergedReferences.MergedObjectReferenceNode)value; |
| 254 | + HeapViewerNode node = vnode.getNode(); |
| 255 | + renderer = RootNode.get(vnode).resolveRenderer(node); |
268 | 256 | renderer.setValue(node, row);
|
269 | 257 |
|
270 | 258 | if (renderer instanceof NormalBoldGrayRenderer) {
|
@@ -314,7 +302,7 @@ public boolean supportsView(HeapContext context, String viewID) {
|
314 | 302 |
|
315 | 303 | @Override
|
316 | 304 | public void registerRenderers(Map<Class<? extends HeapViewerNode>, HeapViewerRenderer> renderers, HeapContext context) {
|
317 |
| - renderers.put(TruffleObjectMergedReferences.MergedObjectReferenceNode.class, new MergedObjectReferenceNodeRenderer2()); |
| 305 | + renderers.put(TruffleObjectMergedReferences.MergedObjectReferenceNode.class, new MergedObjectReferenceNodeRenderer()); |
318 | 306 | }
|
319 | 307 |
|
320 | 308 | }
|
|
0 commit comments