Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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` class. | |
|
Siggi Cherem (dart-lang)
2017/01/27 16:49:06
long line
Johnni Winther
2017/01/30 10:00:12
Done.
| |
| 434 ClassEntity get constListClass; | |
| 435 | |
| 436 /// Returns the backend implementation class for map literals. This is the | |
| 437 /// `LinkedHashMap` class. | |
| 438 ClassEntity get mapClass; | |
| 439 | |
| 440 /// Returns the backend superclass for implementations of constant map | |
| 441 /// literals. This is the `ConstantMap` class. | |
| 442 ClassEntity get constMapClass; | |
| 443 | |
| 444 /// Returns the backend implementation class for `Function`. This is the | |
| 445 /// `Function` class from 'dart:core'. | |
| 446 ClassEntity get functionClass; | |
| 447 | |
| 448 /// Returns the backend implementation class for `Type`. This is the | |
| 449 /// `TypeImpl` class. | |
| 450 ClassEntity get typeClass; | |
| 451 | |
| 452 /// Returns the type of the implementation class for `Type`. | |
| 453 InterfaceType get typeType; | |
| 454 | |
| 455 /// Returns the backend implementation class for `bool`. This is the `JSBool` | |
| 456 /// class. | |
| 457 ClassEntity get boolClass; | |
| 458 | |
| 459 /// Returns the backend implementation class for `null`. This is the `JSNull` | |
| 460 /// class. | |
| 461 ClassEntity get nullClass; | |
| 462 | |
| 463 /// Returns the backend dummy class used to track unsigned 32-bit integer | |
| 464 /// values in type masks. This is the `JSUint32` class. | |
| 465 ClassEntity get uint32Class; | |
| 466 | |
| 467 /// Returns the backend dummy class used to track unsigned 31-bit integer | |
| 468 /// values in type masks. This is the `JSUint31` class. | |
| 469 ClassEntity get uint31Class; | |
| 470 | |
| 471 /// Returns the backend dummy class used to track position values in type | |
| 472 /// masks. This is the `JSPositiveInt` class. | |
| 473 ClassEntity get positiveIntClass; | |
| 474 | |
| 475 /// Returns the backend implementation class for the `Iterable` used in | |
| 476 /// `sync*` methods. This is the `_SyncStarIterable` class in dart:async. | |
| 477 ClassEntity get syncStarIterableClass; | |
| 478 | |
| 479 /// Returns the backend implementation class for the `Future` used in | |
| 480 /// `async` methods. This is the `_Future` class in dart:async. | |
| 481 ClassEntity get asyncFutureClass; | |
| 482 | |
| 483 /// Returns the backend implementation class for the `Stream` used in | |
| 484 /// `async*` methods. This is the `_ControllerStream` class in dart:async. | |
| 485 ClassEntity get asyncStarStreamClass; | |
| 486 | |
| 487 /// Returns the backend superclass directly indexable class, that is classes | |
| 488 /// that natively support the `[]` operator. This is the `JSIndexable` class. | |
| 489 ClassEntity get indexableClass; | |
| 490 | |
| 491 /// Returns the backend superclass directly indexable class, that is classes | |
| 492 /// that natively support the `[]=` operator. This is the `JSMutableIndexable` | |
| 493 /// class. | |
| 494 ClassEntity get mutableIndexableClass; | |
| 495 | |
| 496 /// Returns the backend class used to mark native classes that support integer | |
| 497 /// indexing, that is `[]` and `[]=` where the key is an integer. This is the | |
| 498 /// `JavaScriptIndexingBehavior` class. | |
| 499 ClassEntity get indexingBehaviorClass; | |
| 500 | |
| 501 /// Returns the backend superclass for all intercepted classes. This is the | |
| 502 /// `Interceptor` class. | |
| 503 ClassEntity get interceptorClass; | |
| 504 | |
| 505 /// Returns `true` if [element] is a default implementation of `Object.==`. | |
| 506 /// This either `Object.==`, `Intercepter.==` or `Null.==`. | |
| 507 bool isDefaultEqualityImplementation(MemberEntity element); | |
| 508 | |
| 509 /// Returns `true` if [cls] is an intercepted class. | |
| 510 // TODO(johnniwinther): Rename this to `isInterceptedClass`. | |
| 511 bool isInterceptorClass(ClassEntity cls); | |
| 512 | |
| 513 /// Returns `true` if [cls] is a native class. | |
| 514 bool isNativeClass(ClassEntity element); | |
| 515 | |
| 516 /// Returns `true` if [element] is a native member of a native class. | |
| 517 bool isNativeMember(MemberEntity element); | |
| 429 } | 518 } |
| OLD | NEW |