2017-02-20 09:20:42 +00:00
|
|
|
// 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.
|
|
|
|
|
2020-10-26 18:02:54 +00:00
|
|
|
import { Processor } from "./system-analyzer/processor.mjs";
|
2021-05-31 22:17:32 +00:00
|
|
|
import { BaseArgumentsProcessor} from "./arguments.mjs";
|
2017-02-20 09:20:42 +00:00
|
|
|
|
2020-10-26 18:02:54 +00:00
|
|
|
class ArgumentsProcessor extends BaseArgumentsProcessor {
|
|
|
|
getArgsDispatch() {
|
|
|
|
return {
|
|
|
|
'--range': ['range', 'auto,auto',
|
|
|
|
'Specify the range limit as [start],[end]'],
|
|
|
|
};
|
|
|
|
}
|
|
|
|
getDefaultResults() {
|
|
|
|
return {
|
|
|
|
logFileName: 'v8.log',
|
|
|
|
range: 'auto,auto',
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-31 22:17:32 +00:00
|
|
|
const params = ArgumentsProcessor.process(arguments);
|
2020-10-26 18:02:54 +00:00
|
|
|
const processor = new Processor();
|
2021-06-30 11:17:33 +00:00
|
|
|
await processor.processLogFile(params.logFileName);
|
2020-10-26 18:02:54 +00:00
|
|
|
|
|
|
|
const typeAccumulator = new Map();
|
|
|
|
|
|
|
|
const accumulator = {
|
2021-05-31 22:17:32 +00:00
|
|
|
__proto__: null,
|
2020-10-26 18:02:54 +00:00
|
|
|
LoadGlobalIC: 0,
|
|
|
|
StoreGlobalIC: 0,
|
|
|
|
LoadIC: 0,
|
|
|
|
StoreIC: 0,
|
|
|
|
KeyedLoadIC: 0,
|
|
|
|
KeyedStoreIC: 0,
|
2021-05-31 22:17:32 +00:00
|
|
|
StoreInArrayLiteralIC: 0,
|
2020-10-26 18:02:54 +00:00
|
|
|
}
|
|
|
|
for (const ic of processor.icTimeline.all) {
|
2021-03-24 12:12:45 +00:00
|
|
|
console.log(Object.values(ic));
|
2020-10-26 18:02:54 +00:00
|
|
|
accumulator[ic.type]++;
|
|
|
|
}
|
|
|
|
|
2021-03-24 12:12:45 +00:00
|
|
|
console.log("========================================");
|
2020-10-26 18:02:54 +00:00
|
|
|
for (const key of Object.keys(accumulator)) {
|
2021-03-24 12:12:45 +00:00
|
|
|
console.log(key + ": " + accumulator[key]);
|
2020-10-26 18:02:54 +00:00
|
|
|
}
|