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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 * @param {number} opt_stackPos If an unknown address is encountered | 79 * @param {number} opt_stackPos If an unknown address is encountered |
80 * during stack strace processing, specifies a position of the frame | 80 * during stack strace processing, specifies a position of the frame |
81 * containing the address. | 81 * containing the address. |
82 */ | 82 */ |
83 devtools.profiler.Profile.prototype.handleUnknownCode = function( | 83 devtools.profiler.Profile.prototype.handleUnknownCode = function( |
84 operation, addr, opt_stackPos) { | 84 operation, addr, opt_stackPos) { |
85 }; | 85 }; |
86 | 86 |
87 | 87 |
88 /** | 88 /** |
89 * Registers static (library) code entry. | 89 * Registers a library. |
90 * | 90 * |
91 * @param {string} name Code entry name. | 91 * @param {string} name Code entry name. |
92 * @param {number} startAddr Starting address. | 92 * @param {number} startAddr Starting address. |
| 93 * @param {number} endAddr Ending address. |
| 94 */ |
| 95 devtools.profiler.Profile.prototype.addLibrary = function( |
| 96 name, startAddr, endAddr) { |
| 97 var entry = new devtools.profiler.CodeMap.CodeEntry( |
| 98 endAddr - startAddr, name); |
| 99 this.codeMap_.addLibrary(startAddr, entry); |
| 100 return entry; |
| 101 }; |
| 102 |
| 103 |
| 104 /** |
| 105 * Registers statically compiled code entry. |
| 106 * |
| 107 * @param {string} name Code entry name. |
| 108 * @param {number} startAddr Starting address. |
93 * @param {number} endAddr Ending address. | 109 * @param {number} endAddr Ending address. |
94 */ | 110 */ |
95 devtools.profiler.Profile.prototype.addStaticCode = function( | 111 devtools.profiler.Profile.prototype.addStaticCode = function( |
96 name, startAddr, endAddr) { | 112 name, startAddr, endAddr) { |
97 var entry = new devtools.profiler.CodeMap.CodeEntry( | 113 var entry = new devtools.profiler.CodeMap.CodeEntry( |
98 endAddr - startAddr, name); | 114 endAddr - startAddr, name); |
99 this.codeMap_.addStaticCode(startAddr, entry); | 115 this.codeMap_.addStaticCode(startAddr, entry); |
100 return entry; | 116 return entry; |
101 }; | 117 }; |
102 | 118 |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 labels, opt_f) { | 612 labels, opt_f) { |
597 for (var pos = 0, curr = this; pos < labels.length && curr != null; pos++) { | 613 for (var pos = 0, curr = this; pos < labels.length && curr != null; pos++) { |
598 var child = curr.findChild(labels[pos]); | 614 var child = curr.findChild(labels[pos]); |
599 if (opt_f) { | 615 if (opt_f) { |
600 opt_f(child, pos); | 616 opt_f(child, pos); |
601 } | 617 } |
602 curr = child; | 618 curr = child; |
603 } | 619 } |
604 return curr; | 620 return curr; |
605 }; | 621 }; |
OLD | NEW |