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

Side by Side Diff: pkg/compiler/lib/src/universe/use.dart

Issue 2494093002: Refactor enqueuers (Closed)
Patch Set: Updated cf. comments. Created 4 years, 1 month 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 | « pkg/compiler/lib/src/ssa/codegen.dart ('k') | pkg/compiler/tool/perf.dart » ('j') | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 individual world impacts. 5 /// This library defines individual world impacts.
6 /// 6 ///
7 /// We call these building blocks `uses`. Each `use` is a single impact of the 7 /// We call these building blocks `uses`. Each `use` is a single impact of the
8 /// world. Some example uses are: 8 /// world. Some example uses are:
9 /// 9 ///
10 /// * an invocation of a top level function 10 /// * an invocation of a top level function
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 String toString() => 'StaticUse($element,$kind,$type)'; 316 String toString() => 'StaticUse($element,$kind,$type)';
317 } 317 }
318 318
319 enum TypeUseKind { 319 enum TypeUseKind {
320 IS_CHECK, 320 IS_CHECK,
321 AS_CAST, 321 AS_CAST,
322 CHECKED_MODE_CHECK, 322 CHECKED_MODE_CHECK,
323 CATCH_TYPE, 323 CATCH_TYPE,
324 TYPE_LITERAL, 324 TYPE_LITERAL,
325 INSTANTIATION, 325 INSTANTIATION,
326 MIRROR_INSTANTIATION,
327 NATIVE_INSTANTIATION,
326 } 328 }
327 329
328 /// Use of a [DartType]. 330 /// Use of a [DartType].
329 class TypeUse { 331 class TypeUse {
330 final DartType type; 332 final DartType type;
331 final TypeUseKind kind; 333 final TypeUseKind kind;
332 final int hashCode; 334 final int hashCode;
333 335
334 TypeUse.internal(DartType type, TypeUseKind kind) 336 TypeUse.internal(DartType type, TypeUseKind kind)
335 : this.type = type, 337 : this.type = type,
(...skipping 23 matching lines...) Expand all
359 /// [type] used as a type literal, like `foo() => T;`. 361 /// [type] used as a type literal, like `foo() => T;`.
360 factory TypeUse.typeLiteral(DartType type) { 362 factory TypeUse.typeLiteral(DartType type) {
361 return new TypeUse.internal(type, TypeUseKind.TYPE_LITERAL); 363 return new TypeUse.internal(type, TypeUseKind.TYPE_LITERAL);
362 } 364 }
363 365
364 /// [type] used in an instantiation, like `new T();`. 366 /// [type] used in an instantiation, like `new T();`.
365 factory TypeUse.instantiation(InterfaceType type) { 367 factory TypeUse.instantiation(InterfaceType type) {
366 return new TypeUse.internal(type, TypeUseKind.INSTANTIATION); 368 return new TypeUse.internal(type, TypeUseKind.INSTANTIATION);
367 } 369 }
368 370
371 /// [type] used in an instantiation through mirrors.
372 factory TypeUse.mirrorInstantiation(InterfaceType type) {
373 return new TypeUse.internal(type, TypeUseKind.MIRROR_INSTANTIATION);
374 }
375
376 /// [type] used in a native instantiation.
377 factory TypeUse.nativeInstantiation(InterfaceType type) {
378 return new TypeUse.internal(type, TypeUseKind.NATIVE_INSTANTIATION);
379 }
380
369 bool operator ==(other) { 381 bool operator ==(other) {
370 if (identical(this, other)) return true; 382 if (identical(this, other)) return true;
371 if (other is! TypeUse) return false; 383 if (other is! TypeUse) return false;
372 return type == other.type && kind == other.kind; 384 return type == other.type && kind == other.kind;
373 } 385 }
374 386
375 String toString() => 'TypeUse($type,$kind)'; 387 String toString() => 'TypeUse($type,$kind)';
376 } 388 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/codegen.dart ('k') | pkg/compiler/tool/perf.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698