OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 library rasta.kernel; | 5 library rasta.kernel; |
6 | 6 |
7 import 'dart:async' show | 7 import 'dart:async' show |
8 Future; | 8 Future; |
9 | 9 |
10 import 'dart:collection' show | 10 import 'dart:collection' show |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 } | 591 } |
592 | 592 |
593 bool get isInternalStateConsistent { | 593 bool get isInternalStateConsistent { |
594 if (workQueue.isNotEmpty) { | 594 if (workQueue.isNotEmpty) { |
595 print("Kernel workQueue isn't empty."); | 595 print("Kernel workQueue isn't empty."); |
596 return false; | 596 return false; |
597 } | 597 } |
598 return compiler.isInternalStateConsistent; | 598 return compiler.isInternalStateConsistent; |
599 } | 599 } |
600 | 600 |
601 ir.Procedure getUnresolvedConstructorBuilder() { | 601 ir.Procedure getDartCoreMethod(String name) { |
602 LibraryElement internal = | 602 LibraryElement library = |
603 compiler.libraryLoader.lookupLibrary(Uri.parse("dart:core")); | 603 compiler.libraryLoader.lookupLibrary(Uri.parse("dart:core")); |
604 FunctionElement function = | 604 Element function = library.implementation.localLookup(name); |
605 internal.implementation.localLookup("_unresolvedConstructorError"); | |
606 return functionToIr(function); | 605 return functionToIr(function); |
607 } | 606 } |
608 | 607 |
609 ir.Procedure getMalformedTypeErrorBuilder() { | 608 ir.Procedure getMalformedTypeErrorBuilder() { |
610 LibraryElement internal = | 609 return getDartCoreMethod('_malformedTypeError'); |
611 compiler.libraryLoader.lookupLibrary(Uri.parse("dart:core")); | 610 } |
612 FunctionElement function = | 611 |
613 internal.implementation.localLookup("_malformedTypeError"); | 612 ir.Procedure getUnresolvedConstructorBuilder() { |
614 return functionToIr(function); | 613 return getDartCoreMethod('_unresolvedConstructorError'); |
| 614 } |
| 615 |
| 616 ir.Procedure getUnresolvedStaticGetterBuilder() { |
| 617 return getDartCoreMethod('_unresolvedStaticGetterError'); |
| 618 } |
| 619 |
| 620 ir.Procedure getUnresolvedStaticSetterBuilder() { |
| 621 return getDartCoreMethod('_unresolvedStaticSetterError'); |
| 622 } |
| 623 |
| 624 ir.Procedure getUnresolvedStaticMethodBuilder() { |
| 625 return getDartCoreMethod('_unresolvedStaticMethodError'); |
| 626 } |
| 627 |
| 628 ir.Procedure getUnresolvedTopLevelGetterBuilder() { |
| 629 return getDartCoreMethod('_unresolvedTopLevelGetterError'); |
| 630 } |
| 631 |
| 632 ir.Procedure getUnresolvedTopLevelSetterBuilder() { |
| 633 return getDartCoreMethod('_unresolvedTopLevelSetterError'); |
| 634 } |
| 635 |
| 636 ir.Procedure getUnresolvedTopLevelMethodBuilder() { |
| 637 return getDartCoreMethod('_unresolvedTopLevelMethodError'); |
| 638 } |
| 639 |
| 640 ir.Procedure getUnresolvedSuperGetterBuilder() { |
| 641 return getDartCoreMethod('_unresolvedSuperGetterError'); |
| 642 } |
| 643 |
| 644 ir.Procedure getUnresolvedSuperSetterBuilder() { |
| 645 return getDartCoreMethod('_unresolvedSuperSetterError'); |
| 646 } |
| 647 |
| 648 ir.Procedure getUnresolvedSuperMethodBuilder() { |
| 649 return getDartCoreMethod('_unresolvedSuperMethodError'); |
| 650 } |
| 651 |
| 652 ir.Procedure getGenericNoSuchMethodBuilder() { |
| 653 return getDartCoreMethod('_genericNoSuchMethod'); |
615 } | 654 } |
616 } | 655 } |
617 | 656 |
618 class ConstructorTarget { | 657 class ConstructorTarget { |
619 final ConstructorElement element; | 658 final ConstructorElement element; |
620 final DartType type; | 659 final DartType type; |
621 | 660 |
622 ConstructorTarget(this.element, this.type); | 661 ConstructorTarget(this.element, this.type); |
623 | 662 |
624 String toString() => "ConstructorTarget($element, $type)"; | 663 String toString() => "ConstructorTarget($element, $type)"; |
625 } | 664 } |
OLD | NEW |