v8/tools/parse-processor-driver.js
Camillo Bruni b0e2074d9e [tools] New parse processor tool
From the log data generated with --log-function-events we can create a
detailed model of a function's lifetime. The parse processor displays
several stats at a given time (percent and count) on a per function or
byte basis:
- preparsing
- parsing
- eager/lazy compiling
- execution

Bug: chromium:757467
Change-Id: I0ad5c9369c6a0628704e3caffb3920444ea603a9
Reviewed-on: https://chromium-review.googlesource.com/758641
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50234}
2017-12-20 13:07:17 +00:00

34 lines
1010 B
JavaScript

// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
function processArguments(args) {
var processor = new ArgumentsProcessor(args);
if (processor.parse()) {
return processor.result();
} else {
processor.printUsageAndExit();
}
}
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 params = processArguments(arguments);
var sourceMap = null;
if (params.sourceMap) {
initSourceMapSupport();
sourceMap = SourceMap.load(params.sourceMap);
}
var parseProcessor = new ParseProcessor();
parseProcessor.processLogFile(params.logFileName);