Chromium Code Reviews| Index: Source/devtools/front_end/timeline/TimelineJSProfile.js |
| diff --git a/Source/devtools/front_end/timeline/TimelineJSProfile.js b/Source/devtools/front_end/timeline/TimelineJSProfile.js |
| index dd2ef6ebad32816ce88dacd226c690d0089cdc2d..756887e91635cd7ad12c94252e8bfd0a07f03637 100644 |
| --- a/Source/devtools/front_end/timeline/TimelineJSProfile.js |
| +++ b/Source/devtools/front_end/timeline/TimelineJSProfile.js |
| @@ -251,10 +251,8 @@ WebInspector.TimelineJSProfileProcessor.CodeMap.prototype = { |
| moveEntry: function(oldAddressHex, newAddressHex, size) |
| { |
| var entry = this._getBank(oldAddressHex).removeEntry(this._getAddress(oldAddressHex)); |
| - if (!entry) { |
| - console.error("Entry at address " + oldAddressHex + " not found"); |
|
yurys
2015/06/24 13:57:44
Why was this removed? Is there a valid case when w
alph
2015/06/24 14:03:38
Reverted.
|
| + if (!entry) |
| return; |
| - } |
| entry.address = this._getAddress(newAddressHex); |
| entry.size = size; |
| this._addEntry(newAddressHex, entry); |
| @@ -366,37 +364,38 @@ WebInspector.TimelineJSProfileProcessor.CodeMap.Bank.prototype = { |
| } |
| /** |
| - * @param {string} functionName |
| - * @param {string=} url |
| - * @param {string=} scriptId |
| - * @param {number=} line |
| - * @param {number=} column |
| - * @return {!ConsoleAgent.CallFrame} |
| - */ |
| -WebInspector.TimelineJSProfileProcessor._createFrame = function(functionName, url, scriptId, line, column) |
| -{ |
| - return /** @type {!ConsoleAgent.CallFrame} */ ({ |
| - "functionName": functionName, |
| - "url": url || "", |
| - "scriptId": scriptId || "0", |
| - "lineNumber": line || 0, |
| - "columnNumber": column || 0 |
| - }); |
| -} |
| - |
| -/** |
| * @param {string} name |
| * @param {number} scriptId |
| * @return {!ConsoleAgent.CallFrame} |
| */ |
| WebInspector.TimelineJSProfileProcessor._buildCallFrame = function(name, scriptId) |
| { |
| + /** |
| + * @param {string} functionName |
| + * @param {string=} url |
| + * @param {string=} scriptId |
| + * @param {number=} line |
| + * @param {number=} column |
| + * @param {boolean=} isNative |
| + * @return {!ConsoleAgent.CallFrame} |
| + */ |
| + function createFrame(functionName, url, scriptId, line, column, isNative) |
| + { |
| + return /** @type {!ConsoleAgent.CallFrame} */ ({ |
| + "functionName": functionName, |
| + "url": url || "", |
| + "scriptId": scriptId || "0", |
| + "lineNumber": line || 0, |
| + "columnNumber": column || 0, |
| + "isNative": isNative || false |
| + }); |
| + } |
| + |
| // Code states: |
| // (empty) -> compiled |
| // ~ -> optimizable |
| // * -> optimized |
| var rePrefix = /^(\w*:)?[*~]?(.*)$/m; |
| - |
| var tokens = rePrefix.exec(name); |
| var prefix = tokens[1]; |
| var body = tokens[2]; |
| @@ -410,12 +409,14 @@ WebInspector.TimelineJSProfileProcessor._buildCallFrame = function(name, scriptI |
| rawName = spacePos !== -1 ? body.substr(0, spacePos) : body; |
| rawUrl = spacePos !== -1 ? body.substr(spacePos + 1) : ""; |
| } |
| - var functionName = rawName; |
| + var nativeSuffix = " native"; |
| + var isNative = rawName.endsWith(nativeSuffix); |
| + var functionName = isNative ? rawName.slice(0, -nativeSuffix.length) : rawName; |
| var urlData = WebInspector.ParsedURL.splitLineAndColumn(rawUrl); |
| var url = urlData.url || ""; |
| var line = urlData.lineNumber || 0; |
| var column = urlData.columnNumber || 0; |
| - return WebInspector.TimelineJSProfileProcessor._createFrame(functionName, url, String(scriptId), line, column); |
| + return createFrame(functionName, url, String(scriptId), line, column, isNative); |
| } |
| /** |
| @@ -428,18 +429,18 @@ WebInspector.TimelineJSProfileProcessor.processRawV8Samples = function(events) |
| /** |
| * @param {string} address |
| - * @return {!ConsoleAgent.CallFrame} |
| + * @return {?ConsoleAgent.CallFrame} |
| */ |
| function convertRawFrame(address) |
| { |
| var entry = codeMap.lookupEntry(address); |
| if (entry) |
| - return entry; |
| + return !entry.isNative ? entry : null; |
|
yurys
2015/06/24 13:57:44
entry.isNative ? null : entry;
alph
2015/06/24 14:03:38
Done.
|
| if (!missingAddesses.has(address)) { |
| missingAddesses.add(address); |
| console.error("Address " + address + " has missing code entry"); |
| } |
| - return WebInspector.TimelineJSProfileProcessor._createFrame(address); |
| + return null; |
| } |
| var recordTypes = WebInspector.TimelineModel.RecordType; |
| @@ -463,6 +464,7 @@ WebInspector.TimelineJSProfileProcessor.processRawV8Samples = function(events) |
| if (data["vm_state"] === "js" && !rawStack.length) |
| break; |
| var stack = rawStack.map(convertRawFrame); |
| + stack.remove(null); |
| var sampleEvent = new WebInspector.TracingModel.Event( |
| WebInspector.TracingModel.DevToolsTimelineEventCategory, |
| WebInspector.TimelineModel.RecordType.JSSample, |