Commit f8f7c8b1 authored by Zeynep Cankara's avatar Zeynep Cankara Committed by Commit Bot

[tools][system-analyzer] Check file version

This CL checks the version of the log file
by checking the format of Map Objects processed
by the IC processor. The version check requirement
came from the modified IC event logging pipeline
of the V8.

Bug: v8:10644

Change-Id: Ic661a34cfaf15edfde5fa24588275ac055a5bb5e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2343067
Commit-Queue: Zeynep Cankara <zcankara@google.com>
Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69333}
parent 8d3ababb
......@@ -22,6 +22,8 @@ function parseState(s) {
class IcProcessor extends LogReader {
#profile;
MAJOR_VERSION = 8;
MINOR_VERSION = 5;
constructor() {
super();
let propertyICParser = [
......@@ -36,6 +38,12 @@ class IcProcessor extends LogReader {
],
processor: this.processCodeCreation
},
'v8-version': {
parsers: [
parseInt, parseInt,
],
processor: this.processV8Version
},
'code-move':
{parsers: [parseInt, parseInt], processor: this.processCodeMove},
'code-delete': {parsers: [parseInt], processor: this.processCodeDelete},
......@@ -105,6 +113,15 @@ class IcProcessor extends LogReader {
this.processLogLine(line);
}
}
processV8Version(majorVersion, minorVersion){
if(
(majorVersion == this.MAJOR_VERSION && minorVersion <= this.MINOR_VERSION)
|| (majorVersion < this.MAJOR_VERSION)){
window.alert(
`Unsupported version ${majorVersion}.${minorVersion}. \n` +
`Please use the matching tool for given the V8 version.`);
}
}
processLogFile(fileName) {
this.collectEntries = true;
this.lastLogFileName_ = fileName;
......
......@@ -35,6 +35,8 @@ class MapProcessor extends LogReader {
#profile = new Profile();
#timeline = new Timeline();
#formatPCRegexp = /(.*):[0-9]+:[0-9]+$/;
MAJOR_VERSION = 7;
MINOR_VERSION = 6;
constructor() {
super();
this.dispatchTable_ = {
......@@ -46,6 +48,12 @@ class MapProcessor extends LogReader {
],
processor: this.processCodeCreation
},
'v8-version': {
parsers: [
parseInt, parseInt,
],
processor: this.processV8Version
},
'code-move': {
parsers: [parseInt, parseInt],
'sfi-move':
......@@ -163,6 +171,16 @@ class MapProcessor extends LogReader {
}
}
processV8Version(majorVersion, minorVersion){
if(
(majorVersion == this.MAJOR_VERSION && minorVersion <= this.MINOR_VERSION)
|| (majorVersion < this.MAJOR_VERSION)){
window.alert(
`Unsupported version ${majorVersion}.${minorVersion}. \n` +
`Please use the matching tool for given the V8 version.`);
}
}
processCodeMove(from, to) {
this.#profile.moveCode(from, to);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment