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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/dart_types.dart

Issue 233233002: Copy types object when using a cached compiler. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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: dart/sdk/lib/_internal/compiler/implementation/dart_types.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/dart_types.dart b/dart/sdk/lib/_internal/compiler/implementation/dart_types.dart
index 4177c5bb107c83e04eb7176ad23924d010f4b179..17794f9d6e79c8e6bddda99321484c5ffbf00220 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/dart_types.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/dart_types.dart
@@ -1186,20 +1186,23 @@ class Types {
VoidType voidType = new VoidType(new VoidElementX(library));
DynamicType dynamicType = new DynamicType(dynamicElement);
dynamicElement.rawTypeCache = dynamicElement.thisTypeCache = dynamicType;
- MoreSpecificVisitor moreSpecificVisitor =
- new MoreSpecificVisitor(compiler, dynamicType, voidType);
- SubtypeVisitor subtypeVisitor =
- new SubtypeVisitor(compiler, dynamicType, voidType);
- PotentialSubtypeVisitor potentialSubtypeVisitor =
- new PotentialSubtypeVisitor(compiler, dynamicType, voidType);
-
- return new Types.internal(compiler, voidType, dynamicType,
- moreSpecificVisitor, subtypeVisitor, potentialSubtypeVisitor);
+ return new Types.internal(compiler, voidType, dynamicType);
}
- Types.internal(this.compiler, this.voidType, this.dynamicType,
- this.moreSpecificVisitor, this.subtypeVisitor,
- this.potentialSubtypeVisitor);
+ Types.internal(Compiler compiler, VoidType voidType, DynamicType dynamicType)
+ : this.compiler = compiler,
+ this.voidType = voidType,
+ this.dynamicType = dynamicType,
+ this.moreSpecificVisitor =
+ new MoreSpecificVisitor(compiler, dynamicType, voidType),
+ this.subtypeVisitor =
+ new SubtypeVisitor(compiler, dynamicType, voidType),
+ this.potentialSubtypeVisitor =
+ new PotentialSubtypeVisitor(compiler, dynamicType, voidType);
+
+ Types copy(Compiler compiler) {
+ return new Types.internal(compiler, voidType, dynamicType);
+ }
/** Returns true if [t] is more specific than [s]. */
bool isMoreSpecific(DartType t, DartType s) {
« no previous file with comments | « no previous file | dart/tests/compiler/dart2js/memory_compiler.dart » ('j') | dart/tests/compiler/dart2js/memory_compiler.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698