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

Unified Diff: pkg/compiler/lib/src/js_emitter/type_test_registry.dart

Issue 2938193003: Revert "Towards compiling Hello World!" and "Compile and run Hello World!" (Closed)
Patch Set: Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/js_emitter/type_test_registry.dart
diff --git a/pkg/compiler/lib/src/js_emitter/type_test_registry.dart b/pkg/compiler/lib/src/js_emitter/type_test_registry.dart
index c2317f15993abf628ebe8a4c1d987850aec40ce2..1cf8e1d51dbe91dd8d0cc6270433e01e8d6b5349 100644
--- a/pkg/compiler/lib/src/js_emitter/type_test_registry.dart
+++ b/pkg/compiler/lib/src/js_emitter/type_test_registry.dart
@@ -8,7 +8,12 @@ import '../common.dart';
import '../common_elements.dart';
import '../elements/elements.dart' show ClassElement, MethodElement;
import '../elements/entities.dart';
-import '../elements/resolution_types.dart' show ResolutionFunctionType;
+import '../elements/resolution_types.dart'
+ show
+ ResolutionDartType,
+ ResolutionFunctionType,
+ ResolutionInterfaceType,
+ ResolutionTypeVariableType;
import '../elements/types.dart';
import '../js_backend/runtime_types.dart'
show
@@ -29,28 +34,26 @@ class TypeTestRegistry {
* `x is Set<String>` then the ClassElement `Set` will occur once in
* [checkedClasses].
*/
- Set<ClassEntity> checkedClasses;
+ Set<ClassElement> checkedClasses;
/**
* The set of function types that checked, both explicity through tests of
* typedefs and implicitly through type annotations in checked mode.
*/
- Set<FunctionType> checkedFunctionTypes;
+ Set<ResolutionFunctionType> checkedFunctionTypes;
/// After [computeNeededClasses] this set only contains classes that are only
/// used for RTI.
Set<ClassEntity> _rtiNeededClasses;
- Iterable<ClassEntity> cachedClassesUsingTypeVariableTests;
+ Iterable<ClassElement> cachedClassesUsingTypeVariableTests;
- Iterable<ClassEntity> get classesUsingTypeVariableTests {
+ Iterable<ClassElement> get classesUsingTypeVariableTests {
if (cachedClassesUsingTypeVariableTests == null) {
- cachedClassesUsingTypeVariableTests = new List<ClassEntity>.from(
- _codegenWorldBuilder.isChecks
- .where((DartType t) =>
- t is TypeVariableType &&
- t.element.typeDeclaration is ClassEntity)
- .map((dynamic v) => v.element.typeDeclaration));
+ cachedClassesUsingTypeVariableTests = _codegenWorldBuilder.isChecks
+ .where((ResolutionDartType t) => t is ResolutionTypeVariableType)
+ .map((ResolutionTypeVariableType v) => v.element.enclosingClass)
+ .toList();
}
return cachedClassesUsingTypeVariableTests;
}
@@ -183,12 +186,13 @@ class TypeTestRegistry {
_codegenWorldBuilder, classesUsingTypeVariableTests);
_rtiChecks = rtiChecksBuilder.computeRequiredChecks(_codegenWorldBuilder);
- checkedClasses = new Set<ClassEntity>();
- checkedFunctionTypes = new Set<FunctionType>();
- _codegenWorldBuilder.isChecks.forEach((DartType t) {
- if (t is InterfaceType) {
+ checkedClasses = new Set<ClassElement>();
+ checkedFunctionTypes = new Set<ResolutionFunctionType>();
+ _codegenWorldBuilder.isChecks.forEach((_t) {
+ ResolutionDartType t = _t;
+ if (t is ResolutionInterfaceType) {
checkedClasses.add(t.element);
- } else if (t is FunctionType) {
+ } else if (t is ResolutionFunctionType) {
checkedFunctionTypes.add(t);
}
});
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/startup_emitter/model_emitter.dart ('k') | pkg/compiler/lib/src/js_model/js_strategy.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698