• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2017 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5import { Processor } from "./system-analyzer/processor.mjs";
6import { BaseArgumentsProcessor} from "./arguments.mjs";
7
8class ArgumentsProcessor extends BaseArgumentsProcessor {
9  getArgsDispatch() {
10    return {
11      '--range': ['range', 'auto,auto',
12          'Specify the range limit as [start],[end]'],
13    };
14  }
15  getDefaultResults() {
16   return {
17      logFileName: 'v8.log',
18      range: 'auto,auto',
19    };
20  }
21}
22
23const params = ArgumentsProcessor.process(arguments);
24const processor = new Processor();
25await processor.processLogFile(params.logFileName);
26
27const typeAccumulator = new Map();
28
29const accumulator = {
30  __proto__: null,
31  LoadGlobalIC: 0,
32  StoreGlobalIC: 0,
33  LoadIC: 0,
34  StoreIC: 0,
35  KeyedLoadIC: 0,
36  KeyedStoreIC: 0,
37  StoreInArrayLiteralIC: 0,
38}
39for (const ic of processor.icTimeline.all) {
40  console.log(Object.values(ic));
41  accumulator[ic.type]++;
42}
43
44console.log("========================================");
45for (const key of Object.keys(accumulator)) {
46  console.log(key + ": " + accumulator[key]);
47}
48