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

Side by Side Diff: pkg/compiler/lib/src/common/backend_api.dart

Issue 2659883002: Use entities in BackendClasses (Closed)
Patch Set: Updated cf. comments. Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/compiler.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 library dart2js.backend_api; 5 library dart2js.backend_api;
6 6
7 import 'dart:async' show Future; 7 import 'dart:async' show Future;
8 8
9 import '../common.dart'; 9 import '../common.dart';
10 import '../common/codegen.dart' show CodegenImpact; 10 import '../common/codegen.dart' show CodegenImpact;
11 import '../common/resolution.dart' show ResolutionImpact, Frontend, Target; 11 import '../common/resolution.dart' show ResolutionImpact, Frontend, Target;
12 import '../compile_time_constants.dart' 12 import '../compile_time_constants.dart'
13 show BackendConstantEnvironment, ConstantCompilerTask; 13 show BackendConstantEnvironment, ConstantCompilerTask;
14 import '../compiler.dart' show Compiler; 14 import '../compiler.dart' show Compiler;
15 import '../constants/constant_system.dart' show ConstantSystem; 15 import '../constants/constant_system.dart' show ConstantSystem;
16 import '../constants/expressions.dart' show ConstantExpression; 16 import '../constants/expressions.dart' show ConstantExpression;
17 import '../constants/values.dart' show ConstantValue; 17 import '../constants/values.dart' show ConstantValue;
18 import '../elements/types.dart';
18 import '../elements/resolution_types.dart' 19 import '../elements/resolution_types.dart'
19 show ResolutionDartType, ResolutionInterfaceType; 20 show ResolutionDartType, ResolutionInterfaceType;
20 import '../elements/elements.dart' 21 import '../elements/elements.dart'
21 show 22 show
22 ClassElement, 23 ClassElement,
23 Element, 24 Element,
24 FunctionElement, 25 FunctionElement,
25 MemberElement, 26 MemberElement,
26 MethodElement, 27 MethodElement,
27 LibraryElement; 28 LibraryElement;
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 /// Interface for serialization of backend specific data. 390 /// Interface for serialization of backend specific data.
390 class BackendSerialization { 391 class BackendSerialization {
391 const BackendSerialization(); 392 const BackendSerialization();
392 393
393 SerializerPlugin get serializer => const SerializerPlugin(); 394 SerializerPlugin get serializer => const SerializerPlugin();
394 DeserializerPlugin get deserializer => const DeserializerPlugin(); 395 DeserializerPlugin get deserializer => const DeserializerPlugin();
395 } 396 }
396 397
397 /// Interface providing access to core classes used by the backend. 398 /// Interface providing access to core classes used by the backend.
398 abstract class BackendClasses { 399 abstract class BackendClasses {
399 ClassElement get intImplementation; 400 /// Returns the backend implementation class for `int`. This is the `JSInt`
400 ClassElement get doubleImplementation; 401 /// class.
401 ClassElement get numImplementation; 402 ClassEntity get intClass;
402 ClassElement get stringImplementation;
403 ClassElement get listImplementation;
404 ClassElement get mutableListImplementation;
405 ClassElement get growableListImplementation;
406 ClassElement get fixedListImplementation;
407 ClassElement get constListImplementation;
408 ClassElement get mapImplementation;
409 ClassElement get constMapImplementation;
410 ClassElement get functionImplementation;
411 ClassElement get typeImplementation;
412 ClassElement get boolImplementation;
413 ClassElement get nullImplementation;
414 ClassElement get uint32Implementation;
415 ClassElement get uint31Implementation;
416 ClassElement get positiveIntImplementation;
417 ClassElement get syncStarIterableImplementation;
418 ClassElement get asyncFutureImplementation;
419 ClassElement get asyncStarStreamImplementation;
420 ClassElement get indexableImplementation;
421 ClassElement get mutableIndexableImplementation;
422 ClassElement get indexingBehaviorImplementation;
423 ClassElement get interceptorImplementation;
424 403
425 bool isDefaultEqualityImplementation(MemberElement element); 404 /// Returns the backend implementation class for `double`. This is the
426 bool isInterceptorClass(ClassElement cls); 405 /// `JSDouble` class.
427 bool isNativeClass(ClassElement element); 406 ClassEntity get doubleClass;
428 bool isNativeMember(MemberElement element); 407
408 /// Returns the backend implementation class for `num`. This is the `JSNum`
409 /// class.
410 ClassEntity get numClass;
411
412 /// Returns the backend implementation class for `String`. This is the
413 /// `JSString` class.
414 ClassEntity get stringClass;
415
416 /// Returns the backend implementation class for `List`. This is the
417 /// `JSArray` class.
418 ClassEntity get listClass;
419
420 /// Returns the backend dummy class used to track mutable implementations of
421 /// `List` in type masks. This is the `JSMutableArray` class.
422 ClassEntity get mutableListClass;
423
424 /// Returns the backend dummy class used to track growable implementations of
425 /// `List` in type masks. This is the `JSExtendableArray` class.
426 ClassEntity get growableListClass;
427
428 /// Returns the backend dummy class used to track fixed-sized implementations
429 /// of `List` in type masks. This is the `JSFixedArray` class.
430 ClassEntity get fixedListClass;
431
432 /// Returns the backend dummy class used to track unmodifiable (constant)
433 /// implementations of `List` in type masks. This is the `JSUnmodifiableArray`
434 /// class.
435 ClassEntity get constListClass;
436
437 /// Returns the backend implementation class for map literals. This is the
438 /// `LinkedHashMap` class.
439 ClassEntity get mapClass;
440
441 /// Returns the backend superclass for implementations of constant map
442 /// literals. This is the `ConstantMap` class.
443 ClassEntity get constMapClass;
444
445 /// Returns the backend implementation class for `Function`. This is the
446 /// `Function` class from 'dart:core'.
447 ClassEntity get functionClass;
448
449 /// Returns the backend implementation class for `Type`. This is the
450 /// `TypeImpl` class.
451 ClassEntity get typeClass;
452
453 /// Returns the type of the implementation class for `Type`.
454 InterfaceType get typeType;
455
456 /// Returns the backend implementation class for `bool`. This is the `JSBool`
457 /// class.
458 ClassEntity get boolClass;
459
460 /// Returns the backend implementation class for `null`. This is the `JSNull`
461 /// class.
462 ClassEntity get nullClass;
463
464 /// Returns the backend dummy class used to track unsigned 32-bit integer
465 /// values in type masks. This is the `JSUint32` class.
466 ClassEntity get uint32Class;
467
468 /// Returns the backend dummy class used to track unsigned 31-bit integer
469 /// values in type masks. This is the `JSUint31` class.
470 ClassEntity get uint31Class;
471
472 /// Returns the backend dummy class used to track position values in type
473 /// masks. This is the `JSPositiveInt` class.
474 ClassEntity get positiveIntClass;
475
476 /// Returns the backend implementation class for the `Iterable` used in
477 /// `sync*` methods. This is the `_SyncStarIterable` class in dart:async.
478 ClassEntity get syncStarIterableClass;
479
480 /// Returns the backend implementation class for the `Future` used in
481 /// `async` methods. This is the `_Future` class in dart:async.
482 ClassEntity get asyncFutureClass;
483
484 /// Returns the backend implementation class for the `Stream` used in
485 /// `async*` methods. This is the `_ControllerStream` class in dart:async.
486 ClassEntity get asyncStarStreamClass;
487
488 /// Returns the backend superclass directly indexable class, that is classes
489 /// that natively support the `[]` operator. This is the `JSIndexable` class.
490 ClassEntity get indexableClass;
491
492 /// Returns the backend superclass directly indexable class, that is classes
493 /// that natively support the `[]=` operator. This is the `JSMutableIndexable`
494 /// class.
495 ClassEntity get mutableIndexableClass;
496
497 /// Returns the backend class used to mark native classes that support integer
498 /// indexing, that is `[]` and `[]=` where the key is an integer. This is the
499 /// `JavaScriptIndexingBehavior` class.
500 ClassEntity get indexingBehaviorClass;
501
502 /// Returns the backend superclass for all intercepted classes. This is the
503 /// `Interceptor` class.
504 ClassEntity get interceptorClass;
505
506 /// Returns `true` if [element] is a default implementation of `Object.==`.
507 /// This either `Object.==`, `Intercepter.==` or `Null.==`.
508 bool isDefaultEqualityImplementation(MemberEntity element);
509
510 /// Returns `true` if [cls] is an intercepted class.
511 // TODO(johnniwinther): Rename this to `isInterceptedClass`.
512 bool isInterceptorClass(ClassEntity cls);
513
514 /// Returns `true` if [cls] is a native class.
515 bool isNativeClass(ClassEntity element);
516
517 /// Returns `true` if [element] is a native member of a native class.
518 bool isNativeMember(MemberEntity element);
429 } 519 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698