Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(438)

Side by Side Diff: chrome_linux/resources/inspector/HeapSnapshotWorker.js

Issue 85333005: Update reference builds to Chrome 32.0.1700.19 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/reference_builds/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 WebInspector={};WebInspector.UIString=function(s){return s;};WebInspector.Alloca tionProfile=function(profile) 1 WebInspector={};WebInspector.UIString=function(s){return s;};WebInspector.Alloca tionProfile=function(profile)
2 {this._strings=profile.strings;this._nextNodeId=1;this._idToFunctionInfo={};this ._idToNode={};this._collapsedTopNodeIdToFunctionInfo={};this._traceTops=null;thi s._buildAllocationFunctionInfos(profile.trace_function_infos);this._traceTree=th is._buildInvertedAllocationTree(profile.trace_tree);} 2 {this._strings=profile.strings;this._nextNodeId=1;this._idToFunctionInfo={};this ._idToNode={};this._collapsedTopNodeIdToFunctionInfo={};this._traceTops=null;thi s._buildAllocationFunctionInfos(profile);this._traceTree=this._buildInvertedAllo cationTree(profile);}
3 WebInspector.AllocationProfile.prototype={_buildAllocationFunctionInfos:function (rawInfos) 3 WebInspector.AllocationProfile.prototype={_buildAllocationFunctionInfos:function (profile)
4 {var strings=this._strings;var functionIdOffset=0;var functionNameOffset=1;var s criptNameOffset=2;var functionInfoFieldCount=3;var map=this._idToFunctionInfo;ma p[0]=new WebInspector.FunctionAllocationInfo("(root)","<unknown>");var infoLengt h=rawInfos.length;for(var i=0;i<infoLength;i+=functionInfoFieldCount){map[rawInf os[i+functionIdOffset]]=new WebInspector.FunctionAllocationInfo(strings[rawInfos [i+functionNameOffset]],strings[rawInfos[i+scriptNameOffset]]);}},_buildInverted AllocationTree:function(traceTreeRaw) 4 {var strings=this._strings;var functionInfoFields=profile.snapshot.meta.trace_fu nction_info_fields;var functionIdOffset=functionInfoFields.indexOf("function_id" );var functionNameOffset=functionInfoFields.indexOf("name");var scriptNameOffset =functionInfoFields.indexOf("script_name");var scriptIdOffset=functionInfoFields .indexOf("script_id");var lineOffset=functionInfoFields.indexOf("line");var colu mnOffset=functionInfoFields.indexOf("column");var functionInfoFieldCount=functio nInfoFields.length;var map=this._idToFunctionInfo;map[0]=new WebInspector.Functi onAllocationInfo("(root)","<unknown>",0,-1,-1);var rawInfos=profile.trace_functi on_infos;var infoLength=rawInfos.length;for(var i=0;i<infoLength;i+=functionInfo FieldCount){map[rawInfos[i+functionIdOffset]]=new WebInspector.FunctionAllocatio nInfo(strings[rawInfos[i+functionNameOffset]],strings[rawInfos[i+scriptNameOffse t]],rawInfos[i+scriptIdOffset],rawInfos[i+lineOffset],rawInfos[i+columnOffset]); }},_buildInvertedAllocationTree:function(profile)
5 {var idToFunctionInfo=this._idToFunctionInfo;var nodeIdOffset=0;var functionIdOf fset=1;var allocationCountOffset=2;var allocationSizeOffset=3;var childrenOffset =4;var nodeFieldCount=5;function traverseNode(rawNodeArray,nodeOffset,parent) 5 {var traceTreeRaw=profile.trace_tree;var idToFunctionInfo=this._idToFunctionInfo ;var traceNodeFields=profile.snapshot.meta.trace_node_fields;var nodeIdOffset=tr aceNodeFields.indexOf("id");var functionIdOffset=traceNodeFields.indexOf("functi on_id");var allocationCountOffset=traceNodeFields.indexOf("count");var allocatio nSizeOffset=traceNodeFields.indexOf("size");var childrenOffset=traceNodeFields.i ndexOf("children");var nodeFieldCount=traceNodeFields.length;function traverseNo de(rawNodeArray,nodeOffset,parent)
6 {var functionInfo=idToFunctionInfo[rawNodeArray[nodeOffset+functionIdOffset]];va r result=new WebInspector.AllocationTraceNode(rawNodeArray[nodeOffset+nodeIdOffs et],functionInfo,rawNodeArray[nodeOffset+allocationCountOffset],rawNodeArray[nod eOffset+allocationSizeOffset],parent);functionInfo.addTraceTopNode(result);var r awChildren=rawNodeArray[nodeOffset+childrenOffset];for(var i=0;i<rawChildren.len gth;i+=nodeFieldCount){result.children.push(traverseNode(rawChildren,i,result)); } 6 {var functionInfo=idToFunctionInfo[rawNodeArray[nodeOffset+functionIdOffset]];va r result=new WebInspector.AllocationTraceNode(rawNodeArray[nodeOffset+nodeIdOffs et],functionInfo,rawNodeArray[nodeOffset+allocationCountOffset],rawNodeArray[nod eOffset+allocationSizeOffset],parent);functionInfo.addTraceTopNode(result);var r awChildren=rawNodeArray[nodeOffset+childrenOffset];for(var i=0;i<rawChildren.len gth;i+=nodeFieldCount){result.children.push(traverseNode(rawChildren,i,result)); }
7 return result;} 7 return result;}
8 return traverseNode(traceTreeRaw,0,null);},serializeTraceTops:function() 8 return traverseNode(traceTreeRaw,0,null);},serializeTraceTops:function()
9 {if(this._traceTops) 9 {if(this._traceTops)
10 return this._traceTops;var result=this._traceTops=[];var idToFunctionInfo=this._ idToFunctionInfo;for(var id in idToFunctionInfo){var info=idToFunctionInfo[id];i f(info.totalCount===0) 10 return this._traceTops;var result=this._traceTops=[];var idToFunctionInfo=this._ idToFunctionInfo;for(var id in idToFunctionInfo){var info=idToFunctionInfo[id];i f(info.totalCount===0)
11 continue;var nodeId=this._nextNodeId++;result.push(this._serializeNode(nodeId,in fo.functionName,info.totalCount,info.totalSize,true));this._collapsedTopNodeIdTo FunctionInfo[nodeId]=info;} 11 continue;var nodeId=this._nextNodeId++;result.push(this._serializeNode(nodeId,in fo,info.totalCount,info.totalSize,true));this._collapsedTopNodeIdToFunctionInfo[ nodeId]=info;}
12 return result;},serializeCallers:function(nodeId) 12 result.sort(function(a,b){return b.size-a.size;});return result;},serializeCalle rs:function(nodeId)
13 {var node=this._idToNode[nodeId];if(!node){var functionInfo=this._collapsedTopNo deIdToFunctionInfo[nodeId];node=functionInfo.tracesWithThisTop();delete this._co llapsedTopNodeIdToFunctionInfo[nodeId];this._idToNode[nodeId]=node;} 13 {var node=this._idToNode[nodeId];if(!node){var functionInfo=this._collapsedTopNo deIdToFunctionInfo[nodeId];node=functionInfo.tracesWithThisTop();delete this._co llapsedTopNodeIdToFunctionInfo[nodeId];this._idToNode[nodeId]=node;}
14 var result=[];var callers=node.callers();for(var i=0;i<callers.length;i++){var c allerNode=callers[i];var callerId=this._nextNodeId++;this._idToNode[callerId]=ca llerNode;result.push(this._serializeNode(callerId,callerNode.functionInfo.functi onName,callerNode.allocationCount,callerNode.allocationSize,callerNode.hasCaller s()));} 14 var nodesWithSingleCaller=[];while(node.callers().length===1){node=node.callers( )[0];nodesWithSingleCaller.push(this._serializeCaller(node));}
15 return result;},_serializeNode:function(nodeId,functionName,count,size,hasChildr en) 15 var branchingCallers=[];var callers=node.callers();for(var i=0;i<callers.length; i++){branchingCallers.push(this._serializeCaller(callers[i]));}
16 {return{id:nodeId,name:functionName,count:count,size:size,hasChildren:hasChildre n};}} 16 return{nodesWithSingleCaller:nodesWithSingleCaller,branchingCallers:branchingCal lers};},_serializeCaller:function(node)
17 {var callerId=this._nextNodeId++;this._idToNode[callerId]=node;return this._seri alizeNode(callerId,node.functionInfo,node.allocationCount,node.allocationSize,no de.hasCallers());},_serializeNode:function(nodeId,functionInfo,count,size,hasChi ldren)
18 {return{id:nodeId,name:functionInfo.functionName,scriptName:functionInfo.scriptN ame,line:functionInfo.line,column:functionInfo.column,count:count,size:size,hasC hildren:hasChildren};}}
17 WebInspector.AllocationTraceNode=function(id,functionInfo,count,size,parent) 19 WebInspector.AllocationTraceNode=function(id,functionInfo,count,size,parent)
18 {this.id=id;this.functionInfo=functionInfo;this.allocationCount=count;this.alloc ationSize=size;this.parent=parent;this.children=[];} 20 {this.id=id;this.functionInfo=functionInfo;this.allocationCount=count;this.alloc ationSize=size;this.parent=parent;this.children=[];}
19 WebInspector.AllocationBackTraceNode=function(functionInfo) 21 WebInspector.AllocationBackTraceNode=function(functionInfo)
20 {this.functionInfo=functionInfo;this.allocationCount=0;this.allocationSize=0;thi s._callers=[];} 22 {this.functionInfo=functionInfo;this.allocationCount=0;this.allocationSize=0;thi s._callers=[];}
21 WebInspector.AllocationBackTraceNode.prototype={addCaller:function(traceNode) 23 WebInspector.AllocationBackTraceNode.prototype={addCaller:function(traceNode)
22 {var functionInfo=traceNode.functionInfo;var result;for(var i=0;i<this._callers. length;i++){var caller=this._callers[i];if(caller.functionInfo===functionInfo){r esult=caller;break;}} 24 {var functionInfo=traceNode.functionInfo;var result;for(var i=0;i<this._callers. length;i++){var caller=this._callers[i];if(caller.functionInfo===functionInfo){r esult=caller;break;}}
23 if(!result){result=new WebInspector.AllocationBackTraceNode(functionInfo);this._ callers.push(result);} 25 if(!result){result=new WebInspector.AllocationBackTraceNode(functionInfo);this._ callers.push(result);}
24 return result;},callers:function() 26 return result;},callers:function()
25 {return this._callers;},hasCallers:function() 27 {return this._callers;},hasCallers:function()
26 {return this._callers.length>0;}} 28 {return this._callers.length>0;}}
27 WebInspector.FunctionAllocationInfo=function(functionName,scriptName) 29 WebInspector.FunctionAllocationInfo=function(functionName,scriptName,scriptId,li ne,column)
28 {this.functionName=functionName;this.scriptName=scriptName;this.totalCount=0;thi s.totalSize=0;this._traceTops=[];} 30 {this.functionName=functionName;this.scriptName=scriptName;this.scriptId=scriptI d;this.line=line;this.column=column;this.totalCount=0;this.totalSize=0;this._tra ceTops=[];}
29 WebInspector.FunctionAllocationInfo.prototype={addTraceTopNode:function(node) 31 WebInspector.FunctionAllocationInfo.prototype={addTraceTopNode:function(node)
30 {if(node.allocationCount===0) 32 {if(node.allocationCount===0)
31 return;this._traceTops.push(node);this.totalCount+=node.allocationCount;this.tot alSize+=node.allocationSize;},tracesWithThisTop:function() 33 return;this._traceTops.push(node);this.totalCount+=node.allocationCount;this.tot alSize+=node.allocationSize;},tracesWithThisTop:function()
32 {if(!this._traceTops.length) 34 {if(!this._traceTops.length)
33 return null;if(!this._backTraceTree) 35 return null;if(!this._backTraceTree)
34 this._buildAllocationTraceTree();return this._backTraceTree;},_buildAllocationTr aceTree:function() 36 this._buildAllocationTraceTree();return this._backTraceTree;},_buildAllocationTr aceTree:function()
35 {this._backTraceTree=new WebInspector.AllocationBackTraceNode(this._traceTops[0] .functionInfo);for(var i=0;i<this._traceTops.length;i++){var node=this._traceTop s[i];var backTraceNode=this._backTraceTree;var count=node.allocationCount;var si ze=node.allocationSize;while(true){backTraceNode.allocationCount+=count;backTrac eNode.allocationSize+=size;node=node.parent;if(node===null){break;} 37 {this._backTraceTree=new WebInspector.AllocationBackTraceNode(this._traceTops[0] .functionInfo);for(var i=0;i<this._traceTops.length;i++){var node=this._traceTop s[i];var backTraceNode=this._backTraceTree;var count=node.allocationCount;var si ze=node.allocationSize;while(true){backTraceNode.allocationCount+=count;backTrac eNode.allocationSize+=size;node=node.parent;if(node===null){break;}
36 backTraceNode=backTraceNode.addCaller(node);}}}};WebInspector.HeapSnapshotArrayS lice=function(array,start,end) 38 backTraceNode=backTraceNode.addCaller(node);}}}};WebInspector.HeapSnapshotArrayS lice=function(array,start,end)
37 {this._array=array;this._start=start;this.length=end-start;} 39 {this._array=array;this._start=start;this.length=end-start;}
38 WebInspector.HeapSnapshotArraySlice.prototype={item:function(index) 40 WebInspector.HeapSnapshotArraySlice.prototype={item:function(index)
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 {this._dispatcher=dispatcher;} 123 {this._dispatcher=dispatcher;}
122 WebInspector.HeapSnapshotProgress.Event={Update:"ProgressUpdate"};WebInspector.H eapSnapshotProgress.prototype={updateStatus:function(status) 124 WebInspector.HeapSnapshotProgress.Event={Update:"ProgressUpdate"};WebInspector.H eapSnapshotProgress.prototype={updateStatus:function(status)
123 {this._sendUpdateEvent(WebInspector.UIString(status));},updateProgress:function( title,value,total) 125 {this._sendUpdateEvent(WebInspector.UIString(status));},updateProgress:function( title,value,total)
124 {var percentValue=((total?(value/total):0)*100).toFixed(0);this._sendUpdateEvent (WebInspector.UIString(title,percentValue));},_sendUpdateEvent:function(text) 126 {var percentValue=((total?(value/total):0)*100).toFixed(0);this._sendUpdateEvent (WebInspector.UIString(title,percentValue));},_sendUpdateEvent:function(text)
125 {if(this._dispatcher) 127 {if(this._dispatcher)
126 this._dispatcher.sendEvent(WebInspector.HeapSnapshotProgress.Event.Update,text); }} 128 this._dispatcher.sendEvent(WebInspector.HeapSnapshotProgress.Event.Update,text); }}
127 WebInspector.HeapSnapshot=function(profile,progress) 129 WebInspector.HeapSnapshot=function(profile,progress)
128 {this.uid=profile.snapshot.uid;this._nodes=profile.nodes;this._containmentEdges= profile.edges;this._metaNode=profile.snapshot.meta;this._strings=profile.strings ;this._progress=progress;this._noDistance=-5;this._rootNodeIndex=0;if(profile.sn apshot.root_index) 130 {this.uid=profile.snapshot.uid;this._nodes=profile.nodes;this._containmentEdges= profile.edges;this._metaNode=profile.snapshot.meta;this._strings=profile.strings ;this._progress=progress;this._noDistance=-5;this._rootNodeIndex=0;if(profile.sn apshot.root_index)
129 this._rootNodeIndex=profile.snapshot.root_index;this._snapshotDiffs={};this._agg regatesForDiff=null;this._init();if(WebInspector.HeapSnapshot.enableAllocationPr ofiler){this._progress.updateStatus("Buiding allocation statistics\u2026");this. _allocationProfile=new WebInspector.AllocationProfile(profile);this._progress.up dateStatus("Done");}} 131 this._rootNodeIndex=profile.snapshot.root_index;this._snapshotDiffs={};this._agg regatesForDiff=null;this._init();if(WebInspector.HeapSnapshot.enableAllocationPr ofiler){this._progress.updateStatus("Buiding allocation statistics\u2026");this. _allocationProfile=new WebInspector.AllocationProfile(profile);this._progress.up dateStatus("Done");}}
130 WebInspector.HeapSnapshot.enableAllocationProfiler=false;function HeapSnapshotMe tainfo() 132 WebInspector.HeapSnapshot.enableAllocationProfiler=false;function HeapSnapshotMe tainfo()
131 {this.node_fields=[];this.node_types=[];this.edge_fields=[];this.edge_types=[];t his.type_strings={};this.fields=[];this.types=[];} 133 {this.node_fields=[];this.node_types=[];this.edge_fields=[];this.edge_types=[];t his.trace_function_info_fields=[];this.trace_node_fields=[];this.type_strings={} ;}
132 function HeapSnapshotHeader() 134 function HeapSnapshotHeader()
133 {this.title="";this.uid=0;this.meta=new HeapSnapshotMetainfo();this.node_count=0 ;this.edge_count=0;} 135 {this.title="";this.uid=0;this.meta=new HeapSnapshotMetainfo();this.node_count=0 ;this.edge_count=0;}
134 WebInspector.HeapSnapshot.prototype={_init:function() 136 WebInspector.HeapSnapshot.prototype={_init:function()
135 {var meta=this._metaNode;this._nodeTypeOffset=meta.node_fields.indexOf("type");t his._nodeNameOffset=meta.node_fields.indexOf("name");this._nodeIdOffset=meta.nod e_fields.indexOf("id");this._nodeSelfSizeOffset=meta.node_fields.indexOf("self_s ize");this._nodeEdgeCountOffset=meta.node_fields.indexOf("edge_count");this._nod eFieldCount=meta.node_fields.length;this._nodeTypes=meta.node_types[this._nodeTy peOffset];this._nodeHiddenType=this._nodeTypes.indexOf("hidden");this._nodeObjec tType=this._nodeTypes.indexOf("object");this._nodeNativeType=this._nodeTypes.ind exOf("native");this._nodeConsStringType=this._nodeTypes.indexOf("concatenated st ring");this._nodeSlicedStringType=this._nodeTypes.indexOf("sliced string");this. _nodeCodeType=this._nodeTypes.indexOf("code");this._nodeSyntheticType=this._node Types.indexOf("synthetic");this._edgeFieldsCount=meta.edge_fields.length;this._e dgeTypeOffset=meta.edge_fields.indexOf("type");this._edgeNameOffset=meta.edge_fi elds.indexOf("name_or_index");this._edgeToNodeOffset=meta.edge_fields.indexOf("t o_node");this._edgeTypes=meta.edge_types[this._edgeTypeOffset];this._edgeTypes.p ush("invisible");this._edgeElementType=this._edgeTypes.indexOf("element");this._ edgeHiddenType=this._edgeTypes.indexOf("hidden");this._edgeInternalType=this._ed geTypes.indexOf("internal");this._edgeShortcutType=this._edgeTypes.indexOf("shor tcut");this._edgeWeakType=this._edgeTypes.indexOf("weak");this._edgeInvisibleTyp e=this._edgeTypes.indexOf("invisible");this.nodeCount=this._nodes.length/this._n odeFieldCount;this._edgeCount=this._containmentEdges.length/this._edgeFieldsCoun t;this._progress.updateStatus("Building edge indexes\u2026");this._buildEdgeInde xes();this._progress.updateStatus("Marking invisible edges\u2026");this._markInv isibleEdges();this._progress.updateStatus("Building retainers\u2026");this._buil dRetainers();this._progress.updateStatus("Calculating node flags\u2026");this._c alculateFlags();this._progress.updateStatus("Calculating distances\u2026");this. _calculateDistances();this._progress.updateStatus("Building postorder index\u202 6");var result=this._buildPostOrderIndex();this._progress.updateStatus("Building dominator tree\u2026");this._dominatorsTree=this._buildDominatorTree(result.pos tOrderIndex2NodeOrdinal,result.nodeOrdinal2PostOrderIndex);this._progress.update Status("Calculating retained sizes\u2026");this._calculateRetainedSizes(result.p ostOrderIndex2NodeOrdinal);this._progress.updateStatus("Buiding dominated nodes\ u2026");this._buildDominatedNodes();this._progress.updateStatus("Finished proces sing.");},_buildEdgeIndexes:function() 137 {var meta=this._metaNode;this._nodeTypeOffset=meta.node_fields.indexOf("type");t his._nodeNameOffset=meta.node_fields.indexOf("name");this._nodeIdOffset=meta.nod e_fields.indexOf("id");this._nodeSelfSizeOffset=meta.node_fields.indexOf("self_s ize");this._nodeEdgeCountOffset=meta.node_fields.indexOf("edge_count");this._nod eFieldCount=meta.node_fields.length;this._nodeTypes=meta.node_types[this._nodeTy peOffset];this._nodeHiddenType=this._nodeTypes.indexOf("hidden");this._nodeObjec tType=this._nodeTypes.indexOf("object");this._nodeNativeType=this._nodeTypes.ind exOf("native");this._nodeConsStringType=this._nodeTypes.indexOf("concatenated st ring");this._nodeSlicedStringType=this._nodeTypes.indexOf("sliced string");this. _nodeCodeType=this._nodeTypes.indexOf("code");this._nodeSyntheticType=this._node Types.indexOf("synthetic");this._edgeFieldsCount=meta.edge_fields.length;this._e dgeTypeOffset=meta.edge_fields.indexOf("type");this._edgeNameOffset=meta.edge_fi elds.indexOf("name_or_index");this._edgeToNodeOffset=meta.edge_fields.indexOf("t o_node");this._edgeTypes=meta.edge_types[this._edgeTypeOffset];this._edgeTypes.p ush("invisible");this._edgeElementType=this._edgeTypes.indexOf("element");this._ edgeHiddenType=this._edgeTypes.indexOf("hidden");this._edgeInternalType=this._ed geTypes.indexOf("internal");this._edgeShortcutType=this._edgeTypes.indexOf("shor tcut");this._edgeWeakType=this._edgeTypes.indexOf("weak");this._edgeInvisibleTyp e=this._edgeTypes.indexOf("invisible");this.nodeCount=this._nodes.length/this._n odeFieldCount;this._edgeCount=this._containmentEdges.length/this._edgeFieldsCoun t;this._progress.updateStatus("Building edge indexes\u2026");this._buildEdgeInde xes();this._progress.updateStatus("Marking invisible edges\u2026");this._markInv isibleEdges();this._progress.updateStatus("Building retainers\u2026");this._buil dRetainers();this._progress.updateStatus("Calculating node flags\u2026");this._c alculateFlags();this._progress.updateStatus("Calculating distances\u2026");this. _calculateDistances();this._progress.updateStatus("Building postorder index\u202 6");var result=this._buildPostOrderIndex();this._progress.updateStatus("Building dominator tree\u2026");this._dominatorsTree=this._buildDominatorTree(result.pos tOrderIndex2NodeOrdinal,result.nodeOrdinal2PostOrderIndex);this._progress.update Status("Calculating retained sizes\u2026");this._calculateRetainedSizes(result.p ostOrderIndex2NodeOrdinal);this._progress.updateStatus("Buiding dominated nodes\ u2026");this._buildDominatedNodes();this._progress.updateStatus("Finished proces sing.");},_buildEdgeIndexes:function()
136 {var nodes=this._nodes;var nodeCount=this.nodeCount;var firstEdgeIndexes=this._f irstEdgeIndexes=new Uint32Array(nodeCount+1);var nodeFieldCount=this._nodeFieldC ount;var edgeFieldsCount=this._edgeFieldsCount;var nodeEdgeCountOffset=this._nod eEdgeCountOffset;firstEdgeIndexes[nodeCount]=this._containmentEdges.length;for(v ar nodeOrdinal=0,edgeIndex=0;nodeOrdinal<nodeCount;++nodeOrdinal){firstEdgeIndex es[nodeOrdinal]=edgeIndex;edgeIndex+=nodes[nodeOrdinal*nodeFieldCount+nodeEdgeCo untOffset]*edgeFieldsCount;}},_buildRetainers:function() 138 {var nodes=this._nodes;var nodeCount=this.nodeCount;var firstEdgeIndexes=this._f irstEdgeIndexes=new Uint32Array(nodeCount+1);var nodeFieldCount=this._nodeFieldC ount;var edgeFieldsCount=this._edgeFieldsCount;var nodeEdgeCountOffset=this._nod eEdgeCountOffset;firstEdgeIndexes[nodeCount]=this._containmentEdges.length;for(v ar nodeOrdinal=0,edgeIndex=0;nodeOrdinal<nodeCount;++nodeOrdinal){firstEdgeIndex es[nodeOrdinal]=edgeIndex;edgeIndex+=nodes[nodeOrdinal*nodeFieldCount+nodeEdgeCo untOffset]*edgeFieldsCount;}},_buildRetainers:function()
137 {var retainingNodes=this._retainingNodes=new Uint32Array(this._edgeCount);var re tainingEdges=this._retainingEdges=new Uint32Array(this._edgeCount);var firstReta inerIndex=this._firstRetainerIndex=new Uint32Array(this.nodeCount+1);var contain mentEdges=this._containmentEdges;var edgeFieldsCount=this._edgeFieldsCount;var n odeFieldCount=this._nodeFieldCount;var edgeToNodeOffset=this._edgeToNodeOffset;v ar nodes=this._nodes;var firstEdgeIndexes=this._firstEdgeIndexes;var nodeCount=t his.nodeCount;for(var toNodeFieldIndex=edgeToNodeOffset,l=containmentEdges.lengt h;toNodeFieldIndex<l;toNodeFieldIndex+=edgeFieldsCount){var toNodeIndex=containm entEdges[toNodeFieldIndex];if(toNodeIndex%nodeFieldCount) 139 {var retainingNodes=this._retainingNodes=new Uint32Array(this._edgeCount);var re tainingEdges=this._retainingEdges=new Uint32Array(this._edgeCount);var firstReta inerIndex=this._firstRetainerIndex=new Uint32Array(this.nodeCount+1);var contain mentEdges=this._containmentEdges;var edgeFieldsCount=this._edgeFieldsCount;var n odeFieldCount=this._nodeFieldCount;var edgeToNodeOffset=this._edgeToNodeOffset;v ar firstEdgeIndexes=this._firstEdgeIndexes;var nodeCount=this.nodeCount;for(var toNodeFieldIndex=edgeToNodeOffset,l=containmentEdges.length;toNodeFieldIndex<l;t oNodeFieldIndex+=edgeFieldsCount){var toNodeIndex=containmentEdges[toNodeFieldIn dex];if(toNodeIndex%nodeFieldCount)
138 throw new Error("Invalid toNodeIndex "+toNodeIndex);++firstRetainerIndex[toNodeI ndex/nodeFieldCount];} 140 throw new Error("Invalid toNodeIndex "+toNodeIndex);++firstRetainerIndex[toNodeI ndex/nodeFieldCount];}
139 for(var i=0,firstUnusedRetainerSlot=0;i<nodeCount;i++){var retainersCount=firstR etainerIndex[i];firstRetainerIndex[i]=firstUnusedRetainerSlot;retainingNodes[fir stUnusedRetainerSlot]=retainersCount;firstUnusedRetainerSlot+=retainersCount;} 141 for(var i=0,firstUnusedRetainerSlot=0;i<nodeCount;i++){var retainersCount=firstR etainerIndex[i];firstRetainerIndex[i]=firstUnusedRetainerSlot;retainingNodes[fir stUnusedRetainerSlot]=retainersCount;firstUnusedRetainerSlot+=retainersCount;}
140 firstRetainerIndex[nodeCount]=retainingNodes.length;var nextNodeFirstEdgeIndex=f irstEdgeIndexes[0];for(var srcNodeOrdinal=0;srcNodeOrdinal<nodeCount;++srcNodeOr dinal){var firstEdgeIndex=nextNodeFirstEdgeIndex;nextNodeFirstEdgeIndex=firstEdg eIndexes[srcNodeOrdinal+1];var srcNodeIndex=srcNodeOrdinal*nodeFieldCount;for(va r edgeIndex=firstEdgeIndex;edgeIndex<nextNodeFirstEdgeIndex;edgeIndex+=edgeField sCount){var toNodeIndex=containmentEdges[edgeIndex+edgeToNodeOffset];if(toNodeIn dex%nodeFieldCount) 142 firstRetainerIndex[nodeCount]=retainingNodes.length;var nextNodeFirstEdgeIndex=f irstEdgeIndexes[0];for(var srcNodeOrdinal=0;srcNodeOrdinal<nodeCount;++srcNodeOr dinal){var firstEdgeIndex=nextNodeFirstEdgeIndex;nextNodeFirstEdgeIndex=firstEdg eIndexes[srcNodeOrdinal+1];var srcNodeIndex=srcNodeOrdinal*nodeFieldCount;for(va r edgeIndex=firstEdgeIndex;edgeIndex<nextNodeFirstEdgeIndex;edgeIndex+=edgeField sCount){var toNodeIndex=containmentEdges[edgeIndex+edgeToNodeOffset];if(toNodeIn dex%nodeFieldCount)
141 throw new Error("Invalid toNodeIndex "+toNodeIndex);var firstRetainerSlotIndex=f irstRetainerIndex[toNodeIndex/nodeFieldCount];var nextUnusedRetainerSlotIndex=fi rstRetainerSlotIndex+(--retainingNodes[firstRetainerSlotIndex]);retainingNodes[n extUnusedRetainerSlotIndex]=srcNodeIndex;retainingEdges[nextUnusedRetainerSlotIn dex]=edgeIndex;}}},createNode:function(nodeIndex) 143 throw new Error("Invalid toNodeIndex "+toNodeIndex);var firstRetainerSlotIndex=f irstRetainerIndex[toNodeIndex/nodeFieldCount];var nextUnusedRetainerSlotIndex=fi rstRetainerSlotIndex+(--retainingNodes[firstRetainerSlotIndex]);retainingNodes[n extUnusedRetainerSlotIndex]=srcNodeIndex;retainingEdges[nextUnusedRetainerSlotIn dex]=edgeIndex;}}},createNode:function(nodeIndex)
142 {throw new Error("Not implemented");},createEdge:function(edges,edgeIndex) 144 {throw new Error("Not implemented");},createEdge:function(edges,edgeIndex)
143 {throw new Error("Not implemented");},createRetainingEdge:function(retainedNodeI ndex,retainerIndex) 145 {throw new Error("Not implemented");},createRetainingEdge:function(retainedNodeI ndex,retainerIndex)
144 {throw new Error("Not implemented");},dispose:function() 146 {throw new Error("Not implemented");},dispose:function()
145 {delete this._nodes;delete this._strings;delete this._retainingEdges;delete this ._retainingNodes;delete this._firstRetainerIndex;if(this._aggregates){delete thi s._aggregates;delete this._aggregatesSortedFlags;} 147 {delete this._nodes;delete this._strings;delete this._retainingEdges;delete this ._retainingNodes;delete this._firstRetainerIndex;if(this._aggregates){delete thi s._aggregates;delete this._aggregatesSortedFlags;}
146 delete this._dominatedNodes;delete this._firstDominatedNodeIndex;delete this._no deDistances;delete this._dominatorsTree;},_allNodes:function() 148 delete this._dominatedNodes;delete this._firstDominatedNodeIndex;delete this._no deDistances;delete this._dominatorsTree;},_allNodes:function()
147 {return new WebInspector.HeapSnapshotNodeIterator(this.rootNode());},rootNode:fu nction() 149 {return new WebInspector.HeapSnapshotNodeIterator(this.rootNode());},rootNode:fu nction()
(...skipping 16 matching lines...) Expand all
164 this._aggregatesForDiff[className]={indexes:indexes,ids:ids,selfSizes:selfSizes} ;} 166 this._aggregatesForDiff[className]={indexes:indexes,ids:ids,selfSizes:selfSizes} ;}
165 return this._aggregatesForDiff;},_isUserRoot:function(node) 167 return this._aggregatesForDiff;},_isUserRoot:function(node)
166 {return true;},forEachRoot:function(action,userRootsOnly) 168 {return true;},forEachRoot:function(action,userRootsOnly)
167 {for(var iter=this.rootNode().edges();iter.hasNext();iter.next()){var node=iter. edge.node();if(!userRootsOnly||this._isUserRoot(node)) 169 {for(var iter=this.rootNode().edges();iter.hasNext();iter.next()){var node=iter. edge.node();if(!userRootsOnly||this._isUserRoot(node))
168 action(node);}},_calculateDistances:function() 170 action(node);}},_calculateDistances:function()
169 {var nodeFieldCount=this._nodeFieldCount;var nodeCount=this.nodeCount;var distan ces=new Int32Array(nodeCount);var noDistance=this._noDistance;for(var i=0;i<node Count;++i) 171 {var nodeFieldCount=this._nodeFieldCount;var nodeCount=this.nodeCount;var distan ces=new Int32Array(nodeCount);var noDistance=this._noDistance;for(var i=0;i<node Count;++i)
170 distances[i]=noDistance;var nodesToVisit=new Uint32Array(this.nodeCount);var nod esToVisitLength=0;function enqueueNode(node) 172 distances[i]=noDistance;var nodesToVisit=new Uint32Array(this.nodeCount);var nod esToVisitLength=0;function enqueueNode(node)
171 {var ordinal=node._ordinal();if(distances[ordinal]!==noDistance) 173 {var ordinal=node._ordinal();if(distances[ordinal]!==noDistance)
172 return;distances[ordinal]=0;nodesToVisit[nodesToVisitLength++]=node.nodeIndex;} 174 return;distances[ordinal]=0;nodesToVisit[nodesToVisitLength++]=node.nodeIndex;}
173 this.forEachRoot(enqueueNode,true);this._bfs(nodesToVisit,nodesToVisitLength,dis tances);nodesToVisitLength=0;this.forEachRoot(enqueueNode);this._bfs(nodesToVisi t,nodesToVisitLength,distances);this._nodeDistances=distances;},_bfs:function(no desToVisit,nodesToVisitLength,distances) 175 this.forEachRoot(enqueueNode,true);this._bfs(nodesToVisit,nodesToVisitLength,dis tances);nodesToVisitLength=0;this.forEachRoot(enqueueNode);this._bfs(nodesToVisi t,nodesToVisitLength,distances);this._nodeDistances=distances;},_bfs:function(no desToVisit,nodesToVisitLength,distances)
174 {var edgeFieldsCount=this._edgeFieldsCount;var nodeFieldCount=this._nodeFieldCou nt;var containmentEdges=this._containmentEdges;var firstEdgeIndexes=this._firstE dgeIndexes;var edgeToNodeOffset=this._edgeToNodeOffset;var edgeTypeOffset=this._ edgeTypeOffset;var nodes=this._nodes;var nodeCount=this.nodeCount;var containmen tEdgesLength=containmentEdges.length;var edgeWeakType=this._edgeWeakType;var noD istance=this._noDistance;var index=0;while(index<nodesToVisitLength){var nodeInd ex=nodesToVisit[index++];var nodeOrdinal=nodeIndex/nodeFieldCount;var distance=d istances[nodeOrdinal]+1;var firstEdgeIndex=firstEdgeIndexes[nodeOrdinal];var edg esEnd=firstEdgeIndexes[nodeOrdinal+1];for(var edgeIndex=firstEdgeIndex;edgeIndex <edgesEnd;edgeIndex+=edgeFieldsCount){var edgeType=containmentEdges[edgeIndex+ed geTypeOffset];if(edgeType==edgeWeakType) 176 {var edgeFieldsCount=this._edgeFieldsCount;var nodeFieldCount=this._nodeFieldCou nt;var containmentEdges=this._containmentEdges;var firstEdgeIndexes=this._firstE dgeIndexes;var edgeToNodeOffset=this._edgeToNodeOffset;var edgeTypeOffset=this._ edgeTypeOffset;var nodeCount=this.nodeCount;var containmentEdgesLength=containme ntEdges.length;var edgeWeakType=this._edgeWeakType;var noDistance=this._noDistan ce;var index=0;while(index<nodesToVisitLength){var nodeIndex=nodesToVisit[index+ +];var nodeOrdinal=nodeIndex/nodeFieldCount;var distance=distances[nodeOrdinal]+ 1;var firstEdgeIndex=firstEdgeIndexes[nodeOrdinal];var edgesEnd=firstEdgeIndexes [nodeOrdinal+1];for(var edgeIndex=firstEdgeIndex;edgeIndex<edgesEnd;edgeIndex+=e dgeFieldsCount){var edgeType=containmentEdges[edgeIndex+edgeTypeOffset];if(edgeT ype==edgeWeakType)
175 continue;var childNodeIndex=containmentEdges[edgeIndex+edgeToNodeOffset];var chi ldNodeOrdinal=childNodeIndex/nodeFieldCount;if(distances[childNodeOrdinal]!==noD istance) 177 continue;var childNodeIndex=containmentEdges[edgeIndex+edgeToNodeOffset];var chi ldNodeOrdinal=childNodeIndex/nodeFieldCount;if(distances[childNodeOrdinal]!==noD istance)
176 continue;distances[childNodeOrdinal]=distance;nodesToVisit[nodesToVisitLength++] =childNodeIndex;}} 178 continue;distances[childNodeOrdinal]=distance;nodesToVisit[nodesToVisitLength++] =childNodeIndex;}}
177 if(nodesToVisitLength>nodeCount) 179 if(nodesToVisitLength>nodeCount)
178 throw new Error("BFS failed. Nodes to visit ("+nodesToVisitLength+") is more tha n nodes count ("+nodeCount+")");},_buildAggregates:function(filter) 180 throw new Error("BFS failed. Nodes to visit ("+nodesToVisitLength+") is more tha n nodes count ("+nodeCount+")");},_buildAggregates:function(filter)
179 {var aggregates={};var aggregatesByClassName={};var classIndexes=[];var nodes=th is._nodes;var mapAndFlag=this.userObjectsMapAndFlag();var flags=mapAndFlag?mapAn dFlag.map:null;var flag=mapAndFlag?mapAndFlag.flag:0;var nodesLength=nodes.lengt h;var nodeNativeType=this._nodeNativeType;var nodeFieldCount=this._nodeFieldCoun t;var selfSizeOffset=this._nodeSelfSizeOffset;var nodeTypeOffset=this._nodeTypeO ffset;var node=this.rootNode();var nodeDistances=this._nodeDistances;for(var nod eIndex=0;nodeIndex<nodesLength;nodeIndex+=nodeFieldCount){var nodeOrdinal=nodeIn dex/nodeFieldCount;if(flags&&!(flags[nodeOrdinal]&flag)) 181 {var aggregates={};var aggregatesByClassName={};var classIndexes=[];var nodes=th is._nodes;var mapAndFlag=this.userObjectsMapAndFlag();var flags=mapAndFlag?mapAn dFlag.map:null;var flag=mapAndFlag?mapAndFlag.flag:0;var nodesLength=nodes.lengt h;var nodeNativeType=this._nodeNativeType;var nodeFieldCount=this._nodeFieldCoun t;var selfSizeOffset=this._nodeSelfSizeOffset;var nodeTypeOffset=this._nodeTypeO ffset;var node=this.rootNode();var nodeDistances=this._nodeDistances;for(var nod eIndex=0;nodeIndex<nodesLength;nodeIndex+=nodeFieldCount){var nodeOrdinal=nodeIn dex/nodeFieldCount;if(flags&&!(flags[nodeOrdinal]&flag))
180 continue;node.nodeIndex=nodeIndex;if(filter&&!filter(node)) 182 continue;node.nodeIndex=nodeIndex;if(filter&&!filter(node))
181 continue;var selfSize=nodes[nodeIndex+selfSizeOffset];if(!selfSize&&nodes[nodeIn dex+nodeTypeOffset]!==nodeNativeType) 183 continue;var selfSize=nodes[nodeIndex+selfSizeOffset];if(!selfSize&&nodes[nodeIn dex+nodeTypeOffset]!==nodeNativeType)
182 continue;var classIndex=node.classIndex();if(!(classIndex in aggregates)){var no deType=node.type();var nameMatters=nodeType==="object"||nodeType==="native";var value={count:1,distance:nodeDistances[nodeOrdinal],self:selfSize,maxRet:0,type:n odeType,name:nameMatters?node.name():null,idxs:[nodeIndex]};aggregates[classInde x]=value;classIndexes.push(classIndex);aggregatesByClassName[node.className()]=v alue;}else{var clss=aggregates[classIndex];clss.distance=Math.min(clss.distance, nodeDistances[nodeOrdinal]);++clss.count;clss.self+=selfSize;clss.idxs.push(node Index);}} 184 continue;var classIndex=node.classIndex();if(!(classIndex in aggregates)){var no deType=node.type();var nameMatters=nodeType==="object"||nodeType==="native";var value={count:1,distance:nodeDistances[nodeOrdinal],self:selfSize,maxRet:0,type:n odeType,name:nameMatters?node.name():null,idxs:[nodeIndex]};aggregates[classInde x]=value;classIndexes.push(classIndex);aggregatesByClassName[node.className()]=v alue;}else{var clss=aggregates[classIndex];clss.distance=Math.min(clss.distance, nodeDistances[nodeOrdinal]);++clss.count;clss.self+=selfSize;clss.idxs.push(node Index);}}
183 for(var i=0,l=classIndexes.length;i<l;++i){var classIndex=classIndexes[i];aggreg ates[classIndex].idxs=aggregates[classIndex].idxs.slice();} 185 for(var i=0,l=classIndexes.length;i<l;++i){var classIndex=classIndexes[i];aggreg ates[classIndex].idxs=aggregates[classIndex].idxs.slice();}
184 return{aggregatesByClassName:aggregatesByClassName,aggregatesByClassIndex:aggreg ates};},_calculateClassesRetainedSize:function(aggregates,filter) 186 return{aggregatesByClassName:aggregatesByClassName,aggregatesByClassIndex:aggreg ates};},_calculateClassesRetainedSize:function(aggregates,filter)
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 return;this._snapshot.nodes=this._array;this._state="find-edges";this._array=nul l;break;} 347 return;this._snapshot.nodes=this._array;this._state="find-edges";this._array=nul l;break;}
346 case"find-edges":{var edgesToken="\"edges\"";var edgesTokenIndex=this._json.inde xOf(edgesToken);if(edgesTokenIndex===-1) 348 case"find-edges":{var edgesToken="\"edges\"";var edgesTokenIndex=this._json.inde xOf(edgesToken);if(edgesTokenIndex===-1)
347 return;var bracketIndex=this._json.indexOf("[",edgesTokenIndex);if(bracketIndex= ==-1) 349 return;var bracketIndex=this._json.indexOf("[",edgesTokenIndex);if(bracketIndex= ==-1)
348 return;this._json=this._json.slice(bracketIndex+1);var edge_fields_count=this._s napshot.snapshot.meta.edge_fields.length;var edges_length=this._snapshot.snapsho t.edge_count*edge_fields_count;this._array=new Uint32Array(edges_length);this._a rrayIndex=0;this._state="parse-edges";break;} 350 return;this._json=this._json.slice(bracketIndex+1);var edge_fields_count=this._s napshot.snapshot.meta.edge_fields.length;var edges_length=this._snapshot.snapsho t.edge_count*edge_fields_count;this._array=new Uint32Array(edges_length);this._a rrayIndex=0;this._state="parse-edges";break;}
349 case"parse-edges":{var hasMoreData=this._parseUintArray();this._progress.updateP rogress("Loading edges\u2026 %d\%",this._arrayIndex,this._array.length);if(hasMo reData) 351 case"parse-edges":{var hasMoreData=this._parseUintArray();this._progress.updateP rogress("Loading edges\u2026 %d\%",this._arrayIndex,this._array.length);if(hasMo reData)
350 return;this._snapshot.edges=this._array;this._array=null;if(WebInspector.HeapSna pshot.enableAllocationProfiler) 352 return;this._snapshot.edges=this._array;this._array=null;if(WebInspector.HeapSna pshot.enableAllocationProfiler)
351 this._state="find-trace-function-infos";else 353 this._state="find-trace-function-infos";else
352 this._state="find-strings";break;} 354 this._state="find-strings";break;}
353 case"find-trace-function-infos":{var tracesToken="\"trace_function_infos\"";var tracesTokenIndex=this._json.indexOf(tracesToken);if(tracesTokenIndex===-1) 355 case"find-trace-function-infos":{var tracesToken="\"trace_function_infos\"";var tracesTokenIndex=this._json.indexOf(tracesToken);if(tracesTokenIndex===-1)
354 return;var bracketIndex=this._json.indexOf("[",tracesTokenIndex);if(bracketIndex ===-1) 356 return;var bracketIndex=this._json.indexOf("[",tracesTokenIndex);if(bracketIndex ===-1)
355 return;this._json=this._json.slice(bracketIndex+1);var trace_function_info_field _count=3;var trace_function_info_length=this._snapshot.snapshot.trace_function_c ount*trace_function_info_field_count;this._array=new Uint32Array(trace_function_ info_length);this._arrayIndex=0;this._state="parse-trace-function-infos";break;} 357 return;this._json=this._json.slice(bracketIndex+1);var trace_function_info_field _count=this._snapshot.snapshot.meta.trace_function_info_fields.length;var trace_ function_info_length=this._snapshot.snapshot.trace_function_count*trace_function _info_field_count;this._array=new Uint32Array(trace_function_info_length);this._ arrayIndex=0;this._state="parse-trace-function-infos";break;}
356 case"parse-trace-function-infos":{if(this._parseUintArray()) 358 case"parse-trace-function-infos":{if(this._parseUintArray())
357 return;this._snapshot.trace_function_infos=this._array;this._array=null;this._st ate="find-trace-tree";break;} 359 return;this._snapshot.trace_function_infos=this._array;this._array=null;this._st ate="find-trace-tree";break;}
358 case"find-trace-tree":{var tracesToken="\"trace_tree\"";var tracesTokenIndex=thi s._json.indexOf(tracesToken);if(tracesTokenIndex===-1) 360 case"find-trace-tree":{var tracesToken="\"trace_tree\"";var tracesTokenIndex=thi s._json.indexOf(tracesToken);if(tracesTokenIndex===-1)
359 return;var bracketIndex=this._json.indexOf("[",tracesTokenIndex);if(bracketIndex ===-1) 361 return;var bracketIndex=this._json.indexOf("[",tracesTokenIndex);if(bracketIndex ===-1)
360 return;this._json=this._json.slice(bracketIndex);this._state="parse-trace-tree"; break;} 362 return;this._json=this._json.slice(bracketIndex);this._state="parse-trace-tree"; break;}
361 case"parse-trace-tree":{var stringsToken="\"strings\"";var stringsTokenIndex=thi s._json.indexOf(stringsToken);if(stringsTokenIndex===-1) 363 case"parse-trace-tree":{var stringsToken="\"strings\"";var stringsTokenIndex=thi s._json.indexOf(stringsToken);if(stringsTokenIndex===-1)
362 return;var bracketIndex=this._json.lastIndexOf("]",stringsTokenIndex);this._snap shot.trace_tree=JSON.parse(this._json.substring(0,bracketIndex+1));this._json=th is._json.slice(bracketIndex);this._state="find-strings";this._progress.updateSta tus("Loading strings\u2026");break;} 364 return;var bracketIndex=this._json.lastIndexOf("]",stringsTokenIndex);this._snap shot.trace_tree=JSON.parse(this._json.substring(0,bracketIndex+1));this._json=th is._json.slice(bracketIndex);this._state="find-strings";this._progress.updateSta tus("Loading strings\u2026");break;}
363 case"find-strings":{var stringsToken="\"strings\"";var stringsTokenIndex=this._j son.indexOf(stringsToken);if(stringsTokenIndex===-1) 365 case"find-strings":{var stringsToken="\"strings\"";var stringsTokenIndex=this._j son.indexOf(stringsToken);if(stringsTokenIndex===-1)
364 return;var bracketIndex=this._json.indexOf("[",stringsTokenIndex);if(bracketInde x===-1) 366 return;var bracketIndex=this._json.indexOf("[",stringsTokenIndex);if(bracketInde x===-1)
365 return;this._json=this._json.slice(bracketIndex);this._state="accumulate-strings ";break;} 367 return;this._json=this._json.slice(bracketIndex);this._state="accumulate-strings ";break;}
366 case"accumulate-strings":return;}}}};;WebInspector.HeapSnapshotWorkerDispatcher= function(globalObject,postMessage) 368 case"accumulate-strings":return;}}}};;WebInspector.HeapSnapshotWorkerDispatcher= function(globalObject,postMessage)
367 {this._objects=[];this._global=globalObject;this._postMessage=postMessage;} 369 {this._objects=[];this._global=globalObject;this._postMessage=postMessage;}
368 WebInspector.HeapSnapshotWorkerDispatcher.prototype={_findFunction:function(name ) 370 WebInspector.HeapSnapshotWorkerDispatcher.prototype={_findFunction:function(name )
369 {var path=name.split(".");var result=this._global;for(var i=0;i<path.length;++i) 371 {var path=name.split(".");var result=this._global;for(var i=0;i<path.length;++i)
370 result=result[path[i]];return result;},sendEvent:function(name,data) 372 result=result[path[i]];return result;},sendEvent:function(name,data)
371 {this._postMessage({eventName:name,data:data});},dispatchMessage:function(event) 373 {this._postMessage({eventName:name,data:data});},dispatchMessage:function(event)
372 {var data=event.data;var response={callId:data.callId};try{switch(data.dispositi on){case"create":{var constructorFunction=this._findFunction(data.methodName);th is._objects[data.objectId]=new constructorFunction(this);break;} 374 {var data=event.data;var response={callId:data.callId};try{switch(data.dispositi on){case"create":{var constructorFunction=this._findFunction(data.methodName);th is._objects[data.objectId]=new constructorFunction(this);break;}
373 case"dispose":{delete this._objects[data.objectId];break;} 375 case"dispose":{delete this._objects[data.objectId];break;}
374 case"getter":{var object=this._objects[data.objectId];var result=object[data.met hodName];response.result=result;break;} 376 case"getter":{var object=this._objects[data.objectId];var result=object[data.met hodName];response.result=result;break;}
375 case"factory":{var object=this._objects[data.objectId];var result=object[data.me thodName].apply(object,data.methodArguments);if(result) 377 case"factory":{var object=this._objects[data.objectId];var result=object[data.me thodName].apply(object,data.methodArguments);if(result)
376 this._objects[data.newObjectId]=result;response.result=!!result;break;} 378 this._objects[data.newObjectId]=result;response.result=!!result;break;}
377 case"method":{var object=this._objects[data.objectId];response.result=object[dat a.methodName].apply(object,data.methodArguments);break;}}}catch(e){response.erro r=e.toString();response.errorCallStack=e.stack;if(data.methodName) 379 case"method":{var object=this._objects[data.objectId];response.result=object[dat a.methodName].apply(object,data.methodArguments);break;}}}catch(e){response.erro r=e.toString();response.errorCallStack=e.stack;if(data.methodName)
378 response.errorMethodName=data.methodName;} 380 response.errorMethodName=data.methodName;}
379 this._postMessage(response);}};;WebInspector.JSHeapSnapshot=function(profile,pro gress) 381 this._postMessage(response);}};;WebInspector.JSHeapSnapshot=function(profile,pro gress)
380 {this._nodeFlags={canBeQueried:1,detachedDOMTreeNode:2,pageObject:4,visitedMarke rMask:0x0ffff,visitedMarker:0x10000};this._lazyStringCache={};WebInspector.HeapS napshot.call(this,profile,progress);} 382 {this._nodeFlags={canBeQueried:1,detachedDOMTreeNode:2,pageObject:4,visitedMarke rMask:0x0ffff,visitedMarker:0x10000};this._lazyStringCache={};WebInspector.HeapS napshot.call(this,profile,progress);}
381 WebInspector.JSHeapSnapshot.prototype={createNode:function(nodeIndex) 383 WebInspector.JSHeapSnapshot.prototype={maxJsNodeId:function()
384 {var nodeFieldCount=this._nodeFieldCount;var nodes=this._nodes;var nodesLength=n odes.length;var id=0;for(var nodeIndex=this._nodeIdOffset;nodeIndex<nodesLength; nodeIndex+=nodeFieldCount){var nextId=nodes[nodeIndex];if(nextId%2===0)
385 continue;if(id<nodes[nodeIndex])
386 id=nodes[nodeIndex];}
387 return id;},createNode:function(nodeIndex)
382 {return new WebInspector.JSHeapSnapshotNode(this,nodeIndex);},createEdge:functio n(edges,edgeIndex) 388 {return new WebInspector.JSHeapSnapshotNode(this,nodeIndex);},createEdge:functio n(edges,edgeIndex)
383 {return new WebInspector.JSHeapSnapshotEdge(this,edges,edgeIndex);},createRetain ingEdge:function(retainedNodeIndex,retainerIndex) 389 {return new WebInspector.JSHeapSnapshotEdge(this,edges,edgeIndex);},createRetain ingEdge:function(retainedNodeIndex,retainerIndex)
384 {return new WebInspector.JSHeapSnapshotRetainerEdge(this,retainedNodeIndex,retai nerIndex);},classNodesFilter:function() 390 {return new WebInspector.JSHeapSnapshotRetainerEdge(this,retainedNodeIndex,retai nerIndex);},classNodesFilter:function()
385 {function filter(node) 391 {function filter(node)
386 {return node.isUserObject();} 392 {return node.isUserObject();}
387 return filter;},containmentEdgesFilter:function(showHiddenData) 393 return filter;},containmentEdgesFilter:function(showHiddenData)
388 {function filter(edge){if(edge.isInvisible()) 394 {function filter(edge){if(edge.isInvisible())
389 return false;if(showHiddenData) 395 return false;if(showHiddenData)
390 return true;return!edge.isHidden()&&!edge.node().isHidden();} 396 return true;return!edge.isHidden()&&!edge.node().isHidden();}
391 return filter;},retainingEdgesFilter:function(showHiddenData) 397 return filter;},retainingEdgesFilter:function(showHiddenData)
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 {this._pendingIncomingCallbacksCount=0;} 816 {this._pendingIncomingCallbacksCount=0;}
811 CallbackBarrier.prototype={createCallback:function(userCallback) 817 CallbackBarrier.prototype={createCallback:function(userCallback)
812 {console.assert(!this._outgoingCallback,"CallbackBarrier.createCallback() is cal led after CallbackBarrier.callWhenDone()");++this._pendingIncomingCallbacksCount ;return this._incomingCallback.bind(this,userCallback);},callWhenDone:function(c allback) 818 {console.assert(!this._outgoingCallback,"CallbackBarrier.createCallback() is cal led after CallbackBarrier.callWhenDone()");++this._pendingIncomingCallbacksCount ;return this._incomingCallback.bind(this,userCallback);},callWhenDone:function(c allback)
813 {console.assert(!this._outgoingCallback,"CallbackBarrier.callWhenDone() is calle d multiple times");this._outgoingCallback=callback;if(!this._pendingIncomingCall backsCount) 819 {console.assert(!this._outgoingCallback,"CallbackBarrier.callWhenDone() is calle d multiple times");this._outgoingCallback=callback;if(!this._pendingIncomingCall backsCount)
814 this._outgoingCallback();},_incomingCallback:function(userCallback) 820 this._outgoingCallback();},_incomingCallback:function(userCallback)
815 {console.assert(this._pendingIncomingCallbacksCount>0);if(userCallback){var args =Array.prototype.slice.call(arguments,1);userCallback.apply(null,args);} 821 {console.assert(this._pendingIncomingCallbacksCount>0);if(userCallback){var args =Array.prototype.slice.call(arguments,1);userCallback.apply(null,args);}
816 if(!--this._pendingIncomingCallbacksCount&&this._outgoingCallback) 822 if(!--this._pendingIncomingCallbacksCount&&this._outgoingCallback)
817 this._outgoingCallback();}};function postMessageWrapper(message) 823 this._outgoingCallback();}};function postMessageWrapper(message)
818 {postMessage(message);} 824 {postMessage(message);}
819 var dispatcher=new WebInspector.HeapSnapshotWorkerDispatcher(this,postMessageWra pper);addEventListener("message",dispatcher.dispatchMessage.bind(dispatcher),fal se); 825 var dispatcher=new WebInspector.HeapSnapshotWorkerDispatcher(this,postMessageWra pper);addEventListener("message",dispatcher.dispatchMessage.bind(dispatcher),fal se);
OLDNEW
« no previous file with comments | « chrome_linux/resources/inspector/ElementsPanel.js ('k') | chrome_linux/resources/inspector/Images/navigationControls.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698