Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Use VMScriptRef to identify VM scripts, not URI #216

Merged
merged 1 commit into from
Oct 19, 2018

Conversation

cbracken
Copy link
Contributor

@cbracken cbracken commented Jan 5, 2018

Previously, coverage collection assumed that a script could be uniquely
identified by URI, which is not a valid assumption. For example, when a
part is loaded via two libraries, both of which are loaded by an
isolate, the VM will track these are two scripts that map to the same
URI.

During collection, we now track each script by its (unique)
VMScriptRef. This ensures we lookup the correct script when computing
the affected line for each hit token. The hitmap remains URI based,
since in the end, we want a single, unified set of line->hitCount
mappings per script.

Fixes dart-lang/tools#437

@cbracken
Copy link
Contributor Author

cbracken commented Jan 5, 2018

/cc @amirh

@yjbanov
Copy link

yjbanov commented Oct 19, 2018

lgtm

Previously, coverage collection assumed that a script could be uniquely
identified by URI, which is not a valid assumption. For example, when a
part is loaded via two libraries, both of which are loaded by an
isolate, the VM will track these are two scripts that map to the same
URI.

During collection, we now track each script by its (unique)
VMScriptRef. This ensures we lookup the correct script when computing
the affected line for each hit token. The hitmap remains URI based,
since in the end, we want a single, unified set of line->hitCount
mappings per script.

Fixes dart-lang/coverage#194
@cbracken cbracken merged commit 8ca3f6e into dart-archive:master Oct 19, 2018
@cbracken cbracken deleted the use-scriptref-not-uri branch October 19, 2018 19:22
mosuem pushed a commit to dart-lang/tools that referenced this pull request Aug 28, 2024
…e#216)

Previously, coverage collection assumed that a script could be uniquely
identified by URI, which is not a valid assumption. For example, when a
part is loaded via two libraries, both of which are loaded by an
isolate, the VM will track these are two scripts that map to the same
URI.

During collection, we now track each script by its (unique)
VMScriptRef. This ensures we lookup the correct script when computing
the affected line for each hit token. The hitmap remains URI based,
since in the end, we want a single, unified set of line->hitCount
mappings per script.

Fixes dart-lang/coveragedart-lang/coverage#194
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

VMScript URI does not uniquely identify a script
3 participants