[tools][profiler] Fix JsonProfile script url

Use new Script.prototype.update method to set the url and the script
source.

Bug: v8:11850
Change-Id: I555d4d0158cdacb7cb42efa385371454542fc2f3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2944438
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74985}
This commit is contained in:
Camillo Bruni 2021-06-07 14:57:16 +02:00 committed by V8 LUCI CQ
parent a6207b54d0
commit 4cb3c5cb27

View File

@ -48,8 +48,9 @@ export class SourcePosition {
}
export class Script {
name;
url;
source;
name;
// Map<line, Map<column, SourcePosition>>
lineToColumn = new Map();
_entries = [];
@ -1222,7 +1223,9 @@ JsonProfile.prototype.addSourcePositions = function (
};
JsonProfile.prototype.addScriptSource = function (id, url, source) {
this.scripts_[id] = new Script(id, url, source);
const script = new Script(id);
script.update(url, source);
this.scripts_[id] = script;
};
JsonProfile.prototype.deoptCode = function (