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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 result.push(new Profile.CEntryNode(f, ticks)); | 415 result.push(new Profile.CEntryNode(f, ticks)); |
416 } | 416 } |
417 result[0].ticks = total_ticks; // Sorting will keep this at index 0. | 417 result[0].ticks = total_ticks; // Sorting will keep this at index 0. |
418 result.sort(function(n1, n2) { | 418 result.sort(function(n1, n2) { |
419 return n2.ticks - n1.ticks || (n2.name < n1.name ? -1 : 1) | 419 return n2.ticks - n1.ticks || (n2.name < n1.name ? -1 : 1) |
420 }); | 420 }); |
421 return result; | 421 return result; |
422 } | 422 } |
423 | 423 |
424 | 424 |
| 425 Profile.prototype.getAllStaticEntries = function() { |
| 426 return this.codeMap_.getAllStaticEntriesWithAddresses(); |
| 427 } |
| 428 |
| 429 |
425 /** | 430 /** |
426 * Cleans up function entries that are not referenced by code entries. | 431 * Cleans up function entries that are not referenced by code entries. |
427 */ | 432 */ |
428 Profile.prototype.cleanUpFuncEntries = function() { | 433 Profile.prototype.cleanUpFuncEntries = function() { |
429 var referencedFuncEntries = []; | 434 var referencedFuncEntries = []; |
430 var entries = this.codeMap_.getAllDynamicEntriesWithAddresses(); | 435 var entries = this.codeMap_.getAllDynamicEntriesWithAddresses(); |
431 for (var i = 0, l = entries.length; i < l; ++i) { | 436 for (var i = 0, l = entries.length; i < l; ++i) { |
432 if (entries[i][1].constructor === Profile.FunctionEntry) { | 437 if (entries[i][1].constructor === Profile.FunctionEntry) { |
433 entries[i][1].used = false; | 438 entries[i][1].used = false; |
434 } | 439 } |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 labels, opt_f) { | 830 labels, opt_f) { |
826 for (var pos = 0, curr = this; pos < labels.length && curr != null; pos++) { | 831 for (var pos = 0, curr = this; pos < labels.length && curr != null; pos++) { |
827 var child = curr.findChild(labels[pos]); | 832 var child = curr.findChild(labels[pos]); |
828 if (opt_f) { | 833 if (opt_f) { |
829 opt_f(child, pos); | 834 opt_f(child, pos); |
830 } | 835 } |
831 curr = child; | 836 curr = child; |
832 } | 837 } |
833 return curr; | 838 return curr; |
834 }; | 839 }; |
OLD | NEW |