OLD | NEW |
1 WebInspector={};WebInspector.AllocationProfile=function(profile) | 1 WebInspector={};WebInspector.AllocationProfile=function(profile,liveObjectStats) |
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);} | 2 {this._strings=profile.strings;this._liveObjectStats=liveObjectStats;this._nextN
odeId=1;this._functionInfos=[] |
3 WebInspector.AllocationProfile.prototype={_buildAllocationFunctionInfos:function
(profile) | 3 this._idToNode={};this._collapsedTopNodeIdToFunctionInfo={};this._traceTops=null
;this._buildFunctionAllocationInfos(profile);this._traceTree=this._buildAllocati
onTree(profile,liveObjectStats);} |
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) | 4 WebInspector.AllocationProfile.prototype={_buildFunctionAllocationInfos:function
(profile) |
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) | 5 {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 rawInfos=profile.trace_function_infos;var infoLength=rawI
nfos.length;var functionInfos=this._functionInfos=new Array(infoLength/functionI
nfoFieldCount);var index=0;for(var i=0;i<infoLength;i+=functionInfoFieldCount){f
unctionInfos[index++]=new WebInspector.FunctionAllocationInfo(strings[rawInfos[i
+functionNameOffset]],strings[rawInfos[i+scriptNameOffset]],rawInfos[i+scriptIdO
ffset],rawInfos[i+lineOffset],rawInfos[i+columnOffset]);}},_buildAllocationTree:
function(profile,liveObjectStats) |
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 traceTreeRaw=profile.trace_tree;var functionInfos=this._functionInfos;var t
raceNodeFields=profile.snapshot.meta.trace_node_fields;var nodeIdOffset=traceNod
eFields.indexOf("id");var functionInfoIndexOffset=traceNodeFields.indexOf("funct
ion_info_index");var allocationCountOffset=traceNodeFields.indexOf("count");var
allocationSizeOffset=traceNodeFields.indexOf("size");var childrenOffset=traceNod
eFields.indexOf("children");var nodeFieldCount=traceNodeFields.length;function t
raverseNode(rawNodeArray,nodeOffset,parent) |
| 7 {var functionInfo=functionInfos[rawNodeArray[nodeOffset+functionInfoIndexOffset]
];var id=rawNodeArray[nodeOffset+nodeIdOffset];var stats=liveObjectStats[id];var
liveCount=stats?stats.count:0;var liveSize=stats?stats.size:0;var result=new We
bInspector.TopDownAllocationNode(id,functionInfo,rawNodeArray[nodeOffset+allocat
ionCountOffset],rawNodeArray[nodeOffset+allocationSizeOffset],liveCount,liveSize
,parent);functionInfo.addTraceTopNode(result);var rawChildren=rawNodeArray[nodeO
ffset+childrenOffset];for(var i=0;i<rawChildren.length;i+=nodeFieldCount){result
.children.push(traverseNode(rawChildren,i,result));} |
7 return result;} | 8 return result;} |
8 return traverseNode(traceTreeRaw,0,null);},serializeTraceTops:function() | 9 return traverseNode(traceTreeRaw,0,null);},serializeTraceTops:function() |
9 {if(this._traceTops) | 10 {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) | 11 return this._traceTops;var result=this._traceTops=[];var functionInfos=this._fun
ctionInfos;for(var i=0;i<functionInfos.length;i++){var info=functionInfos[i];if(
info.totalCount===0) |
11 continue;var nodeId=this._nextNodeId++;result.push(this._serializeNode(nodeId,in
fo,info.totalCount,info.totalSize,true));this._collapsedTopNodeIdToFunctionInfo[
nodeId]=info;} | 12 continue;var nodeId=this._nextNodeId++;result.push(this._serializeNode(nodeId,in
fo,info.totalCount,info.totalSize,info.totalLiveCount,info.totalLiveSize,true));
this._collapsedTopNodeIdToFunctionInfo[nodeId]=info;} |
12 result.sort(function(a,b){return b.size-a.size;});return result;},serializeCalle
rs:function(nodeId) | 13 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;} | 14 {var node=this._ensureBottomUpNode(nodeId);var nodesWithSingleCaller=[];while(no
de.callers().length===1){node=node.callers()[0];nodesWithSingleCaller.push(this.
_serializeCaller(node));} |
14 var nodesWithSingleCaller=[];while(node.callers().length===1){node=node.callers(
)[0];nodesWithSingleCaller.push(this._serializeCaller(node));} | |
15 var branchingCallers=[];var callers=node.callers();for(var i=0;i<callers.length;
i++){branchingCallers.push(this._serializeCaller(callers[i]));} | 15 var branchingCallers=[];var callers=node.callers();for(var i=0;i<callers.length;
i++){branchingCallers.push(this._serializeCaller(callers[i]));} |
16 return{nodesWithSingleCaller:nodesWithSingleCaller,branchingCallers:branchingCal
lers};},_serializeCaller:function(node) | 16 return new WebInspector.HeapSnapshotCommon.AllocationNodeCallers(nodesWithSingle
Caller,branchingCallers);},traceIds:function(allocationNodeId) |
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) | 17 {return this._ensureBottomUpNode(allocationNodeId).traceTopIds;},_ensureBottomUp
Node:function(nodeId) |
18 {return{id:nodeId,name:functionInfo.functionName,scriptName:functionInfo.scriptN
ame,line:functionInfo.line,column:functionInfo.column,count:count,size:size,hasC
hildren:hasChildren};}} | 18 {var node=this._idToNode[nodeId];if(!node){var functionInfo=this._collapsedTopNo
deIdToFunctionInfo[nodeId];node=functionInfo.bottomUpRoot();delete this._collaps
edTopNodeIdToFunctionInfo[nodeId];this._idToNode[nodeId]=node;} |
19 WebInspector.AllocationTraceNode=function(id,functionInfo,count,size,parent) | 19 return node;},_serializeCaller:function(node) |
20 {this.id=id;this.functionInfo=functionInfo;this.allocationCount=count;this.alloc
ationSize=size;this.parent=parent;this.children=[];} | 20 {var callerId=this._nextNodeId++;this._idToNode[callerId]=node;return this._seri
alizeNode(callerId,node.functionInfo,node.allocationCount,node.allocationSize,no
de.liveCount,node.liveSize,node.hasCallers());},_serializeNode:function(nodeId,f
unctionInfo,count,size,liveCount,liveSize,hasChildren) |
21 WebInspector.AllocationBackTraceNode=function(functionInfo) | 21 {return new WebInspector.HeapSnapshotCommon.SerializedAllocationNode(nodeId,func
tionInfo.functionName,functionInfo.scriptName,functionInfo.line,functionInfo.col
umn,count,size,liveCount,liveSize,hasChildren);}} |
22 {this.functionInfo=functionInfo;this.allocationCount=0;this.allocationSize=0;thi
s._callers=[];} | 22 WebInspector.TopDownAllocationNode=function(id,functionInfo,count,size,liveCount
,liveSize,parent) |
23 WebInspector.AllocationBackTraceNode.prototype={addCaller:function(traceNode) | 23 {this.id=id;this.functionInfo=functionInfo;this.allocationCount=count;this.alloc
ationSize=size;this.liveCount=liveCount;this.liveSize=liveSize;this.parent=paren
t;this.children=[];} |
| 24 WebInspector.BottomUpAllocationNode=function(functionInfo) |
| 25 {this.functionInfo=functionInfo;this.allocationCount=0;this.allocationSize=0;thi
s.liveCount=0;this.liveSize=0;this.traceTopIds=[];this._callers=[];} |
| 26 WebInspector.BottomUpAllocationNode.prototype={addCaller:function(traceNode) |
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;}} | 27 {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;}} |
25 if(!result){result=new WebInspector.AllocationBackTraceNode(functionInfo);this._
callers.push(result);} | 28 if(!result){result=new WebInspector.BottomUpAllocationNode(functionInfo);this._c
allers.push(result);} |
26 return result;},callers:function() | 29 return result;},callers:function() |
27 {return this._callers;},hasCallers:function() | 30 {return this._callers;},hasCallers:function() |
28 {return this._callers.length>0;}} | 31 {return this._callers.length>0;}} |
29 WebInspector.FunctionAllocationInfo=function(functionName,scriptName,scriptId,li
ne,column) | 32 WebInspector.FunctionAllocationInfo=function(functionName,scriptName,scriptId,li
ne,column) |
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=[];} | 33 {this.functionName=functionName;this.scriptName=scriptName;this.scriptId=scriptI
d;this.line=line;this.column=column;this.totalCount=0;this.totalSize=0;this.tota
lLiveCount=0;this.totalLiveSize=0;this._traceTops=[];} |
31 WebInspector.FunctionAllocationInfo.prototype={addTraceTopNode:function(node) | 34 WebInspector.FunctionAllocationInfo.prototype={addTraceTopNode:function(node) |
32 {if(node.allocationCount===0) | 35 {if(node.allocationCount===0) |
33 return;this._traceTops.push(node);this.totalCount+=node.allocationCount;this.tot
alSize+=node.allocationSize;},tracesWithThisTop:function() | 36 return;this._traceTops.push(node);this.totalCount+=node.allocationCount;this.tot
alSize+=node.allocationSize;this.totalLiveCount+=node.liveCount;this.totalLiveSi
ze+=node.liveSize;},bottomUpRoot:function() |
34 {if(!this._traceTops.length) | 37 {if(!this._traceTops.length) |
35 return null;if(!this._backTraceTree) | 38 return null;if(!this._bottomUpTree) |
36 this._buildAllocationTraceTree();return this._backTraceTree;},_buildAllocationTr
aceTree:function() | 39 this._buildAllocationTraceTree();return this._bottomUpTree;},_buildAllocationTra
ceTree:function() |
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;} | 40 {this._bottomUpTree=new WebInspector.BottomUpAllocationNode(this);for(var i=0;i<
this._traceTops.length;i++){var node=this._traceTops[i];var bottomUpNode=this._b
ottomUpTree;var count=node.allocationCount;var size=node.allocationSize;var live
Count=node.liveCount;var liveSize=node.liveSize;var traceId=node.id;while(true){
bottomUpNode.allocationCount+=count;bottomUpNode.allocationSize+=size;bottomUpNo
de.liveCount+=liveCount;bottomUpNode.liveSize+=liveSize;bottomUpNode.traceTopIds
.push(traceId);node=node.parent;if(node===null){break;} |
38 backTraceNode=backTraceNode.addCaller(node);}}}};WebInspector.HeapSnapshotArrayS
lice=function(array,start,end) | 41 bottomUpNode=bottomUpNode.addCaller(node);}}}};WebInspector.HeapSnapshotItem=fun
ction(){} |
39 {this._array=array;this._start=start;this.length=end-start;} | 42 WebInspector.HeapSnapshotItem.prototype={itemIndex:function(){},serialize:functi
on(){}};WebInspector.HeapSnapshotEdge=function(snapshot,edgeIndex) |
40 WebInspector.HeapSnapshotArraySlice.prototype={item:function(index) | 43 {this._snapshot=snapshot;this._edges=snapshot._containmentEdges;this.edgeIndex=e
dgeIndex||0;} |
41 {return this._array[this._start+index];},slice:function(start,end) | 44 WebInspector.HeapSnapshotEdge.Serialized=function(name,node,nodeIndex,type) |
42 {if(typeof end==="undefined") | 45 {this.name=name;this.node=node;this.nodeIndex=nodeIndex;this.type=type;};WebInsp
ector.HeapSnapshotEdge.prototype={clone:function() |
43 end=this.length;return this._array.subarray(this._start+start,this._start+end);}
} | 46 {return new WebInspector.HeapSnapshotEdge(this._snapshot,this.edgeIndex);},hasSt
ringName:function() |
44 WebInspector.HeapSnapshotEdge=function(snapshot,edges,edgeIndex) | |
45 {this._snapshot=snapshot;this._edges=edges;this.edgeIndex=edgeIndex||0;} | |
46 WebInspector.HeapSnapshotEdge.prototype={clone:function() | |
47 {return new WebInspector.HeapSnapshotEdge(this._snapshot,this._edges,this.edgeIn
dex);},hasStringName:function() | |
48 {throw new Error("Not implemented");},name:function() | 47 {throw new Error("Not implemented");},name:function() |
49 {throw new Error("Not implemented");},node:function() | 48 {throw new Error("Not implemented");},node:function() |
50 {return this._snapshot.createNode(this.nodeIndex());},nodeIndex:function() | 49 {return this._snapshot.createNode(this.nodeIndex());},nodeIndex:function() |
51 {return this._edges.item(this.edgeIndex+this._snapshot._edgeToNodeOffset);},rawE
dges:function() | 50 {return this._edges[this.edgeIndex+this._snapshot._edgeToNodeOffset];},toString:
function() |
52 {return this._edges;},toString:function() | |
53 {return"HeapSnapshotEdge: "+this.name();},type:function() | 51 {return"HeapSnapshotEdge: "+this.name();},type:function() |
54 {return this._snapshot._edgeTypes[this._type()];},serialize:function() | 52 {return this._snapshot._edgeTypes[this._type()];},itemIndex:function() |
55 {var node=this.node();return{name:this.name(),node:node.serialize(),nodeIndex:th
is.nodeIndex(),type:this.type(),distance:node.distance()};},_type:function() | 53 {return this.edgeIndex;},serialize:function() |
56 {return this._edges.item(this.edgeIndex+this._snapshot._edgeTypeOffset);}};WebIn
spector.HeapSnapshotEdgeIterator=function(edge) | 54 {var node=this.node();return new WebInspector.HeapSnapshotEdge.Serialized(this.n
ame(),node.serialize(),this.nodeIndex(),this.type());},_type:function() |
57 {this.edge=edge;} | 55 {return this._edges[this.edgeIndex+this._snapshot._edgeTypeOffset];}};WebInspect
or.HeapSnapshotItemIterator=function(){} |
58 WebInspector.HeapSnapshotEdgeIterator.prototype={rewind:function() | 56 WebInspector.HeapSnapshotItemIterator.prototype={hasNext:function(){},item:funct
ion(){},next:function(){}};WebInspector.HeapSnapshotItemIndexProvider=function()
{} |
59 {this.edge.edgeIndex=0;},hasNext:function() | 57 WebInspector.HeapSnapshotItemIndexProvider.prototype={itemForIndex:function(newI
ndex){},};WebInspector.HeapSnapshotNodeIndexProvider=function(snapshot) |
60 {return this.edge.edgeIndex<this.edge._edges.length;},index:function() | 58 {this._node=snapshot.createNode();} |
61 {return this.edge.edgeIndex;},setIndex:function(newIndex) | 59 WebInspector.HeapSnapshotNodeIndexProvider.prototype={itemForIndex:function(inde
x) |
62 {this.edge.edgeIndex=newIndex;},item:function() | 60 {this._node.nodeIndex=index;return this._node;}};WebInspector.HeapSnapshotEdgeIn
dexProvider=function(snapshot) |
| 61 {this._edge=snapshot.createEdge(0);} |
| 62 WebInspector.HeapSnapshotEdgeIndexProvider.prototype={itemForIndex:function(inde
x) |
| 63 {this._edge.edgeIndex=index;return this._edge;}};WebInspector.HeapSnapshotRetain
erEdgeIndexProvider=function(snapshot) |
| 64 {this._retainerEdge=snapshot.createRetainingEdge(0);} |
| 65 WebInspector.HeapSnapshotRetainerEdgeIndexProvider.prototype={itemForIndex:funct
ion(index) |
| 66 {this._retainerEdge.setRetainerIndex(index);return this._retainerEdge;}};WebInsp
ector.HeapSnapshotEdgeIterator=function(node) |
| 67 {this._sourceNode=node;this.edge=node._snapshot.createEdge(node._edgeIndexesStar
t());} |
| 68 WebInspector.HeapSnapshotEdgeIterator.prototype={hasNext:function() |
| 69 {return this.edge.edgeIndex<this._sourceNode._edgeIndexesEnd();},item:function() |
63 {return this.edge;},next:function() | 70 {return this.edge;},next:function() |
64 {this.edge.edgeIndex+=this.edge._snapshot._edgeFieldsCount;}};WebInspector.HeapS
napshotRetainerEdge=function(snapshot,retainedNodeIndex,retainerIndex) | 71 {this.edge.edgeIndex+=this.edge._snapshot._edgeFieldsCount;}};WebInspector.HeapS
napshotRetainerEdge=function(snapshot,retainerIndex) |
65 {this._snapshot=snapshot;this._retainedNodeIndex=retainedNodeIndex;var retainedN
odeOrdinal=retainedNodeIndex/snapshot._nodeFieldCount;this._firstRetainer=snapsh
ot._firstRetainerIndex[retainedNodeOrdinal];this._retainersCount=snapshot._first
RetainerIndex[retainedNodeOrdinal+1]-this._firstRetainer;this.setRetainerIndex(r
etainerIndex);} | 72 {this._snapshot=snapshot;this.setRetainerIndex(retainerIndex);} |
| 73 WebInspector.HeapSnapshotRetainerEdge.Serialized=function(name,node,nodeIndex,ty
pe){this.name=name;this.node=node;this.nodeIndex=nodeIndex;this.type=type;} |
66 WebInspector.HeapSnapshotRetainerEdge.prototype={clone:function() | 74 WebInspector.HeapSnapshotRetainerEdge.prototype={clone:function() |
67 {return new WebInspector.HeapSnapshotRetainerEdge(this._snapshot,this._retainedN
odeIndex,this.retainerIndex());},hasStringName:function() | 75 {return new WebInspector.HeapSnapshotRetainerEdge(this._snapshot,this.retainerIn
dex());},hasStringName:function() |
68 {return this._edge().hasStringName();},name:function() | 76 {return this._edge().hasStringName();},name:function() |
69 {return this._edge().name();},node:function() | 77 {return this._edge().name();},node:function() |
70 {return this._node();},nodeIndex:function() | 78 {return this._node();},nodeIndex:function() |
71 {return this._nodeIndex;},retainerIndex:function() | 79 {return this._retainingNodeIndex;},retainerIndex:function() |
72 {return this._retainerIndex;},setRetainerIndex:function(newIndex) | 80 {return this._retainerIndex;},setRetainerIndex:function(retainerIndex) |
73 {if(newIndex!==this._retainerIndex){this._retainerIndex=newIndex;this.edgeIndex=
newIndex;}},set edgeIndex(edgeIndex) | 81 {if(retainerIndex===this._retainerIndex) |
74 {var retainerIndex=this._firstRetainer+edgeIndex;this._globalEdgeIndex=this._sna
pshot._retainingEdges[retainerIndex];this._nodeIndex=this._snapshot._retainingNo
des[retainerIndex];delete this._edgeInstance;delete this._nodeInstance;},_node:f
unction() | 82 return;this._retainerIndex=retainerIndex;this._globalEdgeIndex=this._snapshot._r
etainingEdges[retainerIndex];this._retainingNodeIndex=this._snapshot._retainingN
odes[retainerIndex];this._edgeInstance=null;this._nodeInstance=null;},set edgeIn
dex(edgeIndex) |
| 83 {this.setRetainerIndex(edgeIndex);},_node:function() |
75 {if(!this._nodeInstance) | 84 {if(!this._nodeInstance) |
76 this._nodeInstance=this._snapshot.createNode(this._nodeIndex);return this._nodeI
nstance;},_edge:function() | 85 this._nodeInstance=this._snapshot.createNode(this._retainingNodeIndex);return th
is._nodeInstance;},_edge:function() |
77 {if(!this._edgeInstance){var edgeIndex=this._globalEdgeIndex-this._node()._edgeI
ndexesStart();this._edgeInstance=this._snapshot.createEdge(this._node().rawEdges
(),edgeIndex);} | 86 {if(!this._edgeInstance) |
78 return this._edgeInstance;},toString:function() | 87 this._edgeInstance=this._snapshot.createEdge(this._globalEdgeIndex);return this.
_edgeInstance;},toString:function() |
79 {return this._edge().toString();},serialize:function() | 88 {return this._edge().toString();},itemIndex:function() |
80 {var node=this.node();return{name:this.name(),node:node.serialize(),nodeIndex:th
is.nodeIndex(),type:this.type(),distance:node.distance()};},type:function() | 89 {return this._retainerIndex;},serialize:function() |
| 90 {var node=this.node();return new WebInspector.HeapSnapshotRetainerEdge.Serialize
d(this.name(),node.serialize(),this.nodeIndex(),this.type());},type:function() |
81 {return this._edge().type();}} | 91 {return this._edge().type();}} |
82 WebInspector.HeapSnapshotRetainerEdgeIterator=function(retainer) | 92 WebInspector.HeapSnapshotRetainerEdgeIterator=function(retainedNode) |
83 {this.retainer=retainer;} | 93 {var snapshot=retainedNode._snapshot;var retainedNodeOrdinal=retainedNode._ordin
al();var retainerIndex=snapshot._firstRetainerIndex[retainedNodeOrdinal];this._r
etainersEnd=snapshot._firstRetainerIndex[retainedNodeOrdinal+1];this.retainer=sn
apshot.createRetainingEdge(retainerIndex);} |
84 WebInspector.HeapSnapshotRetainerEdgeIterator.prototype={rewind:function() | 94 WebInspector.HeapSnapshotRetainerEdgeIterator.prototype={hasNext:function() |
85 {this.retainer.setRetainerIndex(0);},hasNext:function() | 95 {return this.retainer.retainerIndex()<this._retainersEnd;},item:function() |
86 {return this.retainer.retainerIndex()<this.retainer._retainersCount;},index:func
tion() | |
87 {return this.retainer.retainerIndex();},setIndex:function(newIndex) | |
88 {this.retainer.setRetainerIndex(newIndex);},item:function() | |
89 {return this.retainer;},next:function() | 96 {return this.retainer;},next:function() |
90 {this.retainer.setRetainerIndex(this.retainer.retainerIndex()+1);}};WebInspector
.HeapSnapshotNode=function(snapshot,nodeIndex) | 97 {this.retainer.setRetainerIndex(this.retainer.retainerIndex()+1);}};WebInspector
.HeapSnapshotNode=function(snapshot,nodeIndex) |
91 {this._snapshot=snapshot;this._firstNodeIndex=nodeIndex;this.nodeIndex=nodeIndex
;} | 98 {this._snapshot=snapshot;this.nodeIndex=nodeIndex||0;} |
| 99 WebInspector.HeapSnapshotNode.Serialized=function(id,name,distance,nodeIndex,ret
ainedSize,selfSize,type){this.id=id;this.name=name;this.distance=distance;this.n
odeIndex=nodeIndex;this.retainedSize=retainedSize;this.selfSize=selfSize;this.ty
pe=type;} |
92 WebInspector.HeapSnapshotNode.prototype={distance:function() | 100 WebInspector.HeapSnapshotNode.prototype={distance:function() |
93 {return this._snapshot._nodeDistances[this.nodeIndex/this._snapshot._nodeFieldCo
unt];},className:function() | 101 {return this._snapshot._nodeDistances[this.nodeIndex/this._snapshot._nodeFieldCo
unt];},className:function() |
94 {throw new Error("Not implemented");},classIndex:function() | 102 {throw new Error("Not implemented");},classIndex:function() |
95 {throw new Error("Not implemented");},dominatorIndex:function() | 103 {throw new Error("Not implemented");},dominatorIndex:function() |
96 {var nodeFieldCount=this._snapshot._nodeFieldCount;return this._snapshot._domina
torsTree[this.nodeIndex/this._snapshot._nodeFieldCount]*nodeFieldCount;},edges:f
unction() | 104 {var nodeFieldCount=this._snapshot._nodeFieldCount;return this._snapshot._domina
torsTree[this.nodeIndex/this._snapshot._nodeFieldCount]*nodeFieldCount;},edges:f
unction() |
97 {return new WebInspector.HeapSnapshotEdgeIterator(this._snapshot.createEdge(this
.rawEdges(),0));},edgesCount:function() | 105 {return new WebInspector.HeapSnapshotEdgeIterator(this);},edgesCount:function() |
98 {return(this._edgeIndexesEnd()-this._edgeIndexesStart())/this._snapshot._edgeFie
ldsCount;},id:function() | 106 {return(this._edgeIndexesEnd()-this._edgeIndexesStart())/this._snapshot._edgeFie
ldsCount;},id:function() |
99 {throw new Error("Not implemented");},isRoot:function() | 107 {throw new Error("Not implemented");},isRoot:function() |
100 {return this.nodeIndex===this._snapshot._rootNodeIndex;},name:function() | 108 {return this.nodeIndex===this._snapshot._rootNodeIndex;},name:function() |
101 {return this._snapshot._strings[this._name()];},rawEdges:function() | 109 {return this._snapshot._strings[this._name()];},retainedSize:function() |
102 {return new WebInspector.HeapSnapshotArraySlice(this._snapshot._containmentEdges
,this._edgeIndexesStart(),this._edgeIndexesEnd());},retainedSize:function() | 110 {return this._snapshot._retainedSizes[this._ordinal()];},retainers:function() |
103 {var snapshot=this._snapshot;return snapshot._nodes[this.nodeIndex+snapshot._nod
eRetainedSizeOffset];},retainers:function() | 111 {return new WebInspector.HeapSnapshotRetainerEdgeIterator(this);},retainersCount
:function() |
104 {return new WebInspector.HeapSnapshotRetainerEdgeIterator(this._snapshot.createR
etainingEdge(this.nodeIndex,0));},selfSize:function() | 112 {var snapshot=this._snapshot;var ordinal=this._ordinal();return snapshot._firstR
etainerIndex[ordinal+1]-snapshot._firstRetainerIndex[ordinal];},selfSize:functio
n() |
105 {var snapshot=this._snapshot;return snapshot._nodes[this.nodeIndex+snapshot._nod
eSelfSizeOffset];},type:function() | 113 {var snapshot=this._snapshot;return snapshot._nodes[this.nodeIndex+snapshot._nod
eSelfSizeOffset];},type:function() |
106 {return this._snapshot._nodeTypes[this._type()];},serialize:function() | 114 {return this._snapshot._nodeTypes[this._type()];},traceNodeId:function() |
107 {return{id:this.id(),name:this.name(),distance:this.distance(),nodeIndex:this.no
deIndex,retainedSize:this.retainedSize(),selfSize:this.selfSize(),type:this.type
(),};},_name:function() | 115 {var snapshot=this._snapshot;return snapshot._nodes[this.nodeIndex+snapshot._nod
eTraceNodeIdOffset];},itemIndex:function() |
| 116 {return this.nodeIndex;},serialize:function() |
| 117 {return new WebInspector.HeapSnapshotNode.Serialized(this.id(),this.name(),this.
distance(),this.nodeIndex,this.retainedSize(),this.selfSize(),this.type());},_na
me:function() |
108 {var snapshot=this._snapshot;return snapshot._nodes[this.nodeIndex+snapshot._nod
eNameOffset];},_edgeIndexesStart:function() | 118 {var snapshot=this._snapshot;return snapshot._nodes[this.nodeIndex+snapshot._nod
eNameOffset];},_edgeIndexesStart:function() |
109 {return this._snapshot._firstEdgeIndexes[this._ordinal()];},_edgeIndexesEnd:func
tion() | 119 {return this._snapshot._firstEdgeIndexes[this._ordinal()];},_edgeIndexesEnd:func
tion() |
110 {return this._snapshot._firstEdgeIndexes[this._ordinal()+1];},_ordinal:function(
) | 120 {return this._snapshot._firstEdgeIndexes[this._ordinal()+1];},_ordinal:function(
) |
111 {return this.nodeIndex/this._snapshot._nodeFieldCount;},_nextNodeIndex:function(
) | 121 {return this.nodeIndex/this._snapshot._nodeFieldCount;},_nextNodeIndex:function(
) |
112 {return this.nodeIndex+this._snapshot._nodeFieldCount;},_type:function() | 122 {return this.nodeIndex+this._snapshot._nodeFieldCount;},_type:function() |
113 {var snapshot=this._snapshot;return snapshot._nodes[this.nodeIndex+snapshot._nod
eTypeOffset];}};WebInspector.HeapSnapshotNodeIterator=function(node) | 123 {var snapshot=this._snapshot;return snapshot._nodes[this.nodeIndex+snapshot._nod
eTypeOffset];}};WebInspector.HeapSnapshotNodeIterator=function(node) |
114 {this.node=node;this._nodesLength=node._snapshot._nodes.length;} | 124 {this.node=node;this._nodesLength=node._snapshot._nodes.length;} |
115 WebInspector.HeapSnapshotNodeIterator.prototype={rewind:function() | 125 WebInspector.HeapSnapshotNodeIterator.prototype={hasNext:function() |
116 {this.node.nodeIndex=this.node._firstNodeIndex;},hasNext:function() | 126 {return this.node.nodeIndex<this._nodesLength;},item:function() |
117 {return this.node.nodeIndex<this._nodesLength;},index:function() | |
118 {return this.node.nodeIndex;},setIndex:function(newIndex) | |
119 {this.node.nodeIndex=newIndex;},item:function() | |
120 {return this.node;},next:function() | 127 {return this.node;},next:function() |
121 {this.node.nodeIndex=this.node._nextNodeIndex();}} | 128 {this.node.nodeIndex=this.node._nextNodeIndex();}} |
| 129 WebInspector.HeapSnapshotIndexRangeIterator=function(itemProvider,indexes) |
| 130 {this._itemProvider=itemProvider;this._indexes=indexes;this._position=0;} |
| 131 WebInspector.HeapSnapshotIndexRangeIterator.prototype={hasNext:function() |
| 132 {return this._position<this._indexes.length},item:function() |
| 133 {var index=this._indexes[this._position];return this._itemProvider.itemForIndex(
index);},next:function() |
| 134 {++this._position;}} |
| 135 WebInspector.HeapSnapshotFilteredIterator=function(iterator,filter) |
| 136 {this._iterator=iterator;this._filter=filter;this._skipFilteredItems();} |
| 137 WebInspector.HeapSnapshotFilteredIterator.prototype={hasNext:function() |
| 138 {return this._iterator.hasNext();},item:function() |
| 139 {return this._iterator.item();},next:function() |
| 140 {this._iterator.next();this._skipFilteredItems();},_skipFilteredItems:function() |
| 141 {while(this._iterator.hasNext()&&!this._filter(this._iterator.item())){this._ite
rator.next();}}} |
122 WebInspector.HeapSnapshotProgress=function(dispatcher) | 142 WebInspector.HeapSnapshotProgress=function(dispatcher) |
123 {this._dispatcher=dispatcher;} | 143 {this._dispatcher=dispatcher;} |
124 WebInspector.HeapSnapshotProgress.prototype={updateStatus:function(status) | 144 WebInspector.HeapSnapshotProgress.prototype={updateStatus:function(status) |
125 {this._sendUpdateEvent(WebInspector.UIString(status));},updateProgress:function(
title,value,total) | 145 {this._sendUpdateEvent(WebInspector.UIString(status));},updateProgress:function(
title,value,total) |
126 {var percentValue=((total?(value/total):0)*100).toFixed(0);this._sendUpdateEvent
(WebInspector.UIString(title,percentValue));},_sendUpdateEvent:function(text) | 146 {var percentValue=((total?(value/total):0)*100).toFixed(0);this._sendUpdateEvent
(WebInspector.UIString(title,percentValue));},_sendUpdateEvent:function(text) |
127 {if(this._dispatcher) | 147 {if(this._dispatcher) |
128 this._dispatcher.sendEvent(WebInspector.HeapSnapshotProgressEvent.Update,text);}
} | 148 this._dispatcher.sendEvent(WebInspector.HeapSnapshotProgressEvent.Update,text);}
} |
129 WebInspector.HeapSnapshot=function(profile,progress) | 149 WebInspector.HeapSnapshot=function(profile,progress,showHiddenData) |
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) | 150 {this._nodes=profile.nodes;this._containmentEdges=profile.edges;this._metaNode=p
rofile.snapshot.meta;this._strings=profile.strings;this._progress=progress;this.
_noDistance=-5;this._rootNodeIndex=0;if(profile.snapshot.root_index) |
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");}} | 151 this._rootNodeIndex=profile.snapshot.root_index;this._snapshotDiffs={};this._agg
regatesForDiff=null;this._aggregates={};this._aggregatesSortedFlags={};this._sho
wHiddenData=showHiddenData;this._init();if(profile.snapshot.trace_function_count
){this._progress.updateStatus("Buiding allocation statistics\u2026");var nodes=t
his._nodes;var nodesLength=nodes.length;var nodeFieldCount=this._nodeFieldCount;
var node=this.rootNode();var liveObjects={};for(var nodeIndex=0;nodeIndex<nodesL
ength;nodeIndex+=nodeFieldCount){node.nodeIndex=nodeIndex;var traceNodeId=node.t
raceNodeId();var stats=liveObjects[traceNodeId];if(!stats){liveObjects[traceNode
Id]=stats={count:0,size:0,ids:[]};} |
132 WebInspector.HeapSnapshot.enableAllocationProfiler=false;function HeapSnapshotMe
tainfo() | 152 stats.count++;stats.size+=node.selfSize();stats.ids.push(node.id());} |
| 153 this._allocationProfile=new WebInspector.AllocationProfile(profile,liveObjects);
this._progress.updateStatus("Done");}} |
| 154 function HeapSnapshotMetainfo() |
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={}
;} | 155 {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={}
;} |
134 function HeapSnapshotHeader() | 156 function HeapSnapshotHeader() |
135 {this.title="";this.uid=0;this.meta=new HeapSnapshotMetainfo();this.node_count=0
;this.edge_count=0;} | 157 {this.title="";this.meta=new HeapSnapshotMetainfo();this.node_count=0;this.edge_
count=0;} |
136 WebInspector.HeapSnapshot.prototype={_init:function() | 158 WebInspector.HeapSnapshot.prototype={_init: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() | 159 {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
eTraceNodeIdOffset=meta.node_fields.indexOf("trace_node_id");this._nodeFieldCoun
t=meta.node_fields.length;this._nodeTypes=meta.node_types[this._nodeTypeOffset];
this._nodeHiddenType=this._nodeTypes.indexOf("hidden");this._nodeObjectType=this
._nodeTypes.indexOf("object");this._nodeNativeType=this._nodeTypes.indexOf("nati
ve");this._nodeConsStringType=this._nodeTypes.indexOf("concatenated string");thi
s._nodeSlicedStringType=this._nodeTypes.indexOf("sliced string");this._nodeCodeT
ype=this._nodeTypes.indexOf("code");this._nodeSyntheticType=this._nodeTypes.inde
xOf("synthetic");this._edgeFieldsCount=meta.edge_fields.length;this._edgeTypeOff
set=meta.edge_fields.indexOf("type");this._edgeNameOffset=meta.edge_fields.index
Of("name_or_index");this._edgeToNodeOffset=meta.edge_fields.indexOf("to_node");t
his._edgeTypes=meta.edge_types[this._edgeTypeOffset];this._edgeTypes.push("invis
ible");this._edgeElementType=this._edgeTypes.indexOf("element");this._edgeHidden
Type=this._edgeTypes.indexOf("hidden");this._edgeInternalType=this._edgeTypes.in
dexOf("internal");this._edgeShortcutType=this._edgeTypes.indexOf("shortcut");thi
s._edgeWeakType=this._edgeTypes.indexOf("weak");this._edgeInvisibleType=this._ed
geTypes.indexOf("invisible");this.nodeCount=this._nodes.length/this._nodeFieldCo
unt;this._edgeCount=this._containmentEdges.length/this._edgeFieldsCount;this._pr
ogress.updateStatus("Building edge indexes\u2026");this._buildEdgeIndexes();this
._progress.updateStatus("Building retainers\u2026");this._buildRetainers();this.
_progress.updateStatus("Calculating node flags\u2026");this._calculateFlags();th
is._progress.updateStatus("Calculating distances\u2026");this._calculateDistance
s();this._progress.updateStatus("Building postorder index\u2026");var result=thi
s._buildPostOrderIndex();this._progress.updateStatus("Building dominator tree\u2
026");this._dominatorsTree=this._buildDominatorTree(result.postOrderIndex2NodeOr
dinal,result.nodeOrdinal2PostOrderIndex);this._progress.updateStatus("Calculatin
g retained sizes\u2026");this._calculateRetainedSizes(result.postOrderIndex2Node
Ordinal);this._progress.updateStatus("Buiding dominated nodes\u2026");this._buil
dDominatedNodes();this._progress.updateStatus("Calculating statistics\u2026");th
is._calculateStatistics();this._progress.updateStatus("Finished processing.");},
_buildEdgeIndexes: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() | 160 {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() |
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) | 161 {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) |
140 throw new Error("Invalid toNodeIndex "+toNodeIndex);++firstRetainerIndex[toNodeI
ndex/nodeFieldCount];} | 162 throw new Error("Invalid toNodeIndex "+toNodeIndex);++firstRetainerIndex[toNodeI
ndex/nodeFieldCount];} |
141 for(var i=0,firstUnusedRetainerSlot=0;i<nodeCount;i++){var retainersCount=firstR
etainerIndex[i];firstRetainerIndex[i]=firstUnusedRetainerSlot;retainingNodes[fir
stUnusedRetainerSlot]=retainersCount;firstUnusedRetainerSlot+=retainersCount;} | 163 for(var i=0,firstUnusedRetainerSlot=0;i<nodeCount;i++){var retainersCount=firstR
etainerIndex[i];firstRetainerIndex[i]=firstUnusedRetainerSlot;retainingNodes[fir
stUnusedRetainerSlot]=retainersCount;firstUnusedRetainerSlot+=retainersCount;} |
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) | 164 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) |
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) | 165 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) |
144 {throw new Error("Not implemented");},createEdge:function(edges,edgeIndex) | 166 {throw new Error("Not implemented");},createEdge:function(edgeIndex) |
145 {throw new Error("Not implemented");},createRetainingEdge:function(retainedNodeI
ndex,retainerIndex) | 167 {throw new Error("Not implemented");},createRetainingEdge:function(retainerIndex
) |
146 {throw new Error("Not implemented");},dispose:function() | 168 {throw new Error("Not implemented");},dispose:function() |
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;} | 169 {delete this._nodes;delete this._strings;delete this._retainingEdges;delete this
._retainingNodes;delete this._firstRetainerIndex;delete this._aggregates;delete
this._aggregatesSortedFlags;delete this._dominatedNodes;delete this._firstDomina
tedNodeIndex;delete this._nodeDistances;delete this._dominatorsTree;},_allNodes:
function() |
148 delete this._dominatedNodes;delete this._firstDominatedNodeIndex;delete this._no
deDistances;delete this._dominatorsTree;},_allNodes:function() | |
149 {return new WebInspector.HeapSnapshotNodeIterator(this.rootNode());},rootNode:fu
nction() | 170 {return new WebInspector.HeapSnapshotNodeIterator(this.rootNode());},rootNode:fu
nction() |
150 {return this.createNode(this._rootNodeIndex);},get rootNodeIndex() | 171 {return this.createNode(this._rootNodeIndex);},get rootNodeIndex() |
151 {return this._rootNodeIndex;},get totalSize() | 172 {return this._rootNodeIndex;},get totalSize() |
152 {return this.rootNode().retainedSize();},_getDominatedIndex:function(nodeIndex) | 173 {return this.rootNode().retainedSize();},_getDominatedIndex:function(nodeIndex) |
153 {if(nodeIndex%this._nodeFieldCount) | 174 {if(nodeIndex%this._nodeFieldCount) |
154 throw new Error("Invalid nodeIndex: "+nodeIndex);return this._firstDominatedNode
Index[nodeIndex/this._nodeFieldCount];},_dominatedNodesOfNode:function(node) | 175 throw new Error("Invalid nodeIndex: "+nodeIndex);return this._firstDominatedNode
Index[nodeIndex/this._nodeFieldCount];},_dominatedNodesOfNode:function(node) |
155 {var dominatedIndexFrom=this._getDominatedIndex(node.nodeIndex);var dominatedInd
exTo=this._getDominatedIndex(node._nextNodeIndex());return new WebInspector.Heap
SnapshotArraySlice(this._dominatedNodes,dominatedIndexFrom,dominatedIndexTo);},a
ggregates:function(sortedIndexes,key,filterString) | 176 {var dominatedIndexFrom=this._getDominatedIndex(node.nodeIndex);var dominatedInd
exTo=this._getDominatedIndex(node._nextNodeIndex());return this._dominatedNodes.
subarray(dominatedIndexFrom,dominatedIndexTo);},aggregatesWithFilter:function(no
deFilter) |
156 {if(!this._aggregates){this._aggregates={};this._aggregatesSortedFlags={};} | 177 {var minNodeId=nodeFilter.minNodeId;var maxNodeId=nodeFilter.maxNodeId;var alloc
ationNodeId=nodeFilter.allocationNodeId;var key;var filter;if(typeof allocationN
odeId==="number"){filter=this._createAllocationStackFilter(allocationNodeId);}el
se if(typeof minNodeId==="number"&&typeof maxNodeId==="number"){key=minNodeId+".
."+maxNodeId;filter=this._createNodeIdFilter(minNodeId,maxNodeId);}else{key="all
Objects";} |
157 var aggregatesByClassName=this._aggregates[key];if(aggregatesByClassName){if(sor
tedIndexes&&!this._aggregatesSortedFlags[key]){this._sortAggregateIndexes(aggreg
atesByClassName);this._aggregatesSortedFlags[key]=sortedIndexes;} | 178 return this.aggregates(false,key,filter);},_createNodeIdFilter:function(minNodeI
d,maxNodeId) |
158 return aggregatesByClassName;} | 179 {function nodeIdFilter(node) |
159 var filter;if(filterString) | 180 {var id=node.id();return id>minNodeId&&id<=maxNodeId;} |
160 filter=this._parseFilter(filterString);var aggregates=this._buildAggregates(filt
er);this._calculateClassesRetainedSize(aggregates.aggregatesByClassIndex,filter)
;aggregatesByClassName=aggregates.aggregatesByClassName;if(sortedIndexes) | 181 return nodeIdFilter;},_createAllocationStackFilter:function(bottomUpAllocationNo
deId) |
161 this._sortAggregateIndexes(aggregatesByClassName);this._aggregatesSortedFlags[ke
y]=sortedIndexes;this._aggregates[key]=aggregatesByClassName;return aggregatesBy
ClassName;},allocationTracesTops:function() | 182 {var traceIds=this._allocationProfile.traceIds(bottomUpAllocationNodeId);if(!tra
ceIds.length) |
| 183 return undefined;var set={};for(var i=0;i<traceIds.length;i++) |
| 184 set[traceIds[i]]=true;function traceIdFilter(node) |
| 185 {return!!set[node.traceNodeId()];};return traceIdFilter;},aggregates:function(so
rtedIndexes,key,filter) |
| 186 {var aggregatesByClassName=key&&this._aggregates[key];if(!aggregatesByClassName)
{var aggregates=this._buildAggregates(filter);this._calculateClassesRetainedSize
(aggregates.aggregatesByClassIndex,filter);aggregatesByClassName=aggregates.aggr
egatesByClassName;if(key) |
| 187 this._aggregates[key]=aggregatesByClassName;} |
| 188 if(sortedIndexes&&(!key||!this._aggregatesSortedFlags[key])){this._sortAggregate
Indexes(aggregatesByClassName);if(key) |
| 189 this._aggregatesSortedFlags[key]=sortedIndexes;} |
| 190 return aggregatesByClassName;},allocationTracesTops:function() |
162 {return this._allocationProfile.serializeTraceTops();},allocationNodeCallers:fun
ction(nodeId) | 191 {return this._allocationProfile.serializeTraceTops();},allocationNodeCallers:fun
ction(nodeId) |
163 {return this._allocationProfile.serializeCallers(nodeId);},aggregatesForDiff:fun
ction() | 192 {return this._allocationProfile.serializeCallers(nodeId);},aggregatesForDiff:fun
ction() |
164 {if(this._aggregatesForDiff) | 193 {if(this._aggregatesForDiff) |
165 return this._aggregatesForDiff;var aggregatesByClassName=this.aggregates(true,"a
llObjects");this._aggregatesForDiff={};var node=this.createNode();for(var classN
ame in aggregatesByClassName){var aggregate=aggregatesByClassName[className];var
indexes=aggregate.idxs;var ids=new Array(indexes.length);var selfSizes=new Arra
y(indexes.length);for(var i=0;i<indexes.length;i++){node.nodeIndex=indexes[i];id
s[i]=node.id();selfSizes[i]=node.selfSize();} | 194 return this._aggregatesForDiff;var aggregatesByClassName=this.aggregates(true,"a
llObjects");this._aggregatesForDiff={};var node=this.createNode();for(var classN
ame in aggregatesByClassName){var aggregate=aggregatesByClassName[className];var
indexes=aggregate.idxs;var ids=new Array(indexes.length);var selfSizes=new Arra
y(indexes.length);for(var i=0;i<indexes.length;i++){node.nodeIndex=indexes[i];id
s[i]=node.id();selfSizes[i]=node.selfSize();} |
166 this._aggregatesForDiff[className]={indexes:indexes,ids:ids,selfSizes:selfSizes}
;} | 195 this._aggregatesForDiff[className]={indexes:indexes,ids:ids,selfSizes:selfSizes}
;} |
167 return this._aggregatesForDiff;},_isUserRoot:function(node) | 196 return this._aggregatesForDiff;},_isUserRoot:function(node) |
168 {return true;},forEachRoot:function(action,userRootsOnly) | 197 {return true;},forEachRoot:function(action,userRootsOnly) |
169 {for(var iter=this.rootNode().edges();iter.hasNext();iter.next()){var node=iter.
edge.node();if(!userRootsOnly||this._isUserRoot(node)) | 198 {for(var iter=this.rootNode().edges();iter.hasNext();iter.next()){var node=iter.
edge.node();if(!userRootsOnly||this._isUserRoot(node)) |
170 action(node);}},_calculateDistances:function() | 199 action(node);}},_calculateDistances:function() |
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) | 200 {var nodeFieldCount=this._nodeFieldCount;var nodeCount=this.nodeCount;var distan
ces=this._nodeDistances=new Int32Array(nodeCount);var noDistance=this._noDistanc
e;for(var i=0;i<nodeCount;++i) |
172 distances[i]=noDistance;var nodesToVisit=new Uint32Array(this.nodeCount);var nod
esToVisitLength=0;function enqueueNode(node) | 201 distances[i]=noDistance;var nodesToVisit=new Uint32Array(this.nodeCount);var nod
esToVisitLength=0;function enqueueNode(distance,node) |
173 {var ordinal=node._ordinal();if(distances[ordinal]!==noDistance) | 202 {var ordinal=node._ordinal();if(distances[ordinal]!==noDistance) |
174 return;distances[ordinal]=0;nodesToVisit[nodesToVisitLength++]=node.nodeIndex;} | 203 return;distances[ordinal]=distance;nodesToVisit[nodesToVisitLength++]=node.nodeI
ndex;} |
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) | 204 this.forEachRoot(enqueueNode.bind(null,1),true);this._bfs(nodesToVisit,nodesToVi
sitLength,distances);nodesToVisitLength=0;this.forEachRoot(enqueueNode.bind(null
,0),false);this._bfs(nodesToVisit,nodesToVisitLength,distances);},_bfs:function(
nodesToVisit,nodesToVisitLength,distances) |
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) | 205 {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) |
177 continue;var childNodeIndex=containmentEdges[edgeIndex+edgeToNodeOffset];var chi
ldNodeOrdinal=childNodeIndex/nodeFieldCount;if(distances[childNodeOrdinal]!==noD
istance) | 206 continue;var childNodeIndex=containmentEdges[edgeIndex+edgeToNodeOffset];var chi
ldNodeOrdinal=childNodeIndex/nodeFieldCount;if(distances[childNodeOrdinal]!==noD
istance) |
178 continue;distances[childNodeOrdinal]=distance;nodesToVisit[nodesToVisitLength++]
=childNodeIndex;}} | 207 continue;distances[childNodeOrdinal]=distance;nodesToVisit[nodesToVisitLength++]
=childNodeIndex;}} |
179 if(nodesToVisitLength>nodeCount) | 208 if(nodesToVisitLength>nodeCount) |
180 throw new Error("BFS failed. Nodes to visit ("+nodesToVisitLength+") is more tha
n nodes count ("+nodeCount+")");},_buildAggregates:function(filter) | 209 throw new Error("BFS failed. Nodes to visit ("+nodesToVisitLength+") is more tha
n nodes count ("+nodeCount+")");},_buildAggregates:function(filter) |
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)) | 210 {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)) |
182 continue;node.nodeIndex=nodeIndex;if(filter&&!filter(node)) | 211 continue;node.nodeIndex=nodeIndex;if(filter&&!filter(node)) |
183 continue;var selfSize=nodes[nodeIndex+selfSizeOffset];if(!selfSize&&nodes[nodeIn
dex+nodeTypeOffset]!==nodeNativeType) | 212 continue;var selfSize=nodes[nodeIndex+selfSizeOffset];if(!selfSize&&nodes[nodeIn
dex+nodeTypeOffset]!==nodeNativeType) |
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);}} | 213 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);}} |
185 for(var i=0,l=classIndexes.length;i<l;++i){var classIndex=classIndexes[i];aggreg
ates[classIndex].idxs=aggregates[classIndex].idxs.slice();} | 214 for(var i=0,l=classIndexes.length;i<l;++i){var classIndex=classIndexes[i];aggreg
ates[classIndex].idxs=aggregates[classIndex].idxs.slice();} |
(...skipping 17 matching lines...) Expand all Loading... |
203 continue;var retainerNodeOrdinal=retainerNodeIndex/nodeFieldCount;var retainerNo
deFlag=!flags||(flags[retainerNodeOrdinal]&flag);if(retainerNodeIndex!==rootNode
Index&&nodeFlag&&!retainerNodeFlag) | 232 continue;var retainerNodeOrdinal=retainerNodeIndex/nodeFieldCount;var retainerNo
deFlag=!flags||(flags[retainerNodeOrdinal]&flag);if(retainerNodeIndex!==rootNode
Index&&nodeFlag&&!retainerNodeFlag) |
204 continue;var retanerPostOrderIndex=nodeOrdinal2PostOrderIndex[retainerNodeOrdina
l];if(dominators[retanerPostOrderIndex]!==noEntry){if(newDominatorIndex===noEntr
y) | 233 continue;var retanerPostOrderIndex=nodeOrdinal2PostOrderIndex[retainerNodeOrdina
l];if(dominators[retanerPostOrderIndex]!==noEntry){if(newDominatorIndex===noEntr
y) |
205 newDominatorIndex=retanerPostOrderIndex;else{while(retanerPostOrderIndex!==newDo
minatorIndex){while(retanerPostOrderIndex<newDominatorIndex) | 234 newDominatorIndex=retanerPostOrderIndex;else{while(retanerPostOrderIndex!==newDo
minatorIndex){while(retanerPostOrderIndex<newDominatorIndex) |
206 retanerPostOrderIndex=dominators[retanerPostOrderIndex];while(newDominatorIndex<
retanerPostOrderIndex) | 235 retanerPostOrderIndex=dominators[retanerPostOrderIndex];while(newDominatorIndex<
retanerPostOrderIndex) |
207 newDominatorIndex=dominators[newDominatorIndex];}} | 236 newDominatorIndex=dominators[newDominatorIndex];}} |
208 if(newDominatorIndex===rootPostOrderedIndex) | 237 if(newDominatorIndex===rootPostOrderedIndex) |
209 break;}} | 238 break;}} |
210 if(newDominatorIndex!==noEntry&&dominators[postOrderIndex]!==newDominatorIndex){
dominators[postOrderIndex]=newDominatorIndex;changed=true;nodeOrdinal=postOrderI
ndex2NodeOrdinal[postOrderIndex];beginEdgeToNodeFieldIndex=firstEdgeIndexes[node
Ordinal]+edgeToNodeOffset;endEdgeToNodeFieldIndex=firstEdgeIndexes[nodeOrdinal+1
];for(var toNodeFieldIndex=beginEdgeToNodeFieldIndex;toNodeFieldIndex<endEdgeToN
odeFieldIndex;toNodeFieldIndex+=edgeFieldsCount){var childNodeOrdinal=containmen
tEdges[toNodeFieldIndex]/nodeFieldCount;affected[nodeOrdinal2PostOrderIndex[chil
dNodeOrdinal]]=1;}}}} | 239 if(newDominatorIndex!==noEntry&&dominators[postOrderIndex]!==newDominatorIndex){
dominators[postOrderIndex]=newDominatorIndex;changed=true;nodeOrdinal=postOrderI
ndex2NodeOrdinal[postOrderIndex];beginEdgeToNodeFieldIndex=firstEdgeIndexes[node
Ordinal]+edgeToNodeOffset;endEdgeToNodeFieldIndex=firstEdgeIndexes[nodeOrdinal+1
];for(var toNodeFieldIndex=beginEdgeToNodeFieldIndex;toNodeFieldIndex<endEdgeToN
odeFieldIndex;toNodeFieldIndex+=edgeFieldsCount){var childNodeOrdinal=containmen
tEdges[toNodeFieldIndex]/nodeFieldCount;affected[nodeOrdinal2PostOrderIndex[chil
dNodeOrdinal]]=1;}}}} |
211 var dominatorsTree=new Uint32Array(nodesCount);for(var postOrderIndex=0,l=domina
tors.length;postOrderIndex<l;++postOrderIndex){nodeOrdinal=postOrderIndex2NodeOr
dinal[postOrderIndex];dominatorsTree[nodeOrdinal]=postOrderIndex2NodeOrdinal[dom
inators[postOrderIndex]];} | 240 var dominatorsTree=new Uint32Array(nodesCount);for(var postOrderIndex=0,l=domina
tors.length;postOrderIndex<l;++postOrderIndex){nodeOrdinal=postOrderIndex2NodeOr
dinal[postOrderIndex];dominatorsTree[nodeOrdinal]=postOrderIndex2NodeOrdinal[dom
inators[postOrderIndex]];} |
212 return dominatorsTree;},_calculateRetainedSizes:function(postOrderIndex2NodeOrdi
nal) | 241 return dominatorsTree;},_calculateRetainedSizes:function(postOrderIndex2NodeOrdi
nal) |
213 {var nodeCount=this.nodeCount;var nodes=this._nodes;var nodeSelfSizeOffset=this.
_nodeSelfSizeOffset;var nodeFieldCount=this._nodeFieldCount;var dominatorsTree=t
his._dominatorsTree;var nodeRetainedSizeOffset=this._nodeRetainedSizeOffset=this
._nodeEdgeCountOffset;delete this._nodeEdgeCountOffset;for(var nodeIndex=0,l=nod
es.length;nodeIndex<l;nodeIndex+=nodeFieldCount) | 242 {var nodeCount=this.nodeCount;var nodes=this._nodes;var nodeSelfSizeOffset=this.
_nodeSelfSizeOffset;var nodeFieldCount=this._nodeFieldCount;var dominatorsTree=t
his._dominatorsTree;var retainedSizes=this._retainedSizes=new Float64Array(nodeC
ount);for(var nodeOrdinal=0;nodeOrdinal<nodeCount;++nodeOrdinal) |
214 nodes[nodeIndex+nodeRetainedSizeOffset]=nodes[nodeIndex+nodeSelfSizeOffset];for(
var postOrderIndex=0;postOrderIndex<nodeCount-1;++postOrderIndex){var nodeOrdina
l=postOrderIndex2NodeOrdinal[postOrderIndex];var nodeIndex=nodeOrdinal*nodeField
Count;var dominatorIndex=dominatorsTree[nodeOrdinal]*nodeFieldCount;nodes[domina
torIndex+nodeRetainedSizeOffset]+=nodes[nodeIndex+nodeRetainedSizeOffset];}},_bu
ildDominatedNodes:function() | 243 retainedSizes[nodeOrdinal]=nodes[nodeOrdinal*nodeFieldCount+nodeSelfSizeOffset];
for(var postOrderIndex=0;postOrderIndex<nodeCount-1;++postOrderIndex){var nodeOr
dinal=postOrderIndex2NodeOrdinal[postOrderIndex];var dominatorOrdinal=dominators
Tree[nodeOrdinal];retainedSizes[dominatorOrdinal]+=retainedSizes[nodeOrdinal];}}
,_buildDominatedNodes:function() |
215 {var indexArray=this._firstDominatedNodeIndex=new Uint32Array(this.nodeCount+1);
var dominatedNodes=this._dominatedNodes=new Uint32Array(this.nodeCount-1);var no
deFieldCount=this._nodeFieldCount;var dominatorsTree=this._dominatorsTree;var fr
omNodeOrdinal=0;var toNodeOrdinal=this.nodeCount;var rootNodeOrdinal=this._rootN
odeIndex/nodeFieldCount;if(rootNodeOrdinal===fromNodeOrdinal) | 244 {var indexArray=this._firstDominatedNodeIndex=new Uint32Array(this.nodeCount+1);
var dominatedNodes=this._dominatedNodes=new Uint32Array(this.nodeCount-1);var no
deFieldCount=this._nodeFieldCount;var dominatorsTree=this._dominatorsTree;var fr
omNodeOrdinal=0;var toNodeOrdinal=this.nodeCount;var rootNodeOrdinal=this._rootN
odeIndex/nodeFieldCount;if(rootNodeOrdinal===fromNodeOrdinal) |
216 fromNodeOrdinal=1;else if(rootNodeOrdinal===toNodeOrdinal-1) | 245 fromNodeOrdinal=1;else if(rootNodeOrdinal===toNodeOrdinal-1) |
217 toNodeOrdinal=toNodeOrdinal-1;else | 246 toNodeOrdinal=toNodeOrdinal-1;else |
218 throw new Error("Root node is expected to be either first or last");for(var node
Ordinal=fromNodeOrdinal;nodeOrdinal<toNodeOrdinal;++nodeOrdinal) | 247 throw new Error("Root node is expected to be either first or last");for(var node
Ordinal=fromNodeOrdinal;nodeOrdinal<toNodeOrdinal;++nodeOrdinal) |
219 ++indexArray[dominatorsTree[nodeOrdinal]];var firstDominatedNodeIndex=0;for(var
i=0,l=this.nodeCount;i<l;++i){var dominatedCount=dominatedNodes[firstDominatedNo
deIndex]=indexArray[i];indexArray[i]=firstDominatedNodeIndex;firstDominatedNodeI
ndex+=dominatedCount;} | 248 ++indexArray[dominatorsTree[nodeOrdinal]];var firstDominatedNodeIndex=0;for(var
i=0,l=this.nodeCount;i<l;++i){var dominatedCount=dominatedNodes[firstDominatedNo
deIndex]=indexArray[i];indexArray[i]=firstDominatedNodeIndex;firstDominatedNodeI
ndex+=dominatedCount;} |
220 indexArray[this.nodeCount]=dominatedNodes.length;for(var nodeOrdinal=fromNodeOrd
inal;nodeOrdinal<toNodeOrdinal;++nodeOrdinal){var dominatorOrdinal=dominatorsTre
e[nodeOrdinal];var dominatedRefIndex=indexArray[dominatorOrdinal];dominatedRefIn
dex+=(--dominatedNodes[dominatedRefIndex]);dominatedNodes[dominatedRefIndex]=nod
eOrdinal*nodeFieldCount;}},_markInvisibleEdges:function() | 249 indexArray[this.nodeCount]=dominatedNodes.length;for(var nodeOrdinal=fromNodeOrd
inal;nodeOrdinal<toNodeOrdinal;++nodeOrdinal){var dominatorOrdinal=dominatorsTre
e[nodeOrdinal];var dominatedRefIndex=indexArray[dominatorOrdinal];dominatedRefIn
dex+=(--dominatedNodes[dominatedRefIndex]);dominatedNodes[dominatedRefIndex]=nod
eOrdinal*nodeFieldCount;}},_calculateFlags:function() |
221 {throw new Error("Not implemented");},_calculateFlags:function() | 250 {throw new Error("Not implemented");},_calculateStatistics:function() |
222 {throw new Error("Not implemented");},userObjectsMapAndFlag:function() | 251 {throw new Error("Not implemented");},userObjectsMapAndFlag:function() |
223 {throw new Error("Not implemented");},calculateSnapshotDiff:function(baseSnapsho
tId,baseSnapshotAggregates) | 252 {throw new Error("Not implemented");},calculateSnapshotDiff:function(baseSnapsho
tId,baseSnapshotAggregates) |
224 {var snapshotDiff=this._snapshotDiffs[baseSnapshotId];if(snapshotDiff) | 253 {var snapshotDiff=this._snapshotDiffs[baseSnapshotId];if(snapshotDiff) |
225 return snapshotDiff;snapshotDiff={};var aggregates=this.aggregates(true,"allObje
cts");for(var className in baseSnapshotAggregates){var baseAggregate=baseSnapsho
tAggregates[className];var diff=this._calculateDiffForClass(baseAggregate,aggreg
ates[className]);if(diff) | 254 return snapshotDiff;snapshotDiff={};var aggregates=this.aggregates(true,"allObje
cts");for(var className in baseSnapshotAggregates){var baseAggregate=baseSnapsho
tAggregates[className];var diff=this._calculateDiffForClass(baseAggregate,aggreg
ates[className]);if(diff) |
226 snapshotDiff[className]=diff;} | 255 snapshotDiff[className]=diff;} |
227 var emptyBaseAggregate={ids:[],indexes:[],selfSizes:[]};for(var className in agg
regates){if(className in baseSnapshotAggregates) | 256 var emptyBaseAggregate=new WebInspector.HeapSnapshotCommon.AggregateForDiff();fo
r(var className in aggregates){if(className in baseSnapshotAggregates) |
228 continue;snapshotDiff[className]=this._calculateDiffForClass(emptyBaseAggregate,
aggregates[className]);} | 257 continue;snapshotDiff[className]=this._calculateDiffForClass(emptyBaseAggregate,
aggregates[className]);} |
229 this._snapshotDiffs[baseSnapshotId]=snapshotDiff;return snapshotDiff;},_calculat
eDiffForClass:function(baseAggregate,aggregate) | 258 this._snapshotDiffs[baseSnapshotId]=snapshotDiff;return snapshotDiff;},_calculat
eDiffForClass:function(baseAggregate,aggregate) |
230 {var baseIds=baseAggregate.ids;var baseIndexes=baseAggregate.indexes;var baseSel
fSizes=baseAggregate.selfSizes;var indexes=aggregate?aggregate.idxs:[];var i=0,l
=baseIds.length;var j=0,m=indexes.length;var diff={addedCount:0,removedCount:0,a
ddedSize:0,removedSize:0,deletedIndexes:[],addedIndexes:[]};var nodeB=this.creat
eNode(indexes[j]);while(i<l&&j<m){var nodeAId=baseIds[i];if(nodeAId<nodeB.id()){
diff.deletedIndexes.push(baseIndexes[i]);diff.removedCount++;diff.removedSize+=b
aseSelfSizes[i];++i;}else if(nodeAId>nodeB.id()){diff.addedIndexes.push(indexes[
j]);diff.addedCount++;diff.addedSize+=nodeB.selfSize();nodeB.nodeIndex=indexes[+
+j];}else{++i;nodeB.nodeIndex=indexes[++j];}} | 259 {var baseIds=baseAggregate.ids;var baseIndexes=baseAggregate.indexes;var baseSel
fSizes=baseAggregate.selfSizes;var indexes=aggregate?aggregate.idxs:[];var i=0,l
=baseIds.length;var j=0,m=indexes.length;var diff=new WebInspector.HeapSnapshotC
ommon.Diff();var nodeB=this.createNode(indexes[j]);while(i<l&&j<m){var nodeAId=b
aseIds[i];if(nodeAId<nodeB.id()){diff.deletedIndexes.push(baseIndexes[i]);diff.r
emovedCount++;diff.removedSize+=baseSelfSizes[i];++i;}else if(nodeAId>nodeB.id()
){diff.addedIndexes.push(indexes[j]);diff.addedCount++;diff.addedSize+=nodeB.sel
fSize();nodeB.nodeIndex=indexes[++j];}else{++i;nodeB.nodeIndex=indexes[++j];}} |
231 while(i<l){diff.deletedIndexes.push(baseIndexes[i]);diff.removedCount++;diff.rem
ovedSize+=baseSelfSizes[i];++i;} | 260 while(i<l){diff.deletedIndexes.push(baseIndexes[i]);diff.removedCount++;diff.rem
ovedSize+=baseSelfSizes[i];++i;} |
232 while(j<m){diff.addedIndexes.push(indexes[j]);diff.addedCount++;diff.addedSize+=
nodeB.selfSize();nodeB.nodeIndex=indexes[++j];} | 261 while(j<m){diff.addedIndexes.push(indexes[j]);diff.addedCount++;diff.addedSize+=
nodeB.selfSize();nodeB.nodeIndex=indexes[++j];} |
233 diff.countDelta=diff.addedCount-diff.removedCount;diff.sizeDelta=diff.addedSize-
diff.removedSize;if(!diff.addedCount&&!diff.removedCount) | 262 diff.countDelta=diff.addedCount-diff.removedCount;diff.sizeDelta=diff.addedSize-
diff.removedSize;if(!diff.addedCount&&!diff.removedCount) |
234 return null;return diff;},_nodeForSnapshotObjectId:function(snapshotObjectId) | 263 return null;return diff;},_nodeForSnapshotObjectId:function(snapshotObjectId) |
235 {for(var it=this._allNodes();it.hasNext();it.next()){if(it.node.id()===snapshotO
bjectId) | 264 {for(var it=this._allNodes();it.hasNext();it.next()){if(it.node.id()===snapshotO
bjectId) |
236 return it.node;} | 265 return it.node;} |
237 return null;},nodeClassName:function(snapshotObjectId) | 266 return null;},nodeClassName:function(snapshotObjectId) |
238 {var node=this._nodeForSnapshotObjectId(snapshotObjectId);if(node) | 267 {var node=this._nodeForSnapshotObjectId(snapshotObjectId);if(node) |
239 return node.className();return null;},idsOfObjectsWithName:function(name) | 268 return node.className();return null;},idsOfObjectsWithName:function(name) |
240 {var ids=[];for(var it=this._allNodes();it.hasNext();it.next()){if(it.item().nam
e()===name) | 269 {var ids=[];for(var it=this._allNodes();it.hasNext();it.next()){if(it.item().nam
e()===name) |
241 ids.push(it.item().id());} | 270 ids.push(it.item().id());} |
242 return ids;},dominatorIdsForNode:function(snapshotObjectId) | 271 return ids;},dominatorIdsForNode:function(snapshotObjectId) |
243 {var node=this._nodeForSnapshotObjectId(snapshotObjectId);if(!node) | 272 {var node=this._nodeForSnapshotObjectId(snapshotObjectId);if(!node) |
244 return null;var result=[];while(!node.isRoot()){result.push(node.id());node.node
Index=node.dominatorIndex();} | 273 return null;var result=[];while(!node.isRoot()){result.push(node.id());node.node
Index=node.dominatorIndex();} |
245 return result;},_parseFilter:function(filter) | 274 return result;},createEdgesProvider:function(nodeIndex) |
246 {if(!filter) | 275 {var node=this.createNode(nodeIndex);var filter=this.containmentEdgesFilter();va
r indexProvider=new WebInspector.HeapSnapshotEdgeIndexProvider(this);return new
WebInspector.HeapSnapshotEdgesProvider(this,filter,node.edges(),indexProvider);}
,createEdgesProviderForTest:function(nodeIndex,filter) |
247 return null;var parsedFilter=eval("(function(){return "+filter+"})()");return pa
rsedFilter.bind(this);},createEdgesProvider:function(nodeIndex,showHiddenData) | 276 {var node=this.createNode(nodeIndex);var indexProvider=new WebInspector.HeapSnap
shotEdgeIndexProvider(this);return new WebInspector.HeapSnapshotEdgesProvider(th
is,filter,node.edges(),indexProvider);},retainingEdgesFilter:function() |
248 {var node=this.createNode(nodeIndex);var filter=this.containmentEdgesFilter(show
HiddenData);return new WebInspector.HeapSnapshotEdgesProvider(this,filter,node.e
dges());},createEdgesProviderForTest:function(nodeIndex,filter) | 277 {return null;},containmentEdgesFilter:function() |
249 {var node=this.createNode(nodeIndex);return new WebInspector.HeapSnapshotEdgesPr
ovider(this,filter,node.edges());},retainingEdgesFilter:function(showHiddenData) | 278 {return null;},createRetainingEdgesProvider:function(nodeIndex) |
250 {return null;},containmentEdgesFilter:function(showHiddenData) | 279 {var node=this.createNode(nodeIndex);var filter=this.retainingEdgesFilter();var
indexProvider=new WebInspector.HeapSnapshotRetainerEdgeIndexProvider(this);retur
n new WebInspector.HeapSnapshotEdgesProvider(this,filter,node.retainers(),indexP
rovider);},createAddedNodesProvider:function(baseSnapshotId,className) |
251 {return null;},createRetainingEdgesProvider:function(nodeIndex,showHiddenData) | |
252 {var node=this.createNode(nodeIndex);var filter=this.retainingEdgesFilter(showHi
ddenData);return new WebInspector.HeapSnapshotEdgesProvider(this,filter,node.ret
ainers());},createAddedNodesProvider:function(baseSnapshotId,className) | |
253 {var snapshotDiff=this._snapshotDiffs[baseSnapshotId];var diffForClass=snapshotD
iff[className];return new WebInspector.HeapSnapshotNodesProvider(this,null,diffF
orClass.addedIndexes);},createDeletedNodesProvider:function(nodeIndexes) | 280 {var snapshotDiff=this._snapshotDiffs[baseSnapshotId];var diffForClass=snapshotD
iff[className];return new WebInspector.HeapSnapshotNodesProvider(this,null,diffF
orClass.addedIndexes);},createDeletedNodesProvider:function(nodeIndexes) |
254 {return new WebInspector.HeapSnapshotNodesProvider(this,null,nodeIndexes);},clas
sNodesFilter:function() | 281 {return new WebInspector.HeapSnapshotNodesProvider(this,null,nodeIndexes);},clas
sNodesFilter:function() |
255 {return null;},createNodesProviderForClass:function(className,aggregatesKey) | 282 {return null;},createNodesProviderForClass:function(className,nodeFilter) |
256 {return new WebInspector.HeapSnapshotNodesProvider(this,this.classNodesFilter(),
this.aggregates(false,aggregatesKey)[className].idxs);},createNodesProviderForDo
minator:function(nodeIndex) | 283 {return new WebInspector.HeapSnapshotNodesProvider(this,this.classNodesFilter(),
this.aggregatesWithFilter(nodeFilter)[className].idxs);},createNodesProviderForD
ominator:function(nodeIndex) |
257 {var node=this.createNode(nodeIndex);return new WebInspector.HeapSnapshotNodesPr
ovider(this,null,this._dominatedNodesOfNode(node));},updateStaticData:function() | 284 {var node=this.createNode(nodeIndex);return new WebInspector.HeapSnapshotNodesPr
ovider(this,null,this._dominatedNodesOfNode(node));},_maxJsNodeId:function() |
258 {return{nodeCount:this.nodeCount,rootNodeIndex:this._rootNodeIndex,totalSize:thi
s.totalSize,uid:this.uid};}};WebInspector.HeapSnapshotFilteredOrderedIterator=fu
nction(iterator,filter,unfilteredIterationOrder) | 285 {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) |
259 {this._filter=filter;this._iterator=iterator;this._unfilteredIterationOrder=unfi
lteredIterationOrder;this._iterationOrder=null;this._position=0;this._currentCom
parator=null;this._sortedPrefixLength=0;this._sortedSuffixLength=0;} | 286 continue;if(id<nextId) |
260 WebInspector.HeapSnapshotFilteredOrderedIterator.prototype={_createIterationOrde
r:function() | 287 id=nextId;} |
| 288 return id;},updateStaticData:function() |
| 289 {return new WebInspector.HeapSnapshotCommon.StaticData(this.nodeCount,this._root
NodeIndex,this.totalSize,this._maxJsNodeId());}};WebInspector.HeapSnapshotItemPr
ovider=function(iterator,indexProvider) |
| 290 {this._iterator=iterator;this._indexProvider=indexProvider;this._isEmpty=!iterat
or.hasNext();this._iterationOrder=null;this._currentComparator=null;this._sorted
PrefixLength=0;this._sortedSuffixLength=0;} |
| 291 WebInspector.HeapSnapshotItemProvider.prototype={_createIterationOrder:function(
) |
261 {if(this._iterationOrder) | 292 {if(this._iterationOrder) |
262 return;if(this._unfilteredIterationOrder&&!this._filter){this._iterationOrder=th
is._unfilteredIterationOrder.slice(0);this._unfilteredIterationOrder=null;return
;} | 293 return;this._iterationOrder=[];for(var iterator=this._iterator;iterator.hasNext(
);iterator.next()) |
263 this._iterationOrder=[];var iterator=this._iterator;if(!this._unfilteredIteratio
nOrder&&!this._filter){for(iterator.rewind();iterator.hasNext();iterator.next()) | 294 this._iterationOrder.push(iterator.item().itemIndex());},isEmpty:function() |
264 this._iterationOrder.push(iterator.index());}else if(!this._unfilteredIterationO
rder){for(iterator.rewind();iterator.hasNext();iterator.next()){if(this._filter(
iterator.item())) | 295 {return this._isEmpty;},serializeItemsRange:function(begin,end) |
265 this._iterationOrder.push(iterator.index());}}else{var order=this._unfilteredIte
rationOrder.constructor===Array?this._unfilteredIterationOrder:this._unfilteredI
terationOrder.slice(0);for(var i=0,l=order.length;i<l;++i){iterator.setIndex(ord
er[i]);if(this._filter(iterator.item())) | |
266 this._iterationOrder.push(iterator.index());} | |
267 this._unfilteredIterationOrder=null;}},rewind:function() | |
268 {this._position=0;},hasNext:function() | |
269 {return this._position<this._iterationOrder.length;},isEmpty:function() | |
270 {if(this._iterationOrder) | |
271 return!this._iterationOrder.length;if(this._unfilteredIterationOrder&&!this._fil
ter) | |
272 return!this._unfilteredIterationOrder.length;var iterator=this._iterator;if(!thi
s._unfilteredIterationOrder&&!this._filter){iterator.rewind();return!iterator.ha
sNext();}else if(!this._unfilteredIterationOrder){for(iterator.rewind();iterator
.hasNext();iterator.next()) | |
273 if(this._filter(iterator.item())) | |
274 return false;}else{var order=this._unfilteredIterationOrder.constructor===Array?
this._unfilteredIterationOrder:this._unfilteredIterationOrder.slice(0);for(var i
=0,l=order.length;i<l;++i){iterator.setIndex(order[i]);if(this._filter(iterator.
item())) | |
275 return false;}} | |
276 return true;},item:function() | |
277 {this._iterator.setIndex(this._iterationOrder[this._position]);return this._iter
ator.item();},get length() | |
278 {this._createIterationOrder();return this._iterationOrder.length;},next:function
() | |
279 {++this._position;},serializeItemsRange:function(begin,end) | |
280 {this._createIterationOrder();if(begin>end) | 296 {this._createIterationOrder();if(begin>end) |
281 throw new Error("Start position > end position: "+begin+" > "+end);if(end>this._
iterationOrder.length) | 297 throw new Error("Start position > end position: "+begin+" > "+end);if(end>this._
iterationOrder.length) |
282 end=this._iterationOrder.length;if(this._sortedPrefixLength<end&&begin<this._ite
rationOrder.length-this._sortedSuffixLength){this.sort(this._currentComparator,t
his._sortedPrefixLength,this._iterationOrder.length-1-this._sortedSuffixLength,b
egin,end-1);if(begin<=this._sortedPrefixLength) | 298 end=this._iterationOrder.length;if(this._sortedPrefixLength<end&&begin<this._ite
rationOrder.length-this._sortedSuffixLength){this.sort(this._currentComparator,t
his._sortedPrefixLength,this._iterationOrder.length-1-this._sortedSuffixLength,b
egin,end-1);if(begin<=this._sortedPrefixLength) |
283 this._sortedPrefixLength=end;if(end>=this._iterationOrder.length-this._sortedSuf
fixLength) | 299 this._sortedPrefixLength=end;if(end>=this._iterationOrder.length-this._sortedSuf
fixLength) |
284 this._sortedSuffixLength=this._iterationOrder.length-begin;} | 300 this._sortedSuffixLength=this._iterationOrder.length-begin;} |
285 this._position=begin;var startPosition=this._position;var count=end-begin;var re
sult=new Array(count);for(var i=0;i<count&&this.hasNext();++i,this.next()) | 301 var position=begin;var count=end-begin;var result=new Array(count);var iterator=
this._iterator;for(var i=0;i<count;++i){var itemIndex=this._iterationOrder[posit
ion++];var item=this._indexProvider.itemForIndex(itemIndex);result[i]=item.seria
lize();} |
286 result[i]=this.item().serialize();result.length=i;result.totalLength=this._itera
tionOrder.length;result.startPosition=startPosition;result.endPosition=this._pos
ition;return result;},sortAll:function() | 302 return new WebInspector.HeapSnapshotCommon.ItemsRange(begin,end,this._iterationO
rder.length,result);},sortAndRewind:function(comparator) |
287 {this._createIterationOrder();if(this._sortedPrefixLength+this._sortedSuffixLeng
th>=this._iterationOrder.length) | 303 {this._currentComparator=comparator;this._sortedPrefixLength=0;this._sortedSuffi
xLength=0;}} |
288 return;this.sort(this._currentComparator,this._sortedPrefixLength,this._iteratio
nOrder.length-1-this._sortedSuffixLength,this._sortedPrefixLength,this._iteratio
nOrder.length-1-this._sortedSuffixLength);this._sortedPrefixLength=this._iterati
onOrder.length;this._sortedSuffixLength=0;},sortAndRewind:function(comparator) | 304 WebInspector.HeapSnapshotEdgesProvider=function(snapshot,filter,edgesIter,indexP
rovider) |
289 {this._currentComparator=comparator;this._sortedPrefixLength=0;this._sortedSuffi
xLength=0;this.rewind();}} | 305 {this.snapshot=snapshot;if(filter) |
290 WebInspector.HeapSnapshotEdgesProvider=function(snapshot,filter,edgesIter) | 306 edgesIter=new WebInspector.HeapSnapshotFilteredIterator(edgesIter,filter);WebIns
pector.HeapSnapshotItemProvider.call(this,edgesIter,indexProvider);} |
291 {this.snapshot=snapshot;WebInspector.HeapSnapshotFilteredOrderedIterator.call(th
is,edgesIter,filter);} | |
292 WebInspector.HeapSnapshotEdgesProvider.prototype={sort:function(comparator,leftB
ound,rightBound,windowLeft,windowRight) | 307 WebInspector.HeapSnapshotEdgesProvider.prototype={sort:function(comparator,leftB
ound,rightBound,windowLeft,windowRight) |
293 {var fieldName1=comparator.fieldName1;var fieldName2=comparator.fieldName2;var a
scending1=comparator.ascending1;var ascending2=comparator.ascending2;var edgeA=t
his._iterator.item().clone();var edgeB=edgeA.clone();var nodeA=this.snapshot.cre
ateNode();var nodeB=this.snapshot.createNode();function compareEdgeFieldName(asc
ending,indexA,indexB) | 308 {var fieldName1=comparator.fieldName1;var fieldName2=comparator.fieldName2;var a
scending1=comparator.ascending1;var ascending2=comparator.ascending2;var edgeA=t
his._iterator.item().clone();var edgeB=edgeA.clone();var nodeA=this.snapshot.cre
ateNode();var nodeB=this.snapshot.createNode();function compareEdgeFieldName(asc
ending,indexA,indexB) |
294 {edgeA.edgeIndex=indexA;edgeB.edgeIndex=indexB;if(edgeB.name()==="__proto__")ret
urn-1;if(edgeA.name()==="__proto__")return 1;var result=edgeA.hasStringName()===
edgeB.hasStringName()?(edgeA.name()<edgeB.name()?-1:(edgeA.name()>edgeB.name()?1
:0)):(edgeA.hasStringName()?-1:1);return ascending?result:-result;} | 309 {edgeA.edgeIndex=indexA;edgeB.edgeIndex=indexB;if(edgeB.name()==="__proto__")ret
urn-1;if(edgeA.name()==="__proto__")return 1;var result=edgeA.hasStringName()===
edgeB.hasStringName()?(edgeA.name()<edgeB.name()?-1:(edgeA.name()>edgeB.name()?1
:0)):(edgeA.hasStringName()?-1:1);return ascending?result:-result;} |
295 function compareNodeField(fieldName,ascending,indexA,indexB) | 310 function compareNodeField(fieldName,ascending,indexA,indexB) |
296 {edgeA.edgeIndex=indexA;nodeA.nodeIndex=edgeA.nodeIndex();var valueA=nodeA[field
Name]();edgeB.edgeIndex=indexB;nodeB.nodeIndex=edgeB.nodeIndex();var valueB=node
B[fieldName]();var result=valueA<valueB?-1:(valueA>valueB?1:0);return ascending?
result:-result;} | 311 {edgeA.edgeIndex=indexA;nodeA.nodeIndex=edgeA.nodeIndex();var valueA=nodeA[field
Name]();edgeB.edgeIndex=indexB;nodeB.nodeIndex=edgeB.nodeIndex();var valueB=node
B[fieldName]();var result=valueA<valueB?-1:(valueA>valueB?1:0);return ascending?
result:-result;} |
297 function compareEdgeAndNode(indexA,indexB){var result=compareEdgeFieldName(ascen
ding1,indexA,indexB);if(result===0) | 312 function compareEdgeAndNode(indexA,indexB){var result=compareEdgeFieldName(ascen
ding1,indexA,indexB);if(result===0) |
298 result=compareNodeField(fieldName2,ascending2,indexA,indexB);if(result===0) | 313 result=compareNodeField(fieldName2,ascending2,indexA,indexB);if(result===0) |
299 return indexA-indexB;return result;} | 314 return indexA-indexB;return result;} |
300 function compareNodeAndEdge(indexA,indexB){var result=compareNodeField(fieldName
1,ascending1,indexA,indexB);if(result===0) | 315 function compareNodeAndEdge(indexA,indexB){var result=compareNodeField(fieldName
1,ascending1,indexA,indexB);if(result===0) |
301 result=compareEdgeFieldName(ascending2,indexA,indexB);if(result===0) | 316 result=compareEdgeFieldName(ascending2,indexA,indexB);if(result===0) |
302 return indexA-indexB;return result;} | 317 return indexA-indexB;return result;} |
303 function compareNodeAndNode(indexA,indexB){var result=compareNodeField(fieldName
1,ascending1,indexA,indexB);if(result===0) | 318 function compareNodeAndNode(indexA,indexB){var result=compareNodeField(fieldName
1,ascending1,indexA,indexB);if(result===0) |
304 result=compareNodeField(fieldName2,ascending2,indexA,indexB);if(result===0) | 319 result=compareNodeField(fieldName2,ascending2,indexA,indexB);if(result===0) |
305 return indexA-indexB;return result;} | 320 return indexA-indexB;return result;} |
306 if(fieldName1==="!edgeName") | 321 if(fieldName1==="!edgeName") |
307 this._iterationOrder.sortRange(compareEdgeAndNode,leftBound,rightBound,windowLef
t,windowRight);else if(fieldName2==="!edgeName") | 322 this._iterationOrder.sortRange(compareEdgeAndNode,leftBound,rightBound,windowLef
t,windowRight);else if(fieldName2==="!edgeName") |
308 this._iterationOrder.sortRange(compareNodeAndEdge,leftBound,rightBound,windowLef
t,windowRight);else | 323 this._iterationOrder.sortRange(compareNodeAndEdge,leftBound,rightBound,windowLef
t,windowRight);else |
309 this._iterationOrder.sortRange(compareNodeAndNode,leftBound,rightBound,windowLef
t,windowRight);},__proto__:WebInspector.HeapSnapshotFilteredOrderedIterator.prot
otype} | 324 this._iterationOrder.sortRange(compareNodeAndNode,leftBound,rightBound,windowLef
t,windowRight);},__proto__:WebInspector.HeapSnapshotItemProvider.prototype} |
310 WebInspector.HeapSnapshotNodesProvider=function(snapshot,filter,nodeIndexes) | 325 WebInspector.HeapSnapshotNodesProvider=function(snapshot,filter,nodeIndexes) |
311 {this.snapshot=snapshot;WebInspector.HeapSnapshotFilteredOrderedIterator.call(th
is,snapshot._allNodes(),filter,nodeIndexes);} | 326 {this.snapshot=snapshot;var indexProvider=new WebInspector.HeapSnapshotNodeIndex
Provider(snapshot);var it=new WebInspector.HeapSnapshotIndexRangeIterator(indexP
rovider,nodeIndexes);if(filter) |
| 327 it=new WebInspector.HeapSnapshotFilteredIterator(it,filter);WebInspector.HeapSna
pshotItemProvider.call(this,it,indexProvider);} |
312 WebInspector.HeapSnapshotNodesProvider.prototype={nodePosition:function(snapshot
ObjectId) | 328 WebInspector.HeapSnapshotNodesProvider.prototype={nodePosition:function(snapshot
ObjectId) |
313 {this._createIterationOrder();if(this.isEmpty()) | 329 {this._createIterationOrder();var node=this.snapshot.createNode();for(var i=0;i<
this._iterationOrder.length;i++){node.nodeIndex=this._iterationOrder[i];if(node.
id()===snapshotObjectId) |
314 return-1;this.sortAll();var node=this.snapshot.createNode();for(var i=0;i<this._
iterationOrder.length;i++){node.nodeIndex=this._iterationOrder[i];if(node.id()==
=snapshotObjectId) | 330 break;} |
315 return i;} | 331 if(i===this._iterationOrder.length) |
316 return-1;},sort:function(comparator,leftBound,rightBound,windowLeft,windowRight) | 332 return-1;var targetNodeIndex=this._iterationOrder[i];var smallerCount=0;var comp
are=this._buildCompareFunction(this._currentComparator);for(var i=0;i<this._iter
ationOrder.length;i++){if(compare(this._iterationOrder[i],targetNodeIndex)<0) |
317 {var fieldName1=comparator.fieldName1;var fieldName2=comparator.fieldName2;var a
scending1=comparator.ascending1;var ascending2=comparator.ascending2;var nodeA=t
his.snapshot.createNode();var nodeB=this.snapshot.createNode();function sortByNo
deField(fieldName,ascending) | 333 ++smallerCount;} |
318 {var valueOrFunctionA=nodeA[fieldName];var valueA=typeof valueOrFunctionA!=="fun
ction"?valueOrFunctionA:valueOrFunctionA.call(nodeA);var valueOrFunctionB=nodeB[
fieldName];var valueB=typeof valueOrFunctionB!=="function"?valueOrFunctionB:valu
eOrFunctionB.call(nodeB);var result=valueA<valueB?-1:(valueA>valueB?1:0);return
ascending?result:-result;} | 334 return smallerCount;},_buildCompareFunction:function(comparator) |
319 function sortByComparator(indexA,indexB){nodeA.nodeIndex=indexA;nodeB.nodeIndex=
indexB;var result=sortByNodeField(fieldName1,ascending1);if(result===0) | 335 {var nodeA=this.snapshot.createNode();var nodeB=this.snapshot.createNode();var f
ieldAccessor1=nodeA[comparator.fieldName1];var fieldAccessor2=nodeA[comparator.f
ieldName2];var ascending1=comparator.ascending1?1:-1;var ascending2=comparator.a
scending2?1:-1;function sortByNodeField(fieldAccessor,ascending) |
320 result=sortByNodeField(fieldName2,ascending2);if(result===0) | 336 {var valueA=fieldAccessor.call(nodeA);var valueB=fieldAccessor.call(nodeB);retur
n valueA<valueB?-ascending:(valueA>valueB?ascending:0);} |
321 return indexA-indexB;return result;} | 337 function sortByComparator(indexA,indexB) |
322 this._iterationOrder.sortRange(sortByComparator,leftBound,rightBound,windowLeft,
windowRight);},__proto__:WebInspector.HeapSnapshotFilteredOrderedIterator.protot
ype};WebInspector.HeapSnapshotProgressEvent={Update:"ProgressUpdate"};WebInspect
or.HeapSnapshotCommon={} | 338 {nodeA.nodeIndex=indexA;nodeB.nodeIndex=indexB;var result=sortByNodeField(fieldA
ccessor1,ascending1);if(result===0) |
323 WebInspector.HeapSnapshotCommon.AllocationNodeCallers=function() | 339 result=sortByNodeField(fieldAccessor2,ascending2);return result||indexA-indexB;} |
324 {this.nodesWithSingleCaller;this.branchingCallers;} | 340 return sortByComparator;},sort:function(comparator,leftBound,rightBound,windowLe
ft,windowRight) |
| 341 {this._iterationOrder.sortRange(this._buildCompareFunction(comparator),leftBound
,rightBound,windowLeft,windowRight);},__proto__:WebInspector.HeapSnapshotItemPro
vider.prototype};WebInspector.HeapSnapshotProgressEvent={Update:"ProgressUpdate"
};WebInspector.HeapSnapshotCommon={} |
| 342 WebInspector.HeapSnapshotCommon.AllocationNodeCallers=function(nodesWithSingleCa
ller,branchingCallers) |
| 343 {this.nodesWithSingleCaller=nodesWithSingleCaller;this.branchingCallers=branchin
gCallers;} |
| 344 WebInspector.HeapSnapshotCommon.SerializedAllocationNode=function(nodeId,functio
nName,scriptName,line,column,count,size,liveCount,liveSize,hasChildren) |
| 345 {this.id=nodeId;this.name=functionName;this.scriptName=scriptName;this.line=line
;this.column=column;this.count=count;this.size=size;this.liveCount=liveCount;thi
s.liveSize=liveSize;this.hasChildren=hasChildren;} |
325 WebInspector.HeapSnapshotCommon.Aggregate=function() | 346 WebInspector.HeapSnapshotCommon.Aggregate=function() |
326 {this.count;this.distance;this.self;this.maxRet;this.type;this.name;this.idxs;} | 347 {this.count;this.distance;this.self;this.maxRet;this.type;this.name;this.idxs;} |
| 348 WebInspector.HeapSnapshotCommon.AggregateForDiff=function(){this.indexes=[];this
.ids=[];this.selfSizes=[];} |
| 349 WebInspector.HeapSnapshotCommon.Diff=function() |
| 350 {this.addedCount=0;this.removedCount=0;this.addedSize=0;this.removedSize=0;this.
deletedIndexes=[];this.addedIndexes=[];} |
327 WebInspector.HeapSnapshotCommon.DiffForClass=function() | 351 WebInspector.HeapSnapshotCommon.DiffForClass=function() |
328 {this.addedCount;this.removedCount;this.addedSize;this.removedSize;this.deletedI
ndexes;this.addedIndexes;this.countDelta;this.sizeDelta;} | 352 {this.addedCount;this.removedCount;this.addedSize;this.removedSize;this.deletedI
ndexes;this.addedIndexes;this.countDelta;this.sizeDelta;} |
329 WebInspector.HeapSnapshotCommon.ComparatorConfig=function() | 353 WebInspector.HeapSnapshotCommon.ComparatorConfig=function() |
330 {this.fieldName1;this.ascending1;this.fieldName2;this.ascending2;} | 354 {this.fieldName1;this.ascending1;this.fieldName2;this.ascending2;} |
331 WebInspector.HeapSnapshotCommon.WorkerCommand=function() | 355 WebInspector.HeapSnapshotCommon.WorkerCommand=function() |
332 {this.callId;this.disposition;this.objectId;this.newObjectId;this.methodName;thi
s.methodArguments;this.source;};WebInspector.HeapSnapshotLoader=function(dispatc
her) | 356 {this.callId;this.disposition;this.objectId;this.newObjectId;this.methodName;thi
s.methodArguments;this.source;} |
| 357 WebInspector.HeapSnapshotCommon.ItemsRange=function(startPosition,endPosition,to
talLength,items) |
| 358 {this.startPosition=startPosition;this.endPosition=endPosition;this.totalLength=
totalLength;this.items=items;} |
| 359 WebInspector.HeapSnapshotCommon.StaticData=function(nodeCount,rootNodeIndex,tota
lSize,maxJSObjectId) |
| 360 {this.nodeCount=nodeCount;this.rootNodeIndex=rootNodeIndex;this.totalSize=totalS
ize;this.maxJSObjectId=maxJSObjectId;} |
| 361 WebInspector.HeapSnapshotCommon.Statistics=function() |
| 362 {this.total;this.v8heap;this.native;this.code;this.jsArrays;this.strings;} |
| 363 WebInspector.HeapSnapshotCommon.NodeFilter=function(minNodeId,maxNodeId) |
| 364 {this.minNodeId=minNodeId;this.maxNodeId=maxNodeId;this.allocationNodeId;} |
| 365 WebInspector.HeapSnapshotCommon.NodeFilter.prototype={equals:function(o) |
| 366 {return this.minNodeId===o.minNodeId&&this.maxNodeId===o.maxNodeId&&this.allocat
ionNodeId===o.allocationNodeId;}};WebInspector.HeapSnapshotLoader=function(dispa
tcher) |
333 {this._reset();this._progress=new WebInspector.HeapSnapshotProgress(dispatcher);
} | 367 {this._reset();this._progress=new WebInspector.HeapSnapshotProgress(dispatcher);
} |
334 WebInspector.HeapSnapshotLoader.prototype={dispose:function() | 368 WebInspector.HeapSnapshotLoader.prototype={dispose:function() |
335 {this._reset();},_reset:function() | 369 {this._reset();},_reset:function() |
336 {this._json="";this._state="find-snapshot-info";this._snapshot={};},close:functi
on() | 370 {this._json="";this._state="find-snapshot-info";this._snapshot={};},close:functi
on() |
337 {if(this._json) | 371 {if(this._json) |
338 this._parseStringsArray();},buildSnapshot:function(constructorName) | 372 this._parseStringsArray();},buildSnapshot:function(showHiddenData) |
339 {this._progress.updateStatus("Processing snapshot\u2026");var constructor=WebIns
pector[constructorName];var result=new constructor(this._snapshot,this._progress
);this._reset();return result;},_parseUintArray:function() | 373 {this._progress.updateStatus("Processing snapshot\u2026");var result=new WebInsp
ector.JSHeapSnapshot(this._snapshot,this._progress,showHiddenData);this._reset()
;return result;},_parseUintArray:function() |
340 {var index=0;var char0="0".charCodeAt(0),char9="9".charCodeAt(0),closingBracket=
"]".charCodeAt(0);var length=this._json.length;while(true){while(index<length){v
ar code=this._json.charCodeAt(index);if(char0<=code&&code<=char9) | 374 {var index=0;var char0="0".charCodeAt(0),char9="9".charCodeAt(0),closingBracket=
"]".charCodeAt(0);var length=this._json.length;while(true){while(index<length){v
ar code=this._json.charCodeAt(index);if(char0<=code&&code<=char9) |
341 break;else if(code===closingBracket){this._json=this._json.slice(index+1);return
false;} | 375 break;else if(code===closingBracket){this._json=this._json.slice(index+1);return
false;} |
342 ++index;} | 376 ++index;} |
343 if(index===length){this._json="";return true;} | 377 if(index===length){this._json="";return true;} |
344 var nextNumber=0;var startIndex=index;while(index<length){var code=this._json.ch
arCodeAt(index);if(char0>code||code>char9) | 378 var nextNumber=0;var startIndex=index;while(index<length){var code=this._json.ch
arCodeAt(index);if(char0>code||code>char9) |
345 break;nextNumber*=10;nextNumber+=(code-char0);++index;} | 379 break;nextNumber*=10;nextNumber+=(code-char0);++index;} |
346 if(index===length){this._json=this._json.slice(startIndex);return true;} | 380 if(index===length){this._json=this._json.slice(startIndex);return true;} |
347 this._array[this._arrayIndex++]=nextNumber;}},_parseStringsArray:function() | 381 this._array[this._arrayIndex++]=nextNumber;}},_parseStringsArray:function() |
348 {this._progress.updateStatus("Parsing strings\u2026");var closingBracketIndex=th
is._json.lastIndexOf("]");if(closingBracketIndex===-1) | 382 {this._progress.updateStatus("Parsing strings\u2026");var closingBracketIndex=th
is._json.lastIndexOf("]");if(closingBracketIndex===-1) |
349 throw new Error("Incomplete JSON");this._json=this._json.slice(0,closingBracketI
ndex+1);this._snapshot.strings=JSON.parse(this._json);},write:function(chunk) | 383 throw new Error("Incomplete JSON");this._json=this._json.slice(0,closingBracketI
ndex+1);this._snapshot.strings=JSON.parse(this._json);},write:function(chunk) |
350 {this._json+=chunk;while(true){switch(this._state){case"find-snapshot-info":{var
snapshotToken="\"snapshot\"";var snapshotTokenIndex=this._json.indexOf(snapshot
Token);if(snapshotTokenIndex===-1) | 384 {this._json+=chunk;while(true){switch(this._state){case"find-snapshot-info":{var
snapshotToken="\"snapshot\"";var snapshotTokenIndex=this._json.indexOf(snapshot
Token);if(snapshotTokenIndex===-1) |
351 throw new Error("Snapshot token not found");this._json=this._json.slice(snapshot
TokenIndex+snapshotToken.length+1);this._state="parse-snapshot-info";this._progr
ess.updateStatus("Loading snapshot info\u2026");break;} | 385 throw new Error("Snapshot token not found");this._json=this._json.slice(snapshot
TokenIndex+snapshotToken.length+1);this._state="parse-snapshot-info";this._progr
ess.updateStatus("Loading snapshot info\u2026");break;} |
352 case"parse-snapshot-info":{var closingBracketIndex=WebInspector.TextUtils.findBa
lancedCurlyBrackets(this._json);if(closingBracketIndex===-1) | 386 case"parse-snapshot-info":{var closingBracketIndex=WebInspector.TextUtils.findBa
lancedCurlyBrackets(this._json);if(closingBracketIndex===-1) |
353 return;this._snapshot.snapshot=(JSON.parse(this._json.slice(0,closingBracketInde
x)));this._json=this._json.slice(closingBracketIndex);this._state="find-nodes";b
reak;} | 387 return;this._snapshot.snapshot=(JSON.parse(this._json.slice(0,closingBracketInde
x)));this._json=this._json.slice(closingBracketIndex);this._state="find-nodes";b
reak;} |
354 case"find-nodes":{var nodesToken="\"nodes\"";var nodesTokenIndex=this._json.inde
xOf(nodesToken);if(nodesTokenIndex===-1) | 388 case"find-nodes":{var nodesToken="\"nodes\"";var nodesTokenIndex=this._json.inde
xOf(nodesToken);if(nodesTokenIndex===-1) |
355 return;var bracketIndex=this._json.indexOf("[",nodesTokenIndex);if(bracketIndex=
==-1) | 389 return;var bracketIndex=this._json.indexOf("[",nodesTokenIndex);if(bracketIndex=
==-1) |
356 return;this._json=this._json.slice(bracketIndex+1);var node_fields_count=this._s
napshot.snapshot.meta.node_fields.length;var nodes_length=this._snapshot.snapsho
t.node_count*node_fields_count;this._array=new Uint32Array(nodes_length);this._a
rrayIndex=0;this._state="parse-nodes";break;} | 390 return;this._json=this._json.slice(bracketIndex+1);var node_fields_count=this._s
napshot.snapshot.meta.node_fields.length;var nodes_length=this._snapshot.snapsho
t.node_count*node_fields_count;this._array=new Uint32Array(nodes_length);this._a
rrayIndex=0;this._state="parse-nodes";break;} |
357 case"parse-nodes":{var hasMoreData=this._parseUintArray();this._progress.updateP
rogress("Loading nodes\u2026 %d\%",this._arrayIndex,this._array.length);if(hasMo
reData) | 391 case"parse-nodes":{var hasMoreData=this._parseUintArray();this._progress.updateP
rogress("Loading nodes\u2026 %d\%",this._arrayIndex,this._array.length);if(hasMo
reData) |
358 return;this._snapshot.nodes=this._array;this._state="find-edges";this._array=nul
l;break;} | 392 return;this._snapshot.nodes=this._array;this._state="find-edges";this._array=nul
l;break;} |
359 case"find-edges":{var edgesToken="\"edges\"";var edgesTokenIndex=this._json.inde
xOf(edgesToken);if(edgesTokenIndex===-1) | 393 case"find-edges":{var edgesToken="\"edges\"";var edgesTokenIndex=this._json.inde
xOf(edgesToken);if(edgesTokenIndex===-1) |
360 return;var bracketIndex=this._json.indexOf("[",edgesTokenIndex);if(bracketIndex=
==-1) | 394 return;var bracketIndex=this._json.indexOf("[",edgesTokenIndex);if(bracketIndex=
==-1) |
361 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;} | 395 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;} |
362 case"parse-edges":{var hasMoreData=this._parseUintArray();this._progress.updateP
rogress("Loading edges\u2026 %d\%",this._arrayIndex,this._array.length);if(hasMo
reData) | 396 case"parse-edges":{var hasMoreData=this._parseUintArray();this._progress.updateP
rogress("Loading edges\u2026 %d\%",this._arrayIndex,this._array.length);if(hasMo
reData) |
363 return;this._snapshot.edges=this._array;this._array=null;if(WebInspector.HeapSna
pshot.enableAllocationProfiler) | 397 return;this._snapshot.edges=this._array;this._array=null;if(this._snapshot.snaps
hot.trace_function_count) |
364 this._state="find-trace-function-infos";else | 398 this._state="find-trace-function-infos";else |
365 this._state="find-strings";break;} | 399 this._state="find-strings";break;} |
366 case"find-trace-function-infos":{var tracesToken="\"trace_function_infos\"";var
tracesTokenIndex=this._json.indexOf(tracesToken);if(tracesTokenIndex===-1) | 400 case"find-trace-function-infos":{var tracesToken="\"trace_function_infos\"";var
tracesTokenIndex=this._json.indexOf(tracesToken);if(tracesTokenIndex===-1) |
367 return;var bracketIndex=this._json.indexOf("[",tracesTokenIndex);if(bracketIndex
===-1) | 401 return;var bracketIndex=this._json.indexOf("[",tracesTokenIndex);if(bracketIndex
===-1) |
368 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;} | 402 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;} |
369 case"parse-trace-function-infos":{if(this._parseUintArray()) | 403 case"parse-trace-function-infos":{if(this._parseUintArray()) |
370 return;this._snapshot.trace_function_infos=this._array;this._array=null;this._st
ate="find-trace-tree";break;} | 404 return;this._snapshot.trace_function_infos=this._array;this._array=null;this._st
ate="find-trace-tree";break;} |
371 case"find-trace-tree":{var tracesToken="\"trace_tree\"";var tracesTokenIndex=thi
s._json.indexOf(tracesToken);if(tracesTokenIndex===-1) | 405 case"find-trace-tree":{var tracesToken="\"trace_tree\"";var tracesTokenIndex=thi
s._json.indexOf(tracesToken);if(tracesTokenIndex===-1) |
372 return;var bracketIndex=this._json.indexOf("[",tracesTokenIndex);if(bracketIndex
===-1) | 406 return;var bracketIndex=this._json.indexOf("[",tracesTokenIndex);if(bracketIndex
===-1) |
373 return;this._json=this._json.slice(bracketIndex);this._state="parse-trace-tree";
break;} | 407 return;this._json=this._json.slice(bracketIndex);this._state="parse-trace-tree";
break;} |
374 case"parse-trace-tree":{var stringsToken="\"strings\"";var stringsTokenIndex=thi
s._json.indexOf(stringsToken);if(stringsTokenIndex===-1) | 408 case"parse-trace-tree":{var stringsToken="\"strings\"";var stringsTokenIndex=thi
s._json.indexOf(stringsToken);if(stringsTokenIndex===-1) |
375 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;} | 409 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;} |
376 case"find-strings":{var stringsToken="\"strings\"";var stringsTokenIndex=this._j
son.indexOf(stringsToken);if(stringsTokenIndex===-1) | 410 case"find-strings":{var stringsToken="\"strings\"";var stringsTokenIndex=this._j
son.indexOf(stringsToken);if(stringsTokenIndex===-1) |
377 return;var bracketIndex=this._json.indexOf("[",stringsTokenIndex);if(bracketInde
x===-1) | 411 return;var bracketIndex=this._json.indexOf("[",stringsTokenIndex);if(bracketInde
x===-1) |
378 return;this._json=this._json.slice(bracketIndex);this._state="accumulate-strings
";break;} | 412 return;this._json=this._json.slice(bracketIndex);this._state="accumulate-strings
";break;} |
379 case"accumulate-strings":return;}}}};;WebInspector.HeapSnapshotWorkerDispatcher=
function(globalObject,postMessage) | 413 case"accumulate-strings":return;}}}};;WebInspector.HeapSnapshotWorkerDispatcher=
function(globalObject,postMessage) |
380 {this._objects=[];this._global=globalObject;this._postMessage=postMessage;} | 414 {this._objects=[];this._global=globalObject;this._postMessage=postMessage;} |
381 WebInspector.HeapSnapshotWorkerDispatcher.prototype={_findFunction:function(name
) | 415 WebInspector.HeapSnapshotWorkerDispatcher.prototype={_findFunction:function(name
) |
382 {var path=name.split(".");var result=this._global;for(var i=0;i<path.length;++i) | 416 {var path=name.split(".");var result=this._global;for(var i=0;i<path.length;++i) |
383 result=result[path[i]];return result;},sendEvent:function(name,data) | 417 result=result[path[i]];return result;},sendEvent:function(name,data) |
384 {this._postMessage({eventName:name,data:data});},dispatchMessage:function(event) | 418 {this._postMessage({eventName:name,data:data});},dispatchMessage:function(event) |
385 {var data=(event.data);var response={callId:data.callId};try{switch(data.disposi
tion){case"create":{var constructorFunction=this._findFunction(data.methodName);
this._objects[data.objectId]=new constructorFunction(this);break;} | 419 {var data=(event.data);var response={callId:data.callId};try{switch(data.disposi
tion){case"create":{var constructorFunction=this._findFunction(data.methodName);
this._objects[data.objectId]=new constructorFunction(this);break;} |
386 case"dispose":{delete this._objects[data.objectId];break;} | 420 case"dispose":{delete this._objects[data.objectId];break;} |
387 case"getter":{var object=this._objects[data.objectId];var result=object[data.met
hodName];response.result=result;break;} | 421 case"getter":{var object=this._objects[data.objectId];var result=object[data.met
hodName];response.result=result;break;} |
388 case"factory":{var object=this._objects[data.objectId];var result=object[data.me
thodName].apply(object,data.methodArguments);if(result) | 422 case"factory":{var object=this._objects[data.objectId];var result=object[data.me
thodName].apply(object,data.methodArguments);if(result) |
389 this._objects[data.newObjectId]=result;response.result=!!result;break;} | 423 this._objects[data.newObjectId]=result;response.result=!!result;break;} |
390 case"method":{var object=this._objects[data.objectId];response.result=object[dat
a.methodName].apply(object,data.methodArguments);break;} | 424 case"method":{var object=this._objects[data.objectId];response.result=object[dat
a.methodName].apply(object,data.methodArguments);break;} |
391 case"evaluateForTest":{try{response.result=eval(data.source)}catch(e){response.r
esult=e.toString();} | 425 case"evaluateForTest":{try{response.result=eval(data.source)}catch(e){response.r
esult=e.toString();} |
392 break;} | 426 break;}}}catch(e){response.error=e.toString();response.errorCallStack=e.stack;if
(data.methodName) |
393 case"enableAllocationProfiler":{WebInspector.HeapSnapshot.enableAllocationProfil
er=true;return;}}}catch(e){response.error=e.toString();response.errorCallStack=e
.stack;if(data.methodName) | |
394 response.errorMethodName=data.methodName;} | 427 response.errorMethodName=data.methodName;} |
395 this._postMessage(response);}};;WebInspector.JSHeapSnapshot=function(profile,pro
gress) | 428 this._postMessage(response);}};;WebInspector.JSHeapSnapshot=function(profile,pro
gress,showHiddenData) |
396 {this._nodeFlags={canBeQueried:1,detachedDOMTreeNode:2,pageObject:4,visitedMarke
rMask:0x0ffff,visitedMarker:0x10000};this._lazyStringCache={};WebInspector.HeapS
napshot.call(this,profile,progress);} | 429 {this._nodeFlags={canBeQueried:1,detachedDOMTreeNode:2,pageObject:4,visitedMarke
rMask:0x0ffff,visitedMarker:0x10000};this._lazyStringCache={};WebInspector.HeapS
napshot.call(this,profile,progress,showHiddenData);} |
397 WebInspector.JSHeapSnapshot.prototype={maxJsNodeId:function() | 430 WebInspector.JSHeapSnapshot.prototype={createNode:function(nodeIndex) |
398 {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) | 431 {return new WebInspector.JSHeapSnapshotNode(this,nodeIndex);},createEdge:functio
n(edgeIndex) |
399 continue;if(id<nodes[nodeIndex]) | 432 {return new WebInspector.JSHeapSnapshotEdge(this,edgeIndex);},createRetainingEdg
e:function(retainerIndex) |
400 id=nodes[nodeIndex];} | 433 {return new WebInspector.JSHeapSnapshotRetainerEdge(this,retainerIndex);},classN
odesFilter:function() |
401 return id;},createNode:function(nodeIndex) | |
402 {return new WebInspector.JSHeapSnapshotNode(this,nodeIndex);},createEdge:functio
n(edges,edgeIndex) | |
403 {return new WebInspector.JSHeapSnapshotEdge(this,edges,edgeIndex);},createRetain
ingEdge:function(retainedNodeIndex,retainerIndex) | |
404 {return new WebInspector.JSHeapSnapshotRetainerEdge(this,retainedNodeIndex,retai
nerIndex);},classNodesFilter:function() | |
405 {function filter(node) | 434 {function filter(node) |
406 {return node.isUserObject();} | 435 {return node.isUserObject();} |
407 return filter;},containmentEdgesFilter:function(showHiddenData) | 436 return this._showHiddenData?null:filter;},containmentEdgesFilter:function() |
408 {function filter(edge){if(edge.isInvisible()) | 437 {var showHiddenData=this._showHiddenData;function filter(edge){if(edge.isInvisib
le()) |
409 return false;if(showHiddenData) | 438 return false;if(showHiddenData) |
410 return true;return!edge.isHidden()&&!edge.node().isHidden();} | 439 return true;return!edge.isHidden()&&!edge.node().isHidden();} |
411 return filter;},retainingEdgesFilter:function(showHiddenData) | 440 return filter;},retainingEdgesFilter:function() |
412 {var containmentEdgesFilter=this.containmentEdgesFilter(showHiddenData);function
filter(edge) | 441 {var containmentEdgesFilter=this.containmentEdgesFilter();function filter(edge) |
413 {return containmentEdgesFilter(edge)&&!edge.node().isRoot()&&!edge.isWeak();} | 442 {return containmentEdgesFilter(edge)&&!edge.node().isRoot()&&!edge.isWeak();} |
414 return filter;},dispose:function() | 443 return filter;},dispose:function() |
415 {WebInspector.HeapSnapshot.prototype.dispose.call(this);delete this._flags;},_ma
rkInvisibleEdges:function() | 444 {WebInspector.HeapSnapshot.prototype.dispose.call(this);delete this._flags;},_ca
lculateFlags:function() |
416 {for(var iter=this.rootNode().edges();iter.hasNext();iter.next()){var edge=iter.
edge;if(!edge.isShortcut()) | |
417 continue;var node=edge.node();var propNames={};for(var innerIter=node.edges();in
nerIter.hasNext();innerIter.next()){var globalObjEdge=innerIter.edge;if(globalOb
jEdge.isShortcut()) | |
418 propNames[globalObjEdge._nameOrIndex()]=true;} | |
419 for(innerIter.rewind();innerIter.hasNext();innerIter.next()){var globalObjEdge=i
nnerIter.edge;if(!globalObjEdge.isShortcut()&&globalObjEdge.node().isHidden()&&g
lobalObjEdge._hasStringName()&&(globalObjEdge._nameOrIndex()in propNames)) | |
420 this._containmentEdges[globalObjEdge._edges._start+globalObjEdge.edgeIndex+this.
_edgeTypeOffset]=this._edgeInvisibleType;}}},_calculateFlags:function() | |
421 {this._flags=new Uint32Array(this.nodeCount);this._markDetachedDOMTreeNodes();th
is._markQueriableHeapObjects();this._markPageOwnedNodes();},_isUserRoot:function
(node) | 445 {this._flags=new Uint32Array(this.nodeCount);this._markDetachedDOMTreeNodes();th
is._markQueriableHeapObjects();this._markPageOwnedNodes();},_isUserRoot:function
(node) |
422 {return node.isUserRoot()||node.isDocumentDOMTreesRoot();},forEachRoot:function(
action,userRootsOnly) | 446 {return node.isUserRoot()||node.isDocumentDOMTreesRoot();},forEachRoot:function(
action,userRootsOnly) |
423 {function getChildNodeByName(node,name) | 447 {function getChildNodeByName(node,name) |
424 {for(var iter=node.edges();iter.hasNext();iter.next()){var child=iter.edge.node(
);if(child.name()===name) | 448 {for(var iter=node.edges();iter.hasNext();iter.next()){var child=iter.edge.node(
);if(child.name()===name) |
425 return child;} | 449 return child;} |
426 return null;} | 450 return null;} |
427 function getChildNodeByLinkName(node,name) | |
428 {for(var iter=node.edges();iter.hasNext();iter.next()){var edge=iter.edge;if(edg
e.name()===name) | |
429 return edge.node();} | |
430 return null;} | |
431 var visitedNodes={};function doAction(node) | 451 var visitedNodes={};function doAction(node) |
432 {var ordinal=node._ordinal();if(!visitedNodes[ordinal]){action(node);visitedNode
s[ordinal]=true;}} | 452 {var ordinal=node._ordinal();if(!visitedNodes[ordinal]){action(node);visitedNode
s[ordinal]=true;}} |
433 var gcRoots=getChildNodeByName(this.rootNode(),"(GC roots)");if(!gcRoots) | 453 var gcRoots=getChildNodeByName(this.rootNode(),"(GC roots)");if(!gcRoots) |
434 return;if(userRootsOnly){for(var iter=this.rootNode().edges();iter.hasNext();ite
r.next()){var node=iter.edge.node();if(node.isDocumentDOMTreesRoot()) | 454 return;if(userRootsOnly){for(var iter=this.rootNode().edges();iter.hasNext();ite
r.next()){var node=iter.edge.node();if(this._isUserRoot(node)) |
435 doAction(node);else if(node.isUserRoot()){var nativeContextNode=getChildNodeByLi
nkName(node,"native_context");if(nativeContextNode) | 455 doAction(node);}}else{for(var iter=gcRoots.edges();iter.hasNext();iter.next()){v
ar subRoot=iter.edge.node();for(var iter2=subRoot.edges();iter2.hasNext();iter2.
next()) |
436 doAction(nativeContextNode);else | |
437 doAction(node);}}}else{for(var iter=gcRoots.edges();iter.hasNext();iter.next()){
var subRoot=iter.edge.node();for(var iter2=subRoot.edges();iter2.hasNext();iter2
.next()) | |
438 doAction(iter2.edge.node());doAction(subRoot);} | 456 doAction(iter2.edge.node());doAction(subRoot);} |
439 for(var iter=this.rootNode().edges();iter.hasNext();iter.next()) | 457 for(var iter=this.rootNode().edges();iter.hasNext();iter.next()) |
440 doAction(iter.edge.node())}},userObjectsMapAndFlag:function() | 458 doAction(iter.edge.node())}},userObjectsMapAndFlag:function() |
441 {return{map:this._flags,flag:this._nodeFlags.pageObject};},_flagsOfNode:function
(node) | 459 {return this._showHiddenData?null:{map:this._flags,flag:this._nodeFlags.pageObje
ct};},_flagsOfNode:function(node) |
442 {return this._flags[node.nodeIndex/this._nodeFieldCount];},_markDetachedDOMTreeN
odes:function() | 460 {return this._flags[node.nodeIndex/this._nodeFieldCount];},_markDetachedDOMTreeN
odes:function() |
443 {var flag=this._nodeFlags.detachedDOMTreeNode;var detachedDOMTreesRoot;for(var i
ter=this.rootNode().edges();iter.hasNext();iter.next()){var node=iter.edge.node(
);if(node.name()==="(Detached DOM trees)"){detachedDOMTreesRoot=node;break;}} | 461 {var flag=this._nodeFlags.detachedDOMTreeNode;var detachedDOMTreesRoot;for(var i
ter=this.rootNode().edges();iter.hasNext();iter.next()){var node=iter.edge.node(
);if(node.name()==="(Detached DOM trees)"){detachedDOMTreesRoot=node;break;}} |
444 if(!detachedDOMTreesRoot) | 462 if(!detachedDOMTreesRoot) |
445 return;var detachedDOMTreeRE=/^Detached DOM tree/;for(var iter=detachedDOMTreesR
oot.edges();iter.hasNext();iter.next()){var node=iter.edge.node();if(detachedDOM
TreeRE.test(node.className())){for(var edgesIter=node.edges();edgesIter.hasNext(
);edgesIter.next()) | 463 return;var detachedDOMTreeRE=/^Detached DOM tree/;for(var iter=detachedDOMTreesR
oot.edges();iter.hasNext();iter.next()){var node=iter.edge.node();if(detachedDOM
TreeRE.test(node.className())){for(var edgesIter=node.edges();edgesIter.hasNext(
);edgesIter.next()) |
446 this._flags[edgesIter.edge.node().nodeIndex/this._nodeFieldCount]|=flag;}}},_mar
kQueriableHeapObjects:function() | 464 this._flags[edgesIter.edge.node().nodeIndex/this._nodeFieldCount]|=flag;}}},_mar
kQueriableHeapObjects:function() |
447 {var flag=this._nodeFlags.canBeQueried;var hiddenEdgeType=this._edgeHiddenType;v
ar internalEdgeType=this._edgeInternalType;var invisibleEdgeType=this._edgeInvis
ibleType;var weakEdgeType=this._edgeWeakType;var edgeToNodeOffset=this._edgeToNo
deOffset;var edgeTypeOffset=this._edgeTypeOffset;var edgeFieldsCount=this._edgeF
ieldsCount;var containmentEdges=this._containmentEdges;var nodes=this._nodes;var
nodeCount=this.nodeCount;var nodeFieldCount=this._nodeFieldCount;var firstEdgeI
ndexes=this._firstEdgeIndexes;var flags=this._flags;var list=[];for(var iter=thi
s.rootNode().edges();iter.hasNext();iter.next()){if(iter.edge.node().isUserRoot(
)) | 465 {var flag=this._nodeFlags.canBeQueried;var hiddenEdgeType=this._edgeHiddenType;v
ar internalEdgeType=this._edgeInternalType;var invisibleEdgeType=this._edgeInvis
ibleType;var weakEdgeType=this._edgeWeakType;var edgeToNodeOffset=this._edgeToNo
deOffset;var edgeTypeOffset=this._edgeTypeOffset;var edgeFieldsCount=this._edgeF
ieldsCount;var containmentEdges=this._containmentEdges;var nodes=this._nodes;var
nodeCount=this.nodeCount;var nodeFieldCount=this._nodeFieldCount;var firstEdgeI
ndexes=this._firstEdgeIndexes;var flags=this._flags;var list=[];for(var iter=thi
s.rootNode().edges();iter.hasNext();iter.next()){if(iter.edge.node().isUserRoot(
)) |
448 list.push(iter.edge.node().nodeIndex/nodeFieldCount);} | 466 list.push(iter.edge.node().nodeIndex/nodeFieldCount);} |
449 while(list.length){var nodeOrdinal=list.pop();if(flags[nodeOrdinal]&flag) | 467 while(list.length){var nodeOrdinal=list.pop();if(flags[nodeOrdinal]&flag) |
450 continue;flags[nodeOrdinal]|=flag;var beginEdgeIndex=firstEdgeIndexes[nodeOrdina
l];var endEdgeIndex=firstEdgeIndexes[nodeOrdinal+1];for(var edgeIndex=beginEdgeI
ndex;edgeIndex<endEdgeIndex;edgeIndex+=edgeFieldsCount){var childNodeIndex=conta
inmentEdges[edgeIndex+edgeToNodeOffset];var childNodeOrdinal=childNodeIndex/node
FieldCount;if(flags[childNodeOrdinal]&flag) | 468 continue;flags[nodeOrdinal]|=flag;var beginEdgeIndex=firstEdgeIndexes[nodeOrdina
l];var endEdgeIndex=firstEdgeIndexes[nodeOrdinal+1];for(var edgeIndex=beginEdgeI
ndex;edgeIndex<endEdgeIndex;edgeIndex+=edgeFieldsCount){var childNodeIndex=conta
inmentEdges[edgeIndex+edgeToNodeOffset];var childNodeOrdinal=childNodeIndex/node
FieldCount;if(flags[childNodeOrdinal]&flag) |
451 continue;var type=containmentEdges[edgeIndex+edgeTypeOffset];if(type===hiddenEdg
eType||type===invisibleEdgeType||type===internalEdgeType||type===weakEdgeType) | 469 continue;var type=containmentEdges[edgeIndex+edgeTypeOffset];if(type===hiddenEdg
eType||type===invisibleEdgeType||type===internalEdgeType||type===weakEdgeType) |
452 continue;list.push(childNodeOrdinal);}}},_markPageOwnedNodes:function() | 470 continue;list.push(childNodeOrdinal);}}},_markPageOwnedNodes:function() |
453 {var edgeShortcutType=this._edgeShortcutType;var edgeElementType=this._edgeEleme
ntType;var edgeToNodeOffset=this._edgeToNodeOffset;var edgeTypeOffset=this._edge
TypeOffset;var edgeFieldsCount=this._edgeFieldsCount;var edgeWeakType=this._edge
WeakType;var firstEdgeIndexes=this._firstEdgeIndexes;var containmentEdges=this._
containmentEdges;var containmentEdgesLength=containmentEdges.length;var nodes=th
is._nodes;var nodeFieldCount=this._nodeFieldCount;var nodesCount=this.nodeCount;
var flags=this._flags;var flag=this._nodeFlags.pageObject;var visitedMarker=this
._nodeFlags.visitedMarker;var visitedMarkerMask=this._nodeFlags.visitedMarkerMas
k;var markerAndFlag=visitedMarker|flag;var nodesToVisit=new Uint32Array(nodesCou
nt);var nodesToVisitLength=0;var rootNodeOrdinal=this._rootNodeIndex/nodeFieldCo
unt;var node=this.rootNode();for(var edgeIndex=firstEdgeIndexes[rootNodeOrdinal]
,endEdgeIndex=firstEdgeIndexes[rootNodeOrdinal+1];edgeIndex<endEdgeIndex;edgeInd
ex+=edgeFieldsCount){var edgeType=containmentEdges[edgeIndex+edgeTypeOffset];var
nodeIndex=containmentEdges[edgeIndex+edgeToNodeOffset];if(edgeType===edgeElemen
tType){node.nodeIndex=nodeIndex;if(!node.isDocumentDOMTreesRoot()) | 471 {var edgeShortcutType=this._edgeShortcutType;var edgeElementType=this._edgeEleme
ntType;var edgeToNodeOffset=this._edgeToNodeOffset;var edgeTypeOffset=this._edge
TypeOffset;var edgeFieldsCount=this._edgeFieldsCount;var edgeWeakType=this._edge
WeakType;var firstEdgeIndexes=this._firstEdgeIndexes;var containmentEdges=this._
containmentEdges;var containmentEdgesLength=containmentEdges.length;var nodes=th
is._nodes;var nodeFieldCount=this._nodeFieldCount;var nodesCount=this.nodeCount;
var flags=this._flags;var flag=this._nodeFlags.pageObject;var visitedMarker=this
._nodeFlags.visitedMarker;var visitedMarkerMask=this._nodeFlags.visitedMarkerMas
k;var markerAndFlag=visitedMarker|flag;var nodesToVisit=new Uint32Array(nodesCou
nt);var nodesToVisitLength=0;var rootNodeOrdinal=this._rootNodeIndex/nodeFieldCo
unt;var node=this.rootNode();for(var edgeIndex=firstEdgeIndexes[rootNodeOrdinal]
,endEdgeIndex=firstEdgeIndexes[rootNodeOrdinal+1];edgeIndex<endEdgeIndex;edgeInd
ex+=edgeFieldsCount){var edgeType=containmentEdges[edgeIndex+edgeTypeOffset];var
nodeIndex=containmentEdges[edgeIndex+edgeToNodeOffset];if(edgeType===edgeElemen
tType){node.nodeIndex=nodeIndex;if(!node.isDocumentDOMTreesRoot()) |
454 continue;}else if(edgeType!==edgeShortcutType) | 472 continue;}else if(edgeType!==edgeShortcutType) |
455 continue;var nodeOrdinal=nodeIndex/nodeFieldCount;nodesToVisit[nodesToVisitLengt
h++]=nodeOrdinal;flags[nodeOrdinal]|=visitedMarker;} | 473 continue;var nodeOrdinal=nodeIndex/nodeFieldCount;nodesToVisit[nodesToVisitLengt
h++]=nodeOrdinal;flags[nodeOrdinal]|=visitedMarker;} |
456 while(nodesToVisitLength){var nodeOrdinal=nodesToVisit[--nodesToVisitLength];fla
gs[nodeOrdinal]|=flag;flags[nodeOrdinal]&=visitedMarkerMask;var beginEdgeIndex=f
irstEdgeIndexes[nodeOrdinal];var endEdgeIndex=firstEdgeIndexes[nodeOrdinal+1];fo
r(var edgeIndex=beginEdgeIndex;edgeIndex<endEdgeIndex;edgeIndex+=edgeFieldsCount
){var childNodeIndex=containmentEdges[edgeIndex+edgeToNodeOffset];var childNodeO
rdinal=childNodeIndex/nodeFieldCount;if(flags[childNodeOrdinal]&markerAndFlag) | 474 while(nodesToVisitLength){var nodeOrdinal=nodesToVisit[--nodesToVisitLength];fla
gs[nodeOrdinal]|=flag;flags[nodeOrdinal]&=visitedMarkerMask;var beginEdgeIndex=f
irstEdgeIndexes[nodeOrdinal];var endEdgeIndex=firstEdgeIndexes[nodeOrdinal+1];fo
r(var edgeIndex=beginEdgeIndex;edgeIndex<endEdgeIndex;edgeIndex+=edgeFieldsCount
){var childNodeIndex=containmentEdges[edgeIndex+edgeToNodeOffset];var childNodeO
rdinal=childNodeIndex/nodeFieldCount;if(flags[childNodeOrdinal]&markerAndFlag) |
457 continue;var type=containmentEdges[edgeIndex+edgeTypeOffset];if(type===edgeWeakT
ype) | 475 continue;var type=containmentEdges[edgeIndex+edgeTypeOffset];if(type===edgeWeakT
ype) |
458 continue;nodesToVisit[nodesToVisitLength++]=childNodeOrdinal;flags[childNodeOrdi
nal]|=visitedMarker;}}},__proto__:WebInspector.HeapSnapshot.prototype};WebInspec
tor.JSHeapSnapshotNode=function(snapshot,nodeIndex) | 476 continue;nodesToVisit[nodesToVisitLength++]=childNodeOrdinal;flags[childNodeOrdi
nal]|=visitedMarker;}}},_calculateStatistics:function() |
| 477 {var nodeFieldCount=this._nodeFieldCount;var nodes=this._nodes;var nodesLength=n
odes.length;var nodeTypeOffset=this._nodeTypeOffset;var nodeSizeOffset=this._nod
eSelfSizeOffset;;var nodeNativeType=this._nodeNativeType;var nodeCodeType=this._
nodeCodeType;var nodeConsStringType=this._nodeConsStringType;var nodeSlicedStrin
gType=this._nodeSlicedStringType;var sizeNative=0;var sizeCode=0;var sizeStrings
=0;var sizeJSArrays=0;var node=this.rootNode();for(var nodeIndex=0;nodeIndex<nod
esLength;nodeIndex+=nodeFieldCount){node.nodeIndex=nodeIndex;var nodeType=nodes[
nodeIndex+nodeTypeOffset];var nodeSize=nodes[nodeIndex+nodeSizeOffset];if(nodeTy
pe===nodeNativeType) |
| 478 sizeNative+=nodeSize;else if(nodeType===nodeCodeType) |
| 479 sizeCode+=nodeSize;else if(nodeType===nodeConsStringType||nodeType===nodeSlicedS
tringType||node.type()==="string") |
| 480 sizeStrings+=nodeSize;else if(node.name()==="Array") |
| 481 sizeJSArrays+=this._calculateArraySize(node);} |
| 482 this._statistics=new WebInspector.HeapSnapshotCommon.Statistics();this._statisti
cs.total=this.totalSize;this._statistics.v8heap=this.totalSize-sizeNative;this._
statistics.native=sizeNative;this._statistics.code=sizeCode;this._statistics.jsA
rrays=sizeJSArrays;this._statistics.strings=sizeStrings;},_calculateArraySize:fu
nction(node) |
| 483 {var size=node.selfSize();var beginEdgeIndex=node._edgeIndexesStart();var endEdg
eIndex=node._edgeIndexesEnd();var containmentEdges=this._containmentEdges;var st
rings=this._strings;var edgeToNodeOffset=this._edgeToNodeOffset;var edgeTypeOffs
et=this._edgeTypeOffset;var edgeNameOffset=this._edgeNameOffset;var edgeFieldsCo
unt=this._edgeFieldsCount;var edgeInternalType=this._edgeInternalType;for(var ed
geIndex=beginEdgeIndex;edgeIndex<endEdgeIndex;edgeIndex+=edgeFieldsCount){var ed
geType=containmentEdges[edgeIndex+edgeTypeOffset];if(edgeType!==edgeInternalType
) |
| 484 continue;var edgeName=strings[containmentEdges[edgeIndex+edgeNameOffset]];if(edg
eName!=="elements") |
| 485 continue;var elementsNodeIndex=containmentEdges[edgeIndex+edgeToNodeOffset];node
.nodeIndex=elementsNodeIndex;if(node.retainersCount()===1) |
| 486 size+=node.selfSize();break;} |
| 487 return size;},getStatistics:function() |
| 488 {return this._statistics;},__proto__:WebInspector.HeapSnapshot.prototype};WebIns
pector.JSHeapSnapshotNode=function(snapshot,nodeIndex) |
459 {WebInspector.HeapSnapshotNode.call(this,snapshot,nodeIndex)} | 489 {WebInspector.HeapSnapshotNode.call(this,snapshot,nodeIndex)} |
460 WebInspector.JSHeapSnapshotNode.prototype={canBeQueried:function() | 490 WebInspector.JSHeapSnapshotNode.prototype={canBeQueried:function() |
461 {var flags=this._snapshot._flagsOfNode(this);return!!(flags&this._snapshot._node
Flags.canBeQueried);},isUserObject:function() | 491 {var flags=this._snapshot._flagsOfNode(this);return!!(flags&this._snapshot._node
Flags.canBeQueried);},isUserObject:function() |
462 {var flags=this._snapshot._flagsOfNode(this);return!!(flags&this._snapshot._node
Flags.pageObject);},name:function(){var snapshot=this._snapshot;if(this._type()=
==snapshot._nodeConsStringType){var string=snapshot._lazyStringCache[this.nodeIn
dex];if(typeof string==="undefined"){string=this._consStringName();snapshot._laz
yStringCache[this.nodeIndex]=string;} | 492 {var flags=this._snapshot._flagsOfNode(this);return!!(flags&this._snapshot._node
Flags.pageObject);},name:function(){var snapshot=this._snapshot;if(this._type()=
==snapshot._nodeConsStringType){var string=snapshot._lazyStringCache[this.nodeIn
dex];if(typeof string==="undefined"){string=this._consStringName();snapshot._laz
yStringCache[this.nodeIndex]=string;} |
463 return string;} | 493 return string;} |
464 return WebInspector.HeapSnapshotNode.prototype.name.call(this);},_consStringName
:function() | 494 return WebInspector.HeapSnapshotNode.prototype.name.call(this);},_consStringName
:function() |
465 {var snapshot=this._snapshot;var consStringType=snapshot._nodeConsStringType;var
edgeInternalType=snapshot._edgeInternalType;var edgeFieldsCount=snapshot._edgeF
ieldsCount;var edgeToNodeOffset=snapshot._edgeToNodeOffset;var edgeTypeOffset=sn
apshot._edgeTypeOffset;var edgeNameOffset=snapshot._edgeNameOffset;var strings=s
napshot._strings;var edges=snapshot._containmentEdges;var firstEdgeIndexes=snaps
hot._firstEdgeIndexes;var nodeFieldCount=snapshot._nodeFieldCount;var nodeTypeOf
fset=snapshot._nodeTypeOffset;var nodeNameOffset=snapshot._nodeNameOffset;var no
des=snapshot._nodes;var nodesStack=[];nodesStack.push(this.nodeIndex);var name="
";while(nodesStack.length&&name.length<1024){var nodeIndex=nodesStack.pop();if(n
odes[nodeIndex+nodeTypeOffset]!==consStringType){name+=strings[nodes[nodeIndex+n
odeNameOffset]];continue;} | 495 {var snapshot=this._snapshot;var consStringType=snapshot._nodeConsStringType;var
edgeInternalType=snapshot._edgeInternalType;var edgeFieldsCount=snapshot._edgeF
ieldsCount;var edgeToNodeOffset=snapshot._edgeToNodeOffset;var edgeTypeOffset=sn
apshot._edgeTypeOffset;var edgeNameOffset=snapshot._edgeNameOffset;var strings=s
napshot._strings;var edges=snapshot._containmentEdges;var firstEdgeIndexes=snaps
hot._firstEdgeIndexes;var nodeFieldCount=snapshot._nodeFieldCount;var nodeTypeOf
fset=snapshot._nodeTypeOffset;var nodeNameOffset=snapshot._nodeNameOffset;var no
des=snapshot._nodes;var nodesStack=[];nodesStack.push(this.nodeIndex);var name="
";while(nodesStack.length&&name.length<1024){var nodeIndex=nodesStack.pop();if(n
odes[nodeIndex+nodeTypeOffset]!==consStringType){name+=strings[nodes[nodeIndex+n
odeNameOffset]];continue;} |
466 var nodeOrdinal=nodeIndex/nodeFieldCount;var beginEdgeIndex=firstEdgeIndexes[nod
eOrdinal];var endEdgeIndex=firstEdgeIndexes[nodeOrdinal+1];var firstNodeIndex=0;
var secondNodeIndex=0;for(var edgeIndex=beginEdgeIndex;edgeIndex<endEdgeIndex&&(
!firstNodeIndex||!secondNodeIndex);edgeIndex+=edgeFieldsCount){var edgeType=edge
s[edgeIndex+edgeTypeOffset];if(edgeType===edgeInternalType){var edgeName=strings
[edges[edgeIndex+edgeNameOffset]];if(edgeName==="first") | 496 var nodeOrdinal=nodeIndex/nodeFieldCount;var beginEdgeIndex=firstEdgeIndexes[nod
eOrdinal];var endEdgeIndex=firstEdgeIndexes[nodeOrdinal+1];var firstNodeIndex=0;
var secondNodeIndex=0;for(var edgeIndex=beginEdgeIndex;edgeIndex<endEdgeIndex&&(
!firstNodeIndex||!secondNodeIndex);edgeIndex+=edgeFieldsCount){var edgeType=edge
s[edgeIndex+edgeTypeOffset];if(edgeType===edgeInternalType){var edgeName=strings
[edges[edgeIndex+edgeNameOffset]];if(edgeName==="first") |
467 firstNodeIndex=edges[edgeIndex+edgeToNodeOffset];else if(edgeName==="second") | 497 firstNodeIndex=edges[edgeIndex+edgeToNodeOffset];else if(edgeName==="second") |
468 secondNodeIndex=edges[edgeIndex+edgeToNodeOffset];}} | 498 secondNodeIndex=edges[edgeIndex+edgeToNodeOffset];}} |
469 nodesStack.push(secondNodeIndex);nodesStack.push(firstNodeIndex);} | 499 nodesStack.push(secondNodeIndex);nodesStack.push(firstNodeIndex);} |
470 return name;},className:function() | 500 return name;},className:function() |
471 {var type=this.type();switch(type){case"hidden":return"(system)";case"object":ca
se"native":return this.name();case"code":return"(compiled code)";default:return"
("+type+")";}},classIndex:function() | 501 {var type=this.type();switch(type){case"hidden":return"(system)";case"object":ca
se"native":return this.name();case"code":return"(compiled code)";default:return"
("+type+")";}},classIndex:function() |
472 {var snapshot=this._snapshot;var nodes=snapshot._nodes;var type=nodes[this.nodeI
ndex+snapshot._nodeTypeOffset];;if(type===snapshot._nodeObjectType||type===snaps
hot._nodeNativeType) | 502 {var snapshot=this._snapshot;var nodes=snapshot._nodes;var type=nodes[this.nodeI
ndex+snapshot._nodeTypeOffset];;if(type===snapshot._nodeObjectType||type===snaps
hot._nodeNativeType) |
473 return nodes[this.nodeIndex+snapshot._nodeNameOffset];return-1-type;},id:functio
n() | 503 return nodes[this.nodeIndex+snapshot._nodeNameOffset];return-1-type;},id:functio
n() |
474 {var snapshot=this._snapshot;return snapshot._nodes[this.nodeIndex+snapshot._nod
eIdOffset];},isHidden:function() | 504 {var snapshot=this._snapshot;return snapshot._nodes[this.nodeIndex+snapshot._nod
eIdOffset];},isHidden:function() |
475 {return this._type()===this._snapshot._nodeHiddenType;},isSynthetic:function() | 505 {return this._type()===this._snapshot._nodeHiddenType;},isSynthetic:function() |
476 {return this._type()===this._snapshot._nodeSyntheticType;},isUserRoot:function() | 506 {return this._type()===this._snapshot._nodeSyntheticType;},isUserRoot:function() |
477 {return!this.isSynthetic();},isDocumentDOMTreesRoot:function() | 507 {return!this.isSynthetic();},isDocumentDOMTreesRoot:function() |
478 {return this.isSynthetic()&&this.name()==="(Document DOM trees)";},serialize:fun
ction() | 508 {return this.isSynthetic()&&this.name()==="(Document DOM trees)";},serialize:fun
ction() |
479 {var result=WebInspector.HeapSnapshotNode.prototype.serialize.call(this);var fla
gs=this._snapshot._flagsOfNode(this);if(flags&this._snapshot._nodeFlags.canBeQue
ried) | 509 {var result=WebInspector.HeapSnapshotNode.prototype.serialize.call(this);var fla
gs=this._snapshot._flagsOfNode(this);if(flags&this._snapshot._nodeFlags.canBeQue
ried) |
480 result.canBeQueried=true;if(flags&this._snapshot._nodeFlags.detachedDOMTreeNode) | 510 result.canBeQueried=true;if(flags&this._snapshot._nodeFlags.detachedDOMTreeNode) |
481 result.detachedDOMTreeNode=true;return result;},__proto__:WebInspector.HeapSnaps
hotNode.prototype};WebInspector.JSHeapSnapshotEdge=function(snapshot,edges,edgeI
ndex) | 511 result.detachedDOMTreeNode=true;return result;},__proto__:WebInspector.HeapSnaps
hotNode.prototype};WebInspector.JSHeapSnapshotEdge=function(snapshot,edgeIndex) |
482 {WebInspector.HeapSnapshotEdge.call(this,snapshot,edges,edgeIndex);} | 512 {WebInspector.HeapSnapshotEdge.call(this,snapshot,edgeIndex);} |
483 WebInspector.JSHeapSnapshotEdge.prototype={clone:function() | 513 WebInspector.JSHeapSnapshotEdge.prototype={clone:function() |
484 {return new WebInspector.JSHeapSnapshotEdge(this._snapshot,this._edges,this.edge
Index);},hasStringName:function() | 514 {var snapshot=(this._snapshot);return new WebInspector.JSHeapSnapshotEdge(snapsh
ot,this.edgeIndex);},hasStringName:function() |
485 {if(!this.isShortcut()) | 515 {if(!this.isShortcut()) |
486 return this._hasStringName();return isNaN(parseInt(this._name(),10));},isElement
:function() | 516 return this._hasStringName();return isNaN(parseInt(this._name(),10));},isElement
:function() |
487 {return this._type()===this._snapshot._edgeElementType;},isHidden:function() | 517 {return this._type()===this._snapshot._edgeElementType;},isHidden:function() |
488 {return this._type()===this._snapshot._edgeHiddenType;},isWeak:function() | 518 {return this._type()===this._snapshot._edgeHiddenType;},isWeak:function() |
489 {return this._type()===this._snapshot._edgeWeakType;},isInternal:function() | 519 {return this._type()===this._snapshot._edgeWeakType;},isInternal:function() |
490 {return this._type()===this._snapshot._edgeInternalType;},isInvisible:function() | 520 {return this._type()===this._snapshot._edgeInternalType;},isInvisible:function() |
491 {return this._type()===this._snapshot._edgeInvisibleType;},isShortcut:function() | 521 {return this._type()===this._snapshot._edgeInvisibleType;},isShortcut:function() |
492 {return this._type()===this._snapshot._edgeShortcutType;},name:function() | 522 {return this._type()===this._snapshot._edgeShortcutType;},name:function() |
493 {if(!this.isShortcut()) | 523 {if(!this.isShortcut()) |
494 return this._name();var numName=parseInt(this._name(),10);return isNaN(numName)?
this._name():numName;},toString:function() | 524 return this._name();var numName=parseInt(this._name(),10);return isNaN(numName)?
this._name():numName;},toString:function() |
495 {var name=this.name();switch(this.type()){case"context":return"->"+name;case"ele
ment":return"["+name+"]";case"weak":return"[["+name+"]]";case"property":return n
ame.indexOf(" ")===-1?"."+name:"[\""+name+"\"]";case"shortcut":if(typeof name===
"string") | 525 {var name=this.name();switch(this.type()){case"context":return"->"+name;case"ele
ment":return"["+name+"]";case"weak":return"[["+name+"]]";case"property":return n
ame.indexOf(" ")===-1?"."+name:"[\""+name+"\"]";case"shortcut":if(typeof name===
"string") |
496 return name.indexOf(" ")===-1?"."+name:"[\""+name+"\"]";else | 526 return name.indexOf(" ")===-1?"."+name:"[\""+name+"\"]";else |
497 return"["+name+"]";case"internal":case"hidden":case"invisible":return"{"+name+"}
";};return"?"+name+"?";},_hasStringName:function() | 527 return"["+name+"]";case"internal":case"hidden":case"invisible":return"{"+name+"}
";};return"?"+name+"?";},_hasStringName:function() |
498 {return!this.isElement()&&!this.isHidden()&&!this.isWeak();},_name:function() | 528 {return!this.isElement()&&!this.isHidden();},_name:function() |
499 {return this._hasStringName()?this._snapshot._strings[this._nameOrIndex()]:this.
_nameOrIndex();},_nameOrIndex:function() | 529 {return this._hasStringName()?this._snapshot._strings[this._nameOrIndex()]:this.
_nameOrIndex();},_nameOrIndex:function() |
500 {return this._edges.item(this.edgeIndex+this._snapshot._edgeNameOffset);},_type:
function() | 530 {return this._edges[this.edgeIndex+this._snapshot._edgeNameOffset];},_type:funct
ion() |
501 {return this._edges.item(this.edgeIndex+this._snapshot._edgeTypeOffset);},__prot
o__:WebInspector.HeapSnapshotEdge.prototype};WebInspector.JSHeapSnapshotRetainer
Edge=function(snapshot,retainedNodeIndex,retainerIndex) | 531 {return this._edges[this.edgeIndex+this._snapshot._edgeTypeOffset];},__proto__:W
ebInspector.HeapSnapshotEdge.prototype};WebInspector.JSHeapSnapshotRetainerEdge=
function(snapshot,retainerIndex) |
502 {WebInspector.HeapSnapshotRetainerEdge.call(this,snapshot,retainedNodeIndex,reta
inerIndex);} | 532 {WebInspector.HeapSnapshotRetainerEdge.call(this,snapshot,retainerIndex);} |
503 WebInspector.JSHeapSnapshotRetainerEdge.prototype={clone:function() | 533 WebInspector.JSHeapSnapshotRetainerEdge.prototype={clone:function() |
504 {return new WebInspector.JSHeapSnapshotRetainerEdge(this._snapshot,this._retaine
dNodeIndex,this.retainerIndex());},isHidden:function() | 534 {var snapshot=(this._snapshot);return new WebInspector.JSHeapSnapshotRetainerEdg
e(snapshot,this.retainerIndex());},isHidden:function() |
505 {return this._edge().isHidden();},isInternal:function() | 535 {return this._edge().isHidden();},isInternal:function() |
506 {return this._edge().isInternal();},isInvisible:function() | 536 {return this._edge().isInternal();},isInvisible:function() |
507 {return this._edge().isInvisible();},isShortcut:function() | 537 {return this._edge().isInvisible();},isShortcut:function() |
508 {return this._edge().isShortcut();},isWeak:function() | 538 {return this._edge().isShortcut();},isWeak:function() |
509 {return this._edge().isWeak();},__proto__:WebInspector.HeapSnapshotRetainerEdge.
prototype};WebInspector.TextUtils={isStopChar:function(char) | 539 {return this._edge().isWeak();},__proto__:WebInspector.HeapSnapshotRetainerEdge.
prototype};WebInspector.TextUtils={isStopChar:function(char) |
510 {return(char>" "&&char<"0")||(char>"9"&&char<"A")||(char>"Z"&&char<"_")||(char>"
_"&&char<"a")||(char>"z"&&char<="~");},isWordChar:function(char) | 540 {return(char>" "&&char<"0")||(char>"9"&&char<"A")||(char>"Z"&&char<"_")||(char>"
_"&&char<"a")||(char>"z"&&char<="~");},isWordChar:function(char) |
511 {return!WebInspector.TextUtils.isStopChar(char)&&!WebInspector.TextUtils.isSpace
Char(char);},isSpaceChar:function(char) | 541 {return!WebInspector.TextUtils.isStopChar(char)&&!WebInspector.TextUtils.isSpace
Char(char);},isSpaceChar:function(char) |
512 {return WebInspector.TextUtils._SpaceCharRegex.test(char);},isWord:function(word
) | 542 {return WebInspector.TextUtils._SpaceCharRegex.test(char);},isWord:function(word
) |
513 {for(var i=0;i<word.length;++i){if(!WebInspector.TextUtils.isWordChar(word.charA
t(i))) | 543 {for(var i=0;i<word.length;++i){if(!WebInspector.TextUtils.isWordChar(word.charA
t(i))) |
514 return false;} | 544 return false;} |
(...skipping 18 matching lines...) Expand all Loading... |
533 return false;return true;} | 563 return false;return true;} |
534 Object.values=function(obj) | 564 Object.values=function(obj) |
535 {var result=Object.keys(obj);var length=result.length;for(var i=0;i<length;++i) | 565 {var result=Object.keys(obj);var length=result.length;for(var i=0;i<length;++i) |
536 result[i]=obj[result[i]];return result;} | 566 result[i]=obj[result[i]];return result;} |
537 String.prototype.findAll=function(string) | 567 String.prototype.findAll=function(string) |
538 {var matches=[];var i=this.indexOf(string);while(i!==-1){matches.push(i);i=this.
indexOf(string,i+string.length);} | 568 {var matches=[];var i=this.indexOf(string);while(i!==-1){matches.push(i);i=this.
indexOf(string,i+string.length);} |
539 return matches;} | 569 return matches;} |
540 String.prototype.lineEndings=function() | 570 String.prototype.lineEndings=function() |
541 {if(!this._lineEndings){this._lineEndings=this.findAll("\n");this._lineEndings.p
ush(this.length);} | 571 {if(!this._lineEndings){this._lineEndings=this.findAll("\n");this._lineEndings.p
ush(this.length);} |
542 return this._lineEndings;} | 572 return this._lineEndings;} |
| 573 String.prototype.lineCount=function() |
| 574 {var lineEndings=this.lineEndings();return lineEndings.length;} |
| 575 String.prototype.lineAt=function(lineNumber) |
| 576 {var lineEndings=this.lineEndings();var lineStart=lineNumber>0?lineEndings[lineN
umber-1]+1:0;var lineEnd=lineEndings[lineNumber];var lineContent=this.substring(
lineStart,lineEnd);if(lineContent.length>0&&lineContent.charAt(lineContent.lengt
h-1)==="\r") |
| 577 lineContent=lineContent.substring(0,lineContent.length-1);return lineContent;} |
543 String.prototype.escapeCharacters=function(chars) | 578 String.prototype.escapeCharacters=function(chars) |
544 {var foundChar=false;for(var i=0;i<chars.length;++i){if(this.indexOf(chars.charA
t(i))!==-1){foundChar=true;break;}} | 579 {var foundChar=false;for(var i=0;i<chars.length;++i){if(this.indexOf(chars.charA
t(i))!==-1){foundChar=true;break;}} |
545 if(!foundChar) | 580 if(!foundChar) |
546 return String(this);var result="";for(var i=0;i<this.length;++i){if(chars.indexO
f(this.charAt(i))!==-1) | 581 return String(this);var result="";for(var i=0;i<this.length;++i){if(chars.indexO
f(this.charAt(i))!==-1) |
547 result+="\\";result+=this.charAt(i);} | 582 result+="\\";result+=this.charAt(i);} |
548 return result;} | 583 return result;} |
549 String.regexSpecialCharacters=function() | 584 String.regexSpecialCharacters=function() |
550 {return"^[]{}()\\.$*+?|-,";} | 585 {return"^[]{}()\\.^$*+?|-,";} |
551 String.prototype.escapeForRegExp=function() | 586 String.prototype.escapeForRegExp=function() |
552 {return this.escapeCharacters(String.regexSpecialCharacters());} | 587 {return this.escapeCharacters(String.regexSpecialCharacters());} |
553 String.prototype.escapeHTML=function() | 588 String.prototype.escapeHTML=function() |
554 {return this.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").rep
lace(/"/g,""");} | 589 {return this.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").rep
lace(/"/g,""");} |
555 String.prototype.collapseWhitespace=function() | 590 String.prototype.collapseWhitespace=function() |
556 {return this.replace(/[\s\xA0]+/g," ");} | 591 {return this.replace(/[\s\xA0]+/g," ");} |
557 String.prototype.trimMiddle=function(maxLength) | 592 String.prototype.trimMiddle=function(maxLength) |
558 {if(this.length<=maxLength) | 593 {if(this.length<=maxLength) |
559 return String(this);var leftHalf=maxLength>>1;var rightHalf=maxLength-leftHalf-1
;return this.substr(0,leftHalf)+"\u2026"+this.substr(this.length-rightHalf,right
Half);} | 594 return String(this);var leftHalf=maxLength>>1;var rightHalf=maxLength-leftHalf-1
;return this.substr(0,leftHalf)+"\u2026"+this.substr(this.length-rightHalf,right
Half);} |
560 String.prototype.trimEnd=function(maxLength) | 595 String.prototype.trimEnd=function(maxLength) |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 return value;var number=Number(value);return number%1?number.toFixed(3):String(n
umber);} | 641 return value;var number=Number(value);return number%1?number.toFixed(3):String(n
umber);} |
607 Date.prototype.toISO8601Compact=function() | 642 Date.prototype.toISO8601Compact=function() |
608 {function leadZero(x) | 643 {function leadZero(x) |
609 {return(x>9?"":"0")+x;} | 644 {return(x>9?"":"0")+x;} |
610 return this.getFullYear()+ | 645 return this.getFullYear()+ |
611 leadZero(this.getMonth()+1)+ | 646 leadZero(this.getMonth()+1)+ |
612 leadZero(this.getDate())+"T"+ | 647 leadZero(this.getDate())+"T"+ |
613 leadZero(this.getHours())+ | 648 leadZero(this.getHours())+ |
614 leadZero(this.getMinutes())+ | 649 leadZero(this.getMinutes())+ |
615 leadZero(this.getSeconds());} | 650 leadZero(this.getSeconds());} |
616 Object.defineProperty(Array.prototype,"remove",{value:function(value,onlyFirst) | 651 Date.prototype.toConsoleTime=function() |
617 {if(onlyFirst){var index=this.indexOf(value);if(index!==-1) | 652 {function leadZero2(x) |
618 this.splice(index,1);return;} | 653 {return(x>9?"":"0")+x;} |
619 var length=this.length;for(var i=0;i<length;++i){if(this[i]===value) | 654 function leadZero3(x) |
620 this.splice(i,1);}}});Object.defineProperty(Array.prototype,"keySet",{value:func
tion() | 655 {return(Array(4-x.toString().length)).join('0')+x;} |
| 656 return this.getFullYear()+"-"+ |
| 657 leadZero2(this.getMonth()+1)+"-"+ |
| 658 leadZero2(this.getDate())+" "+ |
| 659 leadZero2(this.getHours())+":"+ |
| 660 leadZero2(this.getMinutes())+":"+ |
| 661 leadZero2(this.getSeconds())+"."+ |
| 662 leadZero3(this.getMilliseconds());} |
| 663 Object.defineProperty(Array.prototype,"remove",{value:function(value,firstOnly) |
| 664 {var index=this.indexOf(value);if(index===-1) |
| 665 return;if(firstOnly){this.splice(index,1);return;} |
| 666 for(var i=index+1,n=this.length;i<n;++i){if(this[i]!==value) |
| 667 this[index++]=this[i];} |
| 668 this.length=index;}});Object.defineProperty(Array.prototype,"keySet",{value:func
tion() |
621 {var keys={};for(var i=0;i<this.length;++i) | 669 {var keys={};for(var i=0;i<this.length;++i) |
622 keys[this[i]]=true;return keys;}});Object.defineProperty(Array.prototype,"rotate
",{value:function(index) | 670 keys[this[i]]=true;return keys;}});Object.defineProperty(Array.prototype,"rotate
",{value:function(index) |
623 {var result=[];for(var i=index;i<index+this.length;++i) | 671 {var result=[];for(var i=index;i<index+this.length;++i) |
624 result.push(this[i%this.length]);return result;}});Object.defineProperty(Uint32A
rray.prototype,"sort",{value:Array.prototype.sort});(function(){var partition={v
alue:function(comparator,left,right,pivotIndex) | 672 result.push(this[i%this.length]);return result;}});Object.defineProperty(Uint32A
rray.prototype,"sort",{value:Array.prototype.sort});(function(){var partition={v
alue:function(comparator,left,right,pivotIndex) |
625 {function swap(array,i1,i2) | 673 {function swap(array,i1,i2) |
626 {var temp=array[i1];array[i1]=array[i2];array[i2]=temp;} | 674 {var temp=array[i1];array[i1]=array[i2];array[i2]=temp;} |
627 var pivotValue=this[pivotIndex];swap(this,right,pivotIndex);var storeIndex=left;
for(var i=left;i<right;++i){if(comparator(this[i],pivotValue)<0){swap(this,store
Index,i);++storeIndex;}} | 675 var pivotValue=this[pivotIndex];swap(this,right,pivotIndex);var storeIndex=left;
for(var i=left;i<right;++i){if(comparator(this[i],pivotValue)<0){swap(this,store
Index,i);++storeIndex;}} |
628 swap(this,right,storeIndex);return storeIndex;}};Object.defineProperty(Array.pro
totype,"partition",partition);Object.defineProperty(Uint32Array.prototype,"parti
tion",partition);var sortRange={value:function(comparator,leftBound,rightBound,s
ortWindowLeft,sortWindowRight) | 676 swap(this,right,storeIndex);return storeIndex;}};Object.defineProperty(Array.pro
totype,"partition",partition);Object.defineProperty(Uint32Array.prototype,"parti
tion",partition);var sortRange={value:function(comparator,leftBound,rightBound,s
ortWindowLeft,sortWindowRight) |
629 {function quickSortRange(array,comparator,left,right,sortWindowLeft,sortWindowRi
ght) | 677 {function quickSortRange(array,comparator,left,right,sortWindowLeft,sortWindowRi
ght) |
630 {if(right<=left) | 678 {if(right<=left) |
(...skipping 11 matching lines...) Expand all Loading... |
642 {var result=comparator(self[a],self[b]);return result?result:a-b;} | 690 {var result=comparator(self[a],self[b]);return result?result:a-b;} |
643 indices.sort(indexComparator);for(var i=0;i<this.length;++i){if(indices[i]<0||i=
==indices[i]) | 691 indices.sort(indexComparator);for(var i=0;i<this.length;++i){if(indices[i]<0||i=
==indices[i]) |
644 continue;var cyclical=i;var saved=this[i];while(true){var next=indices[cyclical]
;indices[cyclical]=-1;if(next===i){this[cyclical]=saved;break;}else{this[cyclica
l]=this[next];cyclical=next;}}} | 692 continue;var cyclical=i;var saved=this[i];while(true){var next=indices[cyclical]
;indices[cyclical]=-1;if(next===i){this[cyclical]=saved;break;}else{this[cyclica
l]=this[next];cyclical=next;}}} |
645 return this;}});Object.defineProperty(Array.prototype,"qselect",{value:function(
k,comparator) | 693 return this;}});Object.defineProperty(Array.prototype,"qselect",{value:function(
k,comparator) |
646 {if(k<0||k>=this.length) | 694 {if(k<0||k>=this.length) |
647 return;if(!comparator) | 695 return;if(!comparator) |
648 comparator=function(a,b){return a-b;} | 696 comparator=function(a,b){return a-b;} |
649 var low=0;var high=this.length-1;for(;;){var pivotPosition=this.partition(compar
ator,low,high,Math.floor((high+low)/2));if(pivotPosition===k) | 697 var low=0;var high=this.length-1;for(;;){var pivotPosition=this.partition(compar
ator,low,high,Math.floor((high+low)/2));if(pivotPosition===k) |
650 return this[k];else if(pivotPosition>k) | 698 return this[k];else if(pivotPosition>k) |
651 high=pivotPosition-1;else | 699 high=pivotPosition-1;else |
652 low=pivotPosition+1;}}});Object.defineProperty(Array.prototype,"lowerBound",{val
ue:function(object,comparator) | 700 low=pivotPosition+1;}}});Object.defineProperty(Array.prototype,"lowerBound",{val
ue:function(object,comparator,left,right) |
653 {function defaultComparator(a,b) | 701 {function defaultComparator(a,b) |
654 {return a<b?-1:(a>b?1:0);} | 702 {return a<b?-1:(a>b?1:0);} |
655 comparator=comparator||defaultComparator;var l=0;var r=this.length;while(l<r){va
r m=(l+r)>>1;if(comparator(object,this[m])>0) | 703 comparator=comparator||defaultComparator;var l=left||0;var r=right!==undefined?r
ight:this.length;while(l<r){var m=(l+r)>>1;if(comparator(object,this[m])>0) |
656 l=m+1;else | 704 l=m+1;else |
657 r=m;} | 705 r=m;} |
658 return r;}});Object.defineProperty(Array.prototype,"upperBound",{value:function(
object,comparator) | 706 return r;}});Object.defineProperty(Array.prototype,"upperBound",{value:function(
object,comparator,left,right) |
659 {function defaultComparator(a,b) | 707 {function defaultComparator(a,b) |
660 {return a<b?-1:(a>b?1:0);} | 708 {return a<b?-1:(a>b?1:0);} |
661 comparator=comparator||defaultComparator;var l=0;var r=this.length;while(l<r){va
r m=(l+r)>>1;if(comparator(object,this[m])>=0) | 709 comparator=comparator||defaultComparator;var l=left||0;var r=right!==undefined?r
ight:this.length;while(l<r){var m=(l+r)>>1;if(comparator(object,this[m])>=0) |
662 l=m+1;else | 710 l=m+1;else |
663 r=m;} | 711 r=m;} |
664 return r;}});Object.defineProperty(Array.prototype,"binaryIndexOf",{value:functi
on(value,comparator) | 712 return r;}});Object.defineProperty(Array.prototype,"binaryIndexOf",{value:functi
on(value,comparator) |
665 {var index=this.lowerBound(value,comparator);return index<this.length&&comparato
r(value,this[index])===0?index:-1;}});Object.defineProperty(Array.prototype,"sel
ect",{value:function(field) | 713 {var index=this.lowerBound(value,comparator);return index<this.length&&comparato
r(value,this[index])===0?index:-1;}});Object.defineProperty(Array.prototype,"sel
ect",{value:function(field) |
666 {var result=new Array(this.length);for(var i=0;i<this.length;++i) | 714 {var result=new Array(this.length);for(var i=0;i<this.length;++i) |
667 result[i]=this[i][field];return result;}});Object.defineProperty(Array.prototype
,"peekLast",{value:function() | 715 result[i]=this[i][field];return result;}});Object.defineProperty(Array.prototype
,"peekLast",{value:function() |
668 {return this[this.length-1];}});(function(){function mergeOrIntersect(array1,arr
ay2,comparator,mergeNotIntersect) | 716 {return this[this.length-1];}});(function(){function mergeOrIntersect(array1,arr
ay2,comparator,mergeNotIntersect) |
669 {var result=[];var i=0;var j=0;while(i<array1.length||j<array2.length){if(i===ar
ray1.length){result=result.concat(array2.slice(j));j=array2.length;}else if(j===
array2.length){result=result.concat(array1.slice(i));i=array1.length;}else{var c
ompareValue=comparator(array1[i],array2[j]) | 717 {var result=[];var i=0;var j=0;while(i<array1.length&&j<array2.length){var compa
reValue=comparator(array1[i],array2[j]);if(mergeNotIntersect||!compareValue) |
670 if(compareValue<0){if(mergeNotIntersect) | 718 result.push(compareValue<=0?array1[i]:array2[j]);if(compareValue<=0) |
671 result.push(array1[i]);++i;}else if(compareValue>0){if(mergeNotIntersect) | 719 i++;if(compareValue>=0) |
672 result.push(array2[j]);++j;}else{result.push(array1[i]);++i;++j;}}} | 720 j++;} |
| 721 if(mergeNotIntersect){while(i<array1.length) |
| 722 result.push(array1[i++]);while(j<array2.length) |
| 723 result.push(array2[j++]);} |
673 return result;} | 724 return result;} |
674 Object.defineProperty(Array.prototype,"intersectOrdered",{value:function(array,c
omparator) | 725 Object.defineProperty(Array.prototype,"intersectOrdered",{value:function(array,c
omparator) |
675 {return mergeOrIntersect(this,array,comparator,false);}});Object.defineProperty(
Array.prototype,"mergeOrdered",{value:function(array,comparator) | 726 {return mergeOrIntersect(this,array,comparator,false);}});Object.defineProperty(
Array.prototype,"mergeOrdered",{value:function(array,comparator) |
676 {return mergeOrIntersect(this,array,comparator,true);}});}());function insertion
IndexForObjectInListSortedByFunction(object,list,comparator,insertionIndexAfter) | 727 {return mergeOrIntersect(this,array,comparator,true);}});}());function insertion
IndexForObjectInListSortedByFunction(object,list,comparator,insertionIndexAfter) |
677 {if(insertionIndexAfter) | 728 {if(insertionIndexAfter) |
678 return list.upperBound(object,comparator);else | 729 return list.upperBound(object,comparator);else |
679 return list.lowerBound(object,comparator);} | 730 return list.lowerBound(object,comparator);} |
680 String.sprintf=function(format,var_arg) | 731 String.sprintf=function(format,var_arg) |
681 {return String.vsprintf(format,Array.prototype.slice.call(arguments,1));} | 732 {return String.vsprintf(format,Array.prototype.slice.call(arguments,1));} |
682 String.tokenizeFormatString=function(format,formatters) | 733 String.tokenizeFormatString=function(format,formatters) |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 result.push("__proto__");return result;},values:function() | 828 result.push("__proto__");return result;},values:function() |
778 {var result=Object.values(this._map);if(this._hasProtoKey) | 829 {var result=Object.values(this._map);if(this._hasProtoKey) |
779 result.push(this._protoValue);return result;},get:function(key) | 830 result.push(this._protoValue);return result;},get:function(key) |
780 {if(key==="__proto__") | 831 {if(key==="__proto__") |
781 return this._protoValue;if(!Object.prototype.hasOwnProperty.call(this._map,key)) | 832 return this._protoValue;if(!Object.prototype.hasOwnProperty.call(this._map,key)) |
782 return undefined;return this._map[key];},contains:function(key) | 833 return undefined;return this._map[key];},contains:function(key) |
783 {var result;if(key==="__proto__") | 834 {var result;if(key==="__proto__") |
784 return this._hasProtoKey;return Object.prototype.hasOwnProperty.call(this._map,k
ey);},size:function() | 835 return this._hasProtoKey;return Object.prototype.hasOwnProperty.call(this._map,k
ey);},size:function() |
785 {return this._size;},clear:function() | 836 {return this._size;},clear:function() |
786 {this._map={};this._size=0;delete this._hasProtoKey;delete this._protoValue;}} | 837 {this._map={};this._size=0;delete this._hasProtoKey;delete this._protoValue;}} |
| 838 var StringSet=function() |
| 839 {this._map=new StringMap();} |
| 840 StringSet.prototype={put:function(value) |
| 841 {this._map.put(value,true);},remove:function(value) |
| 842 {return!!this._map.remove(value);},values:function() |
| 843 {return this._map.keys();},contains:function(value) |
| 844 {return this._map.contains(value);},size:function() |
| 845 {return this._map.size();},clear:function() |
| 846 {this._map.clear();}} |
787 function loadXHR(url,async,callback) | 847 function loadXHR(url,async,callback) |
788 {function onReadyStateChanged() | 848 {function onReadyStateChanged() |
789 {if(xhr.readyState!==XMLHttpRequest.DONE) | 849 {if(xhr.readyState!==XMLHttpRequest.DONE) |
790 return;if(xhr.status===200){callback(xhr.responseText);return;} | 850 return;if(xhr.status===200){callback(xhr.responseText);return;} |
791 callback(null);} | 851 callback(null);} |
792 var xhr=new XMLHttpRequest();xhr.open("GET",url,async);if(async) | 852 var xhr=new XMLHttpRequest();xhr.open("GET",url,async);if(async) |
793 xhr.onreadystatechange=onReadyStateChanged;xhr.send(null);if(!async){if(xhr.stat
us===200) | 853 xhr.onreadystatechange=onReadyStateChanged;xhr.send(null);if(!async){if(xhr.stat
us===200) |
794 return xhr.responseText;return null;} | 854 return xhr.responseText;return null;} |
795 return null;} | 855 return null;} |
796 function StringPool() | |
797 {this.reset();} | |
798 StringPool.prototype={intern:function(string) | |
799 {if(string==="__proto__") | |
800 return"__proto__";var result=this._strings[string];if(result===undefined){this._
strings[string]=string;result=string;} | |
801 return result;},reset:function() | |
802 {this._strings=Object.create(null);},internObjectStrings:function(obj,depthLimit
) | |
803 {if(typeof depthLimit!=="number") | |
804 depthLimit=100;else if(--depthLimit<0) | |
805 throw"recursion depth limit reached in StringPool.deepIntern(), perhaps attempti
ng to traverse cyclical references?";for(var field in obj){switch(typeof obj[fie
ld]){case"string":obj[field]=this.intern(obj[field]);break;case"object":this.int
ernObjectStrings(obj[field],depthLimit);break;}}}} | |
806 var _importedScripts={};function importScript(scriptName) | 856 var _importedScripts={};function importScript(scriptName) |
807 {if(_importedScripts[scriptName]) | 857 {if(_importedScripts[scriptName]) |
808 return;var xhr=new XMLHttpRequest();_importedScripts[scriptName]=true;xhr.open("
GET",scriptName,false);xhr.send(null);if(!xhr.responseText) | 858 return;var xhr=new XMLHttpRequest();_importedScripts[scriptName]=true;xhr.open("
GET",scriptName,false);xhr.send(null);if(!xhr.responseText) |
809 throw"empty response arrived for script '"+scriptName+"'";var baseUrl=location.h
ref;baseUrl=baseUrl.substring(0,baseUrl.lastIndexOf("/"));var sourceURL=baseUrl+
"/"+scriptName;eval(xhr.responseText+"\n//# sourceURL="+sourceURL);} | 859 throw"empty response arrived for script '"+scriptName+"'";var baseUrl=location.o
rigin+location.pathname;baseUrl=baseUrl.substring(0,baseUrl.lastIndexOf("/"));va
r sourceURL=baseUrl+"/"+scriptName;self.eval(xhr.responseText+"\n//# sourceURL="
+sourceURL);} |
810 var loadScript=importScript;function CallbackBarrier() | 860 var loadScript=importScript;function CallbackBarrier() |
811 {this._pendingIncomingCallbacksCount=0;} | 861 {this._pendingIncomingCallbacksCount=0;} |
812 CallbackBarrier.prototype={createCallback:function(userCallback) | 862 CallbackBarrier.prototype={createCallback:function(userCallback) |
813 {console.assert(!this._outgoingCallback,"CallbackBarrier.createCallback() is cal
led after CallbackBarrier.callWhenDone()");++this._pendingIncomingCallbacksCount
;return this._incomingCallback.bind(this,userCallback);},callWhenDone:function(c
allback) | 863 {console.assert(!this._outgoingCallback,"CallbackBarrier.createCallback() is cal
led after CallbackBarrier.callWhenDone()");++this._pendingIncomingCallbacksCount
;return this._incomingCallback.bind(this,userCallback);},callWhenDone:function(c
allback) |
814 {console.assert(!this._outgoingCallback,"CallbackBarrier.callWhenDone() is calle
d multiple times");this._outgoingCallback=callback;if(!this._pendingIncomingCall
backsCount) | 864 {console.assert(!this._outgoingCallback,"CallbackBarrier.callWhenDone() is calle
d multiple times");this._outgoingCallback=callback;if(!this._pendingIncomingCall
backsCount) |
815 this._outgoingCallback();},_incomingCallback:function(userCallback) | 865 this._outgoingCallback();},_incomingCallback:function(userCallback) |
816 {console.assert(this._pendingIncomingCallbacksCount>0);if(userCallback){var args
=Array.prototype.slice.call(arguments,1);userCallback.apply(null,args);} | 866 {console.assert(this._pendingIncomingCallbacksCount>0);if(userCallback){var args
=Array.prototype.slice.call(arguments,1);userCallback.apply(null,args);} |
817 if(!--this._pendingIncomingCallbacksCount&&this._outgoingCallback) | 867 if(!--this._pendingIncomingCallbacksCount&&this._outgoingCallback) |
818 this._outgoingCallback();}};function postMessageWrapper(message) | 868 this._outgoingCallback();}} |
| 869 function suppressUnused(value) |
| 870 {};function postMessageWrapper(message) |
819 {postMessage(message);} | 871 {postMessage(message);} |
820 var dispatcher=new WebInspector.HeapSnapshotWorkerDispatcher(this,postMessageWra
pper);addEventListener("message",dispatcher.dispatchMessage.bind(dispatcher),fal
se); | 872 var dispatcher=new WebInspector.HeapSnapshotWorkerDispatcher(this,postMessageWra
pper);addEventListener("message",dispatcher.dispatchMessage.bind(dispatcher),fal
se); |
OLD | NEW |