aboutsummaryrefslogtreecommitdiff
path: root/tools/ic-processor-driver.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/ic-processor-driver.js')
-rw-r--r--tools/ic-processor-driver.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/ic-processor-driver.js b/tools/ic-processor-driver.js
new file mode 100644
index 00000000..58c608d0
--- /dev/null
+++ b/tools/ic-processor-driver.js
@@ -0,0 +1,33 @@
+// 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 icProcessor = new IcProcessor();
+icProcessor.processLogFile(params.logFileName);