OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 dynaEntry.name = this.dynamicsNameGen_.getName(dynaEntry.name); | 189 dynaEntry.name = this.dynamicsNameGen_.getName(dynaEntry.name); |
190 dynaEntry.nameUpdated_ = true; | 190 dynaEntry.nameUpdated_ = true; |
191 } | 191 } |
192 return dynaEntry; | 192 return dynaEntry; |
193 } | 193 } |
194 return null; | 194 return null; |
195 }; | 195 }; |
196 | 196 |
197 | 197 |
198 /** | 198 /** |
| 199 * Returns a dynamic code entry using its starting address. |
| 200 * |
| 201 * @param {number} addr Address. |
| 202 */ |
| 203 devtools.profiler.CodeMap.prototype.findDynamicEntryByStartAddress = |
| 204 function(addr) { |
| 205 var node = this.dynamics_.find(addr); |
| 206 return node ? node.value : null; |
| 207 }; |
| 208 |
| 209 |
| 210 /** |
199 * Returns an array of all dynamic code entries. | 211 * Returns an array of all dynamic code entries. |
200 */ | 212 */ |
201 devtools.profiler.CodeMap.prototype.getAllDynamicEntries = function() { | 213 devtools.profiler.CodeMap.prototype.getAllDynamicEntries = function() { |
202 return this.dynamics_.exportValues(); | 214 return this.dynamics_.exportValues(); |
203 }; | 215 }; |
204 | 216 |
205 | 217 |
206 /** | 218 /** |
207 * Returns an array of all static code entries. | 219 * Returns an array of all static code entries. |
208 */ | 220 */ |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 | 261 |
250 | 262 |
251 devtools.profiler.CodeMap.NameGenerator.prototype.getName = function(name) { | 263 devtools.profiler.CodeMap.NameGenerator.prototype.getName = function(name) { |
252 if (!(name in this.knownNames_)) { | 264 if (!(name in this.knownNames_)) { |
253 this.knownNames_[name] = 0; | 265 this.knownNames_[name] = 0; |
254 return name; | 266 return name; |
255 } | 267 } |
256 var count = ++this.knownNames_[name]; | 268 var count = ++this.knownNames_[name]; |
257 return name + ' {' + count + '}'; | 269 return name + ' {' + count + '}'; |
258 }; | 270 }; |
OLD | NEW |