@@ -1947,10 +1947,6 @@ ExecutionVisualizer.prototype.renderDataStructures = function() {
19471947 d3DomElement . append ( '<div class="heapObject" id="' + heapObjID + '"></div>' ) ;
19481948 d3DomElement = myViz . domRoot . find ( '#' + heapObjID ) ;
19491949
1950- if ( myViz . textualMemoryLabels ) {
1951- d3DomElement . append ( '<div class="objectIdLabel">id' + objID + '</div>' ) ;
1952- }
1953-
19541950 renderedObjectIDs . set ( objID , 1 ) ;
19551951
19561952 var obj = curEntry . heap [ objID ] ;
@@ -2088,19 +2084,24 @@ ExecutionVisualizer.prototype.renderDataStructures = function() {
20882084 var funcName = htmlspecialchars ( obj [ 1 ] ) . replace ( '<lambda>' , '\u03bb' ) ;
20892085 var parentFrameID = obj [ 2 ] ; // optional
20902086
2087+ d3DomElement . append ( '<div class="typeLabel">function</div>' ) ;
2088+
20912089 if ( parentFrameID ) {
2092- d3DomElement . append ( '<div class="funcObj">function ' + funcName + ' [parent=f' + parentFrameID + ']</div>' ) ;
2090+ d3DomElement . append ( '<div class="funcObj">' + funcName + ' [parent=f' + parentFrameID + ']</div>' ) ;
20932091 }
20942092 else {
2095- d3DomElement . append ( '<div class="funcObj">function ' + funcName + '</div>' ) ;
2093+ d3DomElement . append ( '<div class="funcObj">' + funcName + '</div>' ) ;
20962094 }
20972095 }
20982096 else if ( obj [ 0 ] == 'HEAP_PRIMITIVE' ) {
2099- assert ( obj . length == 2 ) ;
2097+ assert ( obj . length == 3 ) ;
2098+
2099+ var typeName = obj [ 1 ] ;
2100+ var primitiveVal = obj [ 2 ] ;
21002101
2101- var primitiveVal = obj [ 1 ] ;
21022102 // add a bit of padding to heap primitives, for aesthetics
21032103 d3DomElement . append ( '<div class="heapPrimitive"></div>' ) ;
2104+ d3DomElement . find ( 'div.heapPrimitive' ) . append ( '<div class="typeLabel">' + typeName + '</div>' ) ;
21042105 renderPrimitiveObject ( primitiveVal , d3DomElement . find ( 'div.heapPrimitive' ) ) ;
21052106 }
21062107 else {
@@ -2115,6 +2116,15 @@ ExecutionVisualizer.prototype.renderDataStructures = function() {
21152116 d3DomElement . append ( '<div class="typeLabel">' + typeName + '</div>' ) ;
21162117 d3DomElement . append ( '<table class="customObjTbl"><tr><td class="customObjElt">' + strRepr + '</td></tr></table>' ) ;
21172118 }
2119+
2120+ // prepend the type label with a memory address label
2121+ if ( myViz . textualMemoryLabels ) {
2122+ var typeLabelPrefix = 'id' + objID + ':' ;
2123+
2124+ var labelD3 = d3DomElement . find ( 'div.typeLabel' ) ;
2125+ assert ( labelD3 . length == 1 ) ; // everything should have exactly ONE type label
2126+ labelD3 . html ( typeLabelPrefix + labelD3 . html ( ) ) ;
2127+ }
21182128 }
21192129
21202130
0 commit comments