Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(722)

Unified Diff: runtime/vm/coverage.cc

Issue 1660063002: Remove many features when building product mode (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/coverage_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/coverage.cc
diff --git a/runtime/vm/coverage.cc b/runtime/vm/coverage.cc
index acb61f3469f919d536f695a3683c0fbcee3db9ac..8ce260be1b624e788c19276417ad20d29e9f7770 100644
--- a/runtime/vm/coverage.cc
+++ b/runtime/vm/coverage.cc
@@ -60,6 +60,9 @@ void CodeCoverage::CompileAndAdd(const Function& function,
const JSONArray& hits_or_sites,
const GrowableArray<intptr_t>& pos_to_line,
bool as_call_sites) {
+ if (!FLAG_support_coverage) {
+ return;
+ }
// If the function should not be compiled for coverage analysis, then just
// skip this method.
// TODO(iposva): Maybe we should skip synthesized methods in general too.
@@ -146,6 +149,9 @@ void CodeCoverage::PrintClass(const Library& lib,
const JSONArray& jsarr,
CoverageFilter* filter,
bool as_call_sites) {
+ if (!FLAG_support_coverage) {
+ return;
+ }
Thread* thread = Thread::Current();
if (cls.EnsureIsFinalized(thread) != Error::null()) {
// Only classes that have been finalized do have a meaningful list of
@@ -240,6 +246,9 @@ void CodeCoverage::PrintClass(const Library& lib,
void CodeCoverage::Write(Thread* thread) {
+ if (!FLAG_support_coverage) {
+ return;
+ }
if (FLAG_coverage_dir == NULL) {
return;
}
@@ -272,6 +281,9 @@ void CodeCoverage::PrintJSON(Thread* thread,
JSONStream* stream,
CoverageFilter* filter,
bool as_call_sites) {
+ if (!FLAG_support_coverage) {
+ return;
+ }
CoverageFilterAll default_filter;
if (filter == NULL) {
filter = &default_filter;
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/coverage_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698