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

Unified Diff: tools/tickprocessor-driver.js

Issue 22897021: Add source map support to tick processor. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Added copyright & fixed nits Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/tickprocessor.js ('k') | tools/windows-tick-processor.bat » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/tickprocessor-driver.js
diff --git a/tools/tickprocessor-driver.js b/tools/tickprocessor-driver.js
index 02cb81a55fcef48a0acced775f597724b21e4501..8ba3326f630d1d27821226845ccc0a8f690067e8 100644
--- a/tools/tickprocessor-driver.js
+++ b/tools/tickprocessor-driver.js
@@ -37,6 +37,18 @@ function processArguments(args) {
}
}
+function initSourceMapSupport() {
+ // Pull dev tools source maps into our name space.
+ SourceMap = WebInspector.SourceMap;
+
+ // Overwrite the load function to load scripts synchronously.
+ SourceMap.load = function(sourceMapURL) {
+ var content = readFile(sourceMapURL);
+ var sourceMapObject = (JSON.parse(content));
+ return new SourceMap(sourceMapURL, sourceMapObject);
+ };
+}
+
var entriesProviders = {
'unix': UnixCppEntriesProvider,
'windows': WindowsCppEntriesProvider,
@@ -44,6 +56,11 @@ var entriesProviders = {
};
var params = processArguments(arguments);
+var sourceMap = null;
+if (params.sourceMap) {
+ initSourceMapSupport();
+ sourceMap = SourceMap.load(params.sourceMap);
+}
var snapshotLogProcessor;
if (params.snapshotLogFileName) {
snapshotLogProcessor = new SnapshotLogProcessor();
@@ -57,6 +74,7 @@ var tickProcessor = new TickProcessor(
params.stateFilter,
snapshotLogProcessor,
params.distortion,
- params.range);
+ params.range,
+ sourceMap);
tickProcessor.processLogFile(params.logFileName);
tickProcessor.printStatistics();
« no previous file with comments | « tools/tickprocessor.js ('k') | tools/windows-tick-processor.bat » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698