Propagate bytecode offset in SamplingProfiler and use it to name unnamed functions
Reviewed By: cwdick Differential Revision: D4251568 fbshipit-source-id: 2343d8f6a5b2f247a7af1bbd0112bed8edadcbfe
This commit is contained in:
parent
48b95f08fb
commit
81b1a2c6a5
|
@ -50,8 +50,13 @@ class TreeTransformator {
|
||||||
line: tree.lineNumber,
|
line: tree.lineNumber,
|
||||||
column: tree.columnNumber,
|
column: tree.columnNumber,
|
||||||
});
|
});
|
||||||
tree.functionName = tree.functionName || original.name
|
const functionName = original.name
|
||||||
|| (path.posix.basename(original.source || '') + ':' + original.line);
|
|| (path.posix.basename(original.source || '') + ':' + original.line);
|
||||||
|
if (tree.functionName === '(unnamed builtin)') {
|
||||||
|
tree.functionName += ':' + functionName;
|
||||||
|
} else {
|
||||||
|
tree.functionName = tree.functionName || functionName;
|
||||||
|
}
|
||||||
tree.scriptId = tree.id;
|
tree.scriptId = tree.id;
|
||||||
tree.url = 'file://' + original.source;
|
tree.url = 'file://' + original.source;
|
||||||
tree.lineNumber = original.line;
|
tree.lineNumber = original.line;
|
||||||
|
|
Loading…
Reference in New Issue