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

Side by Side Diff: pkg/compiler/lib/src/js_model/elements.dart

Issue 2970673004: Handle static fields in js_model/model_test (Closed)
Patch Set: Created 3 years, 5 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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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.js_model.elements; 5 library dart2js.js_model.elements;
6 6
7 import '../common_elements.dart'; 7 import '../common_elements.dart';
8 import '../constants/constant_system.dart'; 8 import '../constants/constant_system.dart';
9 import '../elements/elements.dart'; 9 import '../elements/elements.dart';
10 import '../elements/entities.dart'; 10 import '../elements/entities.dart';
11 import '../elements/names.dart'; 11 import '../elements/names.dart';
12 import '../elements/types.dart'; 12 import '../elements/types.dart';
13 import '../js_backend/backend_usage.dart'; 13 import '../js_backend/backend_usage.dart';
14 import '../js_backend/interceptor_data.dart'; 14 import '../js_backend/interceptor_data.dart';
15 import '../js_backend/native_data.dart'; 15 import '../js_backend/native_data.dart';
16 import '../kernel/elements.dart'; 16 import '../kernel/elements.dart';
17 import '../kernel/element_map_impl.dart';
17 import '../native/behavior.dart'; 18 import '../native/behavior.dart';
18 import '../ordered_typeset.dart';
19 import '../universe/class_set.dart'; 19 import '../universe/class_set.dart';
20 import '../universe/function_set.dart';
21 import '../universe/selector.dart';
22 import '../universe/world_builder.dart'; 20 import '../universe/world_builder.dart';
23 import '../world.dart'; 21 import '../world.dart';
24 22
25 /// Bidirectional map between 'frontend' and 'backend' elements. 23 /// Bidirectional map between 'frontend' and 'backend' elements.
26 /// 24 ///
27 /// Frontend elements are what we read in, these typically represents concepts 25 /// Frontend elements are what we read in, these typically represents concepts
28 /// in Dart. Backend elements are what we generate, these may include elements 26 /// in Dart. Backend elements are what we generate, these may include elements
29 /// that do not correspond to a Dart concept, such as closure classes. 27 /// that do not correspond to a Dart concept, such as closure classes.
30 /// 28 ///
31 /// Querying for the frontend element for a backend-only element throws an 29 /// Querying for the frontend element for a backend-only element throws an
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 final Entity typeDeclaration; 511 final Entity typeDeclaration;
514 final String name; 512 final String name;
515 final int index; 513 final int index;
516 514
517 JTypeVariable(this.typeDeclaration, this.name, this.index); 515 JTypeVariable(this.typeDeclaration, this.name, this.index);
518 516
519 String toString() => 517 String toString() =>
520 '${jsElementPrefix}type_variable(${typeDeclaration.name}.$name)'; 518 '${jsElementPrefix}type_variable(${typeDeclaration.name}.$name)';
521 } 519 }
522 520
523 class JsClosedWorld extends ClosedWorldBase { 521 class JsClosedWorld extends ClosedWorldBase with KernelClosedWorldMixin {
524 JsClosedWorld( 522 final JsKernelToElementMap elementMap;
523
524 JsClosedWorld(this.elementMap,
525 {ElementEnvironment elementEnvironment, 525 {ElementEnvironment elementEnvironment,
526 DartTypes dartTypes, 526 DartTypes dartTypes,
527 CommonElements commonElements, 527 CommonElements commonElements,
528 ConstantSystem constantSystem, 528 ConstantSystem constantSystem,
529 NativeData nativeData, 529 NativeData nativeData,
530 InterceptorData interceptorData, 530 InterceptorData interceptorData,
531 BackendUsage backendUsage, 531 BackendUsage backendUsage,
532 ResolutionWorldBuilder resolutionWorldBuilder, 532 ResolutionWorldBuilder resolutionWorldBuilder,
533 Set<ClassEntity> implementedClasses, 533 Set<ClassEntity> implementedClasses,
534 FunctionSet functionSet, 534 Iterable<MemberEntity> liveInstanceMembers,
535 Set<TypedefElement> allTypedefs, 535 Set<TypedefElement> allTypedefs,
536 Map<ClassEntity, Set<ClassEntity>> mixinUses, 536 Map<ClassEntity, Set<ClassEntity>> mixinUses,
537 Map<ClassEntity, Set<ClassEntity>> typesImplementedBySubclasses, 537 Map<ClassEntity, Set<ClassEntity>> typesImplementedBySubclasses,
538 Map<ClassEntity, ClassHierarchyNode> classHierarchyNodes, 538 Map<ClassEntity, ClassHierarchyNode> classHierarchyNodes,
539 Map<ClassEntity, ClassSet> classSets}) 539 Map<ClassEntity, ClassSet> classSets})
540 : super( 540 : super(
541 elementEnvironment: elementEnvironment, 541 elementEnvironment,
542 dartTypes: dartTypes, 542 dartTypes,
543 commonElements: commonElements, 543 commonElements,
544 constantSystem: constantSystem, 544 constantSystem,
545 nativeData: nativeData, 545 nativeData,
546 interceptorData: interceptorData, 546 interceptorData,
547 backendUsage: backendUsage, 547 backendUsage,
548 resolutionWorldBuilder: resolutionWorldBuilder, 548 resolutionWorldBuilder,
549 implementedClasses: implementedClasses, 549 implementedClasses,
550 functionSet: functionSet, 550 liveInstanceMembers,
551 allTypedefs: allTypedefs, 551 allTypedefs,
552 mixinUses: mixinUses, 552 mixinUses,
553 typesImplementedBySubclasses: typesImplementedBySubclasses, 553 typesImplementedBySubclasses,
554 classHierarchyNodes: classHierarchyNodes, 554 classHierarchyNodes,
555 classSets: classSets); 555 classSets);
556
557 @override
558 bool hasConcreteMatch(ClassEntity cls, Selector selector,
559 {ClassEntity stopAtSuperclass}) {
560 throw new UnimplementedError('JsClosedWorld.hasConcreteMatch');
561 }
562 556
563 @override 557 @override
564 void registerClosureClass(ClassElement cls) { 558 void registerClosureClass(ClassElement cls) {
565 throw new UnimplementedError('JsClosedWorld.registerClosureClass'); 559 throw new UnimplementedError('JsClosedWorld.registerClosureClass');
566 } 560 }
567
568 @override
569 bool hasElementIn(ClassEntity cls, Selector selector, Entity element) {
570 throw new UnimplementedError('JsClosedWorld.hasElementIn');
571 }
572
573 @override
574 bool checkEntity(Entity element) => true;
575
576 @override
577 bool checkClass(ClassEntity cls) => true;
578
579 @override
580 bool checkInvariants(ClassEntity cls, {bool mustBeInstantiated: true}) {
581 return true;
582 }
583
584 @override
585 OrderedTypeSet getOrderedTypeSet(ClassEntity cls) {
586 throw new UnimplementedError('JsClosedWorld.getOrderedTypeSet');
587 }
588
589 @override
590 int getHierarchyDepth(ClassEntity cls) {
591 throw new UnimplementedError('JsClosedWorld.getHierarchyDepth');
592 }
593
594 @override
595 ClassEntity getSuperClass(ClassEntity cls) {
596 throw new UnimplementedError('JsClosedWorld.getSuperClass');
597 }
598
599 @override
600 Iterable<ClassEntity> getInterfaces(ClassEntity cls) {
601 throw new UnimplementedError('JsClosedWorld.getInterfaces');
602 }
603
604 @override
605 ClassEntity getAppliedMixin(ClassEntity cls) {
606 throw new UnimplementedError('JsClosedWorld.getAppliedMixin');
607 }
608
609 @override
610 bool isNamedMixinApplication(ClassEntity cls) {
611 throw new UnimplementedError('JsClosedWorld.isNamedMixinApplication');
612 }
613 } 561 }
614 562
615 class JsNativeData implements NativeData { 563 class JsNativeData implements NativeData {
616 final JsToFrontendMap _map; 564 final JsToFrontendMap _map;
617 final NativeData _nativeData; 565 final NativeData _nativeData;
618 566
619 JsNativeData(this._map, this._nativeData); 567 JsNativeData(this._map, this._nativeData);
620 568
621 @override 569 @override
622 bool isNativeClass(ClassEntity element) { 570 bool isNativeClass(ClassEntity element) {
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 721
774 @override 722 @override
775 bool get isFunctionApplyUsed => _backendUsage.isFunctionApplyUsed; 723 bool get isFunctionApplyUsed => _backendUsage.isFunctionApplyUsed;
776 724
777 @override 725 @override
778 bool get isMirrorsUsed => _backendUsage.isMirrorsUsed; 726 bool get isMirrorsUsed => _backendUsage.isMirrorsUsed;
779 727
780 @override 728 @override
781 bool get isNoSuchMethodUsed => _backendUsage.isNoSuchMethodUsed; 729 bool get isNoSuchMethodUsed => _backendUsage.isNoSuchMethodUsed;
782 } 730 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_model/js_strategy.dart » ('j') | pkg/compiler/lib/src/kernel/element_map_impl.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698