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

Unified Diff: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/profile.dart

Issue 2875063003: Fix bugs supporting configuring DDC runtime settings before the application starts. (Closed)
Patch Set: Created 3 years, 7 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
Index: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/profile.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/profile.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/profile.dart
index 082410011cab21b1bb37359bb845edbc5cebb033..d10ead7355d490d2849777bef539f2d134e68e89 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/profile.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/profile.dart
@@ -72,6 +72,7 @@ List<List<Object>> getDynamicStats() {
if (!mappedFrame.contains('dart:_runtime/operations.dart') &&
!mappedFrame.contains('dart:_runtime/profile.dart')) {
src = mappedFrame;
+
break;
}
}
@@ -114,14 +115,16 @@ clearDynamicStats() {
_callMethodRecords.clear();
}
-bool _trackProfile = false;
+// We need to set this property while the sdk is only partially initialized
+// so we cannot use a regular Dart field.
+bool get _trackProfile => JS('bool', 'dart.__trackProfile');
void trackProfile(bool flag) {
- _trackProfile = flag;
+ JS('', 'dart.__trackProfile = #', flag);
}
_trackCall(obj) {
- if (JS('bool', '!#', trackProfile)) return;
+ if (JS('bool', '!#', _trackProfile)) return;
int index = -1;
_totalCallRecords++;
if (_callMethodRecords.length == _callRecordSampleSize) {

Powered by Google App Engine
This is Rietveld 408576698