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

Side by Side Diff: pkg/compiler/lib/src/native/enqueue.dart

Issue 1802883002: Use JS backend in serialization_analysis_test (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Serialize ClassElement.isUnnamedMixinApplication and test added properties. Created 4 years, 9 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 import 'dart:collection' show Queue; 5 import 'dart:collection' show Queue;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/backend_api.dart' show 8 import '../common/backend_api.dart' show
9 ForeignResolver; 9 ForeignResolver;
10 import '../common/registry.dart' show 10 import '../common/registry.dart' show
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 nativeClasses.forEach(walkPotentialSubclasses); 229 nativeClasses.forEach(walkPotentialSubclasses);
230 230
231 nativeClasses.addAll(nativeClassesAndSubclasses); 231 nativeClasses.addAll(nativeClassesAndSubclasses);
232 unusedClasses.addAll(nativeClassesAndSubclasses); 232 unusedClasses.addAll(nativeClassesAndSubclasses);
233 } 233 }
234 234
235 /** 235 /**
236 * Returns the source string of the class named in the extends clause, or 236 * Returns the source string of the class named in the extends clause, or
237 * `null` if there is no extends clause. 237 * `null` if there is no extends clause.
238 */ 238 */
239 String findExtendsNameOfClass(BaseClassElementX classElement) { 239 String findExtendsNameOfClass(ClassElement classElement) {
240 if (classElement.isResolved) {
241 ClassElement superClass = classElement.superclass;
242 while (superClass != null) {
243 if (!superClass.isUnnamedMixinApplication) {
244 return superClass.name;
245 }
246 superClass = superClass.superclass;
247 }
248 return null;
249 }
250
240 // "class B extends A ... {}" --> "A" 251 // "class B extends A ... {}" --> "A"
241 // "class B extends foo.A ... {}" --> "A" 252 // "class B extends foo.A ... {}" --> "A"
242 // "class B<T> extends foo.A<T,T> with M1, M2 ... {}" --> "A" 253 // "class B<T> extends foo.A<T,T> with M1, M2 ... {}" --> "A"
243 254
244 // We want to avoid calling classElement.parseNode on every class. Doing so 255 // We want to avoid calling classElement.parseNode on every class. Doing so
245 // will slightly increase parse time and size and cause compiler errors and 256 // will slightly increase parse time and size and cause compiler errors and
246 // warnings to me emitted in more unused code. 257 // warnings to me emitted in more unused code.
247 258
248 // An alternative to this code is to extend the API of ClassElement to 259 // An alternative to this code is to extend the API of ClassElement to
249 // expose the name of the extended element. 260 // expose the name of the extended element.
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 372
362 void flushQueue() { 373 void flushQueue() {
363 if (flushing) return; 374 if (flushing) return;
364 flushing = true; 375 flushing = true;
365 while (!queue.isEmpty) { 376 while (!queue.isEmpty) {
366 (queue.removeFirst())(); 377 (queue.removeFirst())();
367 } 378 }
368 flushing = false; 379 flushing = false;
369 } 380 }
370 381
371 processClass(BaseClassElementX classElement, cause) { 382 processClass(ClassElement classElement, cause) {
372 // TODO(ahe): Fix this assertion to work in incremental compilation. 383 // TODO(ahe): Fix this assertion to work in incremental compilation.
373 assert(compiler.hasIncrementalSupport || 384 assert(compiler.hasIncrementalSupport ||
374 !registeredClasses.contains(classElement)); 385 !registeredClasses.contains(classElement));
375 386
376 bool firstTime = registeredClasses.isEmpty; 387 bool firstTime = registeredClasses.isEmpty;
377 pendingClasses.remove(classElement); 388 pendingClasses.remove(classElement);
378 registeredClasses.add(classElement); 389 registeredClasses.add(classElement);
379 390
380 // TODO(ahe): Is this really a global dependency? 391 // TODO(ahe): Is this really a global dependency?
381 classElement.ensureResolved(resolution); 392 classElement.ensureResolved(resolution);
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 superclass, 732 superclass,
722 () => <ClassElement>[]); 733 () => <ClassElement>[]);
723 directSubtypes.add(cls); 734 directSubtypes.add(cls);
724 } 735 }
725 736
726 void logSummary(log(message)) { 737 void logSummary(log(message)) {
727 log('Compiled ${registeredClasses.length} native classes, ' 738 log('Compiled ${registeredClasses.length} native classes, '
728 '${unusedClasses.length} native classes omitted.'); 739 '${unusedClasses.length} native classes omitted.');
729 } 740 }
730 } 741 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/enqueue.dart ('k') | pkg/compiler/lib/src/serialization/element_serialization.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698