Revert "[vm] Skip filtered class earlier in source report."
This reverts commit 86233b55bc.
Reason for revert: https://github.com/flutter/flutter/issues/115719
Original change's description:
> [vm] Skip filtered class earlier in source report.
>
> The main benefit of this is that it avoids cls.EnsureIsFinalized for
> skipped classes. In some cases (eg very small tests with dependencies
> on very large 3rd party packages, such as flutter) this can reduce
> coverage collection time by 20%.
>
> Change-Id: Id756af7f2d2ecdd07a5d1d05a400cea4de7ec408
> Bug: https://github.com/flutter/flutter/issues/100751
> TEST=CI
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266640
> Commit-Queue: Liam Appelbe <liama@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: https://github.com/flutter/flutter/issues/100751
Change-Id: Ie1e9f29fa6e3966f25040aebad8cb1d55b50a745
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273100
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
This commit is contained in:
committed by
Commit Queue
parent
e89d93f48c
commit
32bfc38a20
+10
-20
@@ -204,14 +204,6 @@ bool SourceReport::ShouldFiltersIncludeUrl(const String& url) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SourceReport::ShouldFiltersIncludeLibrary(const Library& lib) {
|
||||
if (library_filters_.IsNull()) {
|
||||
return true;
|
||||
}
|
||||
const String& url = String::Handle(zone(), lib.url());
|
||||
return ShouldFiltersIncludeUrl(url);
|
||||
}
|
||||
|
||||
bool SourceReport::ShouldFiltersIncludeScript(const Script& script) {
|
||||
if (library_filters_.IsNull()) return true;
|
||||
String& url = String::Handle(zone(), script.url());
|
||||
@@ -623,25 +615,18 @@ void SourceReport::VisitLibrary(JSONArray* jsarr, const Library& lib) {
|
||||
Field& field = Field::Handle(zone());
|
||||
Script& script = Script::Handle(zone());
|
||||
ClassDictionaryIterator it(lib, ClassDictionaryIterator::kIteratePrivate);
|
||||
|
||||
if (!ShouldFiltersIncludeLibrary(lib)) {
|
||||
return;
|
||||
}
|
||||
|
||||
while (it.HasNext()) {
|
||||
cls = it.GetNextClass();
|
||||
|
||||
script = cls.script();
|
||||
const intptr_t script_index = GetScriptIndex(script);
|
||||
if (script_index < 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!cls.is_finalized()) {
|
||||
if (compile_mode_ == kForceCompile) {
|
||||
Error& err = Error::Handle(cls.EnsureIsFinalized(thread()));
|
||||
if (!err.IsNull()) {
|
||||
// Emit an uncompiled range for this class with error information.
|
||||
script = cls.script();
|
||||
const intptr_t script_index = GetScriptIndex(script);
|
||||
if (script_index < 0) {
|
||||
continue;
|
||||
}
|
||||
JSONObject range(jsarr);
|
||||
range.AddProperty("scriptIndex", script_index);
|
||||
range.AddProperty("startPos", cls.token_pos());
|
||||
@@ -654,6 +639,11 @@ void SourceReport::VisitLibrary(JSONArray* jsarr, const Library& lib) {
|
||||
} else {
|
||||
cls.EnsureDeclarationLoaded();
|
||||
// Emit one range for the whole uncompiled class.
|
||||
script = cls.script();
|
||||
const intptr_t script_index = GetScriptIndex(script);
|
||||
if (script_index < 0) {
|
||||
continue;
|
||||
}
|
||||
JSONObject range(jsarr);
|
||||
range.AddProperty("scriptIndex", script_index);
|
||||
range.AddProperty("startPos", cls.token_pos());
|
||||
|
||||
@@ -80,7 +80,6 @@ class SourceReport {
|
||||
bool ScriptIsLoadedByLibrary(const Script& script, const Library& lib);
|
||||
intptr_t GetTokenPosOrLine(const Script& script,
|
||||
const TokenPosition& token_pos);
|
||||
bool ShouldFiltersIncludeLibrary(const Library& script);
|
||||
bool ShouldFiltersIncludeScript(const Script& script);
|
||||
bool ShouldFiltersIncludeUrl(const String& url);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user