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

Side by Side Diff: tool/input_sdk/private/ddc_runtime/operations.dart

Issue 2032903003: Switch how we track whether trackDdcProfile is set to reduce the performance impact. sra was seeing… (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « lib/src/compiler/code_generator.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// This library defines runtime operations on objects used by the code 5 /// This library defines runtime operations on objects used by the code
6 /// generator. 6 /// generator.
7 part of dart._runtime; 7 part of dart._runtime;
8 8
9 _canonicalFieldName(obj, name, args, displayName) => JS('', '''(() => { 9 _canonicalFieldName(obj, name, args, displayName) => JS('', '''(() => {
10 $name = $canonicalMember($obj, $name); 10 $name = $canonicalMember($obj, $name);
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 ret.add([key, count]); 175 ret.add([key, count]);
176 } 176 }
177 177
178 return ret; 178 return ret;
179 } 179 }
180 180
181 clearDynamicStats() { 181 clearDynamicStats() {
182 _callMethodStats.clear(); 182 _callMethodStats.clear();
183 } 183 }
184 184
185 bool trackProfile = JS('bool', 'dart.global.trackDdcProfile');
186
185 _trackCall(obj, name) { 187 _trackCall(obj, name) {
186 if (JS('bool', '!dart.global.trackDdcProfile')) return; 188 if (JS('bool', '!#', trackProfile)) return;
189
187 var actual = getReifiedType(obj); 190 var actual = getReifiedType(obj);
188 String stackStr = JS('String', "new Error().stack"); 191 String stackStr = JS('String', "new Error().stack");
189 var stack = stackStr.split('\n at '); 192 var stack = stackStr.split('\n at ');
190 var src = ''; 193 var src = '';
191 for (int i = 2; i < stack.length; ++i) { 194 for (int i = 2; i < stack.length; ++i) {
192 var frame = stack[i]; 195 var frame = stack[i];
193 if (!frame.contains('dev_compiler/lib/runtime/dart_sdk.js')) { 196 if (!frame.contains('dev_compiler/lib/runtime/dart_sdk.js')) {
194 src = frame; 197 src = frame;
195 break; 198 break;
196 } 199 }
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 constructor(dartIterator) { 649 constructor(dartIterator) {
647 this.dartIterator = dartIterator; 650 this.dartIterator = dartIterator;
648 } 651 }
649 next() { 652 next() {
650 let i = this.dartIterator; 653 let i = this.dartIterator;
651 let done = !i.moveNext(); 654 let done = !i.moveNext();
652 return { done: done, value: done ? void 0 : i.current }; 655 return { done: done, value: done ? void 0 : i.current };
653 } 656 }
654 } 657 }
655 '''); 658 ''');
OLDNEW
« no previous file with comments | « lib/src/compiler/code_generator.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698