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

Side by Side Diff: tools/logreader.js

Issue 546089: Fix issue 553: function frame is skipped in profile when compare stub is called. (Closed)
Patch Set: Introduced dedicated log event types, added stuff for DevTools Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/codemap.js ('k') | tools/profile.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 */ 132 */
133 devtools.profiler.LogReader.prototype.processLogChunk = function(chunk) { 133 devtools.profiler.LogReader.prototype.processLogChunk = function(chunk) {
134 this.processLog_(chunk.split('\n')); 134 this.processLog_(chunk.split('\n'));
135 }; 135 };
136 136
137 137
138 /** 138 /**
139 * Processes stack record. 139 * Processes stack record.
140 * 140 *
141 * @param {number} pc Program counter. 141 * @param {number} pc Program counter.
142 * @param {number} func JS Function.
142 * @param {Array.<string>} stack String representation of a stack. 143 * @param {Array.<string>} stack String representation of a stack.
143 * @return {Array.<number>} Processed stack. 144 * @return {Array.<number>} Processed stack.
144 */ 145 */
145 devtools.profiler.LogReader.prototype.processStack = function(pc, stack) { 146 devtools.profiler.LogReader.prototype.processStack = function(pc, func, stack) {
146 var fullStack = [pc]; 147 var fullStack = func ? [pc, func] : [pc];
147 var prevFrame = pc; 148 var prevFrame = pc;
148 for (var i = 0, n = stack.length; i < n; ++i) { 149 for (var i = 0, n = stack.length; i < n; ++i) {
149 var frame = stack[i]; 150 var frame = stack[i];
150 var firstChar = frame.charAt(0); 151 var firstChar = frame.charAt(0);
151 if (firstChar == '+' || firstChar == '-') { 152 if (firstChar == '+' || firstChar == '-') {
152 // An offset from the previous frame. 153 // An offset from the previous frame.
153 prevFrame += parseInt(frame, 16); 154 prevFrame += parseInt(frame, 16);
154 fullStack.push(prevFrame); 155 fullStack.push(prevFrame);
155 // Filter out possible 'overflow' string. 156 // Filter out possible 'overflow' string.
156 } else if (firstChar != 'o') { 157 } else if (firstChar != 'o') {
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 * @param {Array.<string>} cmd Parsed command. 312 * @param {Array.<string>} cmd Parsed command.
312 * @private 313 * @private
313 */ 314 */
314 devtools.profiler.LogReader.prototype.processRepeat_ = function(count, cmd) { 315 devtools.profiler.LogReader.prototype.processRepeat_ = function(count, cmd) {
315 // Replace the repeat-prefixed command from backrefs list with a non-prefixed. 316 // Replace the repeat-prefixed command from backrefs list with a non-prefixed.
316 this.backRefs_[0] = cmd.join(','); 317 this.backRefs_[0] = cmd.join(',');
317 for (var i = 0; i < count; ++i) { 318 for (var i = 0; i < count; ++i) {
318 this.dispatchLogRow_(cmd); 319 this.dispatchLogRow_(cmd);
319 } 320 }
320 }; 321 };
OLDNEW
« no previous file with comments | « tools/codemap.js ('k') | tools/profile.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698