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

Unified Diff: dart/lib/compiler/implementation/elements/elements.dart

Issue 10823311: Clean up state handling in ClassElement. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 8 years, 4 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/lib/compiler/implementation/elements/elements.dart
diff --git a/dart/lib/compiler/implementation/elements/elements.dart b/dart/lib/compiler/implementation/elements/elements.dart
index 4e4c74d73c89f3cdec77ea935a97eaeac7ff11ed..6df42845ab3678a86fcb75bd10ec8787d244dac5 100644
--- a/dart/lib/compiler/implementation/elements/elements.dart
+++ b/dart/lib/compiler/implementation/elements/elements.dart
@@ -993,7 +993,7 @@ abstract class TypeDeclarationElement implements Element {
// Create types and elements for type variable.
var arguments = new LinkBuilder<Type>();
- for (Link<Node> link = parameters.nodes; !link.isEmpty(); link = link.tail) {
+ for (Link link = parameters.nodes; !link.isEmpty(); link = link.tail) {
TypeVariable node = link.head;
SourceString variableName = node.name.source;
TypeVariableElement variableElement =
@@ -1018,22 +1018,8 @@ class ClassElement extends ScopeContainerElement
Type defaultClass;
Link<Type> interfaces;
SourceString nativeName;
-
- int _supertypeLoadState = STATE_NOT_STARTED;
- int get supertypeLoadState() => _supertypeLoadState;
- void set supertypeLoadState(int state) {
- assert(state == _supertypeLoadState + 1);
- assert(state <= STATE_DONE);
- _supertypeLoadState = state;
- }
-
- int _resolutionState = STATE_NOT_STARTED;
- int get resolutionState() => _resolutionState;
- void set resolutionState(int state) {
- assert(state == _resolutionState + 1);
- assert(state <= STATE_DONE);
- _resolutionState = state;
- }
+ int supertypeLoadState;
+ int resolutionState;
// backendMembers are members that have been added by the backend to simplify
// compilation. They don't have any user-side counter-part.
@@ -1044,8 +1030,10 @@ class ClassElement extends ScopeContainerElement
// Lazily applied patch of class members.
ClassElement patch = null;
- ClassElement(SourceString name, Element enclosing, this.id)
- : super(name, ElementKind.CLASS, enclosing);
+ ClassElement(SourceString name, Element enclosing, this.id, int initialState)
+ : supertypeLoadState = initialState,
+ resolutionState = initialState,
+ super(name, ElementKind.CLASS, enclosing);
InterfaceType computeType(compiler) {
if (type == null) {
« no previous file with comments | « dart/lib/compiler/implementation/closure.dart ('k') | dart/lib/compiler/implementation/scanner/class_element_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698