ic-processor-driver.mjs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. import { Processor } from "./system-analyzer/processor.mjs";
  5. import { BaseArgumentsProcessor} from "./arguments.mjs";
  6. class ArgumentsProcessor extends BaseArgumentsProcessor {
  7. getArgsDispatch() {
  8. return {
  9. '--range': ['range', 'auto,auto',
  10. 'Specify the range limit as [start],[end]'],
  11. };
  12. }
  13. getDefaultResults() {
  14. return {
  15. logFileName: 'v8.log',
  16. range: 'auto,auto',
  17. };
  18. }
  19. }
  20. const params = ArgumentsProcessor.process(arguments);
  21. const processor = new Processor();
  22. await processor.processLogFile(params.logFileName);
  23. const typeAccumulator = new Map();
  24. const accumulator = {
  25. __proto__: null,
  26. LoadGlobalIC: 0,
  27. StoreGlobalIC: 0,
  28. LoadIC: 0,
  29. StoreIC: 0,
  30. KeyedLoadIC: 0,
  31. KeyedStoreIC: 0,
  32. StoreInArrayLiteralIC: 0,
  33. }
  34. for (const ic of processor.icTimeline.all) {
  35. console.log(Object.values(ic));
  36. accumulator[ic.type]++;
  37. }
  38. console.log("========================================");
  39. for (const key of Object.keys(accumulator)) {
  40. console.log(key + ": " + accumulator[key]);
  41. }