Version 0.5.0.0 .

svn merge -r 21520:21754 https://dart.googlecode.com/svn/branches/bleeding_edge trunk

git-svn-id: http://dart.googlecode.com/svn/trunk@21768 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/compiler/build.xml b/compiler/build.xml
index 99e2bb6..7e77b0e 100644
--- a/compiler/build.xml
+++ b/compiler/build.xml
@@ -79,7 +79,8 @@
            fork="true"
            debug="true"
            source="1.6"
-           target="1.6">
+           target="1.6"
+           encoding="UTF-8">
       <classpath refid="classpath.compile"/>
     </javac>
     <!--
@@ -101,7 +102,8 @@
            fork="true"
            debug="true"
            source="1.6"
-           target="1.6">
+           target="1.6"
+           encoding="UTF-8">
       <classpath refid="classpath.compile.tests"/>
     </javac>
     <!--
diff --git a/pkg/analyzer_experimental/example/resolver_driver.dart b/pkg/analyzer_experimental/example/resolver_driver.dart
index d28d964..c3a9ef7 100644
--- a/pkg/analyzer_experimental/example/resolver_driver.dart
+++ b/pkg/analyzer_experimental/example/resolver_driver.dart
@@ -7,7 +7,8 @@
 import 'package:analyzer_experimental/src/generated/java_io.dart';
 import 'package:analyzer_experimental/src/generated/source_io.dart';
 import 'package:analyzer_experimental/src/generated/ast.dart';
-import 'package:analyzer_experimental/src/generated/sdk.dart';
+import 'package:analyzer_experimental/src/generated/sdk.dart' show DartSdk;
+import 'package:analyzer_experimental/src/generated/sdk_io.dart' show DirectoryBasedDartSdk;
 import 'package:analyzer_experimental/src/generated/element.dart';
 import 'package:analyzer_experimental/src/generated/engine.dart';
 
@@ -23,7 +24,7 @@
   }
 
   JavaSystemIO.setProperty("com.google.dart.sdk", args[0]);
-  DartSdk sdk = DartSdk.defaultSdk;
+  DartSdk sdk = DirectoryBasedDartSdk.defaultSdk;
 
   AnalysisContext context = AnalysisEngine.instance.createAnalysisContext();
   context.sourceFactory = new SourceFactory.con2([new DartUriResolver(sdk), new FileUriResolver()]);
diff --git a/pkg/analyzer_experimental/lib/src/generated/ast.dart b/pkg/analyzer_experimental/lib/src/generated/ast.dart
index 96e7662..6f7fd37 100644
--- a/pkg/analyzer_experimental/lib/src/generated/ast.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/ast.dart
@@ -89,8 +89,8 @@
    * range
    */
   int get offset {
-    Token beginToken3 = beginToken;
-    if (beginToken3 == null) {
+    Token beginToken2 = beginToken;
+    if (beginToken2 == null) {
       return -1;
     }
     return beginToken.offset;
@@ -275,6 +275,7 @@
   R visitMethodDeclaration(MethodDeclaration node);
   R visitMethodInvocation(MethodInvocation node);
   R visitNamedExpression(NamedExpression node);
+  R visitNativeFunctionBody(NativeFunctionBody node);
   R visitNullLiteral(NullLiteral node);
   R visitParenthesizedExpression(ParenthesizedExpression node);
   R visitPartDirective(PartDirective node);
@@ -474,7 +475,7 @@
  * metadata ::=
  * annotation
  * annotation ::=
- * '@' {@link Identifier qualified} (‘.’ {@link SimpleIdentifier identifier})? {@link ArgumentList arguments}?
+ * '@' {@link Identifier qualified} ('.' {@link SimpleIdentifier identifier})? {@link ArgumentList arguments}?
  * </pre>
  * @coverage dart.engine.ast
  */
@@ -664,8 +665,8 @@
    * Set the identifier representing the argument being tested to the given identifier.
    * @param identifier the identifier representing the argument being tested
    */
-  void set identifier(SimpleIdentifier identifier7) {
-    this._identifier = becomeParentOf(identifier7);
+  void set identifier(SimpleIdentifier identifier2) {
+    this._identifier = becomeParentOf(identifier2);
   }
   /**
    * Set the token representing the question mark to the given token.
@@ -974,8 +975,8 @@
    * Set the token representing the 'assert' keyword to the given token.
    * @param keyword the token representing the 'assert' keyword
    */
-  void set keyword(Token keyword3) {
-    this._keyword = keyword3;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
   /**
    * Set the left parenthesis to the given token.
@@ -1074,8 +1075,8 @@
    * Set the element associated with the operator to the given element.
    * @param element the element associated with the operator
    */
-  void set element(MethodElement element3) {
-    this._element = element3;
+  void set element(MethodElement element2) {
+    this._element = element2;
   }
   /**
    * Return the expression used to compute the left hand side.
@@ -1175,8 +1176,8 @@
    * Set the element associated with the operator to the given element.
    * @param element the element associated with the operator
    */
-  void set element(MethodElement element4) {
-    this._element = element4;
+  void set element(MethodElement element2) {
+    this._element = element2;
   }
   /**
    * Set the expression used to compute the left operand to the given expression.
@@ -1189,8 +1190,8 @@
    * Set the binary operator being applied to the given operator.
    * @return the binary operator being applied
    */
-  void set operator(Token operator3) {
-    this._operator = operator3;
+  void set operator(Token operator2) {
+    this._operator = operator2;
   }
   /**
    * Set the expression used to compute the right operand to the given expression.
@@ -1380,8 +1381,8 @@
    * Set the value of the literal to the given value.
    * @param value the value of the literal
    */
-  void set value(bool value4) {
-    this._value = value4;
+  void set value(bool value2) {
+    this._value = value2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
   }
@@ -1447,8 +1448,8 @@
    * Set the token representing the 'break' keyword to the given token.
    * @param keyword the token representing the 'break' keyword
    */
-  void set keyword(Token keyword4) {
-    this._keyword = keyword4;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
   /**
    * Set the label associated with the statement to the given identifier.
@@ -1461,8 +1462,8 @@
    * Set the semicolon terminating the statement to the given token.
    * @param semicolon the semicolon terminating the statement
    */
-  void set semicolon(Token semicolon3) {
-    this._semicolon = semicolon3;
+  void set semicolon(Token semicolon2) {
+    this._semicolon = semicolon2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     safelyVisitChild(_label, visitor);
@@ -1913,22 +1914,22 @@
    * Set the extends clause for this class to the given clause.
    * @param extendsClause the extends clause for this class
    */
-  void set extendsClause(ExtendsClause extendsClause3) {
-    this._extendsClause = becomeParentOf(extendsClause3);
+  void set extendsClause(ExtendsClause extendsClause2) {
+    this._extendsClause = becomeParentOf(extendsClause2);
   }
   /**
    * Set the implements clause for the class to the given clause.
    * @param implementsClause the implements clause for the class
    */
-  void set implementsClause(ImplementsClause implementsClause4) {
-    this._implementsClause = becomeParentOf(implementsClause4);
+  void set implementsClause(ImplementsClause implementsClause2) {
+    this._implementsClause = becomeParentOf(implementsClause2);
   }
   /**
    * Set the left curly bracket to the given token.
    * @param leftBracket the left curly bracket
    */
-  void set leftBracket(Token leftBracket3) {
-    this._leftBracket = leftBracket3;
+  void set leftBracket(Token leftBracket2) {
+    this._leftBracket = leftBracket2;
   }
   /**
    * Set the name of the class being declared to the given identifier.
@@ -1941,8 +1942,8 @@
    * Set the right curly bracket to the given token.
    * @param rightBracket the right curly bracket
    */
-  void set rightBracket(Token rightBracket3) {
-    this._rightBracket = rightBracket3;
+  void set rightBracket(Token rightBracket2) {
+    this._rightBracket = rightBracket2;
   }
   /**
    * Set the type parameters for the class to the given list of type parameters.
@@ -1955,8 +1956,8 @@
    * Set the with clause for the class to the given clause.
    * @param withClause the with clause for the class
    */
-  void set withClause(WithClause withClause4) {
-    this._withClause = becomeParentOf(withClause4);
+  void set withClause(WithClause withClause2) {
+    this._withClause = becomeParentOf(withClause2);
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     safelyVisitChild(documentationComment, visitor);
@@ -2114,29 +2115,29 @@
    * Set the token for the 'abstract' keyword to the given token.
    * @param abstractKeyword the token for the 'abstract' keyword
    */
-  void set abstractKeyword(Token abstractKeyword3) {
-    this._abstractKeyword = abstractKeyword3;
+  void set abstractKeyword(Token abstractKeyword2) {
+    this._abstractKeyword = abstractKeyword2;
   }
   /**
    * Set the token for the '=' separating the name from the definition to the given token.
    * @param equals the token for the '=' separating the name from the definition
    */
-  void set equals(Token equals4) {
-    this._equals = equals4;
+  void set equals(Token equals2) {
+    this._equals = equals2;
   }
   /**
    * Set the implements clause for this class to the given implements clause.
    * @param implementsClause the implements clause for this class
    */
-  void set implementsClause(ImplementsClause implementsClause5) {
-    this._implementsClause = becomeParentOf(implementsClause5);
+  void set implementsClause(ImplementsClause implementsClause2) {
+    this._implementsClause = becomeParentOf(implementsClause2);
   }
   /**
    * Set the name of the class being declared to the given identifier.
    * @param name the name of the class being declared
    */
-  void set name(SimpleIdentifier name3) {
-    this._name = becomeParentOf(name3);
+  void set name(SimpleIdentifier name2) {
+    this._name = becomeParentOf(name2);
   }
   /**
    * Set the name of the superclass of the class being declared to the given name.
@@ -2149,15 +2150,15 @@
    * Set the type parameters for the class to the given list of parameters.
    * @param typeParameters the type parameters for the class
    */
-  void set typeParameters(TypeParameterList typeParameters3) {
-    this._typeParameters = becomeParentOf(typeParameters3);
+  void set typeParameters(TypeParameterList typeParameters2) {
+    this._typeParameters = becomeParentOf(typeParameters2);
   }
   /**
    * Set the with clause for this class to the given with clause.
    * @param withClause the with clause for this class
    */
-  void set withClause(WithClause withClause5) {
-    this._withClause = becomeParentOf(withClause5);
+  void set withClause(WithClause withClause2) {
+    this._withClause = becomeParentOf(withClause2);
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     super.visitChildren(visitor);
@@ -2206,8 +2207,8 @@
    * @param keyword the keyword specifying what kind of processing is to be done on the imported
    * names
    */
-  void set keyword(Token keyword5) {
-    this._keyword = keyword5;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
 }
 /**
@@ -2294,6 +2295,11 @@
    */
   NodeList<CommentReference> get references => _references;
   /**
+   * Return the tokens representing the comment.
+   * @return the tokens representing the comment
+   */
+  List<Token> get tokens => _tokens;
+  /**
    * Return {@code true} if this is a block comment.
    * @return {@code true} if this is a block comment
    */
@@ -2316,7 +2322,7 @@
  * The enumeration {@code CommentType} encodes all the different types of comments that are
  * recognized by the parser.
  */
-class CommentType {
+class CommentType implements Comparable<CommentType> {
   /**
    * An end-of-line comment.
    */
@@ -2335,6 +2341,7 @@
   int get ordinal => __ordinal;
   CommentType(this.__name, this.__ordinal) {
   }
+  int compareTo(CommentType other) => __ordinal - other.__ordinal;
   String toString() => __name;
 }
 /**
@@ -2387,8 +2394,8 @@
    * Set the identifier being referenced to the given identifier.
    * @param identifier the identifier being referenced
    */
-  void set identifier(Identifier identifier24) {
-    identifier24 = becomeParentOf(identifier24);
+  void set identifier(Identifier identifier2) {
+    identifier2 = becomeParentOf(identifier2);
   }
   /**
    * Set the token representing the 'new' keyword to the given token.
@@ -2520,11 +2527,11 @@
     }
   }
   int get length {
-    Token endToken3 = endToken;
-    if (endToken3 == null) {
+    Token endToken2 = endToken;
+    if (endToken2 == null) {
       return 0;
     }
-    return endToken3.offset + endToken3.length;
+    return endToken2.offset + endToken2.length;
   }
   /**
    * Get the {@link LineInfo} object for this compilation unit.
@@ -2554,8 +2561,8 @@
    * Set the element associated with this compilation unit to the given element.
    * @param element the element associated with this compilation unit
    */
-  void set element(CompilationUnitElement element5) {
-    this._element = element5;
+  void set element(CompilationUnitElement element2) {
+    this._element = element2;
   }
   /**
    * Set the {@link LineInfo} object for this compilation unit.
@@ -2566,16 +2573,16 @@
   }
   /**
    * Called to cache the parsing errors when the unit is parsed.
-   * @param errors an array of parsing errors, if <code>null</code> is passed, the error array is
-   * set to an empty array, {@link AnalysisError#NO_ERRORS}
+   * @param errors an array of parsing errors, if {@code null} is passed, the error array is set to
+   * an empty array, {@link AnalysisError#NO_ERRORS}
    */
   void set parsingErrors(List<AnalysisError> errors) {
     _parsingErrors = errors == null ? AnalysisError.NO_ERRORS : errors;
   }
   /**
    * Called to cache the resolution errors when the unit is resolved.
-   * @param errors an array of resolution errors, if <code>null</code> is passed, the error array is
-   * set to an empty array, {@link AnalysisError#NO_ERRORS}
+   * @param errors an array of resolution errors, if {@code null} is passed, the error array is set
+   * to an empty array, {@link AnalysisError#NO_ERRORS}
    */
   void set resolutionErrors(List<AnalysisError> errors) {
     _resolutionErrors = errors == null ? AnalysisError.NO_ERRORS : errors;
@@ -2753,8 +2760,8 @@
    * Set the token used to separate the condition from the then expression to the given token.
    * @param question the token used to separate the condition from the then expression
    */
-  void set question(Token question3) {
-    this._question = question3;
+  void set question(Token question2) {
+    this._question = question2;
   }
   /**
    * Set the expression that is executed if the condition evaluates to {@code true} to the given
@@ -2980,8 +2987,8 @@
    * Set the element associated with this constructor to the given element.
    * @param element the element associated with this constructor
    */
-  void set element(ConstructorElement element6) {
-    this._element = element6;
+  void set element(ConstructorElement element2) {
+    this._element = element2;
   }
   /**
    * Set the token for the 'external' keyword to the given token.
@@ -3015,8 +3022,8 @@
    * Set the token for the period before the constructor name to the given token.
    * @param period the token for the period before the constructor name
    */
-  void set period(Token period3) {
-    this._period = period3;
+  void set period(Token period2) {
+    this._period = period2;
   }
   /**
    * Set the name of the constructor to which this constructor will be redirected to the given
@@ -3168,16 +3175,16 @@
    * Set the token for the equal sign between the field name and the expression to the given token.
    * @param equals the token for the equal sign between the field name and the expression
    */
-  void set equals(Token equals5) {
-    this._equals = equals5;
+  void set equals(Token equals2) {
+    this._equals = equals2;
   }
   /**
    * Set the expression computing the value to which the field will be initialized to the given
    * expression.
    * @param expression the expression computing the value to which the field will be initialized
    */
-  void set expression(Expression expression3) {
-    this._expression = becomeParentOf(expression3);
+  void set expression(Expression expression2) {
+    this._expression = becomeParentOf(expression2);
   }
   /**
    * Set the name of the field being initialized to the given identifier.
@@ -3190,15 +3197,15 @@
    * Set the token for the 'this' keyword to the given token.
    * @param keyword the token for the 'this' keyword
    */
-  void set keyword(Token keyword6) {
-    this._keyword = keyword6;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
   /**
    * Set the token for the period after the 'this' keyword to the given token.
    * @param period the token for the period after the 'this' keyword
    */
-  void set period(Token period4) {
-    this._period = period4;
+  void set period(Token period2) {
+    this._period = period2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     safelyVisitChild(_fieldName, visitor);
@@ -3295,22 +3302,22 @@
    * Set the element associated with this constructor name to the given element.
    * @param element the element associated with this constructor name
    */
-  void set element(ConstructorElement element7) {
-    this._element = element7;
+  void set element(ConstructorElement element2) {
+    this._element = element2;
   }
   /**
    * Set the name of the constructor to the given name.
    * @param name the name of the constructor
    */
-  void set name(SimpleIdentifier name4) {
-    this._name = becomeParentOf(name4);
+  void set name(SimpleIdentifier name2) {
+    this._name = becomeParentOf(name2);
   }
   /**
    * Return the token for the period before the constructor name to the given token.
    * @param period the token for the period before the constructor name
    */
-  void set period(Token period5) {
-    this._period = period5;
+  void set period(Token period2) {
+    this._period = period2;
   }
   /**
    * Set the name of the type defining the constructor to the given type name.
@@ -3385,8 +3392,8 @@
    * Set the token representing the 'continue' keyword to the given token.
    * @param keyword the token representing the 'continue' keyword
    */
-  void set keyword(Token keyword7) {
-    this._keyword = keyword7;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
   /**
    * Set the label associated with the statement to the given label.
@@ -3399,8 +3406,8 @@
    * Set the semicolon terminating the statement to the given token.
    * @param semicolon the semicolon terminating the statement
    */
-  void set semicolon(Token semicolon4) {
-    this._semicolon = semicolon4;
+  void set semicolon(Token semicolon2) {
+    this._semicolon = semicolon2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     safelyVisitChild(_label, visitor);
@@ -3479,11 +3486,11 @@
   DeclaredIdentifier({Comment comment, List<Annotation> metadata, Token keyword, TypeName type, SimpleIdentifier identifier}) : this.full(comment, metadata, keyword, type, identifier);
   accept(ASTVisitor visitor) => visitor.visitDeclaredIdentifier(this);
   LocalVariableElement get element {
-    SimpleIdentifier identifier11 = identifier;
-    if (identifier11 == null) {
+    SimpleIdentifier identifier2 = identifier;
+    if (identifier2 == null) {
       return null;
     }
-    return identifier11.element as LocalVariableElement;
+    return identifier2.element as LocalVariableElement;
   }
   Token get endToken => _identifier.endToken;
   /**
@@ -3518,8 +3525,8 @@
    * Set the token representing either the 'final', 'const' or 'var' keyword to the given token.
    * @param keyword the token representing either the 'final', 'const' or 'var' keyword
    */
-  void set keyword(Token keyword8) {
-    this._keyword = keyword8;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
   /**
    * Set the name of the declared type of the parameter to the given type name.
@@ -3656,8 +3663,8 @@
    * Set the token separating the parameter from the default value to the given token.
    * @param separator the token separating the parameter from the default value
    */
-  void set separator(Token separator3) {
-    this._separator = separator3;
+  void set separator(Token separator2) {
+    this._separator = separator2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     safelyVisitChild(_parameter, visitor);
@@ -3707,8 +3714,8 @@
    * Set the element associated with this directive to the given element.
    * @param element the element associated with this directive
    */
-  void set element(Element element8) {
-    this._element = element8;
+  void set element(Element element2) {
+    this._element = element2;
   }
 }
 /**
@@ -3855,8 +3862,8 @@
    * Set the semicolon terminating the statement to the given token.
    * @param semicolon the semicolon terminating the statement
    */
-  void set semicolon(Token semicolon5) {
-    this._semicolon = semicolon5;
+  void set semicolon(Token semicolon2) {
+    this._semicolon = semicolon2;
   }
   /**
    * Set the token representing the 'while' keyword to the given token.
@@ -3922,15 +3929,15 @@
    * Set the token representing the literal to the given token.
    * @param literal the token representing the literal
    */
-  void set literal(Token literal3) {
-    this._literal = literal3;
+  void set literal(Token literal2) {
+    this._literal = literal2;
   }
   /**
    * Set the value of the literal to the given value.
    * @param value the value of the literal
    */
-  void set value(double value5) {
-    this._value = value5;
+  void set value(double value2) {
+    this._value = value2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
   }
@@ -3974,8 +3981,8 @@
    * token.
    * @param semicolon the token representing the semicolon that marks the end of the function body
    */
-  void set semicolon(Token semicolon6) {
-    this._semicolon = semicolon6;
+  void set semicolon(Token semicolon2) {
+    this._semicolon = semicolon2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
   }
@@ -4017,8 +4024,8 @@
    * Set the semicolon terminating the statement to the given token.
    * @param semicolon the semicolon terminating the statement
    */
-  void set semicolon(Token semicolon7) {
-    this._semicolon = semicolon7;
+  void set semicolon(Token semicolon2) {
+    this._semicolon = semicolon2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
   }
@@ -4095,9 +4102,9 @@
    * will be bound
    */
   ParameterElement get parameterElement {
-    ASTNode parent3 = parent;
-    if (parent3 is ArgumentList) {
-      return ((parent3 as ArgumentList)).getParameterElementFor(this);
+    ASTNode parent2 = parent;
+    if (parent2 is ArgumentList) {
+      return ((parent2 as ArgumentList)).getParameterElementFor(this);
     }
     return null;
   }
@@ -4202,8 +4209,8 @@
    * Set the expression representing the body of the function to the given expression.
    * @param expression the expression representing the body of the function
    */
-  void set expression(Expression expression4) {
-    this._expression = becomeParentOf(expression4);
+  void set expression(Expression expression2) {
+    this._expression = becomeParentOf(expression2);
   }
   /**
    * Set the token introducing the expression that represents the body of the function to the given
@@ -4217,8 +4224,8 @@
    * Set the semicolon terminating the statement to the given token.
    * @param semicolon the semicolon terminating the statement
    */
-  void set semicolon(Token semicolon8) {
-    this._semicolon = semicolon8;
+  void set semicolon(Token semicolon2) {
+    this._semicolon = semicolon2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     safelyVisitChild(_expression, visitor);
@@ -4279,15 +4286,15 @@
    * Set the expression that comprises the statement to the given expression.
    * @param expression the expression that comprises the statement
    */
-  void set expression(Expression expression5) {
-    this._expression = becomeParentOf(expression5);
+  void set expression(Expression expression2) {
+    this._expression = becomeParentOf(expression2);
   }
   /**
    * Set the semicolon terminating the statement to the given token.
    * @param semicolon the semicolon terminating the statement
    */
-  void set semicolon(Token semicolon9) {
-    this._semicolon = semicolon9;
+  void set semicolon(Token semicolon2) {
+    this._semicolon = semicolon2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     safelyVisitChild(_expression, visitor);
@@ -4342,8 +4349,8 @@
    * Set the token representing the 'extends' keyword to the given token.
    * @param keyword the token representing the 'extends' keyword
    */
-  void set keyword(Token keyword9) {
-    this._keyword = keyword9;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
   /**
    * Set the name of the class that is being extended to the given name.
@@ -4430,15 +4437,15 @@
    * Set the token representing the 'static' keyword to the given token.
    * @param keyword the token representing the 'static' keyword
    */
-  void set keyword(Token keyword10) {
-    this._keyword = keyword10;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
   /**
    * Set the semicolon terminating the declaration to the given token.
    * @param semicolon the semicolon terminating the declaration
    */
-  void set semicolon(Token semicolon10) {
-    this._semicolon = semicolon10;
+  void set semicolon(Token semicolon2) {
+    this._semicolon = semicolon2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     super.visitChildren(visitor);
@@ -4541,15 +4548,15 @@
    * Set the token representing either the 'final', 'const' or 'var' keyword to the given token.
    * @param keyword the token representing either the 'final', 'const' or 'var' keyword
    */
-  void set keyword(Token keyword11) {
-    this._keyword = keyword11;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
   /**
    * Set the token representing the period to the given token.
    * @param period the token representing the period
    */
-  void set period(Token period6) {
-    this._period = period6;
+  void set period(Token period2) {
+    this._period = period2;
   }
   /**
    * Set the token representing the 'this' keyword to the given token.
@@ -4705,8 +4712,8 @@
    * Set the left parenthesis to the given token.
    * @param leftParenthesis the left parenthesis
    */
-  void set leftParenthesis(Token leftParenthesis3) {
-    this._leftParenthesis = leftParenthesis3;
+  void set leftParenthesis(Token leftParenthesis2) {
+    this._leftParenthesis = leftParenthesis2;
   }
   /**
    * Set the declaration of the loop variable to the given variable.
@@ -4719,8 +4726,8 @@
    * Set the right parenthesis to the given token.
    * @param rightParenthesis the right parenthesis
    */
-  void set rightParenthesis(Token rightParenthesis3) {
-    this._rightParenthesis = rightParenthesis3;
+  void set rightParenthesis(Token rightParenthesis2) {
+    this._rightParenthesis = rightParenthesis2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     safelyVisitChild(_loopVariable, visitor);
@@ -4880,8 +4887,8 @@
    * Set the body of the loop to the given statement.
    * @param body the body of the loop
    */
-  void set body(Statement body3) {
-    this._body = becomeParentOf(body3);
+  void set body(Statement body2) {
+    this._body = becomeParentOf(body2);
   }
   /**
    * Set the condition used to determine when to terminate the loop to the given expression.
@@ -4894,8 +4901,8 @@
    * Set the token representing the 'for' keyword to the given token.
    * @param forKeyword the token representing the 'for' keyword
    */
-  void set forKeyword(Token forKeyword3) {
-    this._forKeyword = forKeyword3;
+  void set forKeyword(Token forKeyword2) {
+    this._forKeyword = forKeyword2;
   }
   /**
    * Set the initialization expression to the given expression.
@@ -4908,8 +4915,8 @@
    * Set the left parenthesis to the given token.
    * @param leftParenthesis the left parenthesis
    */
-  void set leftParenthesis(Token leftParenthesis4) {
-    this._leftParenthesis = leftParenthesis4;
+  void set leftParenthesis(Token leftParenthesis2) {
+    this._leftParenthesis = leftParenthesis2;
   }
   /**
    * Set the semicolon separating the initializer and the condition to the given token.
@@ -4922,8 +4929,8 @@
    * Set the right parenthesis to the given token.
    * @param rightParenthesis the right parenthesis
    */
-  void set rightParenthesis(Token rightParenthesis4) {
-    this._rightParenthesis = rightParenthesis4;
+  void set rightParenthesis(Token rightParenthesis2) {
+    this._rightParenthesis = rightParenthesis2;
   }
   /**
    * Set the semicolon separating the condition and the updater to the given token.
@@ -4961,11 +4968,11 @@
    * @return the element representing this parameter
    */
   ParameterElement get element {
-    SimpleIdentifier identifier12 = identifier;
-    if (identifier12 == null) {
+    SimpleIdentifier identifier2 = identifier;
+    if (identifier2 == null) {
       return null;
     }
-    return identifier12.element as ParameterElement;
+    return identifier2.element as ParameterElement;
   }
   /**
    * Return the name of the parameter being declared.
@@ -5230,15 +5237,15 @@
    * Set the token representing the 'external' keyword to the given token.
    * @param externalKeyword the token representing the 'external' keyword
    */
-  void set externalKeyword(Token externalKeyword3) {
-    this._externalKeyword = externalKeyword3;
+  void set externalKeyword(Token externalKeyword2) {
+    this._externalKeyword = externalKeyword2;
   }
   /**
    * Set the function expression being wrapped to the given function expression.
    * @param functionExpression the function expression being wrapped
    */
-  void set functionExpression(FunctionExpression functionExpression3) {
-    functionExpression3 = becomeParentOf(functionExpression3);
+  void set functionExpression(FunctionExpression functionExpression2) {
+    functionExpression2 = becomeParentOf(functionExpression2);
   }
   /**
    * Set the name of the function to the given identifier.
@@ -5400,15 +5407,15 @@
    * Set the element associated with this function to the given element.
    * @param element the element associated with this function
    */
-  void set element(ExecutableElement element9) {
-    this._element = element9;
+  void set element(ExecutableElement element2) {
+    this._element = element2;
   }
   /**
    * Set the parameters associated with the function to the given list of parameters.
    * @param parameters the parameters associated with the function
    */
-  void set parameters(FormalParameterList parameters3) {
-    this._parameters = becomeParentOf(parameters3);
+  void set parameters(FormalParameterList parameters2) {
+    this._parameters = becomeParentOf(parameters2);
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     safelyVisitChild(_parameters, visitor);
@@ -5477,15 +5484,15 @@
    * Set the list of arguments to the method to the given list.
    * @param argumentList the list of arguments to the method
    */
-  void set argumentList(ArgumentList argumentList5) {
-    this._argumentList = becomeParentOf(argumentList5);
+  void set argumentList(ArgumentList argumentList2) {
+    this._argumentList = becomeParentOf(argumentList2);
   }
   /**
    * Set the element associated with the function being invoked to the given element.
    * @param element the element associated with the function being invoked
    */
-  void set element(ExecutableElement element10) {
-    this._element = element10;
+  void set element(ExecutableElement element2) {
+    this._element = element2;
   }
   /**
    * Set the expression producing the function being invoked to the given expression.
@@ -5583,15 +5590,15 @@
    * Set the name of the function type being declared to the given identifier.
    * @param name the name of the function type being declared
    */
-  void set name(SimpleIdentifier name5) {
-    this._name = becomeParentOf(name5);
+  void set name(SimpleIdentifier name2) {
+    this._name = becomeParentOf(name2);
   }
   /**
    * Set the parameters associated with the function type to the given list of parameters.
    * @param parameters the parameters associated with the function type
    */
-  void set parameters(FormalParameterList parameters4) {
-    this._parameters = becomeParentOf(parameters4);
+  void set parameters(FormalParameterList parameters2) {
+    this._parameters = becomeParentOf(parameters2);
   }
   /**
    * Set the name of the return type of the function type being defined to the given type name.
@@ -5604,8 +5611,8 @@
    * Set the type parameters for the function type to the given list of parameters.
    * @param typeParameters the type parameters for the function type
    */
-  void set typeParameters(TypeParameterList typeParameters4) {
-    this._typeParameters = becomeParentOf(typeParameters4);
+  void set typeParameters(TypeParameterList typeParameters2) {
+    this._typeParameters = becomeParentOf(typeParameters2);
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     super.visitChildren(visitor);
@@ -5679,8 +5686,8 @@
    * Set the parameters of the function-typed parameter to the given parameters.
    * @param parameters the parameters of the function-typed parameter
    */
-  void set parameters(FormalParameterList parameters5) {
-    this._parameters = becomeParentOf(parameters5);
+  void set parameters(FormalParameterList parameters2) {
+    this._parameters = becomeParentOf(parameters2);
   }
   /**
    * Set the return type of the function to the given type.
@@ -5910,15 +5917,15 @@
    * Set the left parenthesis to the given token.
    * @param leftParenthesis the left parenthesis
    */
-  void set leftParenthesis(Token leftParenthesis5) {
-    this._leftParenthesis = leftParenthesis5;
+  void set leftParenthesis(Token leftParenthesis2) {
+    this._leftParenthesis = leftParenthesis2;
   }
   /**
    * Set the right parenthesis to the given token.
    * @param rightParenthesis the right parenthesis
    */
-  void set rightParenthesis(Token rightParenthesis5) {
-    this._rightParenthesis = rightParenthesis5;
+  void set rightParenthesis(Token rightParenthesis2) {
+    this._rightParenthesis = rightParenthesis2;
   }
   /**
    * Set the statement that is executed if the condition evaluates to {@code true} to the given
@@ -5985,8 +5992,8 @@
    * Set the token representing the 'implements' keyword to the given token.
    * @param keyword the token representing the 'implements' keyword
    */
-  void set keyword(Token keyword12) {
-    this._keyword = keyword12;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     _interfaces.accept(visitor);
@@ -6111,8 +6118,8 @@
    * @param index the expression used to compute the index
    * @param rightBracket the right square bracket
    */
-  IndexExpression.forTarget_full(Expression target3, Token leftBracket4, Expression index2, Token rightBracket4) {
-    _jtd_constructor_58_impl(target3, leftBracket4, index2, rightBracket4);
+  IndexExpression.forTarget_full(Expression target2, Token leftBracket2, Expression index2, Token rightBracket2) {
+    _jtd_constructor_58_impl(target2, leftBracket2, index2, rightBracket2);
   }
   /**
    * Initialize a newly created index expression.
@@ -6121,12 +6128,12 @@
    * @param index the expression used to compute the index
    * @param rightBracket the right square bracket
    */
-  IndexExpression.forTarget({Expression target3, Token leftBracket4, Expression index2, Token rightBracket4}) : this.forTarget_full(target3, leftBracket4, index2, rightBracket4);
-  _jtd_constructor_58_impl(Expression target3, Token leftBracket4, Expression index2, Token rightBracket4) {
-    this._target = becomeParentOf(target3);
-    this._leftBracket = leftBracket4;
+  IndexExpression.forTarget({Expression target2, Token leftBracket2, Expression index2, Token rightBracket2}) : this.forTarget_full(target2, leftBracket2, index2, rightBracket2);
+  _jtd_constructor_58_impl(Expression target2, Token leftBracket2, Expression index2, Token rightBracket2) {
+    this._target = becomeParentOf(target2);
+    this._leftBracket = leftBracket2;
     this._index = becomeParentOf(index2);
-    this._rightBracket = rightBracket4;
+    this._rightBracket = rightBracket2;
   }
   /**
    * Initialize a newly created index expression.
@@ -6135,8 +6142,8 @@
    * @param index the expression used to compute the index
    * @param rightBracket the right square bracket
    */
-  IndexExpression.forCascade_full(Token period7, Token leftBracket5, Expression index3, Token rightBracket5) {
-    _jtd_constructor_59_impl(period7, leftBracket5, index3, rightBracket5);
+  IndexExpression.forCascade_full(Token period2, Token leftBracket2, Expression index2, Token rightBracket2) {
+    _jtd_constructor_59_impl(period2, leftBracket2, index2, rightBracket2);
   }
   /**
    * Initialize a newly created index expression.
@@ -6145,12 +6152,12 @@
    * @param index the expression used to compute the index
    * @param rightBracket the right square bracket
    */
-  IndexExpression.forCascade({Token period7, Token leftBracket5, Expression index3, Token rightBracket5}) : this.forCascade_full(period7, leftBracket5, index3, rightBracket5);
-  _jtd_constructor_59_impl(Token period7, Token leftBracket5, Expression index3, Token rightBracket5) {
-    this._period = period7;
-    this._leftBracket = leftBracket5;
-    this._index = becomeParentOf(index3);
-    this._rightBracket = rightBracket5;
+  IndexExpression.forCascade({Token period2, Token leftBracket2, Expression index2, Token rightBracket2}) : this.forCascade_full(period2, leftBracket2, index2, rightBracket2);
+  _jtd_constructor_59_impl(Token period2, Token leftBracket2, Expression index2, Token rightBracket2) {
+    this._period = period2;
+    this._leftBracket = leftBracket2;
+    this._index = becomeParentOf(index2);
+    this._rightBracket = rightBracket2;
   }
   accept(ASTVisitor visitor) => visitor.visitIndexExpression(this);
   /**
@@ -6224,9 +6231,9 @@
    * @return {@code true} if this expression is in a context where the operator '[]' will be invoked
    */
   bool inGetterContext() {
-    ASTNode parent4 = parent;
-    if (parent4 is AssignmentExpression) {
-      AssignmentExpression assignment = parent4 as AssignmentExpression;
+    ASTNode parent2 = parent;
+    if (parent2 is AssignmentExpression) {
+      AssignmentExpression assignment = parent2 as AssignmentExpression;
       if (identical(assignment.leftHandSide, this) && identical(assignment.operator.type, TokenType.EQ)) {
         return false;
       }
@@ -6242,13 +6249,13 @@
    * invoked
    */
   bool inSetterContext() {
-    ASTNode parent5 = parent;
-    if (parent5 is PrefixExpression) {
-      return ((parent5 as PrefixExpression)).operator.type.isIncrementOperator();
-    } else if (parent5 is PostfixExpression) {
+    ASTNode parent2 = parent;
+    if (parent2 is PrefixExpression) {
+      return ((parent2 as PrefixExpression)).operator.type.isIncrementOperator();
+    } else if (parent2 is PostfixExpression) {
       return true;
-    } else if (parent5 is AssignmentExpression) {
-      return identical(((parent5 as AssignmentExpression)).leftHandSide, this);
+    } else if (parent2 is AssignmentExpression) {
+      return identical(((parent2 as AssignmentExpression)).leftHandSide, this);
     }
     return false;
   }
@@ -6270,8 +6277,8 @@
    * Set the element associated with the operator to the given element.
    * @param element the element associated with this operator
    */
-  void set element(MethodElement element11) {
-    this._element = element11;
+  void set element(MethodElement element2) {
+    this._element = element2;
   }
   /**
    * Set the expression used to compute the index to the given expression.
@@ -6291,8 +6298,8 @@
    * Set the period ("..") before a cascaded index expression to the given token.
    * @param period the period ("..") before a cascaded index expression
    */
-  void set period(Token period8) {
-    this._period = period8;
+  void set period(Token period2) {
+    this._period = period2;
   }
   /**
    * Set the right square bracket to the given token.
@@ -6383,29 +6390,29 @@
    * Set the list of arguments to the constructor to the given list.
    * @param argumentList the list of arguments to the constructor
    */
-  void set argumentList(ArgumentList argumentList6) {
-    this._argumentList = becomeParentOf(argumentList6);
+  void set argumentList(ArgumentList argumentList2) {
+    this._argumentList = becomeParentOf(argumentList2);
   }
   /**
    * Set the name of the constructor to be invoked to the given name.
    * @param constructorName the name of the constructor to be invoked
    */
-  void set constructorName(ConstructorName constructorName3) {
-    this._constructorName = constructorName3;
+  void set constructorName(ConstructorName constructorName2) {
+    this._constructorName = constructorName2;
   }
   /**
    * Set the element associated with the constructor to the given element.
    * @param element the element associated with the constructor
    */
-  void set element(ConstructorElement element12) {
-    this._element = element12;
+  void set element(ConstructorElement element2) {
+    this._element = element2;
   }
   /**
    * Set the keyword used to indicate how an object should be created to the given keyword.
    * @param keyword the keyword used to indicate how an object should be created
    */
-  void set keyword(Token keyword13) {
-    this._keyword = keyword13;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     safelyVisitChild(_constructorName, visitor);
@@ -6467,15 +6474,15 @@
    * Set the token representing the literal to the given token.
    * @param literal the token representing the literal
    */
-  void set literal(Token literal4) {
-    this._literal = literal4;
+  void set literal(Token literal2) {
+    this._literal = literal2;
   }
   /**
    * Set the value of the literal to the given value.
    * @param value the value of the literal
    */
-  void set value(int value6) {
-    this._value = value6;
+  void set value(int value2) {
+    this._value = value2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
   }
@@ -6557,22 +6564,22 @@
    * expression.
    * @param expression the expression to be evaluated for the value to be converted into a string
    */
-  void set expression(Expression expression6) {
-    this._expression = becomeParentOf(expression6);
+  void set expression(Expression expression2) {
+    this._expression = becomeParentOf(expression2);
   }
   /**
    * Set the left curly bracket to the given token.
    * @param leftBracket the left curly bracket
    */
-  void set leftBracket(Token leftBracket6) {
-    this._leftBracket = leftBracket6;
+  void set leftBracket(Token leftBracket2) {
+    this._leftBracket = leftBracket2;
   }
   /**
    * Set the right curly bracket to the given token.
    * @param rightBracket the right curly bracket
    */
-  void set rightBracket(Token rightBracket6) {
-    this._rightBracket = rightBracket6;
+  void set rightBracket(Token rightBracket2) {
+    this._rightBracket = rightBracket2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     safelyVisitChild(_expression, visitor);
@@ -6713,8 +6720,8 @@
    * expression.
    * @param expression the expression used to compute the value whose type is being tested
    */
-  void set expression(Expression expression7) {
-    this._expression = becomeParentOf(expression7);
+  void set expression(Expression expression2) {
+    this._expression = becomeParentOf(expression2);
   }
   /**
    * Set the is operator being applied to the given operator.
@@ -6790,15 +6797,15 @@
    * Set the colon that separates the label from the statement to the given token.
    * @param colon the colon that separates the label from the statement
    */
-  void set colon(Token colon3) {
-    this._colon = colon3;
+  void set colon(Token colon2) {
+    this._colon = colon2;
   }
   /**
    * Set the label being associated with the statement to the given label.
    * @param label the label being associated with the statement
    */
-  void set label(SimpleIdentifier label3) {
-    this._label = becomeParentOf(label3);
+  void set label(SimpleIdentifier label2) {
+    this._label = becomeParentOf(label2);
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     safelyVisitChild(_label, visitor);
@@ -6937,15 +6944,15 @@
    * Set the name of the library being defined to the given name.
    * @param name the name of the library being defined
    */
-  void set name(LibraryIdentifier name6) {
-    this._name = becomeParentOf(name6);
+  void set name(LibraryIdentifier name2) {
+    this._name = becomeParentOf(name2);
   }
   /**
    * Set the semicolon terminating the directive to the given token.
    * @param semicolon the semicolon terminating the directive
    */
-  void set semicolon(Token semicolon11) {
-    this._semicolon = semicolon11;
+  void set semicolon(Token semicolon2) {
+    this._semicolon = semicolon2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     super.visitChildren(visitor);
@@ -7056,9 +7063,9 @@
     if (token != null) {
       return token;
     }
-    TypeArgumentList typeArguments6 = typeArguments;
-    if (typeArguments6 != null) {
-      return typeArguments6.beginToken;
+    TypeArgumentList typeArguments2 = typeArguments;
+    if (typeArguments2 != null) {
+      return typeArguments2.beginToken;
     }
     return _leftBracket;
   }
@@ -7110,7 +7117,7 @@
  * Instances of the class {@code MapLiteral} represent a literal map.
  * <pre>
  * mapLiteral ::=
- * 'const'? ('<' {@link TypeName type} '>')? '{' ({@link MapLiteralEntry entry} (',' {@link MapLiteralEntry entry})* ','?)? '}'
+ * 'const'? ('<' {@link TypeName type} (',' {@link TypeName type})* '>')? '{' ({@link MapLiteralEntry entry} (',' {@link MapLiteralEntry entry})* ','?)? '}'
  * </pre>
  * @coverage dart.engine.ast
  */
@@ -7158,9 +7165,9 @@
     if (token != null) {
       return token;
     }
-    TypeArgumentList typeArguments7 = typeArguments;
-    if (typeArguments7 != null) {
-      return typeArguments7.beginToken;
+    TypeArgumentList typeArguments2 = typeArguments;
+    if (typeArguments2 != null) {
+      return typeArguments2.beginToken;
     }
     return _leftBracket;
   }
@@ -7266,8 +7273,8 @@
    * Set the colon that separates the key from the value to the given token.
    * @param separator the colon that separates the key from the value
    */
-  void set separator(Token separator4) {
-    this._separator = separator4;
+  void set separator(Token separator2) {
+    this._separator = separator2;
   }
   /**
    * Set the expression computing the value that will be associated with the key to the given
@@ -7456,8 +7463,8 @@
    * Set the token for the 'external' keyword to the given token.
    * @param externalKeyword the token for the 'external' keyword
    */
-  void set externalKeyword(Token externalKeyword4) {
-    this._externalKeyword = externalKeyword4;
+  void set externalKeyword(Token externalKeyword2) {
+    this._externalKeyword = externalKeyword2;
   }
   /**
    * Set the token representing the 'abstract' or 'static' keyword to the given token.
@@ -7484,15 +7491,15 @@
    * Set the parameters associated with the method to the given list of parameters.
    * @param parameters the parameters associated with the method
    */
-  void set parameters(FormalParameterList parameters6) {
-    this._parameters = becomeParentOf(parameters6);
+  void set parameters(FormalParameterList parameters2) {
+    this._parameters = becomeParentOf(parameters2);
   }
   /**
    * Set the token representing the 'get' or 'set' keyword to the given token.
    * @param propertyKeyword the token representing the 'get' or 'set' keyword
    */
-  void set propertyKeyword(Token propertyKeyword3) {
-    this._propertyKeyword = propertyKeyword3;
+  void set propertyKeyword(Token propertyKeyword2) {
+    this._propertyKeyword = propertyKeyword2;
   }
   /**
    * Set the return type of the method to the given type name.
@@ -7635,8 +7642,8 @@
    * Set the list of arguments to the method to the given list.
    * @param argumentList the list of arguments to the method
    */
-  void set argumentList(ArgumentList argumentList7) {
-    this._argumentList = becomeParentOf(argumentList7);
+  void set argumentList(ArgumentList argumentList2) {
+    this._argumentList = becomeParentOf(argumentList2);
   }
   /**
    * Set the name of the method being invoked to the given identifier.
@@ -7649,8 +7656,8 @@
    * Set the period that separates the target from the method name to the given token.
    * @param period the period that separates the target from the method name
    */
-  void set period(Token period9) {
-    this._period = period9;
+  void set period(Token period2) {
+    this._period = period2;
   }
   /**
    * Set the expression producing the object on which the method is defined to the given expression.
@@ -7704,9 +7711,9 @@
    * @return the element representing the parameter being named by this expression
    */
   ParameterElement get element {
-    Element element22 = _name.label.element;
-    if (element22 is ParameterElement) {
-      return element22 as ParameterElement;
+    Element element2 = _name.label.element;
+    if (element2 is ParameterElement) {
+      return element2 as ParameterElement;
     }
     return null;
   }
@@ -7725,8 +7732,8 @@
    * Set the expression with which the name is associated to the given expression.
    * @param expression the expression with which the name is associated
    */
-  void set expression(Expression expression8) {
-    this._expression = becomeParentOf(expression8);
+  void set expression(Expression expression2) {
+    this._expression = becomeParentOf(expression2);
   }
   /**
    * Set the name associated with the expression to the given identifier.
@@ -7808,12 +7815,76 @@
    * Set the semicolon terminating the directive to the given token.
    * @param semicolon the semicolon terminating the directive
    */
-  void set semicolon(Token semicolon12) {
-    this._semicolon = semicolon12;
+  void set semicolon(Token semicolon2) {
+    this._semicolon = semicolon2;
   }
   Token get firstTokenAfterCommentAndMetadata => _keyword;
 }
 /**
+ * Instances of the class {@code NativeFunctionBody} represent a function body that consists of a
+ * native keyword followed by a string literal.
+ * <pre>
+ * nativeFunctionBody ::=
+ * 'native' {@link SimpleStringLiteral simpleStringLiteral} ';'
+ * </pre>
+ * @coverage dart.engine.ast
+ */
+class NativeFunctionBody extends FunctionBody {
+  /**
+   * The token representing 'native' that marks the start of the function body.
+   */
+  Token _nativeToken;
+  /**
+   * The string literal, after the 'native' token.
+   */
+  StringLiteral _stringLiteral;
+  /**
+   * The token representing the semicolon that marks the end of the function body.
+   */
+  Token _semicolon;
+  /**
+   * Initialize a newly created function body consisting of the 'native' token, a string literal,
+   * and a semicolon.
+   * @param nativeToken the token representing 'native' that marks the start of the function body
+   * @param stringLiteral the string literal
+   * @param semicolon the token representing the semicolon that marks the end of the function body
+   */
+  NativeFunctionBody.full(Token nativeToken, StringLiteral stringLiteral, Token semicolon) {
+    this._nativeToken = nativeToken;
+    this._stringLiteral = becomeParentOf(stringLiteral);
+    this._semicolon = semicolon;
+  }
+  /**
+   * Initialize a newly created function body consisting of the 'native' token, a string literal,
+   * and a semicolon.
+   * @param nativeToken the token representing 'native' that marks the start of the function body
+   * @param stringLiteral the string literal
+   * @param semicolon the token representing the semicolon that marks the end of the function body
+   */
+  NativeFunctionBody({Token nativeToken, StringLiteral stringLiteral, Token semicolon}) : this.full(nativeToken, stringLiteral, semicolon);
+  accept(ASTVisitor visitor) => visitor.visitNativeFunctionBody(this);
+  Token get beginToken => _nativeToken;
+  Token get endToken => _semicolon;
+  /**
+   * Return the simple identifier representing the 'native' token.
+   * @return the simple identifier representing the 'native' token
+   */
+  Token get nativeToken => _nativeToken;
+  /**
+   * Return the token representing the semicolon that marks the end of the function body.
+   * @return the token representing the semicolon that marks the end of the function body
+   */
+  Token get semicolon => _semicolon;
+  /**
+   * Return the string literal representing the string after the 'native' token.
+   * @return the string literal representing the string after the 'native' token
+   */
+  StringLiteral get stringLiteral => _stringLiteral;
+  void visitChildren(ASTVisitor<Object> visitor) {
+    safelyVisitChild(_stringLiteral, visitor);
+  }
+}
+/**
  * The abstract class {@code NormalFormalParameter} defines the behavior common to formal parameters
  * that are required (are not optional).
  * <pre>
@@ -7861,9 +7932,9 @@
   Comment get documentationComment => _comment;
   SimpleIdentifier get identifier => _identifier;
   ParameterKind get kind {
-    ASTNode parent6 = parent;
-    if (parent6 is DefaultFormalParameter) {
-      return ((parent6 as DefaultFormalParameter)).kind;
+    ASTNode parent2 = parent;
+    if (parent2 is DefaultFormalParameter) {
+      return ((parent2 as DefaultFormalParameter)).kind;
     }
     return ParameterKind.REQUIRED;
   }
@@ -7888,15 +7959,15 @@
    * Set the documentation comment associated with this parameter to the given comment
    * @param comment the documentation comment to be associated with this parameter
    */
-  void set documentationComment(Comment comment3) {
-    this._comment = becomeParentOf(comment3);
+  void set documentationComment(Comment comment2) {
+    this._comment = becomeParentOf(comment2);
   }
   /**
    * Set the name of the parameter being declared to the given identifier.
    * @param identifier the name of the parameter being declared
    */
-  void set identifier(SimpleIdentifier identifier8) {
-    this._identifier = becomeParentOf(identifier8);
+  void set identifier(SimpleIdentifier identifier2) {
+    this._identifier = becomeParentOf(identifier2);
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     if (commentIsBeforeAnnotations()) {
@@ -7971,8 +8042,8 @@
    * Set the token representing the literal to the given token.
    * @param literal the token representing the literal
    */
-  void set literal(Token literal5) {
-    this._literal = literal5;
+  void set literal(Token literal2) {
+    this._literal = literal2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
   }
@@ -8038,8 +8109,8 @@
    * Set the expression within the parentheses to the given expression.
    * @param expression the expression within the parentheses
    */
-  void set expression(Expression expression9) {
-    this._expression = becomeParentOf(expression9);
+  void set expression(Expression expression2) {
+    this._expression = becomeParentOf(expression2);
   }
   /**
    * Set the left parenthesis to the given token.
@@ -8120,8 +8191,8 @@
    * Set the semicolon terminating the directive to the given token.
    * @param semicolon the semicolon terminating the directive
    */
-  void set semicolon(Token semicolon13) {
-    this._semicolon = semicolon13;
+  void set semicolon(Token semicolon2) {
+    this._semicolon = semicolon2;
   }
   Token get firstTokenAfterCommentAndMetadata => _partToken;
 }
@@ -8215,15 +8286,15 @@
    * Set the token representing the 'part' token to the given token.
    * @param partToken the token representing the 'part' token
    */
-  void set partToken(Token partToken3) {
-    this._partToken = partToken3;
+  void set partToken(Token partToken2) {
+    this._partToken = partToken2;
   }
   /**
    * Set the semicolon terminating the directive to the given token.
    * @param semicolon the semicolon terminating the directive
    */
-  void set semicolon(Token semicolon14) {
-    this._semicolon = semicolon14;
+  void set semicolon(Token semicolon2) {
+    this._semicolon = semicolon2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     super.visitChildren(visitor);
@@ -8290,8 +8361,8 @@
    * Set the element associated with the operator to the given element.
    * @param element the element associated with the operator
    */
-  void set element(MethodElement element13) {
-    this._element = element13;
+  void set element(MethodElement element2) {
+    this._element = element2;
   }
   /**
    * Set the expression computing the operand for the operator to the given expression.
@@ -8304,8 +8375,8 @@
    * Set the postfix operator being applied to the operand to the given operator.
    * @param operator the postfix operator being applied to the operand
    */
-  void set operator(Token operator4) {
-    this._operator = operator4;
+  void set operator(Token operator2) {
+    this._operator = operator2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     safelyVisitChild(_operand, visitor);
@@ -8370,8 +8441,8 @@
    * Set the element associated with the operator to the given element.
    * @param element the element associated with the operator
    */
-  void set element(MethodElement element14) {
-    this._element = element14;
+  void set element(MethodElement element2) {
+    this._element = element2;
   }
   /**
    * Set the expression computing the operand for the operator to the given expression.
@@ -8384,8 +8455,8 @@
    * Set the prefix operator being applied to the operand to the given operator.
    * @param operator the prefix operator being applied to the operand
    */
-  void set operator(Token operator5) {
-    this._operator = operator5;
+  void set operator(Token operator2) {
+    this._operator = operator2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     safelyVisitChild(_operand, visitor);
@@ -8459,15 +8530,15 @@
    * Set the identifier being prefixed to the given identifier.
    * @param identifier the identifier being prefixed
    */
-  void set identifier(SimpleIdentifier identifier9) {
-    this._identifier = becomeParentOf(identifier9);
+  void set identifier(SimpleIdentifier identifier2) {
+    this._identifier = becomeParentOf(identifier2);
   }
   /**
    * Set the period used to separate the prefix from the identifier to the given token.
    * @param period the period used to separate the prefix from the identifier
    */
-  void set period(Token period10) {
-    this._period = period10;
+  void set period(Token period2) {
+    this._period = period2;
   }
   /**
    * Set the prefix associated with the library in which the identifier is defined to the given
@@ -8578,8 +8649,8 @@
    * Set the property access operator to the given token.
    * @param operator the property access operator
    */
-  void set operator(Token operator6) {
-    this._operator = operator6;
+  void set operator(Token operator2) {
+    this._operator = operator2;
   }
   /**
    * Set the name of the property being accessed to the given identifier.
@@ -8690,8 +8761,8 @@
    * Set the list of arguments to the constructor to the given list.
    * @param argumentList the list of arguments to the constructor
    */
-  void set argumentList(ArgumentList argumentList8) {
-    this._argumentList = becomeParentOf(argumentList8);
+  void set argumentList(ArgumentList argumentList2) {
+    this._argumentList = becomeParentOf(argumentList2);
   }
   /**
    * Set the name of the constructor that is being invoked to the given identifier.
@@ -8704,23 +8775,23 @@
    * Set the element associated with the constructor to the given element.
    * @param element the element associated with the constructor
    */
-  void set element(ConstructorElement element15) {
-    this._element = element15;
+  void set element(ConstructorElement element2) {
+    this._element = element2;
   }
   /**
    * Set the token for the 'this' keyword to the given token.
    * @param keyword the token for the 'this' keyword
    */
-  void set keyword(Token keyword14) {
-    this._keyword = keyword14;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
   /**
    * Set the token for the period before the name of the constructor that is being invoked to the
    * given token.
    * @param period the token for the period before the name of the constructor that is being invoked
    */
-  void set period(Token period11) {
-    this._period = period11;
+  void set period(Token period2) {
+    this._period = period2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     safelyVisitChild(_constructorName, visitor);
@@ -8764,8 +8835,8 @@
    * Set the token representing the 'rethrow' keyword to the given token.
    * @param keyword the token representing the 'rethrow' keyword
    */
-  void set keyword(Token keyword15) {
-    this._keyword = keyword15;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
   }
@@ -8833,22 +8904,22 @@
    * Set the expression computing the value to be returned to the given expression.
    * @param expression the expression computing the value to be returned
    */
-  void set expression(Expression expression10) {
-    this._expression = becomeParentOf(expression10);
+  void set expression(Expression expression2) {
+    this._expression = becomeParentOf(expression2);
   }
   /**
    * Set the token representing the 'return' keyword to the given token.
    * @param keyword the token representing the 'return' keyword
    */
-  void set keyword(Token keyword16) {
-    this._keyword = keyword16;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
   /**
    * Set the semicolon terminating the statement to the given token.
    * @param semicolon the semicolon terminating the statement
    */
-  void set semicolon(Token semicolon15) {
-    this._semicolon = semicolon15;
+  void set semicolon(Token semicolon2) {
+    this._semicolon = semicolon2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     safelyVisitChild(_expression, visitor);
@@ -8892,8 +8963,8 @@
    * Set the token representing this script tag to the given script tag.
    * @param scriptTag the token representing this script tag
    */
-  void set scriptTag(Token scriptTag3) {
-    this._scriptTag = scriptTag3;
+  void set scriptTag(Token scriptTag2) {
+    this._scriptTag = scriptTag2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
   }
@@ -9004,8 +9075,8 @@
    * Set the token representing either the 'final', 'const' or 'var' keyword to the given token.
    * @param keyword the token representing either the 'final', 'const' or 'var' keyword
    */
-  void set keyword(Token keyword17) {
-    this._keyword = keyword17;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
   /**
    * Set the name of the declared type of the parameter to the given type name.
@@ -9067,30 +9138,30 @@
    * @return {@code true} if this identifier is the name being declared in a declaration
    */
   bool inDeclarationContext() {
-    ASTNode parent7 = parent;
-    if (parent7 is CatchClause) {
-      CatchClause clause = parent7 as CatchClause;
+    ASTNode parent2 = parent;
+    if (parent2 is CatchClause) {
+      CatchClause clause = parent2 as CatchClause;
       return identical(this, clause.exceptionParameter) || identical(this, clause.stackTraceParameter);
-    } else if (parent7 is ClassDeclaration) {
-      return identical(this, ((parent7 as ClassDeclaration)).name);
-    } else if (parent7 is ClassTypeAlias) {
-      return identical(this, ((parent7 as ClassTypeAlias)).name);
-    } else if (parent7 is ConstructorDeclaration) {
-      return identical(this, ((parent7 as ConstructorDeclaration)).name);
-    } else if (parent7 is FunctionDeclaration) {
-      return identical(this, ((parent7 as FunctionDeclaration)).name);
-    } else if (parent7 is FunctionTypeAlias) {
-      return identical(this, ((parent7 as FunctionTypeAlias)).name);
-    } else if (parent7 is Label) {
-      return identical(this, ((parent7 as Label)).label) && (parent7.parent is LabeledStatement);
-    } else if (parent7 is MethodDeclaration) {
-      return identical(this, ((parent7 as MethodDeclaration)).name);
-    } else if (parent7 is NormalFormalParameter) {
-      return identical(this, ((parent7 as NormalFormalParameter)).identifier);
-    } else if (parent7 is TypeParameter) {
-      return identical(this, ((parent7 as TypeParameter)).name);
-    } else if (parent7 is VariableDeclaration) {
-      return identical(this, ((parent7 as VariableDeclaration)).name);
+    } else if (parent2 is ClassDeclaration) {
+      return identical(this, ((parent2 as ClassDeclaration)).name);
+    } else if (parent2 is ClassTypeAlias) {
+      return identical(this, ((parent2 as ClassTypeAlias)).name);
+    } else if (parent2 is ConstructorDeclaration) {
+      return identical(this, ((parent2 as ConstructorDeclaration)).name);
+    } else if (parent2 is FunctionDeclaration) {
+      return identical(this, ((parent2 as FunctionDeclaration)).name);
+    } else if (parent2 is FunctionTypeAlias) {
+      return identical(this, ((parent2 as FunctionTypeAlias)).name);
+    } else if (parent2 is Label) {
+      return identical(this, ((parent2 as Label)).label) && (parent2.parent is LabeledStatement);
+    } else if (parent2 is MethodDeclaration) {
+      return identical(this, ((parent2 as MethodDeclaration)).name);
+    } else if (parent2 is FunctionTypedFormalParameter || parent2 is SimpleFormalParameter) {
+      return identical(this, ((parent2 as NormalFormalParameter)).identifier);
+    } else if (parent2 is TypeParameter) {
+      return identical(this, ((parent2 as TypeParameter)).name);
+    } else if (parent2 is VariableDeclaration) {
+      return identical(this, ((parent2 as VariableDeclaration)).name);
     }
     return false;
   }
@@ -9102,25 +9173,28 @@
    * @return {@code true} if this expression is in a context where a getter will be invoked
    */
   bool inGetterContext() {
-    ASTNode parent8 = parent;
+    ASTNode parent2 = parent;
     ASTNode target = this;
-    if (parent8 is PrefixedIdentifier) {
-      PrefixedIdentifier prefixed = parent8 as PrefixedIdentifier;
+    if (parent2 is PrefixedIdentifier) {
+      PrefixedIdentifier prefixed = parent2 as PrefixedIdentifier;
       if (identical(prefixed.prefix, this)) {
         return true;
       }
-      parent8 = prefixed.parent;
+      parent2 = prefixed.parent;
       target = prefixed;
-    } else if (parent8 is PropertyAccess) {
-      PropertyAccess access = parent8 as PropertyAccess;
+    } else if (parent2 is PropertyAccess) {
+      PropertyAccess access = parent2 as PropertyAccess;
       if (identical(access.target, this)) {
         return true;
       }
-      parent8 = access.parent;
+      parent2 = access.parent;
       target = access;
     }
-    if (parent8 is AssignmentExpression) {
-      AssignmentExpression expr = parent8 as AssignmentExpression;
+    if (parent2 is Label) {
+      return false;
+    }
+    if (parent2 is AssignmentExpression) {
+      AssignmentExpression expr = parent2 as AssignmentExpression;
       if (identical(expr.leftHandSide, target) && identical(expr.operator.type, TokenType.EQ)) {
         return false;
       }
@@ -9135,29 +9209,29 @@
    * @return {@code true} if this expression is in a context where a setter will be invoked
    */
   bool inSetterContext() {
-    ASTNode parent9 = parent;
+    ASTNode parent2 = parent;
     ASTNode target = this;
-    if (parent9 is PrefixedIdentifier) {
-      PrefixedIdentifier prefixed = parent9 as PrefixedIdentifier;
+    if (parent2 is PrefixedIdentifier) {
+      PrefixedIdentifier prefixed = parent2 as PrefixedIdentifier;
       if (identical(prefixed.prefix, this)) {
         return false;
       }
-      parent9 = prefixed.parent;
+      parent2 = prefixed.parent;
       target = prefixed;
-    } else if (parent9 is PropertyAccess) {
-      PropertyAccess access = parent9 as PropertyAccess;
+    } else if (parent2 is PropertyAccess) {
+      PropertyAccess access = parent2 as PropertyAccess;
       if (identical(access.target, this)) {
         return false;
       }
-      parent9 = access.parent;
+      parent2 = access.parent;
       target = access;
     }
-    if (parent9 is PrefixExpression) {
-      return ((parent9 as PrefixExpression)).operator.type.isIncrementOperator();
-    } else if (parent9 is PostfixExpression) {
+    if (parent2 is PrefixExpression) {
+      return ((parent2 as PrefixExpression)).operator.type.isIncrementOperator();
+    } else if (parent2 is PostfixExpression) {
       return true;
-    } else if (parent9 is AssignmentExpression) {
-      return identical(((parent9 as AssignmentExpression)).leftHandSide, target);
+    } else if (parent2 is AssignmentExpression) {
+      return identical(((parent2 as AssignmentExpression)).leftHandSide, target);
     }
     return false;
   }
@@ -9166,15 +9240,15 @@
    * Set the element associated with this identifier to the given element.
    * @param element the element associated with this identifier
    */
-  void set element(Element element16) {
-    this._element = element16;
+  void set element(Element element2) {
+    this._element = element2;
   }
   /**
    * Set the token representing the identifier to the given token.
    * @param token the token representing the literal
    */
-  void set token(Token token12) {
-    this._token = token12;
+  void set token(Token token2) {
+    this._token = token2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
   }
@@ -9216,7 +9290,7 @@
    */
   SimpleStringLiteral.full(Token literal, String value) {
     this._literal = literal;
-    this._value = value;
+    this._value = StringUtilities.intern(value);
   }
   /**
    * Initialize a newly created simple string literal.
@@ -9257,15 +9331,15 @@
    * Set the token representing the literal to the given token.
    * @param literal the token representing the literal
    */
-  void set literal(Token literal6) {
-    this._literal = literal6;
+  void set literal(Token literal2) {
+    this._literal = literal2;
   }
   /**
    * Set the value of the literal to the given string.
    * @param string the value of the literal
    */
   void set value(String string) {
-    _value = string;
+    _value = StringUtilities.intern(_value);
   }
   void visitChildren(ASTVisitor<Object> visitor) {
   }
@@ -9414,8 +9488,8 @@
    * Set the list of arguments to the constructor to the given list.
    * @param argumentList the list of arguments to the constructor
    */
-  void set argumentList(ArgumentList argumentList9) {
-    this._argumentList = becomeParentOf(argumentList9);
+  void set argumentList(ArgumentList argumentList2) {
+    this._argumentList = becomeParentOf(argumentList2);
   }
   /**
    * Set the name of the constructor that is being invoked to the given identifier.
@@ -9428,23 +9502,23 @@
    * Set the element associated with the constructor to the given element.
    * @param element the element associated with the constructor
    */
-  void set element(ConstructorElement element17) {
-    this._element = element17;
+  void set element(ConstructorElement element2) {
+    this._element = element2;
   }
   /**
    * Set the token for the 'super' keyword to the given token.
    * @param keyword the token for the 'super' keyword
    */
-  void set keyword(Token keyword18) {
-    this._keyword = keyword18;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
   /**
    * Set the token for the period before the name of the constructor that is being invoked to the
    * given token.
    * @param period the token for the period before the name of the constructor that is being invoked
    */
-  void set period(Token period12) {
-    this._period = period12;
+  void set period(Token period2) {
+    this._period = period2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     safelyVisitChild(_constructorName, visitor);
@@ -9488,8 +9562,8 @@
    * Set the token representing the keyword to the given token.
    * @param keyword the token representing the keyword
    */
-  void set keyword(Token keyword19) {
-    this._keyword = keyword19;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
   }
@@ -9535,8 +9609,8 @@
    * Set the expression controlling whether the statements will be executed to the given expression.
    * @param expression the expression controlling whether the statements will be executed
    */
-  void set expression(Expression expression11) {
-    this._expression = becomeParentOf(expression11);
+  void set expression(Expression expression2) {
+    this._expression = becomeParentOf(expression2);
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     labels.accept(visitor);
@@ -9660,15 +9734,15 @@
    * Set the colon separating the keyword or the expression from the statements to the given token.
    * @param colon the colon separating the keyword or the expression from the statements
    */
-  void set colon(Token colon4) {
-    this._colon = colon4;
+  void set colon(Token colon2) {
+    this._colon = colon2;
   }
   /**
    * Set the token representing the 'case' or 'default' keyword to the given token.
    * @param keyword the token representing the 'case' or 'default' keyword
    */
-  void set keyword(Token keyword20) {
-    this._keyword = keyword20;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
 }
 /**
@@ -9782,43 +9856,43 @@
    * expression.
    * @param expression the expression used to determine which of the switch members will be selected
    */
-  void set expression(Expression expression12) {
-    this._expression = becomeParentOf(expression12);
+  void set expression(Expression expression2) {
+    this._expression = becomeParentOf(expression2);
   }
   /**
    * Set the token representing the 'switch' keyword to the given token.
    * @param keyword the token representing the 'switch' keyword
    */
-  void set keyword(Token keyword21) {
-    this._keyword = keyword21;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
   /**
    * Set the left curly bracket to the given token.
    * @param leftBracket the left curly bracket
    */
-  void set leftBracket(Token leftBracket7) {
-    this._leftBracket = leftBracket7;
+  void set leftBracket(Token leftBracket2) {
+    this._leftBracket = leftBracket2;
   }
   /**
    * Set the left parenthesis to the given token.
    * @param leftParenthesis the left parenthesis
    */
-  void set leftParenthesis(Token leftParenthesis6) {
-    this._leftParenthesis = leftParenthesis6;
+  void set leftParenthesis(Token leftParenthesis2) {
+    this._leftParenthesis = leftParenthesis2;
   }
   /**
    * Set the right curly bracket to the given token.
    * @param rightBracket the right curly bracket
    */
-  void set rightBracket(Token rightBracket7) {
-    this._rightBracket = rightBracket7;
+  void set rightBracket(Token rightBracket2) {
+    this._rightBracket = rightBracket2;
   }
   /**
    * Set the right parenthesis to the given token.
    * @param rightParenthesis the right parenthesis
    */
-  void set rightParenthesis(Token rightParenthesis6) {
-    this._rightParenthesis = rightParenthesis6;
+  void set rightParenthesis(Token rightParenthesis2) {
+    this._rightParenthesis = rightParenthesis2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     safelyVisitChild(_expression, visitor);
@@ -9862,8 +9936,8 @@
    * Set the token representing the keyword to the given token.
    * @param keyword the token representing the keyword
    */
-  void set keyword(Token keyword22) {
-    this._keyword = keyword22;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
   }
@@ -9921,15 +9995,15 @@
    * Set the expression computing the exception to be thrown to the given expression.
    * @param expression the expression computing the exception to be thrown
    */
-  void set expression(Expression expression13) {
-    this._expression = becomeParentOf(expression13);
+  void set expression(Expression expression2) {
+    this._expression = becomeParentOf(expression2);
   }
   /**
    * Set the token representing the 'throw' keyword to the given token.
    * @param keyword the token representing the 'throw' keyword
    */
-  void set keyword(Token keyword23) {
-    this._keyword = keyword23;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     safelyVisitChild(_expression, visitor);
@@ -9990,8 +10064,8 @@
    * Set the semicolon terminating the declaration to the given token.
    * @param semicolon the semicolon terminating the declaration
    */
-  void set semicolon(Token semicolon16) {
-    this._semicolon = semicolon16;
+  void set semicolon(Token semicolon2) {
+    this._semicolon = semicolon2;
   }
   /**
    * Set the top-level variables being declared to the given list of variables.
@@ -10190,15 +10264,15 @@
    * Set the token representing the 'typedef' keyword to the given token.
    * @param keyword the token representing the 'typedef' keyword
    */
-  void set keyword(Token keyword24) {
-    this._keyword = keyword24;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
   /**
    * Set the semicolon terminating the declaration to the given token.
    * @param semicolon the semicolon terminating the declaration
    */
-  void set semicolon(Token semicolon17) {
-    this._semicolon = semicolon17;
+  void set semicolon(Token semicolon2) {
+    this._semicolon = semicolon2;
   }
   Token get firstTokenAfterCommentAndMetadata => _keyword;
 }
@@ -10264,15 +10338,15 @@
    * Set the left bracket to the given token.
    * @param leftBracket the left bracket
    */
-  void set leftBracket(Token leftBracket8) {
-    this._leftBracket = leftBracket8;
+  void set leftBracket(Token leftBracket2) {
+    this._leftBracket = leftBracket2;
   }
   /**
    * Set the right bracket to the given token.
    * @param rightBracket the right bracket
    */
-  void set rightBracket(Token rightBracket8) {
-    this._rightBracket = rightBracket8;
+  void set rightBracket(Token rightBracket2) {
+    this._rightBracket = rightBracket2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     _arguments.accept(visitor);
@@ -10352,8 +10426,8 @@
    * Set the type being named to the given type.
    * @param type the type being named
    */
-  void set type(Type2 type3) {
-    this._type = type3;
+  void set type(Type2 type2) {
+    this._type = type2;
   }
   /**
    * Set the type arguments associated with the type to the given type arguments.
@@ -10446,8 +10520,8 @@
    * Set the token representing the 'assert' keyword to the given token.
    * @param keyword the token representing the 'assert' keyword
    */
-  void set keyword(Token keyword25) {
-    this._keyword = keyword25;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
   /**
    * Set the name of the type parameter to the given identifier.
@@ -10582,8 +10656,8 @@
    * Set the type argument associated with this literal to the given arguments.
    * @param typeArguments the type argument associated with this literal
    */
-  void set typeArguments(TypeArgumentList typeArguments3) {
-    this._typeArguments = typeArguments3;
+  void set typeArguments(TypeArgumentList typeArguments2) {
+    this._typeArguments = typeArguments2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     safelyVisitChild(_typeArguments, visitor);
@@ -10709,8 +10783,8 @@
    * @return {@code true} if this variable was declared with the 'const' modifier
    */
   bool isConst() {
-    ASTNode parent10 = parent;
-    return parent10 is VariableDeclarationList && ((parent10 as VariableDeclarationList)).isConst();
+    ASTNode parent2 = parent;
+    return parent2 is VariableDeclarationList && ((parent2 as VariableDeclarationList)).isConst();
   }
   /**
    * Return {@code true} if this variable was declared with the 'final' modifier. Variables that are
@@ -10719,15 +10793,15 @@
    * @return {@code true} if this variable was declared with the 'final' modifier
    */
   bool isFinal() {
-    ASTNode parent11 = parent;
-    return parent11 is VariableDeclarationList && ((parent11 as VariableDeclarationList)).isFinal();
+    ASTNode parent2 = parent;
+    return parent2 is VariableDeclarationList && ((parent2 as VariableDeclarationList)).isFinal();
   }
   /**
    * Set the equal sign separating the variable name from the initial value to the given token.
    * @param equals the equal sign separating the variable name from the initial value
    */
-  void set equals(Token equals6) {
-    this._equals = equals6;
+  void set equals(Token equals2) {
+    this._equals = equals2;
   }
   /**
    * Set the expression used to compute the initial value for the variable to the given expression.
@@ -10740,8 +10814,8 @@
    * Set the name of the variable being declared to the given identifier.
    * @param name the name of the variable being declared
    */
-  void set name(SimpleIdentifier name7) {
-    this._name = becomeParentOf(name7);
+  void set name(SimpleIdentifier name2) {
+    this._name = becomeParentOf(name2);
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     super.visitChildren(visitor);
@@ -10834,8 +10908,8 @@
    * Set the token representing the 'final', 'const' or 'var' keyword to the given token.
    * @param keyword the token representing the 'final', 'const' or 'var' keyword
    */
-  void set keyword(Token keyword26) {
-    this._keyword = keyword26;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
   /**
    * Set the type of the variables being declared to the given type name.
@@ -10906,8 +10980,8 @@
    * Set the semicolon terminating the statement to the given token.
    * @param semicolon the semicolon terminating the statement
    */
-  void set semicolon(Token semicolon18) {
-    this._semicolon = semicolon18;
+  void set semicolon(Token semicolon2) {
+    this._semicolon = semicolon2;
   }
   /**
    * Set the variables being declared to the given list of variables.
@@ -11019,22 +11093,22 @@
    * Set the token representing the 'while' keyword to the given token.
    * @param keyword the token representing the 'while' keyword
    */
-  void set keyword(Token keyword27) {
-    this._keyword = keyword27;
+  void set keyword(Token keyword2) {
+    this._keyword = keyword2;
   }
   /**
    * Set the left parenthesis to the given token.
    * @param leftParenthesis the left parenthesis
    */
-  void set leftParenthesis(Token leftParenthesis7) {
-    this._leftParenthesis = leftParenthesis7;
+  void set leftParenthesis(Token leftParenthesis2) {
+    this._leftParenthesis = leftParenthesis2;
   }
   /**
    * Set the right parenthesis to the given token.
    * @param rightParenthesis the right parenthesis
    */
-  void set rightParenthesis(Token rightParenthesis7) {
-    this._rightParenthesis = rightParenthesis7;
+  void set rightParenthesis(Token rightParenthesis2) {
+    this._rightParenthesis = rightParenthesis2;
   }
   void visitChildren(ASTVisitor<Object> visitor) {
     safelyVisitChild(_condition, visitor);
@@ -11137,15 +11211,9 @@
    */
   static Object NOT_A_CONSTANT = new Object();
   /**
-   * The error reporter by which errors will be reported.
-   */
-  ErrorReporter _errorReporter;
-  /**
    * Initialize a newly created constant evaluator.
-   * @param errorReporter the error reporter by which errors will be reported
    */
-  ConstantEvaluator(ErrorReporter errorReporter) {
-    this._errorReporter = errorReporter;
+  ConstantEvaluator() {
   }
   Object visitAdjacentStrings(AdjacentStrings node) {
     JavaStringBuilder builder = new JavaStringBuilder();
@@ -11269,32 +11337,20 @@
           if (rightOperand2 != 0) {
             return ((leftOperand2 as int)) ~/ (rightOperand2 as int);
           } else {
-            reportDivideByZeroError(node);
-            return 0;
+            return ((leftOperand2 as int)).toDouble() / ((rightOperand2 as int)).toDouble();
           }
         } else if (leftOperand2 is double && rightOperand2 is double) {
-          if (rightOperand2 != 0) {
-            return ((leftOperand2 as double)) / ((rightOperand2 as double));
-          } else {
-            reportDivideByZeroError(node);
-            return 0;
-          }
+          return ((leftOperand2 as double)) / ((rightOperand2 as double));
         }
       } else if (node.operator.type == TokenType.TILDE_SLASH) {
         if (leftOperand2 is int && rightOperand2 is int) {
           if (rightOperand2 != 0) {
             return ((leftOperand2 as int)) ~/ (rightOperand2 as int);
           } else {
-            reportDivideByZeroError(node);
             return 0;
           }
         } else if (leftOperand2 is double && rightOperand2 is double) {
-          if (rightOperand2 != 0) {
-            return ((leftOperand2 as double)) ~/ ((rightOperand2 as double));
-          } else {
-            reportDivideByZeroError(node);
-            return 0;
-          }
+          return ((leftOperand2 as double)) ~/ ((rightOperand2 as double));
         }
       }
       break;
@@ -11327,11 +11383,11 @@
     Map<String, Object> map = new Map<String, Object>();
     for (MapLiteralEntry entry in node.entries) {
       Object key2 = entry.key.accept(this);
-      Object value8 = entry.value.accept(this);
-      if (key2 is! String || identical(value8, NOT_A_CONSTANT)) {
+      Object value2 = entry.value.accept(this);
+      if (key2 is! String || identical(value2, NOT_A_CONSTANT)) {
         return NOT_A_CONSTANT;
       }
-      map[(key2 as String)] = value8;
+      map[(key2 as String)] = value2;
     }
     return map;
   }
@@ -11396,9 +11452,6 @@
     }
     return NOT_A_CONSTANT;
   }
-  void reportDivideByZeroError(BinaryExpression node) {
-    _errorReporter.reportError(CompileTimeErrorCode.COMPILE_TIME_CONSTANT_RAISES_EXCEPTION_DIVIDE_BY_ZERO, node, []);
-  }
 }
 /**
  * Instances of the class {@code ElementLocator} locate the {@link Element Dart model element}associated with a given {@link ASTNode AST node}.
@@ -11427,19 +11480,23 @@
 class ElementLocator_ElementMapper extends GeneralizingASTVisitor<Element> {
   Element visitBinaryExpression(BinaryExpression node) => node.element;
   Element visitClassDeclaration(ClassDeclaration node) => node.element;
+  Element visitCompilationUnit(CompilationUnit node) => node.element;
+  Element visitConstructorDeclaration(ConstructorDeclaration node) => node.element;
   Element visitFunctionDeclaration(FunctionDeclaration node) => node.element;
   Element visitIdentifier(Identifier node) => node.element;
   Element visitImportDirective(ImportDirective node) => node.element;
   Element visitIndexExpression(IndexExpression node) => node.element;
+  Element visitInstanceCreationExpression(InstanceCreationExpression node) => node.element;
   Element visitLibraryDirective(LibraryDirective node) => node.element;
   Element visitMethodDeclaration(MethodDeclaration node) => node.element;
+  Element visitMethodInvocation(MethodInvocation node) => node.methodName.element;
   Element visitPostfixExpression(PostfixExpression node) => node.element;
   Element visitPrefixedIdentifier(PrefixedIdentifier node) => node.element;
   Element visitPrefixExpression(PrefixExpression node) => node.element;
   Element visitStringLiteral(StringLiteral node) {
-    ASTNode parent12 = node.parent;
-    if (parent12 is UriBasedDirective) {
-      return ((parent12 as UriBasedDirective)).element;
+    ASTNode parent2 = node.parent;
+    if (parent2 is UriBasedDirective) {
+      return ((parent2 as UriBasedDirective)).element;
     }
     return null;
   }
@@ -11541,6 +11598,7 @@
   R visitMethodInvocation(MethodInvocation node) => visitExpression(node);
   R visitNamedExpression(NamedExpression node) => visitExpression(node);
   R visitNamespaceDirective(NamespaceDirective node) => visitUriBasedDirective(node);
+  R visitNativeFunctionBody(NativeFunctionBody node) => visitFunctionBody(node);
   R visitNode(ASTNode node) {
     node.visitChildren(this);
     return null;
@@ -11615,10 +11673,10 @@
    * @param offset the offset used to identify the node
    */
   NodeLocator.con1(int offset) {
-    _jtd_constructor_119_impl(offset);
+    _jtd_constructor_120_impl(offset);
   }
-  _jtd_constructor_119_impl(int offset) {
-    _jtd_constructor_120_impl(offset, offset);
+  _jtd_constructor_120_impl(int offset) {
+    _jtd_constructor_121_impl(offset, offset);
   }
   /**
    * Initialize a newly created locator to locate one or more {@link ASTNode AST nodes} by locating
@@ -11628,9 +11686,9 @@
    * @param end the end offset of the range used to identify the node
    */
   NodeLocator.con2(int start, int end) {
-    _jtd_constructor_120_impl(start, end);
+    _jtd_constructor_121_impl(start, end);
   }
-  _jtd_constructor_120_impl(int start, int end) {
+  _jtd_constructor_121_impl(int start, int end) {
     this._startOffset = start;
     this._endOffset = end;
   }
@@ -11658,6 +11716,14 @@
     return _foundNode;
   }
   Object visitNode(ASTNode node) {
+    int start = node.offset;
+    int end = start + node.length;
+    if (end < _startOffset) {
+      return null;
+    }
+    if (start > _endOffset) {
+      return null;
+    }
     try {
       node.visitChildren(this);
     } on NodeLocator_NodeFoundException catch (exception) {
@@ -11665,8 +11731,6 @@
     } catch (exception) {
       AnalysisEngine.instance.logger.logInformation2("Exception caught while traversing an AST structure.", exception);
     }
-    int start = node.offset;
-    int end = start + node.length;
     if (start <= _startOffset && _endOffset <= end) {
       _foundNode = node;
       throw new NodeLocator_NodeFoundException();
@@ -11952,6 +12016,10 @@
     node.visitChildren(this);
     return null;
   }
+  R visitNativeFunctionBody(NativeFunctionBody node) {
+    node.visitChildren(this);
+    return null;
+  }
   R visitNullLiteral(NullLiteral node) {
     node.visitChildren(this);
     return null;
@@ -12166,6 +12234,7 @@
   R visitMethodDeclaration(MethodDeclaration node) => null;
   R visitMethodInvocation(MethodInvocation node) => null;
   R visitNamedExpression(NamedExpression node) => null;
+  R visitNativeFunctionBody(NativeFunctionBody node) => null;
   R visitNullLiteral(NullLiteral node) => null;
   R visitParenthesizedExpression(ParenthesizedExpression node) => null;
   R visitPartDirective(PartDirective node) => null;
@@ -12341,12 +12410,12 @@
   Object visitComment(Comment node) => null;
   Object visitCommentReference(CommentReference node) => null;
   Object visitCompilationUnit(CompilationUnit node) {
-    ScriptTag scriptTag6 = node.scriptTag;
+    ScriptTag scriptTag2 = node.scriptTag;
     NodeList<Directive> directives2 = node.directives;
-    visit(scriptTag6);
-    String prefix = scriptTag6 == null ? "" : " ";
+    visit(scriptTag2);
+    String prefix = scriptTag2 == null ? "" : " ";
     visitList4(prefix, directives2, " ");
-    prefix = scriptTag6 == null && directives2.isEmpty ? "" : " ";
+    prefix = scriptTag2 == null && directives2.isEmpty ? "" : " ";
     visitList4(prefix, node.declarations, " ");
     return null;
   }
@@ -12473,10 +12542,10 @@
   Object visitFormalParameterList(FormalParameterList node) {
     String groupEnd = null;
     _writer.print('(');
-    NodeList<FormalParameter> parameters9 = node.parameters;
-    int size2 = parameters9.length;
+    NodeList<FormalParameter> parameters2 = node.parameters;
+    int size2 = parameters2.length;
     for (int i = 0; i < size2; i++) {
-      FormalParameter parameter = parameters9[i];
+      FormalParameter parameter = parameters2[i];
       if (i > 0) {
         _writer.print(", ");
       }
@@ -12498,10 +12567,10 @@
     return null;
   }
   Object visitForStatement(ForStatement node) {
-    Expression initialization3 = node.initialization;
+    Expression initialization2 = node.initialization;
     _writer.print("for (");
-    if (initialization3 != null) {
-      visit(initialization3);
+    if (initialization2 != null) {
+      visit(initialization2);
     } else {
       visit(node.variables);
     }
@@ -12699,6 +12768,12 @@
     visit3(" ", node.expression);
     return null;
   }
+  Object visitNativeFunctionBody(NativeFunctionBody node) {
+    _writer.print("native ");
+    visit(node.stringLiteral);
+    _writer.print(';');
+    return null;
+  }
   Object visitNullLiteral(NullLiteral node) {
     _writer.print("null");
     return null;
@@ -12758,12 +12833,12 @@
     return null;
   }
   Object visitReturnStatement(ReturnStatement node) {
-    Expression expression14 = node.expression;
-    if (expression14 == null) {
+    Expression expression2 = node.expression;
+    if (expression2 == null) {
       _writer.print("return;");
     } else {
       _writer.print("return ");
-      expression14.accept(this);
+      expression2.accept(this);
       _writer.print(";");
     }
     return null;
@@ -12965,8 +13040,8 @@
    */
   void visitList2(NodeList<ASTNode> nodes, String separator) {
     if (nodes != null) {
-      int size3 = nodes.length;
-      for (int i = 0; i < size3; i++) {
+      int size2 = nodes.length;
+      for (int i = 0; i < size2; i++) {
         if (i > 0) {
           _writer.print(separator);
         }
@@ -12982,9 +13057,9 @@
    */
   void visitList3(NodeList<ASTNode> nodes, String separator, String suffix) {
     if (nodes != null) {
-      int size4 = nodes.length;
-      if (size4 > 0) {
-        for (int i = 0; i < size4; i++) {
+      int size2 = nodes.length;
+      if (size2 > 0) {
+        for (int i = 0; i < size2; i++) {
           if (i > 0) {
             _writer.print(separator);
           }
@@ -13002,10 +13077,10 @@
    */
   void visitList4(String prefix, NodeList<ASTNode> nodes, String separator) {
     if (nodes != null) {
-      int size5 = nodes.length;
-      if (size5 > 0) {
+      int size2 = nodes.length;
+      if (size2 > 0) {
         _writer.print(prefix);
-        for (int i = 0; i < size5; i++) {
+        for (int i = 0; i < size2; i++) {
           if (i > 0) {
             _writer.print(separator);
           }
@@ -13016,6 +13091,147 @@
   }
 }
 /**
+ * Instances of the class {@code ASTCloner} implement an object that will clone any AST structure
+ * that it visits. The cloner will only clone the structure, it will not preserve any resolution
+ * results or properties associated with the nodes.
+ */
+class ASTCloner implements ASTVisitor<ASTNode> {
+  AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => new AdjacentStrings.full(clone2(node.strings));
+  Annotation visitAnnotation(Annotation node) => new Annotation.full(node.atSign, clone(node.name), node.period, clone(node.constructorName), clone(node.arguments));
+  ArgumentDefinitionTest visitArgumentDefinitionTest(ArgumentDefinitionTest node) => new ArgumentDefinitionTest.full(node.question, clone(node.identifier));
+  ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList.full(node.leftParenthesis, clone2(node.arguments), node.rightParenthesis);
+  AsExpression visitAsExpression(AsExpression node) => new AsExpression.full(clone(node.expression), node.asOperator, clone(node.type));
+  ASTNode visitAssertStatement(AssertStatement node) => new AssertStatement.full(node.keyword, node.leftParenthesis, clone(node.condition), node.rightParenthesis, node.semicolon);
+  AssignmentExpression visitAssignmentExpression(AssignmentExpression node) => new AssignmentExpression.full(clone(node.leftHandSide), node.operator, clone(node.rightHandSide));
+  BinaryExpression visitBinaryExpression(BinaryExpression node) => new BinaryExpression.full(clone(node.leftOperand), node.operator, clone(node.rightOperand));
+  Block visitBlock(Block node) => new Block.full(node.leftBracket, clone2(node.statements), node.rightBracket);
+  BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockFunctionBody.full(clone(node.block));
+  BooleanLiteral visitBooleanLiteral(BooleanLiteral node) => new BooleanLiteral.full(node.literal, node.value);
+  BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement.full(node.keyword, clone(node.label), node.semicolon);
+  CascadeExpression visitCascadeExpression(CascadeExpression node) => new CascadeExpression.full(clone(node.target), clone2(node.cascadeSections));
+  CatchClause visitCatchClause(CatchClause node) => new CatchClause.full(node.onKeyword, clone(node.exceptionType), node.catchKeyword, node.leftParenthesis, clone(node.exceptionParameter), node.comma, clone(node.stackTraceParameter), node.rightParenthesis, clone(node.body));
+  ClassDeclaration visitClassDeclaration(ClassDeclaration node) => new ClassDeclaration.full(clone(node.documentationComment), clone2(node.metadata), node.abstractKeyword, node.classKeyword, clone(node.name), clone(node.typeParameters), clone(node.extendsClause), clone(node.withClause), clone(node.implementsClause), node.leftBracket, clone2(node.members), node.rightBracket);
+  ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias.full(clone(node.documentationComment), clone2(node.metadata), node.keyword, clone(node.name), clone(node.typeParameters), node.equals, node.abstractKeyword, clone(node.superclass), clone(node.withClause), clone(node.implementsClause), node.semicolon);
+  Comment visitComment(Comment node) {
+    if (node.isDocumentation()) {
+      return Comment.createDocumentationComment2(node.tokens, clone2(node.references));
+    } else if (node.isBlock()) {
+      return Comment.createBlockComment(node.tokens);
+    }
+    return Comment.createEndOfLineComment(node.tokens);
+  }
+  CommentReference visitCommentReference(CommentReference node) => new CommentReference.full(node.newKeyword, clone(node.identifier));
+  CompilationUnit visitCompilationUnit(CompilationUnit node) {
+    CompilationUnit clone22 = new CompilationUnit.full(node.beginToken, clone(node.scriptTag), clone2(node.directives), clone2(node.declarations), node.endToken);
+    clone22.lineInfo = node.lineInfo;
+    clone22.parsingErrors = node.parsingErrors;
+    clone22.resolutionErrors = node.resolutionErrors;
+    return clone22;
+  }
+  ConditionalExpression visitConditionalExpression(ConditionalExpression node) => new ConditionalExpression.full(clone(node.condition), node.question, clone(node.thenExpression), node.colon, clone(node.elseExpression));
+  ConstructorDeclaration visitConstructorDeclaration(ConstructorDeclaration node) => new ConstructorDeclaration.full(clone(node.documentationComment), clone2(node.metadata), node.externalKeyword, node.constKeyword, node.factoryKeyword, clone(node.returnType), node.period, clone(node.name), clone(node.parameters), node.separator, clone2(node.initializers), clone(node.redirectedConstructor), clone(node.body));
+  ConstructorFieldInitializer visitConstructorFieldInitializer(ConstructorFieldInitializer node) => new ConstructorFieldInitializer.full(node.keyword, node.period, clone(node.fieldName), node.equals, clone(node.expression));
+  ConstructorName visitConstructorName(ConstructorName node) => new ConstructorName.full(clone(node.type), node.period, clone(node.name));
+  ContinueStatement visitContinueStatement(ContinueStatement node) => new ContinueStatement.full(node.keyword, clone(node.label), node.semicolon);
+  DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => new DeclaredIdentifier.full(clone(node.documentationComment), clone2(node.metadata), node.keyword, clone(node.type), clone(node.identifier));
+  DefaultFormalParameter visitDefaultFormalParameter(DefaultFormalParameter node) => new DefaultFormalParameter.full(clone(node.parameter), node.kind, node.separator, clone(node.defaultValue));
+  DoStatement visitDoStatement(DoStatement node) => new DoStatement.full(node.doKeyword, clone(node.body), node.whileKeyword, node.leftParenthesis, clone(node.condition), node.rightParenthesis, node.semicolon);
+  DoubleLiteral visitDoubleLiteral(DoubleLiteral node) => new DoubleLiteral.full(node.literal, node.value);
+  EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => new EmptyFunctionBody.full(node.semicolon);
+  EmptyStatement visitEmptyStatement(EmptyStatement node) => new EmptyStatement.full(node.semicolon);
+  ExportDirective visitExportDirective(ExportDirective node) => new ExportDirective.full(clone(node.documentationComment), clone2(node.metadata), node.keyword, clone(node.uri), clone2(node.combinators), node.semicolon);
+  ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node) => new ExpressionFunctionBody.full(node.functionDefinition, clone(node.expression), node.semicolon);
+  ExpressionStatement visitExpressionStatement(ExpressionStatement node) => new ExpressionStatement.full(clone(node.expression), node.semicolon);
+  ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause.full(node.keyword, clone(node.superclass));
+  FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => new FieldDeclaration.full(clone(node.documentationComment), clone2(node.metadata), node.keyword, clone(node.fields), node.semicolon);
+  FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => new FieldFormalParameter.full(clone(node.documentationComment), clone2(node.metadata), node.keyword, clone(node.type), node.thisToken, node.period, clone(node.identifier));
+  ForEachStatement visitForEachStatement(ForEachStatement node) => new ForEachStatement.full(node.forKeyword, node.leftParenthesis, clone(node.loopVariable), node.inKeyword, clone(node.iterator), node.rightParenthesis, clone(node.body));
+  FormalParameterList visitFormalParameterList(FormalParameterList node) => new FormalParameterList.full(node.leftParenthesis, clone2(node.parameters), node.leftDelimiter, node.rightDelimiter, node.rightParenthesis);
+  ForStatement visitForStatement(ForStatement node) => new ForStatement.full(node.forKeyword, node.leftParenthesis, clone(node.variables), clone(node.initialization), node.leftSeparator, clone(node.condition), node.rightSeparator, clone2(node.updaters), node.rightParenthesis, clone(node.body));
+  FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => new FunctionDeclaration.full(clone(node.documentationComment), clone2(node.metadata), node.externalKeyword, clone(node.returnType), node.propertyKeyword, clone(node.name), clone(node.functionExpression));
+  FunctionDeclarationStatement visitFunctionDeclarationStatement(FunctionDeclarationStatement node) => new FunctionDeclarationStatement.full(clone(node.functionDeclaration));
+  FunctionExpression visitFunctionExpression(FunctionExpression node) => new FunctionExpression.full(clone(node.parameters), clone(node.body));
+  FunctionExpressionInvocation visitFunctionExpressionInvocation(FunctionExpressionInvocation node) => new FunctionExpressionInvocation.full(clone(node.function), clone(node.argumentList));
+  FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => new FunctionTypeAlias.full(clone(node.documentationComment), clone2(node.metadata), node.keyword, clone(node.returnType), clone(node.name), clone(node.typeParameters), clone(node.parameters), node.semicolon);
+  FunctionTypedFormalParameter visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) => new FunctionTypedFormalParameter.full(clone(node.documentationComment), clone2(node.metadata), clone(node.returnType), clone(node.identifier), clone(node.parameters));
+  HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator.full(node.keyword, clone2(node.hiddenNames));
+  IfStatement visitIfStatement(IfStatement node) => new IfStatement.full(node.ifKeyword, node.leftParenthesis, clone(node.condition), node.rightParenthesis, clone(node.thenStatement), node.elseKeyword, clone(node.elseStatement));
+  ImplementsClause visitImplementsClause(ImplementsClause node) => new ImplementsClause.full(node.keyword, clone2(node.interfaces));
+  ImportDirective visitImportDirective(ImportDirective node) => new ImportDirective.full(clone(node.documentationComment), clone2(node.metadata), node.keyword, clone(node.uri), node.asToken, clone(node.prefix), clone2(node.combinators), node.semicolon);
+  IndexExpression visitIndexExpression(IndexExpression node) {
+    Token period2 = node.period;
+    if (period2 == null) {
+      return new IndexExpression.forTarget_full(clone(node.array), node.leftBracket, clone(node.index), node.rightBracket);
+    } else {
+      return new IndexExpression.forCascade_full(period2, node.leftBracket, clone(node.index), node.rightBracket);
+    }
+  }
+  InstanceCreationExpression visitInstanceCreationExpression(InstanceCreationExpression node) => new InstanceCreationExpression.full(node.keyword, clone(node.constructorName), clone(node.argumentList));
+  IntegerLiteral visitIntegerLiteral(IntegerLiteral node) => new IntegerLiteral.full(node.literal, node.value);
+  InterpolationExpression visitInterpolationExpression(InterpolationExpression node) => new InterpolationExpression.full(node.leftBracket, clone(node.expression), node.rightBracket);
+  InterpolationString visitInterpolationString(InterpolationString node) => new InterpolationString.full(node.contents, node.value);
+  IsExpression visitIsExpression(IsExpression node) => new IsExpression.full(clone(node.expression), node.isOperator, node.notOperator, clone(node.type));
+  Label visitLabel(Label node) => new Label.full(clone(node.label), node.colon);
+  LabeledStatement visitLabeledStatement(LabeledStatement node) => new LabeledStatement.full(clone2(node.labels), clone(node.statement));
+  LibraryDirective visitLibraryDirective(LibraryDirective node) => new LibraryDirective.full(clone(node.documentationComment), clone2(node.metadata), node.libraryToken, clone(node.name), node.semicolon);
+  LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) => new LibraryIdentifier.full(clone2(node.components));
+  ListLiteral visitListLiteral(ListLiteral node) => new ListLiteral.full(node.modifier, clone(node.typeArguments), node.leftBracket, clone2(node.elements), node.rightBracket);
+  MapLiteral visitMapLiteral(MapLiteral node) => new MapLiteral.full(node.modifier, clone(node.typeArguments), node.leftBracket, clone2(node.entries), node.rightBracket);
+  MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) => new MapLiteralEntry.full(clone(node.key), node.separator, clone(node.value));
+  MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => new MethodDeclaration.full(clone(node.documentationComment), clone2(node.metadata), node.externalKeyword, node.modifierKeyword, clone(node.returnType), node.propertyKeyword, node.operatorKeyword, clone(node.name), clone(node.parameters), clone(node.body));
+  MethodInvocation visitMethodInvocation(MethodInvocation node) => new MethodInvocation.full(clone(node.target), node.period, clone(node.methodName), clone(node.argumentList));
+  NamedExpression visitNamedExpression(NamedExpression node) => new NamedExpression.full(clone(node.name), clone(node.expression));
+  NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => new NativeFunctionBody.full(node.nativeToken, clone(node.stringLiteral), node.semicolon);
+  NullLiteral visitNullLiteral(NullLiteral node) => new NullLiteral.full(node.literal);
+  ParenthesizedExpression visitParenthesizedExpression(ParenthesizedExpression node) => new ParenthesizedExpression.full(node.leftParenthesis, clone(node.expression), node.rightParenthesis);
+  PartDirective visitPartDirective(PartDirective node) => new PartDirective.full(clone(node.documentationComment), clone2(node.metadata), node.partToken, clone(node.uri), node.semicolon);
+  PartOfDirective visitPartOfDirective(PartOfDirective node) => new PartOfDirective.full(clone(node.documentationComment), clone2(node.metadata), node.partToken, node.ofToken, clone(node.libraryName), node.semicolon);
+  PostfixExpression visitPostfixExpression(PostfixExpression node) => new PostfixExpression.full(clone(node.operand), node.operator);
+  PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) => new PrefixedIdentifier.full(clone(node.prefix), node.period, clone(node.identifier));
+  PrefixExpression visitPrefixExpression(PrefixExpression node) => new PrefixExpression.full(node.operator, clone(node.operand));
+  PropertyAccess visitPropertyAccess(PropertyAccess node) => new PropertyAccess.full(clone(node.target), node.operator, clone(node.propertyName));
+  RedirectingConstructorInvocation visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) => new RedirectingConstructorInvocation.full(node.keyword, node.period, clone(node.constructorName), clone(node.argumentList));
+  RethrowExpression visitRethrowExpression(RethrowExpression node) => new RethrowExpression.full(node.keyword);
+  ReturnStatement visitReturnStatement(ReturnStatement node) => new ReturnStatement.full(node.keyword, clone(node.expression), node.semicolon);
+  ScriptTag visitScriptTag(ScriptTag node) => new ScriptTag.full(node.scriptTag);
+  ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator.full(node.keyword, clone2(node.shownNames));
+  SimpleFormalParameter visitSimpleFormalParameter(SimpleFormalParameter node) => new SimpleFormalParameter.full(clone(node.documentationComment), clone2(node.metadata), node.keyword, clone(node.type), clone(node.identifier));
+  SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) => new SimpleIdentifier.full(node.token);
+  SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) => new SimpleStringLiteral.full(node.literal, node.value);
+  StringInterpolation visitStringInterpolation(StringInterpolation node) => new StringInterpolation.full(clone2(node.elements));
+  SuperConstructorInvocation visitSuperConstructorInvocation(SuperConstructorInvocation node) => new SuperConstructorInvocation.full(node.keyword, node.period, clone(node.constructorName), clone(node.argumentList));
+  SuperExpression visitSuperExpression(SuperExpression node) => new SuperExpression.full(node.keyword);
+  SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase.full(clone2(node.labels), node.keyword, clone(node.expression), node.colon, clone2(node.statements));
+  SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault.full(clone2(node.labels), node.keyword, node.colon, clone2(node.statements));
+  SwitchStatement visitSwitchStatement(SwitchStatement node) => new SwitchStatement.full(node.keyword, node.leftParenthesis, clone(node.expression), node.rightParenthesis, node.leftBracket, clone2(node.members), node.rightBracket);
+  ThisExpression visitThisExpression(ThisExpression node) => new ThisExpression.full(node.keyword);
+  ThrowExpression visitThrowExpression(ThrowExpression node) => new ThrowExpression.full(node.keyword, clone(node.expression));
+  TopLevelVariableDeclaration visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) => new TopLevelVariableDeclaration.full(clone(node.documentationComment), clone2(node.metadata), clone(node.variables), node.semicolon);
+  TryStatement visitTryStatement(TryStatement node) => new TryStatement.full(node.tryKeyword, clone(node.body), clone2(node.catchClauses), node.finallyKeyword, clone(node.finallyClause));
+  TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => new TypeArgumentList.full(node.leftBracket, clone2(node.arguments), node.rightBracket);
+  TypeName visitTypeName(TypeName node) => new TypeName.full(clone(node.name), clone(node.typeArguments));
+  TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter.full(clone(node.documentationComment), clone2(node.metadata), clone(node.name), node.keyword, clone(node.bound));
+  TypeParameterList visitTypeParameterList(TypeParameterList node) => new TypeParameterList.full(node.leftBracket, clone2(node.typeParameters), node.rightBracket);
+  VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => new VariableDeclaration.full(clone(node.documentationComment), clone2(node.metadata), clone(node.name), node.equals, clone(node.initializer));
+  VariableDeclarationList visitVariableDeclarationList(VariableDeclarationList node) => new VariableDeclarationList.full(clone(node.documentationComment), clone2(node.metadata), node.keyword, clone(node.type), clone2(node.variables));
+  VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclarationStatement node) => new VariableDeclarationStatement.full(clone(node.variables), node.semicolon);
+  WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement.full(node.keyword, node.leftParenthesis, clone(node.condition), node.rightParenthesis, clone(node.body));
+  WithClause visitWithClause(WithClause node) => new WithClause.full(node.withKeyword, clone2(node.mixinTypes));
+  ASTNode clone(ASTNode node) {
+    if (node == null) {
+      return null;
+    }
+    return node.accept(this) as ASTNode;
+  }
+  List clone2(NodeList nodes) {
+    List clonedNodes = new List();
+    for (ASTNode node in nodes) {
+      clonedNodes.add((node.accept(this) as ASTNode));
+    }
+    return clonedNodes;
+  }
+}
+/**
  * Instances of the class {@code NodeList} represent a list of AST nodes that have a common parent.
  */
 class NodeList<E extends ASTNode> extends ListWrapper<E> {
diff --git a/pkg/analyzer_experimental/lib/src/generated/constant.dart b/pkg/analyzer_experimental/lib/src/generated/constant.dart
index 6dfbb47..67dfbdb 100644
--- a/pkg/analyzer_experimental/lib/src/generated/constant.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/constant.dart
@@ -9,6 +9,7 @@
 import 'scanner.dart' show TokenType;
 import 'ast.dart';
 import 'element.dart';
+import 'engine.dart' show AnalysisEngine;
 
 /**
  * Instances of the class {@code ConstantEvaluator} evaluate constant expressions to produce their
@@ -124,6 +125,131 @@
   bool isValid() => _errors == null;
 }
 /**
+ * Instances of the class {@code ConstantFinder} are used to traverse the AST structures of all of
+ * the compilation units being resolved and build a table mapping constant variable elements to the
+ * declarations of those variables.
+ */
+class ConstantFinder extends RecursiveASTVisitor<Object> {
+  /**
+   * A table mapping constant variable elements to the declarations of those variables.
+   */
+  Map<VariableElement, VariableDeclaration> _variableMap = new Map<VariableElement, VariableDeclaration>();
+  /**
+   * Initialize a newly created constant finder.
+   */
+  ConstantFinder() : super() {
+  }
+  /**
+   * Return a table mapping constant variable elements to the declarations of those variables.
+   * @return a table mapping constant variable elements to the declarations of those variables
+   */
+  Map<VariableElement, VariableDeclaration> get variableMap => _variableMap;
+  Object visitVariableDeclaration(VariableDeclaration node) {
+    super.visitVariableDeclaration(node);
+    Expression initializer2 = node.initializer;
+    if (initializer2 != null && node.isConst()) {
+      VariableElement element2 = node.element;
+      if (element2 != null) {
+        _variableMap[element2] = node;
+      }
+    }
+    return null;
+  }
+}
+/**
+ * Instances of the class {@code ConstantValueComputer} compute the values of constant variables in
+ * one or more compilation units. The expected usage pattern is for the compilation units to be
+ * added to this computer using the method {@link #add(CompilationUnit)} and then for the method{@link #computeValues()} to invoked exactly once. Any use of an instance after invoking the
+ * method {@link #computeValues()} will result in unpredictable behavior.
+ */
+class ConstantValueComputer {
+  /**
+   * The object used to find constant variables in the compilation units that were added.
+   */
+  ConstantFinder _constantFinder = new ConstantFinder();
+  /**
+   * A graph in which the nodes are the constant variables and the edges are from each variable to
+   * the other constant variables that are referenced in the head's initializer.
+   */
+  DirectedGraph<VariableElement> _referenceGraph = new DirectedGraph<VariableElement>();
+  /**
+   * A table mapping constant variables to the declarations of those variables.
+   */
+  Map<VariableElement, VariableDeclaration> _declarationMap;
+  /**
+   * Initialize a newly created constant value computer.
+   */
+  ConstantValueComputer() : super() {
+  }
+  /**
+   * Add the constant variables in the given compilation unit to the list of constant variables
+   * whose value needs to be computed.
+   * @param unit the compilation unit defining the constant variables to be added
+   */
+  void add(CompilationUnit unit) {
+    unit.accept(_constantFinder);
+  }
+  /**
+   * Compute values for all of the constant variables in the compilation units that were added.
+   */
+  void computeValues() {
+    _declarationMap = _constantFinder.variableMap;
+    for (MapEntry<VariableElement, VariableDeclaration> entry in getMapEntrySet(_declarationMap)) {
+      VariableElement element = entry.getKey();
+      ReferenceFinder referenceFinder = new ReferenceFinder(element, _referenceGraph);
+      _referenceGraph.addNode(element);
+      entry.getValue().initializer.accept(referenceFinder);
+    }
+    while (!_referenceGraph.isEmpty()) {
+      VariableElement element = _referenceGraph.removeSink();
+      while (element != null) {
+        computeValueFor(element);
+        element = _referenceGraph.removeSink();
+      }
+      if (!_referenceGraph.isEmpty()) {
+        List<VariableElement> variablesInCycle = _referenceGraph.findCycle();
+        if (variablesInCycle == null) {
+          AnalysisEngine.instance.logger.logError("Exiting constant value computer with ${_referenceGraph.nodeCount} variables that are neither sinks no in a cycle");
+          return;
+        }
+        for (VariableElement variable in variablesInCycle) {
+          generateCycleError(variablesInCycle, variable);
+        }
+        _referenceGraph.removeAllNodes(variablesInCycle);
+      }
+    }
+  }
+  /**
+   * Compute a value for the given variable.
+   * @param variable the variable for which a value is to be computed
+   */
+  void computeValueFor(VariableElement variable) {
+    VariableDeclaration declaration = _declarationMap[variable];
+    if (declaration == null) {
+      return;
+    }
+    EvaluationResultImpl result = declaration.initializer.accept(new ConstantVisitor());
+    ((variable as VariableElementImpl)).evaluationResult = result;
+    if (result is ErrorResult) {
+      List<AnalysisError> errors = new List<AnalysisError>();
+      for (ErrorResult_ErrorData data in ((result as ErrorResult)).errorData) {
+        ASTNode node2 = data.node;
+        Source source2 = variable.getAncestor(CompilationUnitElement).source;
+        errors.add(new AnalysisError.con2(source2, node2.offset, node2.length, data.errorCode, []));
+      }
+    }
+  }
+  /**
+   * Generate an error indicating that the given variable is not a valid compile-time constant
+   * because it references at least one of the variables in the given cycle, each of which directly
+   * or indirectly references the variable.
+   * @param variablesInCycle the variables in the cycle that includes the given variable
+   * @param variable the variable that is not a valid compile-time constant
+   */
+  void generateCycleError(List<VariableElement> variablesInCycle, VariableElement variable) {
+  }
+}
+/**
  * Instances of the class {@code ConstantVisitor} evaluate constant expressions to produce their
  * compile-time value. According to the Dart Language Specification: <blockquote> A constant
  * expression is one of the following:
@@ -251,18 +377,18 @@
     return ValidResult.RESULT_OBJECT;
   }
   EvaluationResultImpl visitMethodInvocation(MethodInvocation node) {
-    Element element23 = node.methodName.element;
-    if (element23 is FunctionElement) {
-      FunctionElement function = element23 as FunctionElement;
+    Element element2 = node.methodName.element;
+    if (element2 is FunctionElement) {
+      FunctionElement function = element2 as FunctionElement;
       if (function.name == "identical") {
-        NodeList<Expression> arguments3 = node.argumentList.arguments;
-        if (arguments3.length == 2) {
+        NodeList<Expression> arguments2 = node.argumentList.arguments;
+        if (arguments2.length == 2) {
           Element enclosingElement2 = function.enclosingElement;
           if (enclosingElement2 is CompilationUnitElement) {
-            LibraryElement library20 = ((enclosingElement2 as CompilationUnitElement)).library;
-            if (library20.isDartCore()) {
-              EvaluationResultImpl leftArgument = arguments3[0].accept(this);
-              EvaluationResultImpl rightArgument = arguments3[1].accept(this);
+            LibraryElement library2 = ((enclosingElement2 as CompilationUnitElement)).library;
+            if (library2.isDartCore()) {
+              EvaluationResultImpl leftArgument = arguments2[0].accept(this);
+              EvaluationResultImpl rightArgument = arguments2[1].accept(this);
               return leftArgument.equalEqual(node, rightArgument);
             }
           }
@@ -276,14 +402,14 @@
   EvaluationResultImpl visitParenthesizedExpression(ParenthesizedExpression node) => node.expression.accept(this);
   EvaluationResultImpl visitPrefixedIdentifier(PrefixedIdentifier node) => getConstantValue(node, node.element);
   EvaluationResultImpl visitPrefixExpression(PrefixExpression node) {
-    EvaluationResultImpl operand3 = node.operand.accept(this);
+    EvaluationResultImpl operand2 = node.operand.accept(this);
     while (true) {
       if (node.operator.type == TokenType.BANG) {
-        return operand3.logicalNot(node);
+        return operand2.logicalNot(node);
       } else if (node.operator.type == TokenType.TILDE) {
-        return operand3.bitNot(node);
+        return operand2.bitNot(node);
       } else if (node.operator.type == TokenType.MINUS) {
-        return operand3.negated(node);
+        return operand2.negated(node);
       }
       break;
     }
@@ -317,14 +443,16 @@
    * @return the constant value of the static constant
    */
   EvaluationResultImpl getConstantValue(ASTNode node, Element element) {
-    if (element is PropertyAccessorElementImpl) {
-      element = ((element as PropertyAccessorElementImpl)).variable;
+    if (element is PropertyAccessorElement) {
+      element = ((element as PropertyAccessorElement)).variable;
     }
     if (element is VariableElementImpl) {
       EvaluationResultImpl value = ((element as VariableElementImpl)).evaluationResult;
       if (value != null) {
         return value;
       }
+    } else if (element is ExecutableElement) {
+      return new ValidResult(element);
     }
     return error(node, null);
   }
@@ -348,6 +476,147 @@
   }
 }
 /**
+ * Instances of the class {@code DirectedGraph} implement a directed graph in which the nodes are
+ * arbitrary (client provided) objects and edges are represented implicitly. The graph will allow an
+ * edge from any node to any other node, including itself, but will not represent multiple edges
+ * between the same pair of nodes.
+ * @param N the type of the nodes in the graph
+ */
+class DirectedGraph<N> {
+  /**
+   * The table encoding the edges in the graph. An edge is represented by an entry mapping the head
+   * to a set of tails. Nodes that are not the head of any edge are represented by an entry mapping
+   * the node to an empty set of tails.
+   */
+  Map<N, Set<N>> _edges = new Map<N, Set<N>>();
+  /**
+   * Initialize a newly create directed graph to be empty.
+   */
+  DirectedGraph() : super() {
+  }
+  /**
+   * Add an edge from the given head node to the given tail node. Both nodes will be a part of the
+   * graph after this method is invoked, whether or not they were before.
+   * @param head the node at the head of the edge
+   * @param tail the node at the tail of the edge
+   */
+  void addEdge(N head, N tail) {
+    Set<N> tails = _edges[tail];
+    if (tails == null) {
+      _edges[tail] = new Set<N>();
+    }
+    tails = _edges[head];
+    if (tails == null) {
+      tails = new Set<N>();
+      _edges[head] = tails;
+    }
+    javaSetAdd(tails, tail);
+  }
+  /**
+   * Add the given node to the set of nodes in the graph.
+   * @param node the node to be added
+   */
+  void addNode(N node) {
+    Set<N> tails = _edges[node];
+    if (tails == null) {
+      _edges[node] = new Set<N>();
+    }
+  }
+  /**
+   * Return a list of nodes that form a cycle, or {@code null} if there are no cycles in this graph.
+   * @return a list of nodes that form a cycle
+   */
+  List<N> findCycle() => null;
+  /**
+   * Return the number of nodes in this graph.
+   * @return the number of nodes in this graph
+   */
+  int get nodeCount => _edges.length;
+  /**
+   * Return a set containing the tails of edges that have the given node as their head. The set will
+   * be empty if there are no such edges or if the node is not part of the graph. Clients must not
+   * modify the returned set.
+   * @param head the node at the head of all of the edges whose tails are to be returned
+   * @return a set containing the tails of edges that have the given node as their head
+   */
+  Set<N> getTails(N head) {
+    Set<N> tails = _edges[head];
+    if (tails == null) {
+      return new Set<N>();
+    }
+    return tails;
+  }
+  /**
+   * Return {@code true} if this graph is empty.
+   * @return {@code true} if this graph is empty
+   */
+  bool isEmpty() => _edges.isEmpty;
+  /**
+   * Remove all of the given nodes from this graph. As a consequence, any edges for which those
+   * nodes were either a head or a tail will also be removed.
+   * @param nodes the nodes to be removed
+   */
+  void removeAllNodes(List<N> nodes) {
+    for (N node in nodes) {
+      removeNode(node);
+    }
+  }
+  /**
+   * Remove the edge from the given head node to the given tail node. If there was no such edge then
+   * the graph will be unmodified: the number of edges will be the same and the set of nodes will be
+   * the same (neither node will either be added or removed).
+   * @param head the node at the head of the edge
+   * @param tail the node at the tail of the edge
+   * @return {@code true} if the graph was modified as a result of this operation
+   */
+  void removeEdge(N head, N tail) {
+    Set<N> tails = _edges[head];
+    if (tails != null) {
+      tails.remove(tail);
+    }
+  }
+  /**
+   * Remove the given node from this graph. As a consequence, any edges for which that node was
+   * either a head or a tail will also be removed.
+   * @param node the node to be removed
+   */
+  void removeNode(N node) {
+    _edges.remove(node);
+    for (Set<N> tails in _edges.values) {
+      tails.remove(node);
+    }
+  }
+  /**
+   * Find one node (referred to as a sink node) that has no outgoing edges (that is, for which there
+   * are no edges that have that node as the head of the edge) and remove it from this graph. Return
+   * the node that was removed, or {@code null} if there are no such nodes either because the graph
+   * is empty or because every node in the graph has at least one outgoing edge. As a consequence of
+   * removing the node from the graph any edges for which that node was a tail will also be removed.
+   * @return the sink node that was removed
+   */
+  N removeSink() {
+    N sink = findSink();
+    if (sink == null) {
+      return null;
+    }
+    removeNode(sink);
+    return sink;
+  }
+  /**
+   * Return one node that has no outgoing edges (that is, for which there are no edges that have
+   * that node as the head of the edge), or {@code null} if there are no such nodes.
+   * @return a sink node
+   */
+  N findSink() {
+    for (MapEntry<N, Set<N>> entry in getMapEntrySet(_edges)) {
+      if (entry.getValue().isEmpty) {
+        return entry.getKey();
+      }
+    }
+    return null;
+  }
+}
+/**
  * Instances of the class {@code ErrorResult} represent the result of evaluating an expression that
  * is not a valid compile time constant.
  */
@@ -363,9 +632,9 @@
    * @param errorCode the error code for the error to be generated
    */
   ErrorResult.con1(ASTNode node, ErrorCode errorCode) {
-    _jtd_constructor_157_impl(node, errorCode);
+    _jtd_constructor_162_impl(node, errorCode);
   }
-  _jtd_constructor_157_impl(ASTNode node, ErrorCode errorCode) {
+  _jtd_constructor_162_impl(ASTNode node, ErrorCode errorCode) {
     _errors.add(new ErrorResult_ErrorData(node, errorCode));
   }
   /**
@@ -375,9 +644,9 @@
    * @param secondResult the second set of results being merged
    */
   ErrorResult.con2(ErrorResult firstResult, ErrorResult secondResult) {
-    _jtd_constructor_158_impl(firstResult, secondResult);
+    _jtd_constructor_163_impl(firstResult, secondResult);
   }
-  _jtd_constructor_158_impl(ErrorResult firstResult, ErrorResult secondResult) {
+  _jtd_constructor_163_impl(ErrorResult firstResult, ErrorResult secondResult) {
     _errors.addAll(firstResult._errors);
     _errors.addAll(secondResult._errors);
   }
@@ -390,7 +659,6 @@
   EvaluationResultImpl divide(BinaryExpression node, EvaluationResultImpl rightOperand) => rightOperand.divideError(node, this);
   EvaluationResultImpl equalEqual(Expression node, EvaluationResultImpl rightOperand) => rightOperand.equalEqualError(node, this);
   List<ErrorResult_ErrorData> get errorData => _errors;
-  List<AnalysisError> get errors => new List.from(_errors);
   EvaluationResultImpl greaterThan(BinaryExpression node, EvaluationResultImpl rightOperand) => rightOperand.greaterThanError(node, this);
   EvaluationResultImpl greaterThanOrEqual(BinaryExpression node, EvaluationResultImpl rightOperand) => rightOperand.greaterThanOrEqualError(node, this);
   EvaluationResultImpl integerDivide(BinaryExpression node, EvaluationResultImpl rightOperand) => rightOperand.integerDivideError(node, this);
@@ -549,6 +817,45 @@
   EvaluationResultImpl timesValid(BinaryExpression node, ValidResult leftOperand);
 }
 /**
+ * Instances of the class {@code ReferenceFinder} add reference information for a given variable to
+ * the bi-directional mapping used to order the evaluation of constants.
+ */
+class ReferenceFinder extends RecursiveASTVisitor<Object> {
+  /**
+   * The element representing the variable whose initializer will be visited.
+   */
+  VariableElement _source;
+  /**
+   * A graph in which the nodes are the constant variables and the edges are from each variable to
+   * the other constant variables that are referenced in the head's initializer.
+   */
+  DirectedGraph<VariableElement> _referenceGraph;
+  /**
+   * Initialize a newly created reference finder to find references from the given variable to other
+   * variables and to add those references to the given graph.
+   * @param source the element representing the variable whose initializer will be visited
+   * @param referenceGraph a graph recording which variables (heads) reference which other variables
+   * (tails) in their initializers
+   */
+  ReferenceFinder(VariableElement source, DirectedGraph<VariableElement> referenceGraph) {
+    this._source = source;
+    this._referenceGraph = referenceGraph;
+  }
+  Object visitSimpleIdentifier(SimpleIdentifier node) {
+    Element element2 = node.element;
+    if (element2 is PropertyAccessorElement) {
+      element2 = ((element2 as PropertyAccessorElement)).variable;
+    }
+    if (element2 is VariableElement) {
+      VariableElement variable = element2 as VariableElement;
+      if (variable.isConst()) {
+        _referenceGraph.addEdge(_source, variable);
+      }
+    }
+    return null;
+  }
+}
+/**
  * Instances of the class {@code ValidResult} represent the result of attempting to evaluate a valid
  * compile time constant expression.
  */
@@ -645,8 +952,8 @@
     return _value.toString();
   }
   EvaluationResultImpl addToError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
-  EvaluationResultImpl addToValid(BinaryExpression node, ValidResult leftOperand3) {
-    Object leftValue = leftOperand3.value;
+  EvaluationResultImpl addToValid(BinaryExpression node, ValidResult leftOperand2) {
+    Object leftValue = leftOperand2.value;
     if (leftValue == null) {
       return error(node.leftOperand);
     } else if (_value == null) {
@@ -671,8 +978,8 @@
     return error(node);
   }
   EvaluationResultImpl bitAndError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
-  EvaluationResultImpl bitAndValid(BinaryExpression node, ValidResult leftOperand4) {
-    Object leftValue = leftOperand4.value;
+  EvaluationResultImpl bitAndValid(BinaryExpression node, ValidResult leftOperand2) {
+    Object leftValue = leftOperand2.value;
     if (leftValue == null) {
       return error(node.leftOperand);
     } else if (_value == null) {
@@ -689,8 +996,8 @@
     return union(error(node.leftOperand), error(node.rightOperand));
   }
   EvaluationResultImpl bitOrError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
-  EvaluationResultImpl bitOrValid(BinaryExpression node, ValidResult leftOperand5) {
-    Object leftValue = leftOperand5.value;
+  EvaluationResultImpl bitOrValid(BinaryExpression node, ValidResult leftOperand2) {
+    Object leftValue = leftOperand2.value;
     if (leftValue == null) {
       return error(node.leftOperand);
     } else if (_value == null) {
@@ -707,8 +1014,8 @@
     return union(error(node.leftOperand), error(node.rightOperand));
   }
   EvaluationResultImpl bitXorError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
-  EvaluationResultImpl bitXorValid(BinaryExpression node, ValidResult leftOperand6) {
-    Object leftValue = leftOperand6.value;
+  EvaluationResultImpl bitXorValid(BinaryExpression node, ValidResult leftOperand2) {
+    Object leftValue = leftOperand2.value;
     if (leftValue == null) {
       return error(node.leftOperand);
     } else if (_value == null) {
@@ -733,8 +1040,8 @@
     return error(node);
   }
   EvaluationResultImpl divideError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
-  EvaluationResultImpl divideValid(BinaryExpression node, ValidResult leftOperand7) {
-    Object leftValue = leftOperand7.value;
+  EvaluationResultImpl divideValid(BinaryExpression node, ValidResult leftOperand2) {
+    Object leftValue = leftOperand2.value;
     if (leftValue == null) {
       return error(node.leftOperand);
     } else if (_value == null) {
@@ -742,7 +1049,7 @@
     } else if (leftValue is int) {
       if (_value is int) {
         if (((_value as int)) == 0) {
-          return error2(node.rightOperand, CompileTimeErrorCode.COMPILE_TIME_CONSTANT_RAISES_EXCEPTION_DIVIDE_BY_ZERO);
+          return valueOf3(((leftValue as int)).toDouble() / ((_value as int)).toDouble());
         }
         return valueOf(((leftValue as int)) ~/ (_value as int));
       } else if (_value is double) {
@@ -791,8 +1098,8 @@
   }
   EvaluationResultImpl greaterThanError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
   EvaluationResultImpl greaterThanOrEqualError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
-  EvaluationResultImpl greaterThanOrEqualValid(BinaryExpression node, ValidResult leftOperand8) {
-    Object leftValue = leftOperand8.value;
+  EvaluationResultImpl greaterThanOrEqualValid(BinaryExpression node, ValidResult leftOperand2) {
+    Object leftValue = leftOperand2.value;
     if (leftValue == null) {
       return error(node.leftOperand);
     } else if (_value == null) {
@@ -812,8 +1119,8 @@
     }
     return error(node);
   }
-  EvaluationResultImpl greaterThanValid(BinaryExpression node, ValidResult leftOperand9) {
-    Object leftValue = leftOperand9.value;
+  EvaluationResultImpl greaterThanValid(BinaryExpression node, ValidResult leftOperand2) {
+    Object leftValue = leftOperand2.value;
     if (leftValue == null) {
       return error(node.leftOperand);
     } else if (_value == null) {
@@ -834,8 +1141,8 @@
     return error(node);
   }
   EvaluationResultImpl integerDivideError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
-  EvaluationResultImpl integerDivideValid(BinaryExpression node, ValidResult leftOperand10) {
-    Object leftValue = leftOperand10.value;
+  EvaluationResultImpl integerDivideValid(BinaryExpression node, ValidResult leftOperand2) {
+    Object leftValue = leftOperand2.value;
     if (leftValue == null) {
       return error(node.leftOperand);
     } else if (_value == null) {
@@ -843,7 +1150,7 @@
     } else if (leftValue is int) {
       if (_value is int) {
         if (((_value as int)) == 0) {
-          return error2(node.rightOperand, CompileTimeErrorCode.COMPILE_TIME_CONSTANT_RAISES_EXCEPTION_DIVIDE_BY_ZERO);
+          return valueOf3(((leftValue as int)).toDouble() / ((_value as int)).toDouble());
         }
         return valueOf(((leftValue as int)) ~/ (_value as int));
       } else if (_value is double) {
@@ -863,8 +1170,8 @@
   }
   EvaluationResultImpl lessThanError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
   EvaluationResultImpl lessThanOrEqualError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
-  EvaluationResultImpl lessThanOrEqualValid(BinaryExpression node, ValidResult leftOperand11) {
-    Object leftValue = leftOperand11.value;
+  EvaluationResultImpl lessThanOrEqualValid(BinaryExpression node, ValidResult leftOperand2) {
+    Object leftValue = leftOperand2.value;
     if (leftValue == null) {
       return error(node.leftOperand);
     } else if (_value == null) {
@@ -884,8 +1191,8 @@
     }
     return error(node);
   }
-  EvaluationResultImpl lessThanValid(BinaryExpression node, ValidResult leftOperand12) {
-    Object leftValue = leftOperand12.value;
+  EvaluationResultImpl lessThanValid(BinaryExpression node, ValidResult leftOperand2) {
+    Object leftValue = leftOperand2.value;
     if (leftValue == null) {
       return error(node.leftOperand);
     } else if (_value == null) {
@@ -922,8 +1229,8 @@
     return booleanConversion(node.rightOperand, _value);
   }
   EvaluationResultImpl minusError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
-  EvaluationResultImpl minusValid(BinaryExpression node, ValidResult leftOperand13) {
-    Object leftValue = leftOperand13.value;
+  EvaluationResultImpl minusValid(BinaryExpression node, ValidResult leftOperand2) {
+    Object leftValue = leftOperand2.value;
     if (leftValue == null) {
       return error(node.leftOperand);
     } else if (_value == null) {
@@ -976,17 +1283,17 @@
     return RESULT_TRUE;
   }
   EvaluationResultImpl remainderError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
-  EvaluationResultImpl remainderValid(BinaryExpression node, ValidResult leftOperand14) {
-    Object leftValue = leftOperand14.value;
+  EvaluationResultImpl remainderValid(BinaryExpression node, ValidResult leftOperand2) {
+    Object leftValue = leftOperand2.value;
     if (leftValue == null) {
       return error(node.leftOperand);
     } else if (_value == null) {
       return error(node.rightOperand);
     } else if (leftValue is int) {
-      if (((_value as int)) == 0) {
-        return error2(node.rightOperand, CompileTimeErrorCode.COMPILE_TIME_CONSTANT_RAISES_EXCEPTION_DIVIDE_BY_ZERO);
-      }
       if (_value is int) {
+        if (((_value as int)) == 0) {
+          return valueOf3(((leftValue as int)).toDouble() % ((_value as int)).toDouble());
+        }
         return valueOf(((leftValue as int)).remainder((_value as int)));
       } else if (_value is double) {
         return valueOf3(((leftValue as int)).toDouble() % ((_value as double)));
@@ -1001,8 +1308,8 @@
     return error(node);
   }
   EvaluationResultImpl shiftLeftError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
-  EvaluationResultImpl shiftLeftValid(BinaryExpression node, ValidResult leftOperand15) {
-    Object leftValue = leftOperand15.value;
+  EvaluationResultImpl shiftLeftValid(BinaryExpression node, ValidResult leftOperand2) {
+    Object leftValue = leftOperand2.value;
     if (leftValue == null) {
       return error(node.leftOperand);
     } else if (_value == null) {
@@ -1019,8 +1326,8 @@
     return union(error(node.leftOperand), error(node.rightOperand));
   }
   EvaluationResultImpl shiftRightError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
-  EvaluationResultImpl shiftRightValid(BinaryExpression node, ValidResult leftOperand16) {
-    Object leftValue = leftOperand16.value;
+  EvaluationResultImpl shiftRightValid(BinaryExpression node, ValidResult leftOperand2) {
+    Object leftValue = leftOperand2.value;
     if (leftValue == null) {
       return error(node.leftOperand);
     } else if (_value == null) {
@@ -1037,8 +1344,8 @@
     return union(error(node.leftOperand), error(node.rightOperand));
   }
   EvaluationResultImpl timesError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
-  EvaluationResultImpl timesValid(BinaryExpression node, ValidResult leftOperand17) {
-    Object leftValue = leftOperand17.value;
+  EvaluationResultImpl timesValid(BinaryExpression node, ValidResult leftOperand2) {
+    Object leftValue = leftOperand2.value;
     if (leftValue == null) {
       return error(node.leftOperand);
     } else if (_value == null) {
diff --git a/pkg/analyzer_experimental/lib/src/generated/element.dart b/pkg/analyzer_experimental/lib/src/generated/element.dart
index e3e9d02..0dd5369 100644
--- a/pkg/analyzer_experimental/lib/src/generated/element.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/element.dart
@@ -9,6 +9,7 @@
 import 'source.dart';
 import 'scanner.dart' show Keyword;
 import 'ast.dart' show Identifier, LibraryIdentifier;
+import 'sdk.dart' show DartSdk;
 import 'html.dart' show XmlTagNode;
 import 'engine.dart' show AnalysisContext;
 import 'constant.dart' show EvaluationResultImpl;
@@ -204,15 +205,22 @@
    */
   List<FunctionElement> get functions;
   /**
+   * Return an array containing all of the function type aliases contained in this compilation unit.
+   * @return the function type aliases contained in this compilation unit
+   */
+  List<FunctionTypeAliasElement> get functionTypeAliases;
+  /**
    * Return an array containing all of the top-level variables contained in this compilation unit.
    * @return the top-level variables contained in this compilation unit
    */
   List<TopLevelVariableElement> get topLevelVariables;
   /**
-   * Return an array containing all of the function type aliases contained in this compilation unit.
-   * @return the function type aliases contained in this compilation unit
+   * Return the class defined in this compilation unit that has the given name, or {@code null} if
+   * this compilation unit does not define a class with the given name.
+   * @param className the name of the class to be returned
+   * @return the class with the given name that is defined in this compilation unit
    */
-  List<FunctionTypeAliasElement> get functionTypeAliases;
+  ClassElement getType(String className);
   /**
    * Return an array containing all of the classes contained in this compilation unit.
    * @return the classes contained in this compilation unit
@@ -297,8 +305,9 @@
    */
   ElementKind get kind;
   /**
-   * Return the library that contains this element. This will be {@code null} if this element is a
-   * library or HTML file because libraries and HTML files are not contained in other libraries.
+   * Return the library that contains this element. This will be the element itself if it is a
+   * library element. This will be {@code null} if this element is an HTML file because HTML files
+   * are not contained in libraries.
    * @return the library that contains this element
    */
   LibraryElement get library;
@@ -358,7 +367,7 @@
  * The enumeration {@code ElementKind} defines the various kinds of elements in the element model.
  * @coverage dart.engine.element
  */
-class ElementKind {
+class ElementKind implements Comparable<ElementKind> {
   static final ElementKind CLASS = new ElementKind('CLASS', 0, "class");
   static final ElementKind COMPILATION_UNIT = new ElementKind('COMPILATION_UNIT', 1, "compilation unit");
   static final ElementKind CONSTRUCTOR = new ElementKind('CONSTRUCTOR', 2, "constructor");
@@ -396,6 +405,7 @@
    * @return the name of this {@link ElementKind} to display in UI.
    */
   String get displayName => _displayName;
+  int compareTo(ElementKind other) => __ordinal - other.__ordinal;
   String toString() => __name;
 }
 /**
@@ -424,7 +434,9 @@
   R visitExportElement(ExportElement element);
   R visitExternalHtmlScriptElement(ExternalHtmlScriptElement element);
   R visitFieldElement(FieldElement element);
+  R visitFieldFormalParameterElement(FieldFormalParameterElement element);
   R visitFunctionElement(FunctionElement element);
+  R visitFunctionTypeAliasElement(FunctionTypeAliasElement element);
   R visitHtmlElement(HtmlElement element);
   R visitImportElement(ImportElement element);
   R visitLabelElement(LabelElement element);
@@ -436,7 +448,6 @@
   R visitPrefixElement(PrefixElement element);
   R visitPropertyAccessorElement(PropertyAccessorElement element);
   R visitTopLevelVariableElement(TopLevelVariableElement element);
-  R visitFunctionTypeAliasElement(FunctionTypeAliasElement element);
   R visitTypeVariableElement(TypeVariableElement element);
 }
 /**
@@ -545,6 +556,18 @@
   ClassElement get enclosingElement;
 }
 /**
+ * The interface {@code FieldFormalParameterElement} defines the behavior of elements representing a
+ * field formal parameter defined within a constructor element.
+ */
+abstract class FieldFormalParameterElement implements ParameterElement {
+  /**
+   * Return the field element associated with this field formal parameter, or {@code null} if the
+   * parameter references a field that doesn't exist.
+   * @return the field element associated with this field formal parameter
+   */
+  FieldElement get field;
+}
+/**
  * The interface {@code FunctionElement} defines the behavior of elements representing a function.
  * @coverage dart.engine.element
  */
@@ -703,6 +726,13 @@
    */
   List<PrefixElement> get prefixes;
   /**
+   * Return the class defined in this library that has the given name, or {@code null} if this
+   * library does not define a class with the given name.
+   * @param className the name of the class to be returned
+   * @return the class with the given name that is defined in this library
+   */
+  ClassElement getType(String className);
+  /**
    * Answer {@code true} if this library is an application that can be run in the browser.
    * @return {@code true} if this library is an application that can be run in the browser
    */
@@ -808,6 +838,12 @@
    */
   ParameterKind get parameterKind;
   /**
+   * Return an array containing all of the parameters defined by this parameter. A parameter will
+   * only define other parameters if it is a function typed parameter.
+   * @return the parameters defined by this parameter element
+   */
+  List<ParameterElement> get parameters;
+  /**
    * Return {@code true} if this parameter is an initializing formal parameter.
    * @return {@code true} if this parameter is an initializing formal parameter
    */
@@ -1022,6 +1058,7 @@
  * LocalElement
  * LocalVariableElement
  * ParameterElement
+ * FieldFormalParameterElement
  * </pre>
  * <p>
  * Subclasses that override a visit method must either invoke the overridden visit method or
@@ -1043,7 +1080,9 @@
   R visitExportElement(ExportElement element) => visitElement(element);
   R visitExternalHtmlScriptElement(ExternalHtmlScriptElement element) => visitHtmlScriptElement(element);
   R visitFieldElement(FieldElement element) => visitPropertyInducingElement(element);
+  R visitFieldFormalParameterElement(FieldFormalParameterElement element) => visitParameterElement(element);
   R visitFunctionElement(FunctionElement element) => visitLocalElement(element);
+  R visitFunctionTypeAliasElement(FunctionTypeAliasElement element) => visitElement(element);
   R visitHtmlElement(HtmlElement element) => visitElement(element);
   R visitHtmlScriptElement(HtmlScriptElement element) => visitElement(element);
   R visitImportElement(ImportElement element) => visitElement(element);
@@ -1067,7 +1106,6 @@
   R visitPropertyAccessorElement(PropertyAccessorElement element) => visitExecutableElement(element);
   R visitPropertyInducingElement(PropertyInducingElement element) => visitVariableElement(element);
   R visitTopLevelVariableElement(TopLevelVariableElement element) => visitPropertyInducingElement(element);
-  R visitFunctionTypeAliasElement(FunctionTypeAliasElement element) => visitElement(element);
   R visitTypeVariableElement(TypeVariableElement element) => visitElement(element);
   R visitVariableElement(VariableElement element) => visitElement(element);
 }
@@ -1111,10 +1149,18 @@
     element.visitChildren(this);
     return null;
   }
+  R visitFieldFormalParameterElement(FieldFormalParameterElement element) {
+    element.visitChildren(this);
+    return null;
+  }
   R visitFunctionElement(FunctionElement element) {
     element.visitChildren(this);
     return null;
   }
+  R visitFunctionTypeAliasElement(FunctionTypeAliasElement element) {
+    element.visitChildren(this);
+    return null;
+  }
   R visitHtmlElement(HtmlElement element) {
     element.visitChildren(this);
     return null;
@@ -1159,10 +1205,6 @@
     element.visitChildren(this);
     return null;
   }
-  R visitFunctionTypeAliasElement(FunctionTypeAliasElement element) {
-    element.visitChildren(this);
-    return null;
-  }
   R visitTypeVariableElement(TypeVariableElement element) {
     element.visitChildren(this);
     return null;
@@ -1183,7 +1225,9 @@
   R visitExportElement(ExportElement element) => null;
   R visitExternalHtmlScriptElement(ExternalHtmlScriptElement element) => null;
   R visitFieldElement(FieldElement element) => null;
+  R visitFieldFormalParameterElement(FieldFormalParameterElement element) => null;
   R visitFunctionElement(FunctionElement element) => null;
+  R visitFunctionTypeAliasElement(FunctionTypeAliasElement element) => null;
   R visitHtmlElement(HtmlElement element) => null;
   R visitImportElement(ImportElement element) => null;
   R visitLabelElement(LabelElement element) => null;
@@ -1195,7 +1239,6 @@
   R visitPrefixElement(PrefixElement element) => null;
   R visitPropertyAccessorElement(PropertyAccessorElement element) => null;
   R visitTopLevelVariableElement(TopLevelVariableElement element) => null;
-  R visitFunctionTypeAliasElement(FunctionTypeAliasElement element) => null;
   R visitTypeVariableElement(TypeVariableElement element) => null;
 }
 /**
@@ -1277,60 +1320,116 @@
   accept(ElementVisitor visitor) => visitor.visitClassElement(this);
   List<PropertyAccessorElement> get accessors => _accessors;
   List<InterfaceType> get allSupertypes {
-    Set<InterfaceType> set = new Set<InterfaceType>();
-    collectAllSupertypes(set);
-    return set.toList();
+    Set<InterfaceType> list = new Set<InterfaceType>();
+    collectAllSupertypes(list);
+    return new List.from(list);
   }
-  ElementImpl getChild(String identifier25) {
+  ElementImpl getChild(String identifier2) {
     for (PropertyAccessorElement accessor in _accessors) {
-      if (((accessor as PropertyAccessorElementImpl)).identifier == identifier25) {
+      if (((accessor as PropertyAccessorElementImpl)).identifier == identifier2) {
         return accessor as PropertyAccessorElementImpl;
       }
     }
     for (ConstructorElement constructor in _constructors) {
-      if (((constructor as ConstructorElementImpl)).identifier == identifier25) {
+      if (((constructor as ConstructorElementImpl)).identifier == identifier2) {
         return constructor as ConstructorElementImpl;
       }
     }
     for (FieldElement field in _fields) {
-      if (((field as FieldElementImpl)).identifier == identifier25) {
+      if (((field as FieldElementImpl)).identifier == identifier2) {
         return field as FieldElementImpl;
       }
     }
     for (MethodElement method in _methods) {
-      if (((method as MethodElementImpl)).identifier == identifier25) {
+      if (((method as MethodElementImpl)).identifier == identifier2) {
         return method as MethodElementImpl;
       }
     }
     for (TypeVariableElement typeVariable in _typeVariables) {
-      if (((typeVariable as TypeVariableElementImpl)).identifier == identifier25) {
+      if (((typeVariable as TypeVariableElementImpl)).identifier == identifier2) {
         return typeVariable as TypeVariableElementImpl;
       }
     }
     return null;
   }
   List<ConstructorElement> get constructors => _constructors;
+  /**
+   * Given some name, this returns the {@link FieldElement} with the matching name, if there is no
+   * such field, then {@code null} is returned.
+   * @param name some name to lookup a field element with
+   * @return the matching field element, or {@code null} if no such element was found
+   */
+  FieldElement getField(String name2) {
+    for (FieldElement fieldElement in _fields) {
+      if (name2 == fieldElement.name) {
+        return fieldElement;
+      }
+    }
+    return null;
+  }
   List<FieldElement> get fields => _fields;
+  /**
+   * Return the element representing the getter with the given name that is declared in this class,
+   * or {@code null} if this class does not declare a getter with the given name.
+   * @param getterName the name of the getter to be returned
+   * @return the getter declared in this class with the given name
+   */
+  PropertyAccessorElement getGetter(String getterName) {
+    for (PropertyAccessorElement accessor in _accessors) {
+      if (accessor.isGetter() && accessor.name == getterName) {
+        return accessor;
+      }
+    }
+    return null;
+  }
   List<InterfaceType> get interfaces => _interfaces;
   ElementKind get kind => ElementKind.CLASS;
+  /**
+   * Return the element representing the method with the given name that is declared in this class,
+   * or {@code null} if this class does not declare a method with the given name.
+   * @param methodName the name of the method to be returned
+   * @return the method declared in this class with the given name
+   */
+  MethodElement getMethod(String methodName) {
+    for (MethodElement method in _methods) {
+      if (method.name == methodName) {
+        return method;
+      }
+    }
+    return null;
+  }
   List<MethodElement> get methods => _methods;
   List<InterfaceType> get mixins => _mixins;
-  ConstructorElement getNamedConstructor(String name24) {
+  ConstructorElement getNamedConstructor(String name2) {
     for (ConstructorElement element in constructors) {
       String elementName = element.name;
-      if (elementName != null && elementName == name24) {
+      if (elementName != null && elementName == name2) {
         return element;
       }
     }
     return null;
   }
+  /**
+   * Return the element representing the setter with the given name that is declared in this class,
+   * or {@code null} if this class does not declare a setter with the given name.
+   * @param setterName the name of the getter to be returned
+   * @return the setter declared in this class with the given name
+   */
+  PropertyAccessorElement getSetter(String setterName) {
+    for (PropertyAccessorElement accessor in _accessors) {
+      if (accessor.isSetter() && accessor.name == setterName) {
+        return accessor;
+      }
+    }
+    return null;
+  }
   InterfaceType get supertype => _supertype;
   InterfaceType get type => _type;
   List<TypeVariableElement> get typeVariables => _typeVariables;
   ConstructorElement get unnamedConstructor {
     for (ConstructorElement element in constructors) {
-      String name10 = element.name;
-      if (name10 == null || name10.isEmpty) {
+      String name2 = element.name;
+      if (name2 == null || name2.isEmpty) {
         return element;
       }
     }
@@ -1487,8 +1586,8 @@
    * Set the type defined by the class to the given type.
    * @param type the type defined by the class
    */
-  void set type(InterfaceType type5) {
-    this._type = type5;
+  void set type(InterfaceType type2) {
+    this._type = type2;
   }
   /**
    * Set whether this class is defined by a typedef construct to correspond to the given value.
@@ -1523,11 +1622,11 @@
     safelyVisitChildren(_typeVariables, visitor);
   }
   void appendTo(JavaStringBuilder builder) {
-    String name11 = name;
-    if (name11 == null) {
+    String name2 = name;
+    if (name2 == null) {
       builder.append("{unnamed class}");
     } else {
-      builder.append(name11);
+      builder.append(name2);
     }
     int variableCount = _typeVariables.length;
     if (variableCount > 0) {
@@ -1541,66 +1640,24 @@
       builder.append(">");
     }
   }
-  void collectAllSupertypes(var list) {
+  void collectAllSupertypes(Set<InterfaceType> list) {
     if (_supertype == null || list.contains(_supertype)) {
       return;
     }
-    list.add(_supertype);
+    javaSetAdd(list, _supertype);
     ((_supertype.element as ClassElementImpl)).collectAllSupertypes(list);
     for (InterfaceType type in interfaces) {
       if (!list.contains(type)) {
-        list.add(type);
+        javaSetAdd(list, type);
         ((type.element as ClassElementImpl)).collectAllSupertypes(list);
       }
     }
     for (InterfaceType type in mixins) {
       if (!list.contains(type)) {
-        list.add(type);
+        javaSetAdd(list, type);
       }
     }
   }
-  /**
-   * Return the element representing the getter with the given name that is declared in this class,
-   * or {@code null} if this class does not declare a getter with the given name.
-   * @param getterName the name of the getter to be returned
-   * @return the getter declared in this class with the given name
-   */
-  PropertyAccessorElement getGetter(String getterName) {
-    for (PropertyAccessorElement accessor in _accessors) {
-      if (accessor.isGetter() && accessor.name == getterName) {
-        return accessor;
-      }
-    }
-    return null;
-  }
-  /**
-   * Return the element representing the method with the given name that is declared in this class,
-   * or {@code null} if this class does not declare a method with the given name.
-   * @param methodName the name of the method to be returned
-   * @return the method declared in this class with the given name
-   */
-  MethodElement getMethod(String methodName) {
-    for (MethodElement method in _methods) {
-      if (method.name == methodName) {
-        return method;
-      }
-    }
-    return null;
-  }
-  /**
-   * Return the element representing the setter with the given name that is declared in this class,
-   * or {@code null} if this class does not declare a setter with the given name.
-   * @param setterName the name of the getter to be returned
-   * @return the getter declared in this class with the given name
-   */
-  PropertyAccessorElement getSetter(String setterName) {
-    for (PropertyAccessorElement accessor in _accessors) {
-      if (accessor.isSetter() && accessor.name == setterName) {
-        return accessor;
-      }
-    }
-    return null;
-  }
 }
 /**
  * Instances of the class {@code CompilationUnitElementImpl} implement a{@link CompilationUnitElement}.
@@ -1643,31 +1700,31 @@
   CompilationUnitElementImpl(String name) : super.con2(name, -1) {
   }
   accept(ElementVisitor visitor) => visitor.visitCompilationUnitElement(this);
-  bool operator ==(Object object) => object != null && identical(runtimeType, object.runtimeType) && _source == ((object as CompilationUnitElementImpl)).source;
+  bool operator ==(Object object) => object != null && runtimeType == object.runtimeType && _source == ((object as CompilationUnitElementImpl)).source;
   List<PropertyAccessorElement> get accessors => _accessors;
-  ElementImpl getChild(String identifier26) {
+  ElementImpl getChild(String identifier2) {
     for (PropertyAccessorElement accessor in _accessors) {
-      if (((accessor as PropertyAccessorElementImpl)).identifier == identifier26) {
+      if (((accessor as PropertyAccessorElementImpl)).identifier == identifier2) {
         return accessor as PropertyAccessorElementImpl;
       }
     }
     for (VariableElement variable in _variables) {
-      if (((variable as VariableElementImpl)).identifier == identifier26) {
+      if (((variable as VariableElementImpl)).identifier == identifier2) {
         return variable as VariableElementImpl;
       }
     }
     for (ExecutableElement function in _functions) {
-      if (((function as ExecutableElementImpl)).identifier == identifier26) {
+      if (((function as ExecutableElementImpl)).identifier == identifier2) {
         return function as ExecutableElementImpl;
       }
     }
     for (FunctionTypeAliasElement typeAlias in _typeAliases) {
-      if (((typeAlias as FunctionTypeAliasElementImpl)).identifier == identifier26) {
+      if (((typeAlias as FunctionTypeAliasElementImpl)).identifier == identifier2) {
         return typeAlias as FunctionTypeAliasElementImpl;
       }
     }
     for (ClassElement type in _types) {
-      if (((type as ClassElementImpl)).identifier == identifier26) {
+      if (((type as ClassElementImpl)).identifier == identifier2) {
         return type as ClassElementImpl;
       }
     }
@@ -1680,6 +1737,14 @@
   ElementKind get kind => ElementKind.COMPILATION_UNIT;
   Source get source => _source;
   List<TopLevelVariableElement> get topLevelVariables => _variables;
+  ClassElement getType(String className) {
+    for (ClassElement type in _types) {
+      if (type.name == className) {
+        return type;
+      }
+    }
+    return null;
+  }
   List<ClassElement> get types => _types;
   int get hashCode => _source.hashCode;
   /**
@@ -1687,11 +1752,11 @@
    * given accessors.
    * @param the top-level accessors (getters and setters) contained in this compilation unit
    */
-  void set accessors(List<PropertyAccessorElement> accessors3) {
-    for (PropertyAccessorElement accessor in accessors3) {
+  void set accessors(List<PropertyAccessorElement> accessors2) {
+    for (PropertyAccessorElement accessor in accessors2) {
       ((accessor as PropertyAccessorElementImpl)).enclosingElement = this;
     }
-    this._accessors = accessors3;
+    this._accessors = accessors2;
   }
   /**
    * Set the top-level functions contained in this compilation unit to the given functions.
@@ -1707,8 +1772,8 @@
    * Set the source that corresponds to this compilation unit to the given source.
    * @param source the source that corresponds to this compilation unit
    */
-  void set source(Source source5) {
-    this._source = source5;
+  void set source(Source source2) {
+    this._source = source2;
   }
   /**
    * Set the top-level variables contained in this compilation unit to the given variables.
@@ -1792,8 +1857,8 @@
   ConstLocalVariableElementImpl(Identifier name) : super(name) {
   }
   EvaluationResultImpl get evaluationResult => _result;
-  void set evaluationResult(EvaluationResultImpl result3) {
-    this._result = result3;
+  void set evaluationResult(EvaluationResultImpl result2) {
+    this._result = result2;
   }
 }
 /**
@@ -1813,8 +1878,8 @@
   ConstParameterElementImpl(Identifier name) : super(name) {
   }
   EvaluationResultImpl get evaluationResult => _result;
-  void set evaluationResult(EvaluationResultImpl result4) {
-    this._result = result4;
+  void set evaluationResult(EvaluationResultImpl result2) {
+    this._result = result2;
   }
 }
 /**
@@ -1832,8 +1897,8 @@
   ConstTopLevelVariableElementImpl(Identifier name) : super.con1(name) {
   }
   EvaluationResultImpl get evaluationResult => _result;
-  void set evaluationResult(EvaluationResultImpl result5) {
-    this._result = result5;
+  void set evaluationResult(EvaluationResultImpl result2) {
+    this._result = result2;
   }
 }
 /**
@@ -1873,10 +1938,10 @@
   }
   void appendTo(JavaStringBuilder builder) {
     builder.append(enclosingElement.name);
-    String name12 = name;
-    if (name12 != null && !name12.isEmpty) {
+    String name2 = name;
+    if (name2 != null && !name2.isEmpty) {
       builder.append(".");
-      builder.append(name12);
+      builder.append(name2);
     }
     super.appendTo(builder);
   }
@@ -1915,8 +1980,8 @@
    * Set the type defined by this element to the given type.
    * @param type the type defined by this element
    */
-  void set type(DynamicTypeImpl type6) {
-    this._type = type6;
+  void set type(DynamicTypeImpl type2) {
+    this._type = type2;
   }
 }
 /**
@@ -1948,14 +2013,18 @@
    */
   List<Annotation> _metadata = AnnotationImpl.EMPTY_ARRAY;
   /**
+   * A cached copy of the calculated hashCode for this element.
+   */
+  int _cachedHashCode = 0;
+  /**
    * Initialize a newly created element to have the given name.
    * @param name the name of this element
    */
-  ElementImpl.con1(Identifier name25) {
-    _jtd_constructor_178_impl(name25);
+  ElementImpl.con1(Identifier name2) {
+    _jtd_constructor_188_impl(name2);
   }
-  _jtd_constructor_178_impl(Identifier name25) {
-    _jtd_constructor_179_impl(name25 == null ? "" : name25.name, name25 == null ? -1 : name25.offset);
+  _jtd_constructor_188_impl(Identifier name2) {
+    _jtd_constructor_189_impl(name2 == null ? "" : name2.name, name2 == null ? -1 : name2.offset);
   }
   /**
    * Initialize a newly created element to have the given name.
@@ -1963,15 +2032,14 @@
    * @param nameOffset the offset of the name of this element in the file that contains the
    * declaration of this element
    */
-  ElementImpl.con2(String name8, int nameOffset2) {
-    _jtd_constructor_179_impl(name8, nameOffset2);
+  ElementImpl.con2(String name2, int nameOffset2) {
+    _jtd_constructor_189_impl(name2, nameOffset2);
   }
-  _jtd_constructor_179_impl(String name8, int nameOffset2) {
-    this._name = name8;
+  _jtd_constructor_189_impl(String name2, int nameOffset2) {
+    this._name = StringUtilities.intern(name2);
     this._nameOffset = nameOffset2;
-    this._modifiers = new Set();
   }
-  bool operator ==(Object object) => object != null && identical(object.runtimeType, runtimeType) && ((object as Element)).location == location;
+  bool operator ==(Object object) => object != null && object.runtimeType == runtimeType && ((object as Element)).location == location;
   Element getAncestor(Type elementClass) {
     Element ancestor = _enclosingElement;
     while (ancestor != null && !isInstanceOf(ancestor, elementClass)) {
@@ -2003,10 +2071,15 @@
     }
     return _enclosingElement.source;
   }
-  int get hashCode => location.hashCode;
-  bool isAccessibleIn(LibraryElement library21) {
+  int get hashCode {
+    if (_cachedHashCode == 0) {
+      _cachedHashCode = location.hashCode;
+    }
+    return _cachedHashCode;
+  }
+  bool isAccessibleIn(LibraryElement library2) {
     if (Identifier.isPrivateName(_name)) {
-      return library21 == library;
+      return library2 == library;
     }
     return true;
   }
@@ -2015,8 +2088,8 @@
    * Set the metadata associate with this element to the given array of annotations.
    * @param metadata the metadata to be associated with this element
    */
-  void set metadata(List<Annotation> metadata3) {
-    this._metadata = metadata3;
+  void set metadata(List<Annotation> metadata2) {
+    this._metadata = metadata2;
   }
   /**
    * Set the offset of the name of this element in the file that contains the declaration of this
@@ -2024,8 +2097,8 @@
    * provided to support unnamed constructors.
    * @param nameOffset the offset to the beginning of the name
    */
-  void set nameOffset(int nameOffset3) {
-    this._nameOffset = nameOffset3;
+  void set nameOffset(int nameOffset2) {
+    this._nameOffset = nameOffset2;
   }
   /**
    * Set whether this element is synthetic to correspond to the given value.
@@ -2065,7 +2138,7 @@
    * @param modifier the modifier being tested for
    * @return {@code true} if this element has the given modifier associated with it
    */
-  bool hasModifier(Modifier modifier) => _modifiers.contains(modifier);
+  bool hasModifier(Modifier modifier) => _modifiers != null && _modifiers.contains(modifier);
   /**
    * If the given child is not {@code null}, use the given visitor to visit it.
    * @param child the child to be visited
@@ -2103,9 +2176,17 @@
    */
   void setModifier(Modifier modifier, bool value) {
     if (value) {
+      if (_modifiers == null) {
+        _modifiers = new Set();
+      }
       _modifiers.add(modifier);
     } else {
-      _modifiers.remove(modifier);
+      if (_modifiers != null) {
+        _modifiers.remove(modifier);
+        if (_modifiers.isEmpty) {
+          _modifiers = null;
+        }
+      }
     }
   }
 }
@@ -2127,9 +2208,9 @@
    * @param element the element whose location is being represented
    */
   ElementLocationImpl.con1(Element element) {
-    _jtd_constructor_180_impl(element);
+    _jtd_constructor_190_impl(element);
   }
-  _jtd_constructor_180_impl(Element element) {
+  _jtd_constructor_190_impl(Element element) {
     List<String> components = new List<String>();
     Element ancestor = element;
     while (ancestor != null) {
@@ -2143,9 +2224,9 @@
    * @param encoding the encoded form of a location
    */
   ElementLocationImpl.con2(String encoding) {
-    _jtd_constructor_181_impl(encoding);
+    _jtd_constructor_191_impl(encoding);
   }
-  _jtd_constructor_181_impl(String encoding) {
+  _jtd_constructor_191_impl(String encoding) {
     this._components = decode(encoding);
   }
   bool operator ==(Object object) {
@@ -2182,11 +2263,11 @@
     List<String> components = new List<String>();
     JavaStringBuilder builder = new JavaStringBuilder();
     int index = 0;
-    int length3 = encoding.length;
-    while (index < length3) {
+    int length2 = encoding.length;
+    while (index < length2) {
       int currentChar = encoding.codeUnitAt(index);
       if (currentChar == _SEPARATOR_CHAR) {
-        if (index + 1 < length3 && encoding.codeUnitAt(index + 1) == _SEPARATOR_CHAR) {
+        if (index + 1 < length2 && encoding.codeUnitAt(index + 1) == _SEPARATOR_CHAR) {
           builder.appendChar(_SEPARATOR_CHAR);
           index += 2;
         } else {
@@ -2210,8 +2291,8 @@
    * @param component the component to be appended to the builder
    */
   void encode(JavaStringBuilder builder, String component) {
-    int length4 = component.length;
-    for (int i = 0; i < length4; i++) {
+    int length2 = component.length;
+    for (int i = 0; i < length2; i++) {
       int currentChar = component.codeUnitAt(i);
       if (currentChar == _SEPARATOR_CHAR) {
         builder.appendChar(_SEPARATOR_CHAR);
@@ -2284,9 +2365,9 @@
    * @param name the name of this element
    */
   ExecutableElementImpl.con1(Identifier name) : super.con1(name) {
-    _jtd_constructor_183_impl(name);
+    _jtd_constructor_193_impl(name);
   }
-  _jtd_constructor_183_impl(Identifier name) {
+  _jtd_constructor_193_impl(Identifier name) {
   }
   /**
    * Initialize a newly created executable element to have the given name.
@@ -2295,28 +2376,28 @@
    * declaration of this element
    */
   ExecutableElementImpl.con2(String name, int nameOffset) : super.con2(name, nameOffset) {
-    _jtd_constructor_184_impl(name, nameOffset);
+    _jtd_constructor_194_impl(name, nameOffset);
   }
-  _jtd_constructor_184_impl(String name, int nameOffset) {
+  _jtd_constructor_194_impl(String name, int nameOffset) {
   }
-  ElementImpl getChild(String identifier27) {
+  ElementImpl getChild(String identifier2) {
     for (ExecutableElement function in _functions) {
-      if (((function as ExecutableElementImpl)).identifier == identifier27) {
+      if (((function as ExecutableElementImpl)).identifier == identifier2) {
         return function as ExecutableElementImpl;
       }
     }
     for (LabelElement label in _labels) {
-      if (((label as LabelElementImpl)).identifier == identifier27) {
+      if (((label as LabelElementImpl)).identifier == identifier2) {
         return label as LabelElementImpl;
       }
     }
     for (VariableElement variable in _localVariables) {
-      if (((variable as VariableElementImpl)).identifier == identifier27) {
+      if (((variable as VariableElementImpl)).identifier == identifier2) {
         return variable as VariableElementImpl;
       }
     }
     for (ParameterElement parameter in _parameters) {
-      if (((parameter as ParameterElementImpl)).identifier == identifier27) {
+      if (((parameter as ParameterElementImpl)).identifier == identifier2) {
         return parameter as ParameterElementImpl;
       }
     }
@@ -2332,11 +2413,11 @@
    * Set the functions defined within this executable element to the given functions.
    * @param functions the functions defined within this executable element
    */
-  void set functions(List<FunctionElement> functions3) {
-    for (FunctionElement function in functions3) {
+  void set functions(List<FunctionElement> functions2) {
+    for (FunctionElement function in functions2) {
       ((function as FunctionElementImpl)).enclosingElement = this;
     }
-    this._functions = functions3;
+    this._functions = functions2;
   }
   /**
    * Set the labels defined within this executable element to the given labels.
@@ -2362,18 +2443,18 @@
    * Set the parameters defined by this executable element to the given parameters.
    * @param parameters the parameters defined by this executable element
    */
-  void set parameters(List<ParameterElement> parameters7) {
-    for (ParameterElement parameter in parameters7) {
+  void set parameters(List<ParameterElement> parameters2) {
+    for (ParameterElement parameter in parameters2) {
       ((parameter as ParameterElementImpl)).enclosingElement = this;
     }
-    this._parameters = parameters7;
+    this._parameters = parameters2;
   }
   /**
    * Set the type of function defined by this executable element to the given type.
    * @param type the type of function defined by this executable element
    */
-  void set type(FunctionType type7) {
-    this._type = type7;
+  void set type(FunctionType type2) {
+    this._type = type2;
   }
   void visitChildren(ElementVisitor<Object> visitor) {
     super.visitChildren(visitor);
@@ -2482,18 +2563,18 @@
    * @param name the name of this element
    */
   FieldElementImpl.con1(Identifier name) : super.con1(name) {
-    _jtd_constructor_187_impl(name);
+    _jtd_constructor_197_impl(name);
   }
-  _jtd_constructor_187_impl(Identifier name) {
+  _jtd_constructor_197_impl(Identifier name) {
   }
   /**
    * Initialize a newly created synthetic field element to have the given name.
    * @param name the name of this element
    */
   FieldElementImpl.con2(String name) : super.con2(name) {
-    _jtd_constructor_188_impl(name);
+    _jtd_constructor_198_impl(name);
   }
-  _jtd_constructor_188_impl(String name) {
+  _jtd_constructor_198_impl(String name) {
   }
   accept(ElementVisitor visitor) => visitor.visitFieldElement(this);
   ClassElement get enclosingElement => super.enclosingElement as ClassElement;
@@ -2508,6 +2589,31 @@
   }
 }
 /**
+ * Instances of the class {@code FieldFormalParameterElementImpl} extend{@link ParameterElementImpl} to provide the additional information of the {@link FieldElement}associated with the parameter.
+ * @coverage dart.engine.element
+ */
+class FieldFormalParameterElementImpl extends ParameterElementImpl implements FieldFormalParameterElement {
+  /**
+   * The field associated with this field formal parameter.
+   */
+  FieldElement _field;
+  /**
+   * Initialize a newly created parameter element to have the given name.
+   * @param name the name of this element
+   */
+  FieldFormalParameterElementImpl(Identifier name) : super(name) {
+  }
+  accept(ElementVisitor visitor) => visitor.visitFieldFormalParameterElement(this);
+  FieldElement get field => _field;
+  /**
+   * Set the field element associated with this field formal parameter to the given element.
+   * @param field the new field element
+   */
+  void set field(FieldElement field2) {
+    this._field = field2;
+  }
+}
+/**
  * Instances of the class {@code FunctionElementImpl} implement a {@code FunctionElement}.
  * @coverage dart.engine.element
  */
@@ -2529,9 +2635,9 @@
    * Initialize a newly created synthetic function element.
    */
   FunctionElementImpl() : super.con2("", -1) {
-    _jtd_constructor_189_impl();
+    _jtd_constructor_200_impl();
   }
-  _jtd_constructor_189_impl() {
+  _jtd_constructor_200_impl() {
     synthetic = true;
   }
   /**
@@ -2539,9 +2645,20 @@
    * @param name the name of this element
    */
   FunctionElementImpl.con1(Identifier name) : super.con1(name) {
-    _jtd_constructor_190_impl(name);
+    _jtd_constructor_201_impl(name);
   }
-  _jtd_constructor_190_impl(Identifier name) {
+  _jtd_constructor_201_impl(Identifier name) {
+  }
+  /**
+   * Initialize a newly created function element to have no name and the given offset. This is used
+   * for function expressions, which have no name.
+   * @param nameOffset the offset of the name of this element in the file that contains the
+   * declaration of this element
+   */
+  FunctionElementImpl.con2(int nameOffset) : super.con2("", nameOffset) {
+    _jtd_constructor_202_impl(nameOffset);
+  }
+  _jtd_constructor_202_impl(int nameOffset) {
   }
   accept(ElementVisitor visitor) => visitor.visitFunctionElement(this);
   String get identifier => name;
@@ -2565,9 +2682,9 @@
     _visibleRangeLength = length;
   }
   void appendTo(JavaStringBuilder builder) {
-    String name13 = name;
-    if (name13 != null) {
-      builder.append(name13);
+    String name2 = name;
+    if (name2 != null) {
+      builder.append(name2);
     }
     super.appendTo(builder);
   }
@@ -2600,14 +2717,14 @@
   FunctionTypeAliasElementImpl(Identifier name) : super.con1(name) {
   }
   accept(ElementVisitor visitor) => visitor.visitFunctionTypeAliasElement(this);
-  ElementImpl getChild(String identifier28) {
+  ElementImpl getChild(String identifier2) {
     for (VariableElement parameter in _parameters) {
-      if (((parameter as VariableElementImpl)).identifier == identifier28) {
+      if (((parameter as VariableElementImpl)).identifier == identifier2) {
         return parameter as VariableElementImpl;
       }
     }
     for (TypeVariableElement typeVariable in _typeVariables) {
-      if (((typeVariable as TypeVariableElementImpl)).identifier == identifier28) {
+      if (((typeVariable as TypeVariableElementImpl)).identifier == identifier2) {
         return typeVariable as TypeVariableElementImpl;
       }
     }
@@ -2622,30 +2739,30 @@
    * Set the parameters defined by this type alias to the given parameters.
    * @param parameters the parameters defined by this type alias
    */
-  void set parameters(List<ParameterElement> parameters8) {
-    if (parameters8 != null) {
-      for (ParameterElement parameter in parameters8) {
+  void set parameters(List<ParameterElement> parameters2) {
+    if (parameters2 != null) {
+      for (ParameterElement parameter in parameters2) {
         ((parameter as ParameterElementImpl)).enclosingElement = this;
       }
     }
-    this._parameters = parameters8;
+    this._parameters = parameters2;
   }
   /**
    * Set the type of function defined by this type alias to the given type.
    * @param type the type of function defined by this type alias
    */
-  void set type(FunctionType type8) {
-    this._type = type8;
+  void set type(FunctionType type2) {
+    this._type = type2;
   }
   /**
    * Set the type variables defined for this type to the given variables.
    * @param typeVariables the type variables defined for this type
    */
-  void set typeVariables(List<TypeVariableElement> typeVariables3) {
-    for (TypeVariableElement variable in typeVariables3) {
+  void set typeVariables(List<TypeVariableElement> typeVariables2) {
+    for (TypeVariableElement variable in typeVariables2) {
       ((variable as TypeVariableElementImpl)).enclosingElement = this;
     }
-    this._typeVariables = typeVariables3;
+    this._typeVariables = typeVariables2;
   }
   void visitChildren(ElementVisitor<Object> visitor) {
     super.visitChildren(visitor);
@@ -2748,7 +2865,7 @@
     this._context = context;
   }
   accept(ElementVisitor visitor) => visitor.visitHtmlElement(this);
-  bool operator ==(Object object) => identical(runtimeType, object.runtimeType) && _source == ((object as CompilationUnitElementImpl)).source;
+  bool operator ==(Object object) => runtimeType == object.runtimeType && _source == ((object as CompilationUnitElementImpl)).source;
   AnalysisContext get context => _context;
   ElementKind get kind => ElementKind.HTML;
   List<HtmlScriptElement> get scripts => _scripts;
@@ -2759,6 +2876,9 @@
    * @param scripts the scripts
    */
   void set scripts(List<HtmlScriptElement> scripts2) {
+    if (scripts2.length == 0) {
+      scripts2 = HtmlScriptElementImpl.EMPTY_ARRAY;
+    }
     for (HtmlScriptElement script in scripts2) {
       ((script as HtmlScriptElementImpl)).enclosingElement = this;
     }
@@ -2768,8 +2888,8 @@
    * Set the source that corresponds to this HTML file to the given source.
    * @param source the source that corresponds to this HTML file
    */
-  void set source(Source source6) {
-    this._source = source6;
+  void set source(Source source2) {
+    this._source = source2;
   }
   void visitChildren(ElementVisitor<Object> visitor) {
     super.visitChildren(visitor);
@@ -2833,23 +2953,23 @@
    * combinators.
    * @param combinators the combinators that were specified as part of the import directive
    */
-  void set combinators(List<NamespaceCombinator> combinators3) {
-    this._combinators = combinators3;
+  void set combinators(List<NamespaceCombinator> combinators2) {
+    this._combinators = combinators2;
   }
   /**
    * Set the library that is imported into this library by this import directive to the given
    * library.
    * @param importedLibrary the library that is imported into this library
    */
-  void set importedLibrary(LibraryElement importedLibrary3) {
-    this._importedLibrary = importedLibrary3;
+  void set importedLibrary(LibraryElement importedLibrary2) {
+    this._importedLibrary = importedLibrary2;
   }
   /**
    * Set the prefix that was specified as part of the import directive to the given prefix.
    * @param prefix the prefix that was specified as part of the import directive
    */
-  void set prefix(PrefixElement prefix3) {
-    this._prefix = prefix3;
+  void set prefix(PrefixElement prefix2) {
+    this._prefix = prefix2;
   }
   void visitChildren(ElementVisitor<Object> visitor) {
     super.visitChildren(visitor);
@@ -2973,13 +3093,13 @@
     this._context = context;
   }
   accept(ElementVisitor visitor) => visitor.visitLibraryElement(this);
-  bool operator ==(Object object) => object != null && identical(runtimeType, object.runtimeType) && _definingCompilationUnit == ((object as LibraryElementImpl)).definingCompilationUnit;
-  ElementImpl getChild(String identifier29) {
-    if (((_definingCompilationUnit as CompilationUnitElementImpl)).identifier == identifier29) {
+  bool operator ==(Object object) => object != null && runtimeType == object.runtimeType && _definingCompilationUnit == ((object as LibraryElementImpl)).definingCompilationUnit;
+  ElementImpl getChild(String identifier2) {
+    if (((_definingCompilationUnit as CompilationUnitElementImpl)).identifier == identifier2) {
       return _definingCompilationUnit as CompilationUnitElementImpl;
     }
     for (CompilationUnitElement part in _parts) {
-      if (((part as CompilationUnitElementImpl)).identifier == identifier29) {
+      if (((part as CompilationUnitElementImpl)).identifier == identifier2) {
         return part as CompilationUnitElementImpl;
       }
     }
@@ -3012,13 +3132,14 @@
   }
   List<ImportElement> get imports => _imports;
   ElementKind get kind => ElementKind.LIBRARY;
+  LibraryElement get library => this;
   List<CompilationUnitElement> get parts => _parts;
   List<PrefixElement> get prefixes {
     Set<PrefixElement> prefixes = new Set<PrefixElement>();
     for (ImportElement element in _imports) {
-      PrefixElement prefix4 = element.prefix;
-      if (prefix4 != null) {
-        javaSetAdd(prefixes, prefix4);
+      PrefixElement prefix2 = element.prefix;
+      if (prefix2 != null) {
+        javaSetAdd(prefixes, prefix2);
       }
     }
     return new List.from(prefixes);
@@ -3029,6 +3150,19 @@
     }
     return _definingCompilationUnit.source;
   }
+  ClassElement getType(String className) {
+    ClassElement type = _definingCompilationUnit.getType(className);
+    if (type != null) {
+      return type;
+    }
+    for (CompilationUnitElement part in _parts) {
+      type = part.getType(className);
+      if (type != null) {
+        return type;
+      }
+    }
+    return null;
+  }
   int get hashCode => _definingCompilationUnit.hashCode;
   bool isBrowserApplication() => _entryPoint != null && isOrImportsBrowserLibrary();
   bool isDartCore() => name == "dart.core";
@@ -3068,9 +3202,9 @@
   void set imports(List<ImportElement> imports2) {
     for (ImportElement importElement in imports2) {
       ((importElement as ImportElementImpl)).enclosingElement = this;
-      PrefixElementImpl prefix5 = importElement.prefix as PrefixElementImpl;
-      if (prefix5 != null) {
-        prefix5.enclosingElement = this;
+      PrefixElementImpl prefix2 = importElement.prefix as PrefixElementImpl;
+      if (prefix2 != null) {
+        prefix2.enclosingElement = this;
       }
     }
     this._imports = imports2;
@@ -3098,12 +3232,12 @@
    */
   bool isOrImportsBrowserLibrary() {
     List<LibraryElement> visited = new List<LibraryElement>();
-    Source htmlLibSource = definingCompilationUnit.source.resolve("dart:html");
+    Source htmlLibSource = _context.sourceFactory.forUri(DartSdk.DART_HTML);
     visited.add(this);
     for (int index = 0; index < visited.length; index++) {
       LibraryElement library = visited[index];
-      Source source10 = library.definingCompilationUnit.source;
-      if (source10 == htmlLibSource) {
+      Source source2 = library.definingCompilationUnit.source;
+      if (source2 == htmlLibSource) {
         return true;
       }
       for (LibraryElement importedLibrary in library.importedLibraries) {
@@ -3183,9 +3317,9 @@
    * @param name the name of this element
    */
   MethodElementImpl.con1(Identifier name) : super.con1(name) {
-    _jtd_constructor_199_impl(name);
+    _jtd_constructor_211_impl(name);
   }
-  _jtd_constructor_199_impl(Identifier name) {
+  _jtd_constructor_211_impl(Identifier name) {
   }
   /**
    * Initialize a newly created method element to have the given name.
@@ -3194,20 +3328,20 @@
    * declaration of this element
    */
   MethodElementImpl.con2(String name, int nameOffset) : super.con2(name, nameOffset) {
-    _jtd_constructor_200_impl(name, nameOffset);
+    _jtd_constructor_212_impl(name, nameOffset);
   }
-  _jtd_constructor_200_impl(String name, int nameOffset) {
+  _jtd_constructor_212_impl(String name, int nameOffset) {
   }
   accept(ElementVisitor visitor) => visitor.visitMethodElement(this);
   ClassElement get enclosingElement => super.enclosingElement as ClassElement;
   ElementKind get kind => ElementKind.METHOD;
   bool isAbstract() => hasModifier(Modifier.ABSTRACT);
   bool isOperator() {
-    String name14 = name;
-    if (name14.isEmpty) {
+    String name2 = name;
+    if (name2.isEmpty) {
       return false;
     }
-    int first = name14.codeUnitAt(0);
+    int first = name2.codeUnitAt(0);
     return !((0x61 <= first && first <= 0x7A) || (0x41 <= first && first <= 0x5A) || first == 0x5F || first == 0x24);
   }
   bool isStatic() => hasModifier(Modifier.STATIC);
@@ -3237,7 +3371,7 @@
  * language and for a few additional flags that are useful.
  * @coverage dart.engine.element
  */
-class Modifier {
+class Modifier implements Comparable<Modifier> {
   static final Modifier ABSTRACT = new Modifier('ABSTRACT', 0);
   static final Modifier CONST = new Modifier('CONST', 1);
   static final Modifier FACTORY = new Modifier('FACTORY', 2);
@@ -3255,6 +3389,7 @@
   int get ordinal => __ordinal;
   Modifier(this.__name, this.__ordinal) {
   }
+  int compareTo(Modifier other) => __ordinal - other.__ordinal;
   String toString() => __name;
 }
 /**
@@ -3357,6 +3492,11 @@
  */
 class ParameterElementImpl extends VariableElementImpl implements ParameterElement {
   /**
+   * An array containing all of the parameters defined by this parameter element. There will only be
+   * parameters if this parameter is a function typed parameter.
+   */
+  List<ParameterElement> _parameters = ParameterElementImpl.EMPTY_ARRAY;
+  /**
    * The kind of this parameter.
    */
   ParameterKind _parameterKind;
@@ -3382,6 +3522,7 @@
   accept(ElementVisitor visitor) => visitor.visitParameterElement(this);
   ElementKind get kind => ElementKind.PARAMETER;
   ParameterKind get parameterKind => _parameterKind;
+  List<ParameterElement> get parameters => _parameters;
   SourceRange get visibleRange {
     if (_visibleRangeLength < 0) {
       return null;
@@ -3404,6 +3545,16 @@
     this._parameterKind = parameterKind2;
   }
   /**
+   * Set the parameters defined by this executable element to the given parameters.
+   * @param parameters the parameters defined by this executable element
+   */
+  void set parameters(List<ParameterElement> parameters2) {
+    for (ParameterElement parameter in parameters2) {
+      ((parameter as ParameterElementImpl)).enclosingElement = this;
+    }
+    this._parameters = parameters2;
+  }
+  /**
    * Set the visible range for this element to the range starting at the given offset with the given
    * length.
    * @param offset the offset to the beginning of the visible range for this element
@@ -3414,13 +3565,28 @@
     _visibleRangeOffset = offset;
     _visibleRangeLength = length;
   }
+  void visitChildren(ElementVisitor<Object> visitor) {
+    super.visitChildren(visitor);
+    safelyVisitChildren(_parameters, visitor);
+  }
   void appendTo(JavaStringBuilder builder) {
+    String left = "";
+    String right = "";
+    while (true) {
+      if (parameterKind == ParameterKind.NAMED) {
+        left = "{";
+        right = "}";
+      } else if (parameterKind == ParameterKind.POSITIONAL) {
+        left = "[";
+        right = "]";
+      }
+      break;
+    }
+    builder.append(left);
     builder.append(type);
     builder.append(" ");
     builder.append(name);
-    builder.append(" (");
-    builder.append(kind);
-    builder.append(")");
+    builder.append(right);
   }
 }
 /**
@@ -3479,9 +3645,9 @@
    * @param name the name of this element
    */
   PropertyAccessorElementImpl.con1(Identifier name) : super.con1(name) {
-    _jtd_constructor_205_impl(name);
+    _jtd_constructor_217_impl(name);
   }
-  _jtd_constructor_205_impl(Identifier name) {
+  _jtd_constructor_217_impl(Identifier name) {
   }
   /**
    * Initialize a newly created synthetic property accessor element to be associated with the given
@@ -3489,9 +3655,9 @@
    * @param variable the variable with which this access is associated
    */
   PropertyAccessorElementImpl.con2(PropertyInducingElementImpl variable2) : super.con2(variable2.name, -1) {
-    _jtd_constructor_206_impl(variable2);
+    _jtd_constructor_218_impl(variable2);
   }
-  _jtd_constructor_206_impl(PropertyInducingElementImpl variable2) {
+  _jtd_constructor_218_impl(PropertyInducingElementImpl variable2) {
     this._variable = variable2;
     synthetic = true;
   }
@@ -3525,8 +3691,8 @@
    * Set the variable associated with this accessor to the given variable.
    * @param variable the variable associated with this accessor
    */
-  void set variable(PropertyInducingElement variable3) {
-    this._variable = variable3;
+  void set variable(PropertyInducingElement variable2) {
+    this._variable = variable2;
   }
   void appendTo(JavaStringBuilder builder) {
     builder.append(isGetter() ? "get " : "set ");
@@ -3556,18 +3722,18 @@
    * @param name the name of this element
    */
   PropertyInducingElementImpl.con1(Identifier name) : super.con1(name) {
-    _jtd_constructor_207_impl(name);
+    _jtd_constructor_219_impl(name);
   }
-  _jtd_constructor_207_impl(Identifier name) {
+  _jtd_constructor_219_impl(Identifier name) {
   }
   /**
    * Initialize a newly created synthetic element to have the given name.
    * @param name the name of this element
    */
   PropertyInducingElementImpl.con2(String name) : super.con2(name, -1) {
-    _jtd_constructor_208_impl(name);
+    _jtd_constructor_220_impl(name);
   }
-  _jtd_constructor_208_impl(String name) {
+  _jtd_constructor_220_impl(String name) {
     synthetic = true;
   }
   PropertyAccessorElement get getter => _getter;
@@ -3638,18 +3804,18 @@
    * @param name the name of this element
    */
   TopLevelVariableElementImpl.con1(Identifier name) : super.con1(name) {
-    _jtd_constructor_210_impl(name);
+    _jtd_constructor_222_impl(name);
   }
-  _jtd_constructor_210_impl(Identifier name) {
+  _jtd_constructor_222_impl(Identifier name) {
   }
   /**
    * Initialize a newly created synthetic top-level variable element to have the given name.
    * @param name the name of this element
    */
   TopLevelVariableElementImpl.con2(String name) : super.con2(name) {
-    _jtd_constructor_211_impl(name);
+    _jtd_constructor_223_impl(name);
   }
-  _jtd_constructor_211_impl(String name) {
+  _jtd_constructor_223_impl(String name) {
   }
   accept(ElementVisitor visitor) => visitor.visitTopLevelVariableElement(this);
   ElementKind get kind => ElementKind.TOP_LEVEL_VARIABLE;
@@ -3694,8 +3860,8 @@
    * Set the type defined by this type variable to the given type
    * @param type the type defined by this type variable
    */
-  void set type(TypeVariableType type9) {
-    this._type = type9;
+  void set type(TypeVariableType type2) {
+    this._type = type2;
   }
   void appendTo(JavaStringBuilder builder) {
     builder.append(name);
@@ -3728,9 +3894,9 @@
    * @param name the name of this element
    */
   VariableElementImpl.con1(Identifier name) : super.con1(name) {
-    _jtd_constructor_213_impl(name);
+    _jtd_constructor_225_impl(name);
   }
-  _jtd_constructor_213_impl(Identifier name) {
+  _jtd_constructor_225_impl(Identifier name) {
   }
   /**
    * Initialize a newly created variable element to have the given name.
@@ -3739,9 +3905,9 @@
    * declaration of this element
    */
   VariableElementImpl.con2(String name, int nameOffset) : super.con2(name, nameOffset) {
-    _jtd_constructor_214_impl(name, nameOffset);
+    _jtd_constructor_226_impl(name, nameOffset);
   }
-  _jtd_constructor_214_impl(String name, int nameOffset) {
+  _jtd_constructor_226_impl(String name, int nameOffset) {
   }
   /**
    * Return the result of evaluating this variable's initializer as a compile-time constant
@@ -3780,18 +3946,18 @@
    * Set the function representing this variable's initializer to the given function.
    * @param initializer the function representing this variable's initializer
    */
-  void set initializer(FunctionElement initializer3) {
-    if (initializer3 != null) {
-      ((initializer3 as FunctionElementImpl)).enclosingElement = this;
+  void set initializer(FunctionElement initializer2) {
+    if (initializer2 != null) {
+      ((initializer2 as FunctionElementImpl)).enclosingElement = this;
     }
-    this._initializer = initializer3;
+    this._initializer = initializer2;
   }
   /**
    * Set the declared type of this variable to the given type.
    * @param type the declared type of this variable
    */
-  void set type(Type2 type10) {
-    this._type = type10;
+  void set type(Type2 type2) {
+    this._type = type2;
   }
   void visitChildren(ElementVisitor<Object> visitor) {
     super.visitChildren(visitor);
@@ -3804,6 +3970,418 @@
   }
 }
 /**
+ * The abstract class {@code ExecutableMember} defines the behavior common to members that represent
+ * an executable element defined in a parameterized type where the values of the type parameters are
+ * known.
+ */
+abstract class ExecutableMember extends Member implements ExecutableElement {
+  /**
+   * Initialize a newly created element to represent an executable element of the given
+   * parameterized type.
+   * @param baseElement the element on which the parameterized element was created
+   * @param definingType the type in which the element is defined
+   */
+  ExecutableMember(ExecutableElement baseElement, InterfaceType definingType) : super(baseElement, definingType) {
+  }
+  ExecutableElement get baseElement => super.baseElement as ExecutableElement;
+  List<FunctionElement> get functions {
+    throw new UnsupportedOperationException();
+  }
+  List<LabelElement> get labels => baseElement.labels;
+  List<LocalVariableElement> get localVariables {
+    throw new UnsupportedOperationException();
+  }
+  List<ParameterElement> get parameters {
+    List<ParameterElement> baseParameters = baseElement.parameters;
+    int parameterCount = baseParameters.length;
+    if (parameterCount == 0) {
+      return baseParameters;
+    }
+    List<ParameterElement> parameterizedParameters = new List<ParameterElement>(parameterCount);
+    for (int i = 0; i < parameterCount; i++) {
+      parameterizedParameters[i] = ParameterMember.from(baseParameters[i], definingType);
+    }
+    return parameterizedParameters;
+  }
+  FunctionType get type => substituteFor(baseElement.type);
+  bool isOperator() => baseElement.isOperator();
+  bool isStatic() => baseElement.isStatic();
+  void visitChildren(ElementVisitor<Object> visitor) {
+    super.visitChildren(visitor);
+    safelyVisitChildren(baseElement.functions, visitor);
+    safelyVisitChildren(labels, visitor);
+    safelyVisitChildren(baseElement.localVariables, visitor);
+    safelyVisitChildren(parameters, visitor);
+  }
+}
+/**
+ * Instances of the class {@code FieldMember} represent a field element defined in a parameterized
+ * type where the values of the type parameters are known.
+ */
+class FieldMember extends VariableMember implements FieldElement {
+  /**
+   * If the given field's type is different when any type parameters from the defining type's
+   * declaration are replaced with the actual type arguments from the defining type, create a field
+   * member representing the given field. Return the member that was created, or the base field if
+   * no member was created.
+   * @param baseField the base field for which a member might be created
+   * @param definingType the type defining the parameters and arguments to be used in the
+   * substitution
+   * @return the field element that will return the correctly substituted types
+   */
+  static FieldElement from(FieldElement baseField, InterfaceType definingType) {
+    if (baseField == null || definingType.typeArguments.length == 0) {
+      return baseField;
+    }
+    Type2 baseType = baseField.type;
+    if (baseType == null) {
+      return baseField;
+    }
+    List<Type2> argumentTypes = definingType.typeArguments;
+    List<Type2> parameterTypes = TypeVariableTypeImpl.getTypes(definingType.element.typeVariables);
+    Type2 substitutedType = baseType.substitute2(argumentTypes, parameterTypes);
+    if (baseType == substitutedType) {
+      return baseField;
+    }
+    return new FieldMember(baseField, definingType);
+  }
+  /**
+   * Initialize a newly created element to represent a field of the given parameterized type.
+   * @param baseElement the element on which the parameterized element was created
+   * @param definingType the type in which the element is defined
+   */
+  FieldMember(FieldElement baseElement, InterfaceType definingType) : super(baseElement, definingType) {
+  }
+  accept(ElementVisitor visitor) => visitor.visitFieldElement(this);
+  FieldElement get baseElement => super.baseElement as FieldElement;
+  ClassElement get enclosingElement => baseElement.enclosingElement;
+  PropertyAccessorElement get getter => PropertyAccessorMember.from(baseElement.getter, definingType);
+  PropertyAccessorElement get setter => PropertyAccessorMember.from(baseElement.setter, definingType);
+  bool isStatic() => baseElement.isStatic();
+}
+/**
+ * The abstract class {@code Member} defines the behavior common to elements that represent members
+ * of parameterized types.
+ */
+abstract class Member implements Element {
+  /**
+   * The element on which the parameterized element was created.
+   */
+  Element _baseElement;
+  /**
+   * The type in which the element is defined.
+   */
+  InterfaceType _definingType;
+  /**
+   * Initialize a newly created element to represent the member of the given parameterized type.
+   * @param baseElement the element on which the parameterized element was created
+   * @param definingType the type in which the element is defined
+   */
+  Member(Element baseElement, InterfaceType definingType) {
+    this._baseElement = baseElement;
+    this._definingType = definingType;
+  }
+  Element getAncestor(Type elementClass) => baseElement.getAncestor(elementClass);
+  /**
+   * Return the element on which the parameterized element was created.
+   * @return the element on which the parameterized element was created
+   */
+  Element get baseElement => _baseElement;
+  AnalysisContext get context => _baseElement.context;
+  ElementKind get kind => _baseElement.kind;
+  LibraryElement get library => _baseElement.library;
+  ElementLocation get location => _baseElement.location;
+  List<Annotation> get metadata {
+    throw new UnsupportedOperationException();
+  }
+  String get name => _baseElement.name;
+  int get nameOffset => _baseElement.nameOffset;
+  Source get source => _baseElement.source;
+  bool isAccessibleIn(LibraryElement library) => _baseElement.isAccessibleIn(library);
+  bool isSynthetic() => _baseElement.isSynthetic();
+  void visitChildren(ElementVisitor<Object> visitor) {
+  }
+  /**
+   * Return the type in which the element is defined.
+   * @return the type in which the element is defined
+   */
+  InterfaceType get definingType => _definingType;
+  /**
+   * If the given child is not {@code null}, use the given visitor to visit it.
+   * @param child the child to be visited
+   * @param visitor the visitor to be used to visit the child
+   */
+  void safelyVisitChild(Element child, ElementVisitor<Object> visitor) {
+    if (child != null) {
+      child.accept(visitor);
+    }
+  }
+  /**
+   * Use the given visitor to visit all of the children in the given array.
+   * @param children the children to be visited
+   * @param visitor the visitor being used to visit the children
+   */
+  void safelyVisitChildren(List<Element> children, ElementVisitor<Object> visitor) {
+    if (children != null) {
+      for (Element child in children) {
+        child.accept(visitor);
+      }
+    }
+  }
+  /**
+   * Return the type that results from replacing the type parameters in the given type with the type
+   * arguments.
+   * @param type the type to be transformed
+   * @return the result of transforming the type
+   */
+  Type2 substituteFor(Type2 type) {
+    List<Type2> argumentTypes = _definingType.typeArguments;
+    List<Type2> parameterTypes = TypeVariableTypeImpl.getTypes(_definingType.element.typeVariables);
+    return type.substitute2(argumentTypes, parameterTypes) as Type2;
+  }
+  /**
+   * Return the array of types that results from replacing the type parameters in the given types
+   * with the type arguments.
+   * @param types the types to be transformed
+   * @return the result of transforming the types
+   */
+  List<InterfaceType> substituteFor2(List<InterfaceType> types) {
+    int count = types.length;
+    List<InterfaceType> substitutedTypes = new List<InterfaceType>(count);
+    for (int i = 0; i < count; i++) {
+      substitutedTypes[i] = substituteFor(types[i]);
+    }
+    return substitutedTypes;
+  }
+}
+/**
+ * Instances of the class {@code MethodMember} represent a method element defined in a parameterized
+ * type where the values of the type parameters are known.
+ */
+class MethodMember extends ExecutableMember implements MethodElement {
+  /**
+   * If the given method's type is different when any type parameters from the defining type's
+   * declaration are replaced with the actual type arguments from the defining type, create a method
+   * member representing the given method. Return the member that was created, or the base method if
+   * no member was created.
+   * @param baseMethod the base method for which a member might be created
+   * @param definingType the type defining the parameters and arguments to be used in the
+   * substitution
+   * @return the method element that will return the correctly substituted types
+   */
+  static MethodElement from(MethodElement baseMethod, InterfaceType definingType) {
+    if (baseMethod == null || definingType.typeArguments.length == 0) {
+      return baseMethod;
+    }
+    FunctionType baseType = baseMethod.type;
+    List<Type2> argumentTypes = definingType.typeArguments;
+    List<Type2> parameterTypes = TypeVariableTypeImpl.getTypes(definingType.element.typeVariables);
+    FunctionType substitutedType = baseType.substitute2(argumentTypes, parameterTypes);
+    if (baseType == substitutedType) {
+      return baseMethod;
+    }
+    return new MethodMember(baseMethod, definingType);
+  }
+  /**
+   * Initialize a newly created element to represent a method of the given parameterized type.
+   * @param baseElement the element on which the parameterized element was created
+   * @param definingType the type in which the element is defined
+   */
+  MethodMember(MethodElement baseElement, InterfaceType definingType) : super(baseElement, definingType) {
+  }
+  accept(ElementVisitor visitor) => visitor.visitMethodElement(this);
+  MethodElement get baseElement => super.baseElement as MethodElement;
+  ClassElement get enclosingElement => baseElement.enclosingElement;
+  bool isAbstract() => baseElement.isAbstract();
+  String toString() {
+    MethodElement baseElement2 = baseElement;
+    List<ParameterElement> parameters2 = parameters;
+    FunctionType type2 = type;
+    JavaStringBuilder builder = new JavaStringBuilder();
+    builder.append(baseElement2.enclosingElement.name);
+    builder.append(".");
+    builder.append(baseElement2.name);
+    builder.append("(");
+    int parameterCount = parameters2.length;
+    for (int i = 0; i < parameterCount; i++) {
+      if (i > 0) {
+        builder.append(", ");
+      }
+      builder.append(parameters2[i]).toString();
+    }
+    builder.append(")");
+    if (type2 != null) {
+      builder.append(" -> ");
+      builder.append(type2.returnType);
+    }
+    return builder.toString();
+  }
+}
+/**
+ * Instances of the class {@code ParameterMember} represent a parameter element defined in a
+ * parameterized type where the values of the type parameters are known.
+ */
+class ParameterMember extends VariableMember implements ParameterElement {
+  /**
+   * If the given parameter's type is different when any type parameters from the defining type's
+   * declaration are replaced with the actual type arguments from the defining type, create a
+   * parameter member representing the given parameter. Return the member that was created, or the
+   * base parameter if no member was created.
+   * @param baseParameter the base parameter for which a member might be created
+   * @param definingType the type defining the parameters and arguments to be used in the
+   * substitution
+   * @return the parameter element that will return the correctly substituted types
+   */
+  static ParameterElement from(ParameterElement baseParameter, InterfaceType definingType) {
+    if (baseParameter == null || definingType.typeArguments.length == 0) {
+      return baseParameter;
+    }
+    Type2 baseType = baseParameter.type;
+    List<Type2> argumentTypes = definingType.typeArguments;
+    List<Type2> parameterTypes = TypeVariableTypeImpl.getTypes(definingType.element.typeVariables);
+    Type2 substitutedType = baseType.substitute2(argumentTypes, parameterTypes);
+    if (baseType == substitutedType) {
+      return baseParameter;
+    }
+    return new ParameterMember(baseParameter, definingType);
+  }
+  /**
+   * Initialize a newly created element to represent a parameter of the given parameterized type.
+   * @param baseElement the element on which the parameterized element was created
+   * @param definingType the type in which the element is defined
+   */
+  ParameterMember(ParameterElement baseElement, InterfaceType definingType) : super(baseElement, definingType) {
+  }
+  accept(ElementVisitor visitor) => visitor.visitParameterElement(this);
+  Element getAncestor(Type elementClass) {
+    Element element = baseElement.getAncestor(elementClass);
+    if (element is MethodElement) {
+      return MethodMember.from((element as MethodElement), definingType) as Element;
+    } else if (element is PropertyAccessorElement) {
+      return PropertyAccessorMember.from((element as PropertyAccessorElement), definingType) as Element;
+    }
+    return element;
+  }
+  ParameterElement get baseElement => super.baseElement as ParameterElement;
+  Element get enclosingElement => baseElement.enclosingElement;
+  ParameterKind get parameterKind => baseElement.parameterKind;
+  List<ParameterElement> get parameters {
+    List<ParameterElement> baseParameters = baseElement.parameters;
+    int parameterCount = baseParameters.length;
+    if (parameterCount == 0) {
+      return baseParameters;
+    }
+    List<ParameterElement> parameterizedParameters = new List<ParameterElement>(parameterCount);
+    for (int i = 0; i < parameterCount; i++) {
+      parameterizedParameters[i] = ParameterMember.from(baseParameters[i], definingType);
+    }
+    return parameterizedParameters;
+  }
+  SourceRange get visibleRange => baseElement.visibleRange;
+  bool isInitializingFormal() => baseElement.isInitializingFormal();
+  String toString() {
+    ParameterElement baseElement2 = baseElement;
+    String left = "";
+    String right = "";
+    while (true) {
+      if (baseElement2.parameterKind == ParameterKind.NAMED) {
+        left = "{";
+        right = "}";
+      } else if (baseElement2.parameterKind == ParameterKind.POSITIONAL) {
+        left = "[";
+        right = "]";
+      }
+      break;
+    }
+    JavaStringBuilder builder = new JavaStringBuilder();
+    builder.append(left);
+    builder.append(type);
+    builder.append(" ");
+    builder.append(baseElement2.name);
+    builder.append(right);
+    return builder.toString();
+  }
+  void visitChildren(ElementVisitor<Object> visitor) {
+    super.visitChildren(visitor);
+    safelyVisitChildren(parameters, visitor);
+  }
+}
+/**
+ * Instances of the class {@code PropertyAccessorMember} represent a property accessor element
+ * defined in a parameterized type where the values of the type parameters are known.
+ */
+class PropertyAccessorMember extends ExecutableMember implements PropertyAccessorElement {
+  /**
+   * If the given property accessor's type is different when any type parameters from the defining
+   * type's declaration are replaced with the actual type arguments from the defining type, create a
+   * property accessor member representing the given property accessor. Return the member that was
+   * created, or the base accessor if no member was created.
+   * @param baseAccessor the base property accessor for which a member might be created
+   * @param definingType the type defining the parameters and arguments to be used in the
+   * substitution
+   * @return the property accessor element that will return the correctly substituted types
+   */
+  static PropertyAccessorElement from(PropertyAccessorElement baseAccessor, InterfaceType definingType) {
+    if (baseAccessor == null || definingType.typeArguments.length == 0) {
+      return baseAccessor;
+    }
+    FunctionType baseType = baseAccessor.type;
+    List<Type2> argumentTypes = definingType.typeArguments;
+    List<Type2> parameterTypes = TypeVariableTypeImpl.getTypes(definingType.element.typeVariables);
+    FunctionType substitutedType = baseType.substitute2(argumentTypes, parameterTypes);
+    if (baseType == substitutedType) {
+      return baseAccessor;
+    }
+    return new PropertyAccessorMember(baseAccessor, definingType);
+  }
+  /**
+   * Initialize a newly created element to represent a property accessor of the given parameterized
+   * type.
+   * @param baseElement the element on which the parameterized element was created
+   * @param definingType the type in which the element is defined
+   */
+  PropertyAccessorMember(PropertyAccessorElement baseElement, InterfaceType definingType) : super(baseElement, definingType) {
+  }
+  accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this);
+  PropertyAccessorElement get baseElement => super.baseElement as PropertyAccessorElement;
+  Element get enclosingElement => baseElement.enclosingElement;
+  PropertyInducingElement get variable {
+    PropertyInducingElement variable2 = baseElement.variable;
+    if (variable2 is FieldElement) {
+      return FieldMember.from(((variable2 as FieldElement)), definingType);
+    }
+    return variable2;
+  }
+  bool isGetter() => baseElement.isGetter();
+  bool isSetter() => baseElement.isSetter();
+}
+/**
+ * The abstract class {@code VariableMember} defines the behavior common to members that represent a
+ * variable element defined in a parameterized type where the values of the type parameters are
+ * known.
+ */
+abstract class VariableMember extends Member implements VariableElement {
+  /**
+   * Initialize a newly created element to represent an executable element of the given
+   * parameterized type.
+   * @param baseElement the element on which the parameterized element was created
+   * @param definingType the type in which the element is defined
+   */
+  VariableMember(VariableElement baseElement, InterfaceType definingType) : super(baseElement, definingType) {
+  }
+  VariableElement get baseElement => super.baseElement as VariableElement;
+  FunctionElement get initializer {
+    throw new UnsupportedOperationException();
+  }
+  Type2 get type => substituteFor(baseElement.type);
+  bool isConst() => baseElement.isConst();
+  bool isFinal() => baseElement.isFinal();
+  void visitChildren(ElementVisitor<Object> visitor) {
+    super.visitChildren(visitor);
+    safelyVisitChild(baseElement.initializer, visitor);
+  }
+}
+/**
  * The unique instance of the class {@code BottomTypeImpl} implements the type {@code bottom}.
  * @coverage dart.engine.type
  */
@@ -3934,9 +4512,9 @@
    * @param element the element representing the declaration of the function type
    */
   FunctionTypeImpl.con1(ExecutableElement element) : super(element, element == null ? null : element.name) {
-    _jtd_constructor_265_impl(element);
+    _jtd_constructor_290_impl(element);
   }
-  _jtd_constructor_265_impl(ExecutableElement element) {
+  _jtd_constructor_290_impl(ExecutableElement element) {
   }
   /**
    * Initialize a newly created function type to be declared by the given element and to have the
@@ -3944,16 +4522,16 @@
    * @param element the element representing the declaration of the function type
    */
   FunctionTypeImpl.con2(FunctionTypeAliasElement element) : super(element, element == null ? null : element.name) {
-    _jtd_constructor_266_impl(element);
+    _jtd_constructor_291_impl(element);
   }
-  _jtd_constructor_266_impl(FunctionTypeAliasElement element) {
+  _jtd_constructor_291_impl(FunctionTypeAliasElement element) {
   }
   bool operator ==(Object object) {
     if (object is! FunctionTypeImpl) {
       return false;
     }
     FunctionTypeImpl otherType = object as FunctionTypeImpl;
-    return element == otherType.element && JavaArrays.equals(_normalParameterTypes, otherType._normalParameterTypes) && JavaArrays.equals(_optionalParameterTypes, otherType._optionalParameterTypes) && equals2(_namedParameterTypes, otherType._namedParameterTypes);
+    return element == otherType.element && JavaArrays.equals(_normalParameterTypes, otherType._normalParameterTypes) && JavaArrays.equals(_optionalParameterTypes, otherType._optionalParameterTypes) && equals2(_namedParameterTypes, otherType._namedParameterTypes) && _returnType == otherType._returnType;
   }
   Map<String, Type2> get namedParameterTypes => _namedParameterTypes;
   List<Type2> get normalParameterTypes => _normalParameterTypes;
@@ -3961,11 +4539,11 @@
   Type2 get returnType => _returnType;
   List<Type2> get typeArguments => _typeArguments;
   int get hashCode {
-    Element element44 = element;
-    if (element44 == null) {
+    Element element2 = element;
+    if (element2 == null) {
       return 0;
     }
-    return element44.hashCode;
+    return element2.hashCode;
   }
   bool isSubtypeOf(Type2 type) {
     if (type == null) {
@@ -4058,15 +4636,15 @@
    * Set the type of object returned by this type of function to the given type.
    * @param returnType the type of object returned by this type of function
    */
-  void set returnType(Type2 returnType3) {
-    this._returnType = returnType3;
+  void set returnType(Type2 returnType2) {
+    this._returnType = returnType2;
   }
   /**
    * Set the actual types of the type arguments to the given types.
    * @param typeArguments the actual types of the type arguments
    */
-  void set typeArguments(List<Type2> typeArguments4) {
-    this._typeArguments = typeArguments4;
+  void set typeArguments(List<Type2> typeArguments2) {
+    this._typeArguments = typeArguments2;
   }
   FunctionTypeImpl substitute4(List<Type2> argumentTypes) => substitute2(argumentTypes, typeArguments);
   FunctionTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes) {
@@ -4076,8 +4654,8 @@
     if (argumentTypes.length == 0) {
       return this;
     }
-    Element element45 = element;
-    FunctionTypeImpl newType = (element45 is ExecutableElement) ? new FunctionTypeImpl.con1((element45 as ExecutableElement)) : new FunctionTypeImpl.con2((element45 as FunctionTypeAliasElement));
+    Element element2 = element;
+    FunctionTypeImpl newType = (element2 is ExecutableElement) ? new FunctionTypeImpl.con1((element2 as ExecutableElement)) : new FunctionTypeImpl.con2((element2 as FunctionTypeAliasElement));
     newType.returnType = _returnType.substitute2(argumentTypes, parameterTypes);
     newType.normalParameterTypes = TypeImpl.substitute(_normalParameterTypes, argumentTypes, parameterTypes);
     newType.optionalParameterTypes = TypeImpl.substitute(_optionalParameterTypes, argumentTypes, parameterTypes);
@@ -4193,8 +4771,8 @@
         }
       }
     }
-    InterfaceType supertype3 = classElement.supertype;
-    pathLength = computeLongestInheritancePathToObject2(supertype3, depth + 1);
+    InterfaceType supertype2 = classElement.supertype;
+    pathLength = computeLongestInheritancePathToObject2(supertype2, depth + 1);
     if (pathLength > longestPath) {
       longestPath = pathLength;
     }
@@ -4210,18 +4788,18 @@
    * @see #getLeastUpperBound(Type)
    */
   static Set<InterfaceType> computeSuperinterfaceSet2(InterfaceType type, Set<InterfaceType> set) {
-    Element element46 = type.element;
-    if (element46 != null && element46 is ClassElement) {
-      ClassElement classElement = element46 as ClassElement;
+    Element element2 = type.element;
+    if (element2 != null && element2 is ClassElement) {
+      ClassElement classElement = element2 as ClassElement;
       List<InterfaceType> superinterfaces = classElement.interfaces;
       for (InterfaceType superinterface in superinterfaces) {
         javaSetAdd(set, superinterface);
         computeSuperinterfaceSet2(superinterface, set);
       }
-      InterfaceType supertype4 = classElement.supertype;
-      if (supertype4 != null) {
-        javaSetAdd(set, supertype4);
-        computeSuperinterfaceSet2(supertype4, set);
+      InterfaceType supertype2 = classElement.supertype;
+      if (supertype2 != null) {
+        javaSetAdd(set, supertype2);
+        computeSuperinterfaceSet2(supertype2, set);
       }
     }
     return set;
@@ -4235,9 +4813,9 @@
    * @param element the element representing the declaration of the type
    */
   InterfaceTypeImpl.con1(ClassElement element) : super(element, element.name) {
-    _jtd_constructor_267_impl(element);
+    _jtd_constructor_292_impl(element);
   }
-  _jtd_constructor_267_impl(ClassElement element) {
+  _jtd_constructor_292_impl(ClassElement element) {
   }
   /**
    * Initialize a newly created type to have the given name. This constructor should only be used in
@@ -4245,9 +4823,9 @@
    * @param name the name of the type
    */
   InterfaceTypeImpl.con2(String name) : super(null, name) {
-    _jtd_constructor_268_impl(name);
+    _jtd_constructor_293_impl(name);
   }
-  _jtd_constructor_268_impl(String name) {
+  _jtd_constructor_293_impl(String name) {
   }
   bool operator ==(Object object) {
     if (object is! InterfaceTypeImpl) {
@@ -4257,20 +4835,35 @@
     return element == otherType.element && JavaArrays.equals(_typeArguments, otherType._typeArguments);
   }
   ClassElement get element => super.element as ClassElement;
-  Type2 getLeastUpperBound(Type2 type) {
+  PropertyAccessorElement getGetter(String getterName) => PropertyAccessorMember.from(((element as ClassElementImpl)).getGetter(getterName), this);
+  List<InterfaceType> get interfaces {
+    ClassElement classElement = element;
+    List<InterfaceType> interfaces2 = classElement.interfaces;
+    List<TypeVariableElement> typeVariables2 = classElement.typeVariables;
+    if (typeVariables2.length == 0) {
+      return interfaces2;
+    }
+    int count = interfaces2.length;
+    List<InterfaceType> typedInterfaces = new List<InterfaceType>(count);
+    for (int i = 0; i < count; i++) {
+      typedInterfaces[i] = interfaces2[i].substitute2(_typeArguments, TypeVariableTypeImpl.getTypes(typeVariables2));
+    }
+    return typedInterfaces;
+  }
+  Type2 getLeastUpperBound(Type2 type2) {
     Type2 dynamicType = DynamicTypeImpl.instance;
-    if (identical(this, dynamicType) || identical(type, dynamicType)) {
+    if (identical(this, dynamicType) || identical(type2, dynamicType)) {
       return dynamicType;
     }
-    if (type == null || type is! InterfaceType) {
+    if (type2 == null || type2 is! InterfaceType) {
       return null;
     }
     InterfaceType i = this;
-    InterfaceType j = type as InterfaceType;
+    InterfaceType j = type2 as InterfaceType;
     Set<InterfaceType> si = computeSuperinterfaceSet(i);
     Set<InterfaceType> sj = computeSuperinterfaceSet(j);
-    javaSetAdd(si, i);
-    javaSetAdd(sj, j);
+    javaSetAdd(si, i.element.type);
+    javaSetAdd(sj, j.element.type);
     si.retainAll(sj);
     Set<InterfaceType> s = si;
     List<InterfaceType> sn = new List.from(s);
@@ -4297,33 +4890,53 @@
     }
     return null;
   }
-  Type2 get superclass {
+  MethodElement getMethod(String methodName) => MethodMember.from(((element as ClassElementImpl)).getMethod(methodName), this);
+  List<InterfaceType> get mixins {
     ClassElement classElement = element;
-    return element.supertype.substitute2(_typeArguments, TypeVariableTypeImpl.getTypes(classElement.typeVariables));
+    List<InterfaceType> mixins2 = classElement.mixins;
+    List<TypeVariableElement> typeVariables2 = classElement.typeVariables;
+    if (typeVariables2.length == 0) {
+      return mixins2;
+    }
+    int count = mixins2.length;
+    List<InterfaceType> typedMixins = new List<InterfaceType>(count);
+    for (int i = 0; i < count; i++) {
+      typedMixins[i] = mixins2[i].substitute2(_typeArguments, TypeVariableTypeImpl.getTypes(typeVariables2));
+    }
+    return typedMixins;
+  }
+  PropertyAccessorElement getSetter(String setterName) => PropertyAccessorMember.from(((element as ClassElementImpl)).getSetter(setterName), this);
+  InterfaceType get superclass {
+    ClassElement classElement = element;
+    InterfaceType supertype2 = classElement.supertype;
+    if (supertype2 == null) {
+      return null;
+    }
+    return supertype2.substitute2(_typeArguments, TypeVariableTypeImpl.getTypes(classElement.typeVariables));
   }
   List<Type2> get typeArguments => _typeArguments;
   int get hashCode {
-    ClassElement element47 = element;
-    if (element47 == null) {
+    ClassElement element2 = element;
+    if (element2 == null) {
       return 0;
     }
-    return element47.hashCode;
+    return element2.hashCode;
   }
   bool isDartCoreFunction() {
-    ClassElement element48 = element;
-    if (element48 == null) {
+    ClassElement element2 = element;
+    if (element2 == null) {
       return false;
     }
-    return element48.name == "Function" && element48.library.isDartCore();
+    return element2.name == "Function" && element2.library.isDartCore();
   }
   bool isDirectSupertypeOf(InterfaceType type) {
     ClassElement i = element;
     ClassElement j = type.element;
-    InterfaceType supertype5 = j.supertype;
-    if (supertype5 == null) {
+    InterfaceType supertype2 = j.supertype;
+    if (supertype2 == null) {
       return false;
     }
-    ClassElement supertypeElement = supertype5.element;
+    ClassElement supertypeElement = supertype2.element;
     if (supertypeElement == i) {
       return true;
     }
@@ -4404,8 +5017,8 @@
       }
       return true;
     }
-    Type2 supertype6 = elementT.supertype;
-    if (supertype6 == null) {
+    Type2 supertype2 = elementT.supertype;
+    if (supertype2 == null) {
       return false;
     }
     List<Type2> interfaceTypes = elementT.interfaces;
@@ -4420,14 +5033,77 @@
         return true;
       }
     }
-    return supertype6.isSubtypeOf(typeS);
+    return supertype2.isSubtypeOf(typeS);
+  }
+  PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library) {
+    PropertyAccessorElement element = getGetter(getterName);
+    if (element != null && element.isAccessibleIn(library)) {
+      return element;
+    }
+    for (InterfaceType mixin in mixins) {
+      element = mixin.getGetter(getterName);
+      if (element != null && element.isAccessibleIn(library)) {
+        return element;
+      }
+    }
+    InterfaceType supertype = superclass;
+    while (supertype != null) {
+      element = supertype.getGetter(getterName);
+      if (element != null && element.isAccessibleIn(library)) {
+        return element;
+      }
+      supertype = supertype.superclass;
+    }
+    return null;
+  }
+  MethodElement lookUpMethod(String methodName, LibraryElement library) {
+    MethodElement element = getMethod(methodName);
+    if (element != null && element.isAccessibleIn(library)) {
+      return element;
+    }
+    for (InterfaceType mixin in mixins) {
+      element = mixin.getMethod(methodName);
+      if (element != null && element.isAccessibleIn(library)) {
+        return element;
+      }
+    }
+    InterfaceType supertype = superclass;
+    while (supertype != null) {
+      element = supertype.getMethod(methodName);
+      if (element != null && element.isAccessibleIn(library)) {
+        return element;
+      }
+      supertype = supertype.superclass;
+    }
+    return null;
+  }
+  PropertyAccessorElement lookUpSetter(String setterName, LibraryElement library) {
+    PropertyAccessorElement element = getSetter(setterName);
+    if (element != null && element.isAccessibleIn(library)) {
+      return element;
+    }
+    for (InterfaceType mixin in mixins) {
+      element = mixin.getSetter(setterName);
+      if (element != null && element.isAccessibleIn(library)) {
+        return element;
+      }
+    }
+    InterfaceType supertype = superclass;
+    while (supertype != null) {
+      element = supertype.getSetter(setterName);
+      if (element != null && element.isAccessibleIn(library)) {
+        return element;
+      }
+      supertype = supertype.superclass;
+    }
+    return null;
   }
   /**
    * Set the actual types of the type arguments to those in the given array.
    * @param typeArguments the actual types of the type arguments
    */
-  void set typeArguments(List<Type2> typeArguments5) {
-    this._typeArguments = typeArguments5;
+  void set typeArguments(List<Type2> typeArguments2) {
+    this._typeArguments = typeArguments2;
   }
   InterfaceTypeImpl substitute5(List<Type2> argumentTypes) => substitute2(argumentTypes, typeArguments);
   InterfaceTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes) {
@@ -4471,12 +5147,12 @@
    * @return the result of performing the substitution on each of the types
    */
   static List<Type2> substitute(List<Type2> types, List<Type2> argumentTypes, List<Type2> parameterTypes) {
-    int length6 = types.length;
-    if (length6 == 0) {
+    int length2 = types.length;
+    if (length2 == 0) {
       return types;
     }
-    List<Type2> newTypes = new List<Type2>(length6);
-    for (int i = 0; i < length6; i++) {
+    List<Type2> newTypes = new List<Type2>(length2);
+    for (int i = 0; i < length2; i++) {
       newTypes[i] = types[i].substitute2(argumentTypes, parameterTypes);
     }
     return newTypes;
@@ -4565,8 +5241,8 @@
   }
   bool isSubtypeOf(Type2 type) => true;
   Type2 substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes) {
-    int length7 = parameterTypes.length;
-    for (int i = 0; i < length7; i++) {
+    int length2 = parameterTypes.length;
+    for (int i = 0; i < length2; i++) {
       if (parameterTypes[i] == this) {
         return argumentTypes[i];
       }
@@ -4731,6 +5407,20 @@
 abstract class InterfaceType implements Type2 {
   ClassElement get element;
   /**
+   * Return the element representing the getter with the given name that is declared in this class,
+   * or {@code null} if this class does not declare a getter with the given name.
+   * @param getterName the name of the getter to be returned
+   * @return the getter declared in this class with the given name
+   */
+  PropertyAccessorElement getGetter(String getterName);
+  /**
+   * Return an array containing all of the interfaces that are implemented by this interface. Note
+   * that this is <b>not</b>, in general, equivalent to getting the interfaces from this type's
+   * element because the types returned by this method will have had their type parameters replaced.
+   * @return the interfaces that are implemented by this type
+   */
+  List<InterfaceType> get interfaces;
+  /**
    * Return the least upper bound of this type and the given type, or {@code null} if there is no
    * least upper bound.
    * <p>
@@ -4747,12 +5437,35 @@
    */
   Type2 getLeastUpperBound(Type2 type);
   /**
-   * Return the type representing the superclass of this type. Note that this is <b>not</b>, in
-   * general, equivalent to getting the superclass from this type's element because the type
-   * returned by this method will have had it's type parameters replaced.
+   * Return the element representing the method with the given name that is declared in this class,
+   * or {@code null} if this class does not declare a method with the given name.
+   * @param methodName the name of the method to be returned
+   * @return the method declared in this class with the given name
+   */
+  MethodElement getMethod(String methodName);
+  /**
+   * Return an array containing all of the mixins that are applied to the class being extended in
+   * order to derive the superclass of this class. Note that this is <b>not</b>, in general,
+   * equivalent to getting the mixins from this type's element because the types returned by this
+   * method will have had their type parameters replaced.
+   * @return the mixins that are applied to derive the superclass of this class
+   */
+  List<InterfaceType> get mixins;
+  /**
+   * Return the element representing the setter with the given name that is declared in this class,
+   * or {@code null} if this class does not declare a setter with the given name.
+   * @param setterName the name of the setter to be returned
+   * @return the setter declared in this class with the given name
+   */
+  PropertyAccessorElement getSetter(String setterName);
+  /**
+   * Return the type representing the superclass of this type, or null if this type represents the
+   * class 'Object'. Note that this is <b>not</b>, in general, equivalent to getting the superclass
+   * from this type's element because the type returned by this method will have had it's type
+   * parameters replaced.
    * @return the superclass of this type
    */
-  Type2 get superclass;
+  InterfaceType get superclass;
   /**
    * Return an array containing the actual types of the type arguments. If this type's element does
    * not have type parameters, then the array should be empty (although it is possible for type
@@ -4807,6 +5520,65 @@
    */
   bool isSubtypeOf(Type2 type);
   /**
+   * Return the element representing the getter that results from looking up the given getter in
+   * this class with respect to the given library, or {@code null} if the look up fails. The
+   * behavior of this method is defined by the Dart Language Specification in section 12.15.1:
+   * <blockquote>The result of looking up getter (respectively setter) <i>m</i> in class <i>C</i>
+   * with respect to library <i>L</i> is:
+   * <ul>
+   * <li>If <i>C</i> declares an instance getter (respectively setter) named <i>m</i> that is
+   * accessible to <i>L</i>, then that getter (respectively setter) is the result of the lookup.
+   * Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lookup is the result
+   * of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respect to <i>L</i>.
+   * Otherwise, we say that the lookup has failed.</li>
+   * </ul>
+   * </blockquote>
+   * @param getterName the name of the getter being looked up
+   * @param library the library with respect to which the lookup is being performed
+   * @return the result of looking up the given getter in this class with respect to the given
+   * library
+   */
+  PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library);
+  /**
+   * Return the element representing the method that results from looking up the given method in
+   * this class with respect to the given library, or {@code null} if the look up fails. The
+   * behavior of this method is defined by the Dart Language Specification in section 12.15.1:
+   * <blockquote> The result of looking up method <i>m</i> in class <i>C</i> with respect to library
+   * <i>L</i> is:
+   * <ul>
+   * <li>If <i>C</i> declares an instance method named <i>m</i> that is accessible to <i>L</i>, then
+   * that method is the result of the lookup. Otherwise, if <i>C</i> has a superclass <i>S</i>, then
+   * the result of the lookup is the result of looking up method <i>m</i> in <i>S</i> with respect
+   * to <i>L</i>. Otherwise, we say that the lookup has failed.</li>
+   * </ul>
+   * </blockquote>
+   * @param methodName the name of the method being looked up
+   * @param library the library with respect to which the lookup is being performed
+   * @return the result of looking up the given method in this class with respect to the given
+   * library
+   */
+  MethodElement lookUpMethod(String methodName, LibraryElement library);
+  /**
+   * Return the element representing the setter that results from looking up the given setter in
+   * this class with respect to the given library, or {@code null} if the look up fails. The
+   * behavior of this method is defined by the Dart Language Specification in section 12.16:
+   * <blockquote> The result of looking up getter (respectively setter) <i>m</i> in class <i>C</i>
+   * with respect to library <i>L</i> is:
+   * <ul>
+   * <li>If <i>C</i> declares an instance getter (respectively setter) named <i>m</i> that is
+   * accessible to <i>L</i>, then that getter (respectively setter) is the result of the lookup.
+   * Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lookup is the result
+   * of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respect to <i>L</i>.
+   * Otherwise, we say that the lookup has failed.</li>
+   * </ul>
+   * </blockquote>
+   * @param setterName the name of the setter being looked up
+   * @param library the library with respect to which the lookup is being performed
+   * @return the result of looking up the given setter in this class with respect to the given
+   * library
+   */
+  PropertyAccessorElement lookUpSetter(String setterName, LibraryElement library);
+  /**
    * Return the type resulting from substituting the given arguments for this type's parameters.
    * This is fully equivalent to {@code substitute(argumentTypes, getTypeArguments())}.
    * @param argumentTypes the actual type arguments being substituted for the type parameters
@@ -4913,4 +5685,4 @@
  */
 abstract class VoidType implements Type2 {
   VoidType substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes);
-}
+}
\ No newline at end of file
diff --git a/pkg/analyzer_experimental/lib/src/generated/engine.dart b/pkg/analyzer_experimental/lib/src/generated/engine.dart
index 6b0bdad..66f945b 100644
--- a/pkg/analyzer_experimental/lib/src/generated/engine.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/engine.dart
@@ -3,17 +3,20 @@
 
 library engine;
 
+import 'dart:collection' show HasNextIterator;
+import 'dart:uri' show Uri;
 import 'java_core.dart';
 import 'java_engine.dart';
-import 'dart:collection' show HasNextIterator;
+import 'instrumentation.dart';
 import 'error.dart';
 import 'source.dart';
 import 'scanner.dart' show Token, CharBufferScanner, StringScanner;
-import 'ast.dart' show CompilationUnit, Directive, PartOfDirective;
+import 'ast.dart';
 import 'parser.dart' show Parser;
+import 'sdk.dart' show DartSdk;
 import 'element.dart';
-import 'resolver.dart' show Namespace, NamespaceBuilder, LibraryResolver, HtmlUnitBuilder;
-import 'html.dart' show XmlTagNode, XmlAttributeNode, SimpleXmlVisitor, HtmlScanner, HtmlScanResult, HtmlParser, HtmlParseResult, HtmlUnit;
+import 'resolver.dart';
+import 'html.dart' show XmlTagNode, XmlAttributeNode, RecursiveXmlVisitor, HtmlScanner, HtmlScanResult, HtmlParser, HtmlParseResult, HtmlUnit;
 
 /**
  * The unique instance of the class {@code AnalysisEngine} serves as the entry point for the
@@ -78,7 +81,13 @@
    * Create a new context in which analysis can be performed.
    * @return the analysis context that was created
    */
-  AnalysisContext createAnalysisContext() => new AnalysisContextImpl();
+  AnalysisContext createAnalysisContext() {
+    if (Instrumentation.isNullLogger()) {
+      return new DelegatingAnalysisContextImpl();
+    } else {
+      return new InstrumentedAnalysisContextImpl.con1(new DelegatingAnalysisContextImpl());
+    }
+  }
   /**
    * Return the logger that should receive information about errors within the analysis engine.
    * @return the logger that should receive information about errors within the analysis engine
@@ -207,14 +216,15 @@
    */
   Element getElement(ElementLocation location);
   /**
-   * Return an array containing all of the errors associated with the given source. The array will
-   * be empty if the source is not known to this context or if there are no errors in the source.
-   * The errors contained in the array can be incomplete.
+   * Return an analysis error info containing the array of all of the errors and the line info
+   * associated with the given source. The array of errors will be empty if the source is not known
+   * to this context or if there are no errors in the source. The errors contained in the array can
+   * be incomplete.
    * @param source the source whose errors are to be returned
-   * @return all of the errors associated with the given source
+   * @return all of the errors associated with the given source and the line info
    * @see #computeErrors(Source)
    */
-  List<AnalysisError> getErrors(Source source);
+  AnalysisErrorInfo getErrors(Source source);
   /**
    * Return the element model corresponding to the HTML file defined by the given source, or{@code null} if the source does not represent an HTML file, the element representing the file
    * has not yet been created, or the analysis of the HTML file failed for some reason.
@@ -298,6 +308,23 @@
    */
   LineInfo getLineInfo(Source source);
   /**
+   * Return a fully resolved AST for a single compilation unit within the given library, or{@code null} if the resolved AST is not already computed.
+   * @param unitSource the source of the compilation unit
+   * @param library the library containing the compilation unit
+   * @return a fully resolved AST for the compilation unit
+   * @see #resolveCompilationUnit(Source,LibraryElement)
+   */
+  CompilationUnit getResolvedCompilationUnit(Source unitSource, LibraryElement library);
+  /**
+   * Return a fully resolved AST for a single compilation unit within the given library, or{@code null} if the resolved AST is not already computed.
+   * @param unitSource the source of the compilation unit
+   * @param librarySource the source of the defining compilation unit of the library containing the
+   * compilation unit
+   * @return a fully resolved AST for the compilation unit
+   * @see #resolveCompilationUnit(Source,Source)
+   */
+  CompilationUnit getResolvedCompilationUnit2(Source unitSource, Source librarySource);
+  /**
    * Return the source factory used to create the sources that can be analyzed in this context.
    * @return the source factory used to create the sources that can be analyzed in this context
    */
@@ -365,6 +392,7 @@
    * @return the result of resolving the AST structure representing the content of the source in the
    * context of the given library
    * @throws AnalysisException if the analysis could not be performed
+   * @see #getResolvedCompilationUnit(Source,LibraryElement)
    */
   CompilationUnit resolveCompilationUnit(Source unitSource, LibraryElement library);
   /**
@@ -375,6 +403,7 @@
    * @return the result of resolving the AST structure representing the content of the source in the
    * context of the given library
    * @throws AnalysisException if the analysis could not be performed
+   * @see #getResolvedCompilationUnit(Source,Source)
    */
   CompilationUnit resolveCompilationUnit2(Source unitSource, Source librarySource);
   /**
@@ -408,6 +437,23 @@
   Iterable<Source> sourcesToResolve(List<Source> changedSources);
 }
 /**
+ * The interface {@code AnalysisErrorInfo} contains the analysis errors and line information for the
+ * errors.
+ */
+abstract class AnalysisErrorInfo {
+  /**
+   * Return the errors that as a result of the analysis, or {@code null} if there were no errors.
+   * @return the errors as a result of the analysis
+   */
+  List<AnalysisError> get errors;
+  /**
+   * Return the line information associated with the errors, or {@code null} if there were no
+   * errors.
+   * @return the line information associated with the errors
+   */
+  LineInfo get lineInfo;
+}
+/**
  * Instances of the class {@code AnalysisException} represent an exception that occurred during the
  * analysis of one or more sources.
  * @coverage dart.engine
@@ -417,18 +463,18 @@
    * Initialize a newly created exception.
    */
   AnalysisException() : super() {
-    _jtd_constructor_124_impl();
+    _jtd_constructor_125_impl();
   }
-  _jtd_constructor_124_impl() {
+  _jtd_constructor_125_impl() {
   }
   /**
    * Initialize a newly created exception to have the given message.
    * @param message the message associated with the exception
    */
   AnalysisException.con1(String message) : super(message) {
-    _jtd_constructor_125_impl(message);
+    _jtd_constructor_126_impl(message);
   }
-  _jtd_constructor_125_impl(String message) {
+  _jtd_constructor_126_impl(String message) {
   }
   /**
    * Initialize a newly created exception to have the given message and cause.
@@ -436,18 +482,18 @@
    * @param cause the underlying exception that caused this exception
    */
   AnalysisException.con2(String message, Exception cause) : super(message, cause) {
-    _jtd_constructor_126_impl(message, cause);
+    _jtd_constructor_127_impl(message, cause);
   }
-  _jtd_constructor_126_impl(String message, Exception cause) {
+  _jtd_constructor_127_impl(String message, Exception cause) {
   }
   /**
    * Initialize a newly created exception to have the given cause.
    * @param cause the underlying exception that caused this exception
    */
   AnalysisException.con3(Exception cause) : super.withCause(cause) {
-    _jtd_constructor_127_impl(cause);
+    _jtd_constructor_128_impl(cause);
   }
-  _jtd_constructor_127_impl(Exception cause) {
+  _jtd_constructor_128_impl(Exception cause) {
   }
 }
 /**
@@ -455,7 +501,7 @@
  * analysis results associated with a given source.
  * @coverage dart.engine
  */
-abstract class ChangeNotice {
+abstract class ChangeNotice implements AnalysisErrorInfo {
   /**
    * Return the fully resolved AST that changed as a result of the analysis, or {@code null} if the
    * AST was not changed.
@@ -463,18 +509,6 @@
    */
   CompilationUnit get compilationUnit;
   /**
-   * Return the errors that changed as a result of the analysis, or {@code null} if errors were not
-   * changed.
-   * @return the errors that changed as a result of the analysis
-   */
-  List<AnalysisError> get errors;
-  /**
-   * Return the line information associated with the source, or {@code null} if errors were not
-   * changed.
-   * @return the line information associated with the source
-   */
-  LineInfo get lineInfo;
-  /**
    * Return the source for which the result is being reported.
    * @return the source for which the result is being reported
    */
@@ -572,7 +606,7 @@
  * context}.
  * @coverage dart.engine
  */
-class AnalysisContextImpl implements AnalysisContext {
+class AnalysisContextImpl implements InternalAnalysisContext {
   /**
    * The source factory used to create the sources that can be analyzed in this context.
    */
@@ -587,10 +621,20 @@
    */
   Map<Source, ChangeNoticeImpl> _pendingNotices = new Map<Source, ChangeNoticeImpl>();
   /**
+   * A list containing the most recently accessed sources with the most recently used at the end of
+   * the list. When more sources are added than the maximum allowed then the least recently used
+   * source will be removed and will have it's cached AST structure flushed.
+   */
+  List<Source> _recentlyUsed = new List<Source>();
+  /**
    * The object used to synchronize access to all of the caches.
    */
   Object _cacheLock = new Object();
   /**
+   * The maximum number of sources for which data should be kept in the cache.
+   */
+  static int _MAX_CACHE_SIZE = 64;
+  /**
    * The name of the 'src' attribute in a HTML tag.
    */
   static String _ATTRIBUTE_SRC = "src";
@@ -599,10 +643,18 @@
    */
   static String _TAG_SCRIPT = "script";
   /**
+   * The number of times that the flushing of information from the cache has been disabled without
+   * being re-enabled.
+   */
+  int _cacheRemovalCount = 0;
+  /**
    * Initialize a newly created analysis context.
    */
   AnalysisContextImpl() : super() {
   }
+  void addSourceInfo(Source source, SourceInfo info) {
+    _sourceMap[source] = info;
+  }
   void applyChanges(ChangeSet changeSet) {
     if (changeSet.isEmpty()) {
       return;
@@ -646,8 +698,8 @@
       if (htmlUnitInfo == null) {
         return null;
       }
-      HtmlElement element24 = htmlUnitInfo.element;
-      if (element24 == null) {
+      HtmlElement element2 = htmlUnitInfo.element;
+      if (element2 == null) {
         HtmlUnit unit = htmlUnitInfo.resolvedUnit;
         if (unit == null) {
           unit = htmlUnitInfo.parsedUnit;
@@ -656,11 +708,11 @@
           }
         }
         HtmlUnitBuilder builder = new HtmlUnitBuilder(this);
-        element24 = builder.buildHtmlElement2(source, unit);
+        element2 = builder.buildHtmlElement2(source, unit);
         htmlUnitInfo.resolvedUnit = unit;
-        htmlUnitInfo.element = element24;
+        htmlUnitInfo.element = element2;
       }
-      return element24;
+      return element2;
     }
   }
   SourceKind computeKindOf(Source source) {
@@ -668,8 +720,8 @@
       SourceInfo sourceInfo = getSourceInfo(source);
       if (sourceInfo == null) {
         return SourceKind.UNKNOWN;
-      } else if (sourceInfo is DartInfo) {
-        sourceInfo = internalComputeKindOf(source, sourceInfo);
+      } else if (identical(sourceInfo, DartInfo.pendingInstance)) {
+        sourceInfo = internalComputeKindOf(source);
       }
       return sourceInfo.kind;
     }
@@ -683,22 +735,22 @@
       if (libraryInfo == null) {
         return null;
       }
-      LibraryElement element25 = libraryInfo.element;
-      if (element25 == null) {
+      LibraryElement element2 = libraryInfo.element;
+      if (element2 == null) {
         if (computeKindOf(source) != SourceKind.LIBRARY) {
           return null;
         }
         LibraryResolver resolver = new LibraryResolver.con1(this);
         try {
-          element25 = resolver.resolveLibrary(source, true);
-          if (element25 != null) {
-            libraryInfo.element = element25;
+          element2 = resolver.resolveLibrary(source, true);
+          if (element2 != null) {
+            libraryInfo.element = element2;
           }
         } on AnalysisException catch (exception) {
           AnalysisEngine.instance.logger.logError2("Could not resolve the library ${source.fullName}", exception);
         }
       }
-      return element25;
+      return element2;
     }
   }
   LineInfo computeLineInfo(Source source) {
@@ -707,31 +759,49 @@
       if (sourceInfo == null) {
         return null;
       }
-      LineInfo lineInfo4 = sourceInfo.lineInfo;
-      if (lineInfo4 == null) {
-        if (sourceInfo is DartInfo) {
-          sourceInfo = internalComputeKindOf(source, sourceInfo);
+      LineInfo lineInfo2 = sourceInfo.lineInfo;
+      if (lineInfo2 == null) {
+        if (identical(sourceInfo, DartInfo.pendingInstance)) {
+          sourceInfo = internalComputeKindOf(source);
         }
         if (sourceInfo is HtmlUnitInfo) {
           parseHtmlUnit(source);
-          lineInfo4 = sourceInfo.lineInfo;
+          lineInfo2 = sourceInfo.lineInfo;
         } else if (sourceInfo is CompilationUnitInfo) {
           parseCompilationUnit(source);
-          lineInfo4 = sourceInfo.lineInfo;
+          lineInfo2 = sourceInfo.lineInfo;
         }
       }
-      return lineInfo4;
+      return lineInfo2;
     }
   }
-  AnalysisContext extractContext(SourceContainer container) {
-    AnalysisContextImpl newContext = AnalysisEngine.instance.createAnalysisContext() as AnalysisContextImpl;
+  CompilationUnit computeResolvableCompilationUnit(Source source) {
+    {
+      CompilationUnitInfo compilationUnitInfo = getCompilationUnitInfo(source);
+      if (compilationUnitInfo == null) {
+        return null;
+      }
+      CompilationUnit unit = compilationUnitInfo.parsedCompilationUnit;
+      if (unit == null) {
+        unit = compilationUnitInfo.resolvedCompilationUnit;
+      }
+      if (unit != null) {
+        return unit.accept(new ASTCloner()) as CompilationUnit;
+      }
+      unit = internalParseCompilationUnit(compilationUnitInfo, source);
+      compilationUnitInfo.clearParsedUnit();
+      return unit;
+    }
+  }
+  AnalysisContext extractContext(SourceContainer container) => extractContextInto(container, (AnalysisEngine.instance.createAnalysisContext() as AnalysisContextImpl));
+  InternalAnalysisContext extractContextInto(SourceContainer container, InternalAnalysisContext newContext) {
     List<Source> sourcesToRemove = new List<Source>();
     {
       for (MapEntry<Source, SourceInfo> entry in getMapEntrySet(_sourceMap)) {
         Source source = entry.getKey();
         if (container.contains(source)) {
           sourcesToRemove.add(source);
-          newContext._sourceMap[source] = entry.getValue().copy();
+          newContext.addSourceInfo(source, entry.getValue().copy());
         }
       }
     }
@@ -756,13 +826,14 @@
     }
     return element;
   }
-  List<AnalysisError> getErrors(Source source) {
+  AnalysisErrorInfo getErrors(Source source) {
     {
       SourceInfo info = getSourceInfo(source);
       if (info is CompilationUnitInfo) {
-        return ((info as CompilationUnitInfo)).allErrors;
+        CompilationUnitInfo compilationUnitInfo = info as CompilationUnitInfo;
+        return new AnalysisErrorInfoImpl(compilationUnitInfo.allErrors, compilationUnitInfo.lineInfo);
       }
-      return AnalysisError.NO_ERRORS;
+      return new AnalysisErrorInfoImpl(AnalysisError.NO_ERRORS, info.lineInfo);
     }
   }
   HtmlElement getHtmlElement(Source source) {
@@ -776,22 +847,25 @@
   }
   List<Source> getHtmlFilesReferencing(Source source) {
     {
-      SourceInfo info = getSourceInfo(source);
-      if (info is LibraryInfo) {
-        return ((info as LibraryInfo)).htmlSources;
-      } else if (info is CompilationUnitInfo) {
-        List<Source> sources = new List<Source>();
-        for (Source librarySource in ((info as CompilationUnitInfo)).librarySources) {
-          LibraryInfo libraryInfo = getLibraryInfo(librarySource);
-          for (Source htmlSource in libraryInfo.htmlSources) {
-            sources.add(htmlSource);
+      List<Source> htmlSources = new List<Source>();
+      while (true) {
+        if (getKindOf(source) == SourceKind.LIBRARY) {
+        } else if (getKindOf(source) == SourceKind.PART) {
+          List<Source> librarySources = getLibrariesContaining(source);
+          for (MapEntry<Source, SourceInfo> entry in getMapEntrySet(_sourceMap)) {
+            if (identical(entry.getValue().kind, SourceKind.HTML)) {
+              if (containsAny(((entry.getValue() as HtmlUnitInfo)).librarySources, librarySources)) {
+                htmlSources.add(entry.getKey());
+              }
+            }
           }
         }
-        if (!sources.isEmpty) {
-          return new List.from(sources);
-        }
+        break;
       }
-      return Source.EMPTY_ARRAY;
+      if (htmlSources.isEmpty) {
+        return Source.EMPTY_ARRAY;
+      }
+      return new List.from(htmlSources);
     }
   }
   List<Source> get htmlSources => getSources(SourceKind.HTML);
@@ -832,11 +906,18 @@
   }
   List<Source> getLibrariesContaining(Source source) {
     {
-      SourceInfo info = getSourceInfo(source);
-      if (info is CompilationUnitInfo) {
-        return ((info as CompilationUnitInfo)).librarySources;
+      List<Source> librarySources = new List<Source>();
+      for (MapEntry<Source, SourceInfo> entry in getMapEntrySet(_sourceMap)) {
+        if (identical(entry.getValue().kind, SourceKind.LIBRARY)) {
+          if (contains(((entry.getValue() as LibraryInfo)).unitSources, source)) {
+            librarySources.add(entry.getKey());
+          }
+        }
       }
-      return Source.EMPTY_ARRAY;
+      if (librarySources.isEmpty) {
+        return Source.EMPTY_ARRAY;
+      }
+      return new List.from(librarySources);
     }
   }
   LibraryElement getLibraryElement(Source source) {
@@ -858,16 +939,10 @@
       return null;
     }
   }
-  /**
-   * Return a namespace containing mappings for all of the public names defined by the given
-   * library.
-   * @param library the library whose public namespace is to be returned
-   * @return the public namespace of the given library
-   */
   Namespace getPublicNamespace(LibraryElement library) {
-    Source source8 = library.definingCompilationUnit.source;
+    Source source2 = library.definingCompilationUnit.source;
     {
-      LibraryInfo libraryInfo = getLibraryInfo(source8);
+      LibraryInfo libraryInfo = getLibraryInfo(source2);
       if (libraryInfo == null) {
         return null;
       }
@@ -880,13 +955,6 @@
       return namespace;
     }
   }
-  /**
-   * Return a namespace containing mappings for all of the public names defined by the library
-   * defined by the given source.
-   * @param source the source defining the library whose public namespace is to be returned
-   * @return the public namespace corresponding to the library defined by the given source
-   * @throws AnalysisException if the public namespace could not be computed
-   */
   Namespace getPublicNamespace2(Source source) {
     {
       LibraryInfo libraryInfo = getLibraryInfo(source);
@@ -906,6 +974,22 @@
       return namespace;
     }
   }
+  CompilationUnit getResolvedCompilationUnit(Source unitSource, LibraryElement library) {
+    if (library == null) {
+      return null;
+    }
+    return getResolvedCompilationUnit2(unitSource, library.source);
+  }
+  CompilationUnit getResolvedCompilationUnit2(Source unitSource, Source librarySource) {
+    {
+      accessed(unitSource);
+      CompilationUnitInfo compilationUnitInfo = getCompilationUnitInfo(unitSource);
+      if (compilationUnitInfo == null) {
+        return null;
+      }
+      return compilationUnitInfo.resolvedCompilationUnit;
+    }
+  }
   SourceFactory get sourceFactory => _sourceFactory;
   bool isClientLibrary(Source librarySource) {
     SourceInfo sourceInfo = getSourceInfo(librarySource);
@@ -943,6 +1027,7 @@
   }
   CompilationUnit parseCompilationUnit(Source source) {
     {
+      accessed(source);
       CompilationUnitInfo compilationUnitInfo = getCompilationUnitInfo(source);
       if (compilationUnitInfo == null) {
         return null;
@@ -951,17 +1036,7 @@
       if (unit == null) {
         unit = compilationUnitInfo.parsedCompilationUnit;
         if (unit == null) {
-          RecordingErrorListener errorListener = new RecordingErrorListener();
-          AnalysisContextImpl_ScanResult scanResult = internalScan(source, errorListener);
-          Parser parser = new Parser(source, errorListener);
-          unit = parser.parseCompilationUnit(scanResult._token);
-          LineInfo lineInfo = new LineInfo(scanResult._lineStarts);
-          List<AnalysisError> errors = errorListener.getErrors2(source);
-          unit.parsingErrors = errors;
-          unit.lineInfo = lineInfo;
-          compilationUnitInfo.lineInfo = lineInfo;
-          compilationUnitInfo.parsedCompilationUnit = unit;
-          compilationUnitInfo.parseErrors = errors;
+          unit = internalParseCompilationUnit(compilationUnitInfo, source);
         }
       }
       return unit;
@@ -969,6 +1044,7 @@
   }
   HtmlUnit parseHtmlUnit(Source source) {
     {
+      accessed(source);
       HtmlUnitInfo htmlUnitInfo = getHtmlUnitInfo(source);
       if (htmlUnitInfo == null) {
         return null;
@@ -981,17 +1057,7 @@
           unit = result.htmlUnit;
           htmlUnitInfo.lineInfo = new LineInfo(result.lineStarts);
           htmlUnitInfo.parsedUnit = unit;
-          for (SourceInfo sourceInfo in _sourceMap.values) {
-            if (sourceInfo is LibraryInfo) {
-              ((sourceInfo as LibraryInfo)).removeHtmlSource(source);
-            }
-          }
-          for (Source librarySource in getLibrarySources2(source, unit)) {
-            LibraryInfo libraryInfo = getLibraryInfo(librarySource);
-            if (libraryInfo != null) {
-              libraryInfo.addHtmlSource(source);
-            }
-          }
+          htmlUnitInfo.librarySources = getLibrarySources2(source, unit);
         }
       }
       return unit;
@@ -1010,105 +1076,113 @@
       return notices;
     }
   }
-  /**
-   * Given a table mapping the source for the libraries represented by the corresponding elements to
-   * the elements representing the libraries, record those mappings.
-   * @param elementMap a table mapping the source for the libraries represented by the elements to
-   * the elements representing the libraries
-   */
   void recordLibraryElements(Map<Source, LibraryElement> elementMap) {
     Source htmlSource = _sourceFactory.forUri("dart:html");
     {
       for (MapEntry<Source, LibraryElement> entry in getMapEntrySet(elementMap)) {
+        Source librarySource = entry.getKey();
         LibraryElement library = entry.getValue();
-        LibraryInfo libraryInfo = getLibraryInfo(entry.getKey());
+        LibraryInfo libraryInfo = getLibraryInfo(librarySource);
         if (libraryInfo != null) {
           libraryInfo.element = library;
           libraryInfo.launchable = library.entryPoint != null;
           libraryInfo.client = isClient(library, htmlSource, new Set<LibraryElement>());
-        }
-        Source librarySource = library.source;
-        if (librarySource != null) {
-          for (SourceInfo info in _sourceMap.values) {
-            if (info is CompilationUnitInfo) {
-              ((info as CompilationUnitInfo)).removeLibrarySource(librarySource);
-            }
-          }
-          if (libraryInfo != null) {
-            libraryInfo.addLibrarySource(librarySource);
-          }
+          List<Source> unitSources = new List<Source>();
+          unitSources.add(librarySource);
           for (CompilationUnitElement part in library.parts) {
             Source partSource = part.source;
-            CompilationUnitInfo partInfo = partSource == null ? null : getCompilationUnitInfo(partSource);
-            if (partInfo != null) {
-              partInfo.addLibrarySource(librarySource);
-            }
+            unitSources.add(partSource);
           }
+          libraryInfo.unitSources = new List.from(unitSources);
         }
       }
     }
   }
-  /**
-   * Give the resolution errors and line info associated with the given source, add the information
-   * to the cache.
-   * @param source the source with which the information is associated
-   * @param errors the resolution errors associated with the source
-   * @param lineInfo the line information associated with the source
-   */
-  void recordResolutionErrors(Source source, List<AnalysisError> errors, LineInfo lineInfo5) {
+  void recordResolutionErrors(Source source, List<AnalysisError> errors, LineInfo lineInfo2) {
     {
       CompilationUnitInfo compilationUnitInfo = getCompilationUnitInfo(source);
       if (compilationUnitInfo != null) {
-        compilationUnitInfo.lineInfo = lineInfo5;
+        compilationUnitInfo.lineInfo = lineInfo2;
         compilationUnitInfo.resolutionErrors = errors;
       }
-      getNotice(source).setErrors(compilationUnitInfo.allErrors, lineInfo5);
+      getNotice(source).setErrors(compilationUnitInfo.allErrors, lineInfo2);
     }
   }
-  /**
-   * Give the resolved compilation unit associated with the given source, add the unit to the cache.
-   * @param source the source with which the unit is associated
-   * @param unit the compilation unit associated with the source
-   */
   void recordResolvedCompilationUnit(Source source, CompilationUnit unit) {
     {
       CompilationUnitInfo compilationUnitInfo = getCompilationUnitInfo(source);
       if (compilationUnitInfo != null) {
         compilationUnitInfo.resolvedCompilationUnit = unit;
+        compilationUnitInfo.clearParsedUnit();
         getNotice(source).compilationUnit = unit;
       }
     }
   }
-  CompilationUnit resolveCompilationUnit(Source source15, LibraryElement library) {
+  CompilationUnit resolveCompilationUnit(Source source2, LibraryElement library) {
     if (library == null) {
       return null;
     }
-    return resolveCompilationUnit2(source15, library.source);
+    return resolveCompilationUnit2(source2, library.source);
   }
   CompilationUnit resolveCompilationUnit2(Source unitSource, Source librarySource) {
     {
+      accessed(unitSource);
       CompilationUnitInfo compilationUnitInfo = getCompilationUnitInfo(unitSource);
       if (compilationUnitInfo == null) {
         return null;
       }
       CompilationUnit unit = compilationUnitInfo.resolvedCompilationUnit;
       if (unit == null) {
-        computeLibraryElement(librarySource);
-        unit = compilationUnitInfo.resolvedCompilationUnit;
+        disableCacheRemoval();
+        try {
+          LibraryElement libraryElement = computeLibraryElement(librarySource);
+          unit = compilationUnitInfo.resolvedCompilationUnit;
+          if (unit == null && libraryElement != null) {
+            Source coreLibrarySource = libraryElement.context.sourceFactory.forUri(DartSdk.DART_CORE);
+            LibraryElement coreElement = computeLibraryElement(coreLibrarySource);
+            TypeProvider typeProvider = new TypeProviderImpl(coreElement);
+            CompilationUnit unitAST = computeResolvableCompilationUnit(unitSource);
+            new DeclarationResolver().resolve(unitAST, find(libraryElement, unitSource));
+            RecordingErrorListener errorListener = new RecordingErrorListener();
+            TypeResolverVisitor typeResolverVisitor = new TypeResolverVisitor.con2(libraryElement, unitSource, typeProvider, errorListener);
+            unitAST.accept(typeResolverVisitor);
+            ResolverVisitor resolverVisitor = new ResolverVisitor.con2(libraryElement, unitSource, typeProvider, errorListener);
+            unitAST.accept(resolverVisitor);
+            ErrorReporter errorReporter = new ErrorReporter(errorListener, unitSource);
+            ErrorVerifier errorVerifier = new ErrorVerifier(errorReporter, libraryElement, typeProvider);
+            unitAST.accept(errorVerifier);
+            ConstantVerifier constantVerifier = new ConstantVerifier(errorReporter);
+            unitAST.accept(constantVerifier);
+            unitAST.resolutionErrors = errorListener.errors;
+            compilationUnitInfo.resolvedCompilationUnit = unitAST;
+            unit = unitAST;
+          }
+        } finally {
+          enableCacheRemoval();
+        }
       }
       return unit;
     }
   }
   HtmlUnit resolveHtmlUnit(Source unitSource) {
     {
+      accessed(unitSource);
       HtmlUnitInfo htmlUnitInfo = getHtmlUnitInfo(unitSource);
       if (htmlUnitInfo == null) {
         return null;
       }
       HtmlUnit unit = htmlUnitInfo.resolvedUnit;
       if (unit == null) {
-        computeHtmlElement(unitSource);
-        unit = htmlUnitInfo.resolvedUnit;
+        disableCacheRemoval();
+        try {
+          computeHtmlElement(unitSource);
+          unit = htmlUnitInfo.resolvedUnit;
+          if (unit == null) {
+            unit = parseHtmlUnit(unitSource);
+          }
+        } finally {
+          enableCacheRemoval();
+        }
       }
       return unit;
     }
@@ -1159,6 +1233,31 @@
     return librarySources;
   }
   /**
+   * Record that the given source was just accessed for some unspecified purpose.
+   * <p>
+   * Note: This method must only be invoked while we are synchronized on {@link #cacheLock}.
+   * @param source the source that was accessed
+   */
+  void accessed(Source source) {
+    if (_recentlyUsed.contains(source)) {
+      _recentlyUsed.remove(source);
+      _recentlyUsed.add(source);
+      return;
+    }
+    if (_cacheRemovalCount == 0 && _recentlyUsed.length >= _MAX_CACHE_SIZE) {
+      Source removedSource = _recentlyUsed.removeAt(0);
+      SourceInfo sourceInfo = _sourceMap[removedSource];
+      if (sourceInfo is HtmlUnitInfo) {
+        ((sourceInfo as HtmlUnitInfo)).clearParsedUnit();
+        ((sourceInfo as HtmlUnitInfo)).clearResolvedUnit();
+      } else if (sourceInfo is CompilationUnitInfo) {
+        ((sourceInfo as CompilationUnitInfo)).clearParsedUnit();
+        ((sourceInfo as CompilationUnitInfo)).clearResolvedUnit();
+      }
+    }
+    _recentlyUsed.add(source);
+  }
+  /**
    * Add all of the sources contained in the given source container to the given list of sources.
    * <p>
    * Note: This method must only be invoked while we are synchronized on {@link #cacheLock}.
@@ -1173,6 +1272,34 @@
     }
   }
   /**
+   * Return {@code true} if the given array of sources contains the given source.
+   * @param sources the sources being searched
+   * @param targetSource the source being searched for
+   * @return {@code true} if the given source is in the array
+   */
+  bool contains(List<Source> sources, Source targetSource) {
+    for (Source source in sources) {
+      if (source == targetSource) {
+        return true;
+      }
+    }
+    return false;
+  }
+  /**
+   * Return {@code true} if the given array of sources contains any of the given target sources.
+   * @param sources the sources being searched
+   * @param targetSources the sources being searched for
+   * @return {@code true} if any of the given target sources are in the array
+   */
+  bool containsAny(List<Source> sources, List<Source> targetSources) {
+    for (Source targetSource in targetSources) {
+      if (contains(sources, targetSource)) {
+        return true;
+      }
+    }
+    return false;
+  }
+  /**
    * Create a source information object suitable for the given source. Return the source information
    * object that was created, or {@code null} if the source should not be tracked by this context.
    * @param source the source for which an information object is being created
@@ -1185,13 +1312,61 @@
       _sourceMap[source] = info;
       return info;
     } else if (AnalysisEngine.isDartFileName(name)) {
-      DartInfo info = DartInfo.instance;
+      DartInfo info = DartInfo.pendingInstance;
       _sourceMap[source] = info;
       return info;
     }
     return null;
   }
   /**
+   * Disable flushing information from the cache until {@link #enableCacheRemoval()} has been
+   * called.
+   */
+  void disableCacheRemoval() {
+    _cacheRemovalCount++;
+  }
+  /**
+   * Re-enable flushing information from the cache.
+   */
+  void enableCacheRemoval() {
+    if (_cacheRemovalCount > 0) {
+      _cacheRemovalCount--;
+    }
+    if (_cacheRemovalCount == 0) {
+      while (_recentlyUsed.length >= _MAX_CACHE_SIZE) {
+        Source removedSource = _recentlyUsed.removeAt(0);
+        SourceInfo sourceInfo = _sourceMap[removedSource];
+        if (sourceInfo is HtmlUnitInfo) {
+          ((sourceInfo as HtmlUnitInfo)).clearParsedUnit();
+          ((sourceInfo as HtmlUnitInfo)).clearResolvedUnit();
+        } else if (sourceInfo is CompilationUnitInfo) {
+          ((sourceInfo as CompilationUnitInfo)).clearParsedUnit();
+          ((sourceInfo as CompilationUnitInfo)).clearResolvedUnit();
+        }
+      }
+    }
+  }
+  /**
+   * Search the compilation units that are part of the given library and return the element
+   * representing the compilation unit with the given source. Return {@code null} if there is no
+   * such compilation unit.
+   * @param libraryElement the element representing the library being searched through
+   * @param unitSource the source for the compilation unit whose element is to be returned
+   * @return the element representing the compilation unit
+   */
+  CompilationUnitElement find(LibraryElement libraryElement, Source unitSource) {
+    CompilationUnitElement element = libraryElement.definingCompilationUnit;
+    if (element.source == unitSource) {
+      return element;
+    }
+    for (CompilationUnitElement partElement in libraryElement.parts) {
+      if (partElement.source == unitSource) {
+        return partElement;
+      }
+    }
+    return null;
+  }
+  /**
    * Return the compilation unit information associated with the given source, or {@code null} if
    * the source is not known to this context. This method should be used to access the compilation
    * unit information rather than accessing the compilation unit map directly because sources in the
@@ -1210,8 +1385,8 @@
       return sourceInfo as CompilationUnitInfo;
     } else if (sourceInfo is CompilationUnitInfo) {
       return sourceInfo as CompilationUnitInfo;
-    } else if (sourceInfo is DartInfo) {
-      sourceInfo = internalComputeKindOf(source, sourceInfo);
+    } else if (identical(sourceInfo, DartInfo.pendingInstance)) {
+      sourceInfo = internalComputeKindOf(source);
       if (sourceInfo is CompilationUnitInfo) {
         return sourceInfo as CompilationUnitInfo;
       }
@@ -1258,8 +1433,8 @@
       return sourceInfo as LibraryInfo;
     } else if (sourceInfo is LibraryInfo) {
       return sourceInfo as LibraryInfo;
-    } else if (sourceInfo is DartInfo) {
-      sourceInfo = internalComputeKindOf(source, sourceInfo);
+    } else if (identical(sourceInfo, DartInfo.pendingInstance)) {
+      sourceInfo = internalComputeKindOf(source);
       if (sourceInfo is LibraryInfo) {
         return sourceInfo as LibraryInfo;
       }
@@ -1274,8 +1449,11 @@
    */
   List<Source> getLibrarySources2(Source htmlSource, HtmlUnit htmlUnit) {
     List<Source> libraries = new List<Source>();
-    htmlUnit.accept(new SimpleXmlVisitor_3(htmlSource, libraries));
-    return libraries;
+    htmlUnit.accept(new RecursiveXmlVisitor_6(this, htmlSource, libraries));
+    if (libraries.isEmpty) {
+      return Source.EMPTY_ARRAY;
+    }
+    return new List.from(libraries);
   }
   /**
    * Return a change notice for the given source, creating one if one does not already exist.
@@ -1312,11 +1490,11 @@
    * @param kind the kind of sources to be returned
    * @return all of the sources known to this context that have the given kind
    */
-  List<Source> getSources(SourceKind kind3) {
+  List<Source> getSources(SourceKind kind2) {
     List<Source> sources = new List<Source>();
     {
       for (MapEntry<Source, SourceInfo> entry in getMapEntrySet(_sourceMap)) {
-        if (identical(entry.getValue().kind, kind3)) {
+        if (identical(entry.getValue().kind, kind2)) {
           sources.add(entry.getKey());
         }
       }
@@ -1324,20 +1502,33 @@
     return new List.from(sources);
   }
   /**
-   * Return {@code true} if the given compilation unit has a part-of directive.
+   * Return {@code true} if the given compilation unit has a part-of directive but no library
+   * directive.
    * @param unit the compilation unit being tested
    * @return {@code true} if the compilation unit has a part-of directive
    */
   bool hasPartOfDirective(CompilationUnit unit) {
+    bool hasPartOf = false;
     for (Directive directive in unit.directives) {
       if (directive is PartOfDirective) {
-        return true;
+        hasPartOf = true;
+      } else if (directive is LibraryDirective) {
+        return false;
       }
     }
-    return false;
+    return hasPartOf;
   }
-  SourceInfo internalComputeKindOf(Source source, SourceInfo info) {
+  /**
+   * Compute the kind of the given source. This method should only be invoked when the kind is not
+   * already known. In such a case the source is currently being represented by a {@link DartInfo}.
+   * After this method has run the source will be represented by a new information object that is
+   * appropriate to the computed kind of the source.
+   * @param source the source for which a kind is to be computed
+   * @return the new source info that was created to represent the source
+   */
+  SourceInfo internalComputeKindOf(Source source) {
     try {
+      accessed(source);
       RecordingErrorListener errorListener = new RecordingErrorListener();
       AnalysisContextImpl_ScanResult scanResult = internalScan(source, errorListener);
       Parser parser = new Parser(source, errorListener);
@@ -1358,12 +1549,29 @@
       _sourceMap[source] = sourceInfo;
       return sourceInfo;
     } on AnalysisException catch (exception) {
-      return info;
+      DartInfo sourceInfo = DartInfo.errorInstance;
+      _sourceMap[source] = sourceInfo;
+      return sourceInfo;
     }
   }
+  CompilationUnit internalParseCompilationUnit(CompilationUnitInfo compilationUnitInfo, Source source) {
+    accessed(source);
+    RecordingErrorListener errorListener = new RecordingErrorListener();
+    AnalysisContextImpl_ScanResult scanResult = internalScan(source, errorListener);
+    Parser parser = new Parser(source, errorListener);
+    CompilationUnit unit = parser.parseCompilationUnit(scanResult._token);
+    LineInfo lineInfo = new LineInfo(scanResult._lineStarts);
+    List<AnalysisError> errors = errorListener.getErrors2(source);
+    unit.parsingErrors = errors;
+    unit.lineInfo = lineInfo;
+    compilationUnitInfo.lineInfo = lineInfo;
+    compilationUnitInfo.parsedCompilationUnit = unit;
+    compilationUnitInfo.parseErrors = errors;
+    return unit;
+  }
   AnalysisContextImpl_ScanResult internalScan(Source source, AnalysisErrorListener errorListener) {
     AnalysisContextImpl_ScanResult result = new AnalysisContextImpl_ScanResult();
-    Source_ContentReceiver receiver = new Source_ContentReceiver_4(source, errorListener, result);
+    Source_ContentReceiver receiver = new Source_ContentReceiver_7(source, errorListener, result);
     try {
       source.getContents(receiver);
     } catch (exception) {
@@ -1372,6 +1580,27 @@
     return result;
   }
   /**
+   * In response to a change to at least one of the compilation units in the given library,
+   * invalidate any results that are dependent on the result of resolving that library.
+   * @param librarySource the source of the library being invalidated
+   * @param libraryInfo the information for the library being invalidated
+   */
+  void invalidateLibraryResolution(Source librarySource, LibraryInfo libraryInfo) {
+    if (libraryInfo != null) {
+      libraryInfo.invalidateElement();
+      libraryInfo.invalidateLaunchable();
+      libraryInfo.invalidatePublicNamespace();
+      libraryInfo.invalidateResolutionErrors();
+      libraryInfo.invalidateResolvedUnit();
+      for (Source unitSource in libraryInfo.unitSources) {
+        CompilationUnitInfo partInfo = getCompilationUnitInfo(unitSource);
+        partInfo.invalidateResolutionErrors();
+        partInfo.invalidateResolvedUnit();
+      }
+      libraryInfo.invalidateUnitSources();
+    }
+  }
+  /**
    * Return {@code true} if this library is, or depends on, dart:html.
    * @param library the library being tested
    * @param visitedLibraries a collection of the libraries that have been visited, used to prevent
@@ -1407,8 +1636,8 @@
   bool performSingleAnalysisTask() {
     for (MapEntry<Source, SourceInfo> entry in getMapEntrySet(_sourceMap)) {
       SourceInfo sourceInfo = entry.getValue();
-      if (identical(sourceInfo, DartInfo.instance) || sourceInfo.kind == null) {
-        internalComputeKindOf(entry.getKey(), sourceInfo);
+      if (identical(sourceInfo, DartInfo.pendingInstance)) {
+        internalComputeKindOf(entry.getKey());
         return true;
       }
     }
@@ -1447,7 +1676,18 @@
             computeLibraryElement(entry.getKey());
           } on AnalysisException catch (exception) {
             libraryInfo.element = null;
-            AnalysisEngine.instance.logger.logError2("Could not compute the library element for ${entry.getKey().fullName}", exception);
+            AnalysisEngine.instance.logger.logError2("Could not resolve ${entry.getKey().fullName}", exception);
+          }
+          return true;
+        }
+      } else if (sourceInfo is HtmlUnitInfo) {
+        HtmlUnitInfo unitInfo = sourceInfo as HtmlUnitInfo;
+        if (unitInfo.hasInvalidResolvedUnit()) {
+          try {
+            resolveHtmlUnit(entry.getKey());
+          } on AnalysisException catch (exception) {
+            unitInfo.resolvedUnit = null;
+            AnalysisEngine.instance.logger.logError2("Could not resolve ${entry.getKey().fullName}", exception);
           }
           return true;
         }
@@ -1482,21 +1722,20 @@
     SourceInfo sourceInfo = _sourceMap[source];
     if (sourceInfo is HtmlUnitInfo) {
       HtmlUnitInfo htmlUnitInfo = sourceInfo as HtmlUnitInfo;
+      htmlUnitInfo.invalidateElement();
       htmlUnitInfo.invalidateLineInfo();
       htmlUnitInfo.invalidateParsedUnit();
       htmlUnitInfo.invalidateResolvedUnit();
+    } else if (sourceInfo is LibraryInfo) {
+      LibraryInfo libraryInfo = sourceInfo as LibraryInfo;
+      invalidateLibraryResolution(source, libraryInfo);
+      _sourceMap[source] = DartInfo.pendingInstance;
     } else if (sourceInfo is CompilationUnitInfo) {
-      CompilationUnitInfo compilationUnitInfo = sourceInfo as CompilationUnitInfo;
-      for (Source librarySource in compilationUnitInfo.librarySources) {
+      for (Source librarySource in getLibrariesContaining(source)) {
         LibraryInfo libraryInfo = getLibraryInfo(librarySource);
-        if (libraryInfo != null) {
-          libraryInfo.invalidateElement();
-          libraryInfo.invalidatePublicNamespace();
-          libraryInfo.invalidateLaunchable();
-          libraryInfo.invalidateClientServer();
-        }
+        invalidateLibraryResolution(librarySource, libraryInfo);
       }
-      _sourceMap[source] = DartInfo.instance;
+      _sourceMap[source] = DartInfo.pendingInstance;
     }
   }
   /**
@@ -1506,14 +1745,9 @@
   void sourceRemoved(Source source) {
     CompilationUnitInfo compilationUnitInfo = getCompilationUnitInfo(source);
     if (compilationUnitInfo != null) {
-      for (Source librarySource in compilationUnitInfo.librarySources) {
+      for (Source librarySource in getLibrariesContaining(source)) {
         LibraryInfo libraryInfo = getLibraryInfo(librarySource);
-        if (libraryInfo != null) {
-          libraryInfo.invalidateElement();
-          libraryInfo.invalidatePublicNamespace();
-          libraryInfo.invalidateLaunchable();
-          libraryInfo.invalidateClientServer();
-        }
+        invalidateLibraryResolution(librarySource, libraryInfo);
       }
     }
     _sourceMap.remove(source);
@@ -1524,6 +1758,10 @@
  */
 class AnalysisContextImpl_ScanResult {
   /**
+   * The time at which the contents of the source were last set.
+   */
+  int _modificationTime = 0;
+  /**
    * The first token in the token stream.
    */
   Token _token;
@@ -1537,44 +1775,89 @@
   AnalysisContextImpl_ScanResult() : super() {
   }
 }
-class SimpleXmlVisitor_3 extends SimpleXmlVisitor<Object> {
+class RecursiveXmlVisitor_6 extends RecursiveXmlVisitor<Object> {
+  final AnalysisContextImpl AnalysisContextImpl_this;
   Source htmlSource;
   List<Source> libraries;
-  SimpleXmlVisitor_3(this.htmlSource, this.libraries) : super();
+  RecursiveXmlVisitor_6(this.AnalysisContextImpl_this, this.htmlSource, this.libraries) : super();
   Object visitXmlTagNode(XmlTagNode node) {
     if (javaStringEqualsIgnoreCase(node.tag.lexeme, AnalysisContextImpl._TAG_SCRIPT)) {
       for (XmlAttributeNode attribute in node.attributes) {
         if (javaStringEqualsIgnoreCase(attribute.name.lexeme, AnalysisContextImpl._ATTRIBUTE_SRC)) {
-          Source librarySource = htmlSource.resolve(attribute.value.lexeme);
-          if (librarySource.exists()) {
-            libraries.add(librarySource);
+          try {
+            Uri uri = new Uri.fromComponents(path: attribute.text);
+            String fileName = uri.path;
+            if (AnalysisEngine.isDartFileName(fileName)) {
+              Source librarySource = AnalysisContextImpl_this._sourceFactory.resolveUri(htmlSource, fileName);
+              if (librarySource.exists()) {
+                libraries.add(librarySource);
+              }
+            }
+          } catch (exception) {
+            AnalysisEngine.instance.logger.logError2("Invalid URL ('${attribute.text}') in script tag in '${htmlSource.fullName}'", exception);
           }
         }
       }
     }
-    return null;
+    return super.visitXmlTagNode(node);
   }
 }
-class Source_ContentReceiver_4 implements Source_ContentReceiver {
+class Source_ContentReceiver_7 implements Source_ContentReceiver {
   Source source;
   AnalysisErrorListener errorListener;
   AnalysisContextImpl_ScanResult result;
-  Source_ContentReceiver_4(this.source, this.errorListener, this.result);
-  accept(CharBuffer contents) {
+  Source_ContentReceiver_7(this.source, this.errorListener, this.result);
+  void accept(CharBuffer contents, int modificationTime2) {
     CharBufferScanner scanner = new CharBufferScanner(source, contents, errorListener);
+    result._modificationTime = modificationTime2;
     result._token = scanner.tokenize();
     result._lineStarts = scanner.lineStarts;
   }
-  void accept2(String contents) {
+  void accept2(String contents, int modificationTime2) {
     StringScanner scanner = new StringScanner(source, contents, errorListener);
+    result._modificationTime = modificationTime2;
     result._token = scanner.tokenize();
     result._lineStarts = scanner.lineStarts;
   }
 }
 /**
+ * Instances of the class {@code AnalysisErrorInfoImpl} represent the analysis errors and line info
+ * associated with a source.
+ */
+class AnalysisErrorInfoImpl implements AnalysisErrorInfo {
+  /**
+   * The analysis errors associated with a source, or {@code null} if there are no errors.
+   */
+  List<AnalysisError> _errors;
+  /**
+   * The line information associated with the errors, or {@code null} if there are no errors.
+   */
+  LineInfo _lineInfo;
+  /**
+   * Initialize an newly created error info with the errors and line information
+   * @param errors the errors as a result of analysis
+   * @param lineinfo the line info for the errors
+   */
+  AnalysisErrorInfoImpl(List<AnalysisError> errors, LineInfo lineInfo) {
+    this._errors = errors;
+    this._lineInfo = lineInfo;
+  }
+  /**
+   * Return the errors of analysis, or {@code null} if there were no errors.
+   * @return the errors as a result of the analysis
+   */
+  List<AnalysisError> get errors => _errors;
+  /**
+   * Return the line information associated with the errors, or {@code null} if there were no
+   * errors.
+   * @return the line information associated with the errors
+   */
+  LineInfo get lineInfo => _lineInfo;
+}
+/**
  * The enumeration {@code CacheState} defines the possible states of cached data.
  */
-class CacheState {
+class CacheState implements Comparable<CacheState> {
   /**
    * A state representing the fact that the data was up-to-date but flushed from the cache in order
    * to control memory usage.
@@ -1595,6 +1878,7 @@
   int get ordinal => __ordinal;
   CacheState(this.__name, this.__ordinal) {
   }
+  int compareTo(CacheState other) => __ordinal - other.__ordinal;
   String toString() => __name;
 }
 /**
@@ -1659,8 +1943,8 @@
    * Set the fully resolved AST that changed as a result of the analysis to the given AST.
    * @param compilationUnit the fully resolved AST that changed as a result of the analysis
    */
-  void set compilationUnit(CompilationUnit compilationUnit9) {
-    this._compilationUnit = compilationUnit9;
+  void set compilationUnit(CompilationUnit compilationUnit2) {
+    this._compilationUnit = compilationUnit2;
   }
   /**
    * Set the errors that changed as a result of the analysis to the given errors and set the line
@@ -1668,9 +1952,9 @@
    * @param errors the errors that changed as a result of the analysis
    * @param lineInfo the line information associated with the source
    */
-  void setErrors(List<AnalysisError> errors2, LineInfo lineInfo3) {
+  void setErrors(List<AnalysisError> errors2, LineInfo lineInfo2) {
     this._errors = errors2;
-    this._lineInfo = lineInfo3;
+    this._lineInfo = lineInfo2;
   }
 }
 /**
@@ -1716,48 +2000,37 @@
    */
   List<AnalysisError> _resolutionErrors;
   /**
-   * The sources for the defining compilation units of the libraries containing the source, or{@code null} if the libraries containing the source are not yet known.
-   */
-  List<Source> _librarySources = null;
-  /**
    * Initialize a newly created information holder to be empty.
    */
   CompilationUnitInfo() : super() {
   }
   /**
-   * Add the given source to the list of sources for the defining compilation units for the
-   * libraries containing this source.
-   * @param source the source to be added to the list
-   */
-  void addLibrarySource(Source source) {
-    if (_librarySources == null) {
-      _librarySources = new List<Source>();
-    }
-    _librarySources.add(source);
-  }
-  /**
    * Remove the parsed compilation unit from the cache.
    */
   void clearParsedUnit() {
     _parsedUnit = null;
+    _parsedUnitState = CacheState.FLUSHED;
   }
   /**
    * Remove the parse errors from the cache.
    */
   void clearParseErrors() {
     _parseErrors = null;
+    _parseErrorsState = CacheState.FLUSHED;
   }
   /**
    * Remove the resolution errors from the cache.
    */
   void clearResolutionErrors() {
     _resolutionErrors = null;
+    _resolutionErrorsState = CacheState.FLUSHED;
   }
   /**
    * Remove the resolved compilation unit from the cache.
    */
   void clearResolvedUnit() {
     _resolvedUnit = null;
+    _resolvedUnitState = CacheState.FLUSHED;
   }
   CompilationUnitInfo copy() {
     CompilationUnitInfo copy = new CompilationUnitInfo();
@@ -1786,16 +2059,6 @@
   }
   SourceKind get kind => SourceKind.PART;
   /**
-   * Return the sources for the defining compilation units for the libraries containing this source.
-   * @return the sources for the defining compilation units for the libraries containing this source
-   */
-  List<Source> get librarySources {
-    if (_librarySources == null) {
-      return Source.EMPTY_ARRAY;
-    }
-    return new List.from(_librarySources);
-  }
-  /**
    * Return the parsed compilation unit, or {@code null} if the parsed compilation unit is not
    * currently cached.
    * @return the parsed compilation unit
@@ -1868,19 +2131,6 @@
     _resolvedUnit = null;
   }
   /**
-   * Remove the given source from the list of sources for the defining compilation units for the
-   * libraries containing this source.
-   * @param source the source to be removed to the list
-   */
-  void removeLibrarySource(Source source) {
-    if (_librarySources != null) {
-      _librarySources.remove(source);
-      if (_librarySources.isEmpty) {
-        _librarySources = null;
-      }
-    }
-  }
-  /**
    * Set the parsed compilation unit to the given compilation unit.
    * <p>
    * <b>Note:</b> Do not use this method to clear or invalidate the parsed compilation unit. Use
@@ -1927,20 +2177,34 @@
   }
 }
 /**
- * The unique instance of the class {@code DartInfo} acts as a placeholder for Dart compilation
- * units that have not yet had their kind computed.
+ * Instances of the class {@code DartInfo} acts as a placeholder for Dart compilation units that
+ * have not yet had their kind computed.
  * @coverage dart.engine
  */
 class DartInfo extends SourceInfo {
   /**
-   * The unique instance of this class.
+   * The instance of this class used to represent a compilation unit for which an attempt was made
+   * to compute the kind but the kind could not be computed.
    */
-  static DartInfo _UniqueInstance = new DartInfo();
+  static DartInfo _ErrorInstance = new DartInfo();
   /**
-   * Return the unique instance of this class.
-   * @return the unique instance of this class
+   * The instance of this class used to represent a compilation unit for which no attempt has been
+   * made to compute the kind.
    */
-  static DartInfo get instance => _UniqueInstance;
+  static DartInfo _PendingInstance = new DartInfo();
+  /**
+   * Return an instance of this class representing a compilation unit for which an attempt was made
+   * to compute the kind but the kind could not be computed.
+   * @return an instance of this class used to indicate that the computation of the kind resulted in
+   * an error and there is no point trying again
+   */
+  static DartInfo get errorInstance => _ErrorInstance;
+  /**
+   * Return an instance of this class representing a compilation unit for which no attempt has been
+   * made to compute the kind.
+   * @return an instance of this class used to indicate that the computation of the kind is pending
+   */
+  static DartInfo get pendingInstance => _PendingInstance;
   /**
    * Prevent the creation of instances of this class.
    */
@@ -1950,6 +2214,243 @@
   SourceKind get kind => SourceKind.UNKNOWN;
 }
 /**
+ * Instances of the class {@code DelegatingAnalysisContextImpl} extend {@link AnalysisContextImplanalysis context} to delegate sources to the appropriate analysis context. For instance, if the
+ * source is in a system library then the analysis context from the {@link DartSdk} is used.
+ * @coverage dart.engine
+ */
+class DelegatingAnalysisContextImpl extends AnalysisContextImpl {
+  /**
+   * This references the {@link InternalAnalysisContext} held onto by the {@link DartSdk} which is
+   * used (instead of this {@link AnalysisContext}) for SDK sources. This field is set when
+   * #setSourceFactory(SourceFactory) is called, and references the analysis context in the{@link DartUriResolver} in the {@link SourceFactory}, this analysis context assumes that there
+   * will be such a resolver.
+   */
+  InternalAnalysisContext _sdkAnalysisContext;
+  /**
+   * Initialize a newly created delegating analysis context.
+   */
+  DelegatingAnalysisContextImpl() : super() {
+  }
+  void addSourceInfo(Source source, SourceInfo info) {
+    if (source.isInSystemLibrary()) {
+      _sdkAnalysisContext.addSourceInfo(source, info);
+    } else {
+      super.addSourceInfo(source, info);
+    }
+  }
+  List<AnalysisError> computeErrors(Source source) {
+    if (source.isInSystemLibrary()) {
+      return _sdkAnalysisContext.computeErrors(source);
+    } else {
+      return super.computeErrors(source);
+    }
+  }
+  HtmlElement computeHtmlElement(Source source) {
+    if (source.isInSystemLibrary()) {
+      return _sdkAnalysisContext.computeHtmlElement(source);
+    } else {
+      return super.computeHtmlElement(source);
+    }
+  }
+  SourceKind computeKindOf(Source source) {
+    if (source.isInSystemLibrary()) {
+      return _sdkAnalysisContext.computeKindOf(source);
+    } else {
+      return super.computeKindOf(source);
+    }
+  }
+  LibraryElement computeLibraryElement(Source source) {
+    if (source.isInSystemLibrary()) {
+      return _sdkAnalysisContext.computeLibraryElement(source);
+    } else {
+      return super.computeLibraryElement(source);
+    }
+  }
+  LineInfo computeLineInfo(Source source) {
+    if (source.isInSystemLibrary()) {
+      return _sdkAnalysisContext.computeLineInfo(source);
+    } else {
+      return super.computeLineInfo(source);
+    }
+  }
+  CompilationUnit computeResolvableCompilationUnit(Source source) {
+    if (source.isInSystemLibrary()) {
+      return _sdkAnalysisContext.computeResolvableCompilationUnit(source);
+    } else {
+      return super.computeResolvableCompilationUnit(source);
+    }
+  }
+  AnalysisErrorInfo getErrors(Source source) {
+    if (source.isInSystemLibrary()) {
+      return _sdkAnalysisContext.getErrors(source);
+    } else {
+      return super.getErrors(source);
+    }
+  }
+  HtmlElement getHtmlElement(Source source) {
+    if (source.isInSystemLibrary()) {
+      return _sdkAnalysisContext.getHtmlElement(source);
+    } else {
+      return super.getHtmlElement(source);
+    }
+  }
+  List<Source> getHtmlFilesReferencing(Source source) {
+    if (source.isInSystemLibrary()) {
+      return _sdkAnalysisContext.getHtmlFilesReferencing(source);
+    } else {
+      return super.getHtmlFilesReferencing(source);
+    }
+  }
+  SourceKind getKindOf(Source source) {
+    if (source.isInSystemLibrary()) {
+      return _sdkAnalysisContext.getKindOf(source);
+    } else {
+      return super.getKindOf(source);
+    }
+  }
+  List<Source> getLibrariesContaining(Source source) {
+    if (source.isInSystemLibrary()) {
+      return _sdkAnalysisContext.getLibrariesContaining(source);
+    } else {
+      return super.getLibrariesContaining(source);
+    }
+  }
+  LibraryElement getLibraryElement(Source source) {
+    if (source.isInSystemLibrary()) {
+      return _sdkAnalysisContext.getLibraryElement(source);
+    } else {
+      return super.getLibraryElement(source);
+    }
+  }
+  List<Source> get librarySources => ArrayUtils.addAll(super.librarySources, _sdkAnalysisContext.librarySources);
+  LineInfo getLineInfo(Source source) {
+    if (source.isInSystemLibrary()) {
+      return _sdkAnalysisContext.getLineInfo(source);
+    } else {
+      return super.getLineInfo(source);
+    }
+  }
+  Namespace getPublicNamespace(LibraryElement library) {
+    Source source2 = library.source;
+    if (source2.isInSystemLibrary()) {
+      return _sdkAnalysisContext.getPublicNamespace(library);
+    } else {
+      return super.getPublicNamespace(library);
+    }
+  }
+  Namespace getPublicNamespace2(Source source) {
+    if (source.isInSystemLibrary()) {
+      return _sdkAnalysisContext.getPublicNamespace2(source);
+    } else {
+      return super.getPublicNamespace2(source);
+    }
+  }
+  CompilationUnit getResolvedCompilationUnit(Source unitSource, LibraryElement library) {
+    if (unitSource.isInSystemLibrary()) {
+      return _sdkAnalysisContext.getResolvedCompilationUnit(unitSource, library);
+    } else {
+      return super.getResolvedCompilationUnit(unitSource, library);
+    }
+  }
+  CompilationUnit getResolvedCompilationUnit2(Source unitSource, Source librarySource) {
+    if (unitSource.isInSystemLibrary()) {
+      return _sdkAnalysisContext.getResolvedCompilationUnit2(unitSource, librarySource);
+    } else {
+      return super.getResolvedCompilationUnit2(unitSource, librarySource);
+    }
+  }
+  bool isClientLibrary(Source librarySource) {
+    if (librarySource.isInSystemLibrary()) {
+      return _sdkAnalysisContext.isClientLibrary(librarySource);
+    } else {
+      return super.isClientLibrary(librarySource);
+    }
+  }
+  bool isServerLibrary(Source librarySource) {
+    if (librarySource.isInSystemLibrary()) {
+      return _sdkAnalysisContext.isServerLibrary(librarySource);
+    } else {
+      return super.isServerLibrary(librarySource);
+    }
+  }
+  CompilationUnit parseCompilationUnit(Source source) {
+    if (source.isInSystemLibrary()) {
+      return _sdkAnalysisContext.parseCompilationUnit(source);
+    } else {
+      return super.parseCompilationUnit(source);
+    }
+  }
+  HtmlUnit parseHtmlUnit(Source source) {
+    if (source.isInSystemLibrary()) {
+      return _sdkAnalysisContext.parseHtmlUnit(source);
+    } else {
+      return super.parseHtmlUnit(source);
+    }
+  }
+  void recordLibraryElements(Map<Source, LibraryElement> elementMap) {
+    if (elementMap.isEmpty) {
+      return;
+    }
+    Source source = new JavaIterator(elementMap.keys.toSet()).next();
+    if (source.isInSystemLibrary()) {
+      _sdkAnalysisContext.recordLibraryElements(elementMap);
+    } else {
+      super.recordLibraryElements(elementMap);
+    }
+  }
+  void recordResolutionErrors(Source source, List<AnalysisError> errors, LineInfo lineInfo) {
+    if (source.isInSystemLibrary()) {
+      _sdkAnalysisContext.recordResolutionErrors(source, errors, lineInfo);
+    } else {
+      super.recordResolutionErrors(source, errors, lineInfo);
+    }
+  }
+  void recordResolvedCompilationUnit(Source source, CompilationUnit unit) {
+    if (source.isInSystemLibrary()) {
+      _sdkAnalysisContext.recordResolvedCompilationUnit(source, unit);
+    } else {
+      super.recordResolvedCompilationUnit(source, unit);
+    }
+  }
+  CompilationUnit resolveCompilationUnit(Source source, LibraryElement library) {
+    if (source.isInSystemLibrary()) {
+      return _sdkAnalysisContext.resolveCompilationUnit(source, library);
+    } else {
+      return super.resolveCompilationUnit(source, library);
+    }
+  }
+  CompilationUnit resolveCompilationUnit2(Source unitSource, Source librarySource) {
+    if (unitSource.isInSystemLibrary()) {
+      return _sdkAnalysisContext.resolveCompilationUnit2(unitSource, librarySource);
+    } else {
+      return super.resolveCompilationUnit2(unitSource, librarySource);
+    }
+  }
+  HtmlUnit resolveHtmlUnit(Source unitSource) {
+    if (unitSource.isInSystemLibrary()) {
+      return _sdkAnalysisContext.resolveHtmlUnit(unitSource);
+    } else {
+      return super.resolveHtmlUnit(unitSource);
+    }
+  }
+  void setContents(Source source, String contents) {
+    if (source.isInSystemLibrary()) {
+      _sdkAnalysisContext.setContents(source, contents);
+    } else {
+      super.setContents(source, contents);
+    }
+  }
+  void set sourceFactory(SourceFactory factory) {
+    super.sourceFactory = factory;
+    DartSdk sdk = factory.dartSdk;
+    if (sdk != null) {
+      _sdkAnalysisContext = sdk.context as InternalAnalysisContext;
+    } else {
+      throw new IllegalStateException("SourceFactorys provided to DelegatingAnalysisContextImpls must have a DartSdk associated with the provided SourceFactory.");
+    }
+  }
+}
+/**
  * Instances of the class {@code HtmlUnitInfo} maintain the information cached by an analysis
  * context about an individual HTML file.
  * @coverage dart.engine
@@ -1980,6 +2481,14 @@
    */
   HtmlElement _element;
   /**
+   * The state of the cached library sources.
+   */
+  CacheState _librarySourcesState = CacheState.INVALID;
+  /**
+   * The sources of libraries referenced by this HTML file.
+   */
+  List<Source> _librarySources = Source.EMPTY_ARRAY;
+  /**
    * Initialize a newly created information holder to be empty.
    */
   HtmlUnitInfo() : super() {
@@ -1989,12 +2498,14 @@
    */
   void clearParsedUnit() {
     _parsedUnit = null;
+    _parsedUnitState = CacheState.FLUSHED;
   }
   /**
    * Remove the resolved HTML unit from the cache.
    */
   void clearResolvedUnit() {
     _resolvedUnit = null;
+    _resolvedUnitState = CacheState.FLUSHED;
   }
   HtmlUnitInfo copy() {
     HtmlUnitInfo copy = new HtmlUnitInfo();
@@ -2009,6 +2520,11 @@
   HtmlElement get element => _element;
   SourceKind get kind => SourceKind.HTML;
   /**
+   * Return the sources of libraries referenced by this HTML file.
+   * @return the sources of libraries referenced by this HTML file
+   */
+  List<Source> get librarySources => _librarySources;
+  /**
    * Return the parsed HTML unit, or {@code null} if the parsed HTML unit is not currently cached.
    * @return the parsed HTML unit
    */
@@ -2042,6 +2558,13 @@
     _element = null;
   }
   /**
+   * Mark the library sources as needing to be recomputed.
+   */
+  void invalidateLibrarySources() {
+    _librarySourcesState = CacheState.INVALID;
+    _librarySources = Source.EMPTY_ARRAY;
+  }
+  /**
    * Mark the parsed HTML unit as needing to be recomputed.
    */
   void invalidateParsedUnit() {
@@ -2052,6 +2575,7 @@
    * Mark the resolved HTML unit as needing to be recomputed.
    */
   void invalidateResolvedUnit() {
+    invalidateElement();
     _resolvedUnitState = CacheState.INVALID;
     _resolvedUnit = null;
   }
@@ -2061,11 +2585,19 @@
    * <b>Note:</b> Do not use this method to clear or invalidate the element. Use either{@link #clearElement()} or {@link #invalidateElement()}.
    * @param element the element representing the HTML file
    */
-  void set element(HtmlElement element19) {
-    this._element = element19;
+  void set element(HtmlElement element2) {
+    this._element = element2;
     _elementState = CacheState.VALID;
   }
   /**
+   * Set the sources of libraries referenced by this HTML file to the given sources.
+   * @param sources the sources of libraries referenced by this HTML file
+   */
+  void set librarySources(List<Source> sources) {
+    _librarySources = sources;
+    _librarySourcesState = CacheState.VALID;
+  }
+  /**
    * Set the parsed HTML unit to the given HTML unit.
    * <p>
    * <b>Note:</b> Do not use this method to clear or invalidate the HTML unit. Use either{@link #clearParsedUnit()} or {@link #invalidateParsedUnit()}.
@@ -2090,6 +2622,504 @@
   }
 }
 /**
+ * Instances of the class {@code InstrumentedAnalysisContextImpl} implement an{@link AnalysisContext analysis context} by recording instrumentation data and delegating to
+ * another analysis context to do the non-instrumentation work.
+ * @coverage dart.engine
+ */
+class InstrumentedAnalysisContextImpl implements InternalAnalysisContext {
+  /**
+   * Record an exception that was thrown during analysis.
+   * @param instrumentation the instrumentation builder being used to record the exception
+   * @param exception the exception being reported
+   */
+  static void recordAnalysisException(InstrumentationBuilder instrumentation, AnalysisException exception) {
+    instrumentation.record(exception);
+  }
+  /**
+   * The unique identifier used to identify this analysis context in the instrumentation data.
+   */
+  String _contextId = UUID.randomUUID().toString();
+  /**
+   * The analysis context to which all of the non-instrumentation work is delegated.
+   */
+  InternalAnalysisContext _basis;
+  /**
+   * Create a new {@link InstrumentedAnalysisContextImpl} which wraps a new{@link AnalysisContextImpl} as the basis context.
+   */
+  InstrumentedAnalysisContextImpl() {
+    _jtd_constructor_175_impl();
+  }
+  _jtd_constructor_175_impl() {
+    _jtd_constructor_176_impl(new AnalysisContextImpl());
+  }
+  /**
+   * Create a new {@link InstrumentedAnalysisContextImpl} with a specified basis context, aka the
+   * context to wrap and instrument.
+   * @param context some {@link InstrumentedAnalysisContext} to wrap and instrument
+   */
+  InstrumentedAnalysisContextImpl.con1(InternalAnalysisContext context) {
+    _jtd_constructor_176_impl(context);
+  }
+  _jtd_constructor_176_impl(InternalAnalysisContext context) {
+    _basis = context;
+  }
+  void addSourceInfo(Source source, SourceInfo info) {
+    _basis.addSourceInfo(source, info);
+  }
+  void applyChanges(ChangeSet changeSet) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-applyChanges");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      _basis.applyChanges(changeSet);
+    } finally {
+      instrumentation.log();
+    }
+  }
+  List<AnalysisError> computeErrors(Source source) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-computeErrors");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      List<AnalysisError> errors = _basis.computeErrors(source);
+      instrumentation.metric2("Errors-count", errors.length);
+      return errors;
+    } finally {
+      instrumentation.log();
+    }
+  }
+  HtmlElement computeHtmlElement(Source source) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-computeHtmlElement");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.computeHtmlElement(source);
+    } on AnalysisException catch (e) {
+      recordAnalysisException(instrumentation, e);
+      throw e;
+    } finally {
+      instrumentation.log();
+    }
+  }
+  SourceKind computeKindOf(Source source) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-computeKindOf");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.computeKindOf(source);
+    } finally {
+      instrumentation.log();
+    }
+  }
+  LibraryElement computeLibraryElement(Source source) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-computeLibraryElement");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.computeLibraryElement(source);
+    } on AnalysisException catch (e) {
+      recordAnalysisException(instrumentation, e);
+      throw e;
+    } finally {
+      instrumentation.log();
+    }
+  }
+  LineInfo computeLineInfo(Source source) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-computeLineInfo");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.computeLineInfo(source);
+    } on AnalysisException catch (e) {
+      recordAnalysisException(instrumentation, e);
+      throw e;
+    } finally {
+      instrumentation.log();
+    }
+  }
+  CompilationUnit computeResolvableCompilationUnit(Source source) => _basis.computeResolvableCompilationUnit(source);
+  AnalysisContext extractContext(SourceContainer container) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-extractContext");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      InstrumentedAnalysisContextImpl newContext = new InstrumentedAnalysisContextImpl();
+      _basis.extractContextInto(container, newContext._basis);
+      return newContext;
+    } finally {
+      instrumentation.log();
+    }
+  }
+  InternalAnalysisContext extractContextInto(SourceContainer container, InternalAnalysisContext newContext) => _basis.extractContextInto(container, newContext);
+  /**
+   * @return the underlying {@link AnalysisContext}.
+   */
+  AnalysisContext get basis => _basis;
+  Element getElement(ElementLocation location) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getElement");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.getElement(location);
+    } finally {
+      instrumentation.log();
+    }
+  }
+  AnalysisErrorInfo getErrors(Source source) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getErrors");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      AnalysisErrorInfo ret = _basis.getErrors(source);
+      if (ret != null) {
+        instrumentation.metric2("Errors-count", ret.errors.length);
+      }
+      return ret;
+    } finally {
+      instrumentation.log();
+    }
+  }
+  HtmlElement getHtmlElement(Source source) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getHtmlElement");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.getHtmlElement(source);
+    } finally {
+      instrumentation.log();
+    }
+  }
+  List<Source> getHtmlFilesReferencing(Source source) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getHtmlFilesReferencing");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      List<Source> ret = _basis.getHtmlFilesReferencing(source);
+      if (ret != null) {
+        instrumentation.metric2("Source-count", ret.length);
+      }
+      return ret;
+    } finally {
+      instrumentation.log();
+    }
+  }
+  List<Source> get htmlSources {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getHtmlSources");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      List<Source> ret = _basis.htmlSources;
+      if (ret != null) {
+        instrumentation.metric2("Source-count", ret.length);
+      }
+      return ret;
+    } finally {
+      instrumentation.log();
+    }
+  }
+  SourceKind getKindOf(Source source) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getKindOf");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.getKindOf(source);
+    } finally {
+      instrumentation.log();
+    }
+  }
+  List<Source> get launchableClientLibrarySources {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getLaunchableClientLibrarySources");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      List<Source> ret = _basis.launchableClientLibrarySources;
+      if (ret != null) {
+        instrumentation.metric2("Source-count", ret.length);
+      }
+      return ret;
+    } finally {
+      instrumentation.log();
+    }
+  }
+  List<Source> get launchableServerLibrarySources {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getLaunchableServerLibrarySources");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      List<Source> ret = _basis.launchableServerLibrarySources;
+      if (ret != null) {
+        instrumentation.metric2("Source-count", ret.length);
+      }
+      return ret;
+    } finally {
+      instrumentation.log();
+    }
+  }
+  List<Source> getLibrariesContaining(Source source) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getLibrariesContaining");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      List<Source> ret = _basis.getLibrariesContaining(source);
+      if (ret != null) {
+        instrumentation.metric2("Source-count", ret.length);
+      }
+      return ret;
+    } finally {
+      instrumentation.log();
+    }
+  }
+  LibraryElement getLibraryElement(Source source) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getLibraryElement");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.getLibraryElement(source);
+    } finally {
+      instrumentation.log();
+    }
+  }
+  List<Source> get librarySources {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getLibrarySources");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      List<Source> ret = _basis.librarySources;
+      if (ret != null) {
+        instrumentation.metric2("Source-count", ret.length);
+      }
+      return ret;
+    } finally {
+      instrumentation.log();
+    }
+  }
+  LineInfo getLineInfo(Source source) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getLineInfo");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.getLineInfo(source);
+    } finally {
+      instrumentation.log();
+    }
+  }
+  Namespace getPublicNamespace(LibraryElement library) => _basis.getPublicNamespace(library);
+  Namespace getPublicNamespace2(Source source) => _basis.getPublicNamespace2(source);
+  CompilationUnit getResolvedCompilationUnit(Source unitSource, LibraryElement library) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getResolvedCompilationUnit");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.getResolvedCompilationUnit(unitSource, library);
+    } finally {
+      instrumentation.log();
+    }
+  }
+  CompilationUnit getResolvedCompilationUnit2(Source unitSource, Source librarySource) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getResolvedCompilationUnit");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.getResolvedCompilationUnit2(unitSource, librarySource);
+    } finally {
+      instrumentation.log();
+    }
+  }
+  SourceFactory get sourceFactory {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getSourceFactory");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.sourceFactory;
+    } finally {
+      instrumentation.log();
+    }
+  }
+  bool isClientLibrary(Source librarySource) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-isClientLibrary");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.isClientLibrary(librarySource);
+    } finally {
+      instrumentation.log();
+    }
+  }
+  bool isServerLibrary(Source librarySource) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-isServerLibrary");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.isServerLibrary(librarySource);
+    } finally {
+      instrumentation.log();
+    }
+  }
+  void mergeContext(AnalysisContext context) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-mergeContext");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      if (context is InstrumentedAnalysisContextImpl) {
+        context = ((context as InstrumentedAnalysisContextImpl))._basis;
+      }
+      _basis.mergeContext(context);
+    } finally {
+      instrumentation.log();
+    }
+  }
+  CompilationUnit parseCompilationUnit(Source source) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-parseCompilationUnit");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.parseCompilationUnit(source);
+    } on AnalysisException catch (e) {
+      recordAnalysisException(instrumentation, e);
+      throw e;
+    } finally {
+      instrumentation.log();
+    }
+  }
+  HtmlUnit parseHtmlUnit(Source source) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-parseHtmlUnit");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.parseHtmlUnit(source);
+    } on AnalysisException catch (e) {
+      recordAnalysisException(instrumentation, e);
+      throw e;
+    } finally {
+      instrumentation.log();
+    }
+  }
+  List<ChangeNotice> performAnalysisTask() {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-performAnalysisTask");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      List<ChangeNotice> ret = _basis.performAnalysisTask();
+      if (ret != null) {
+        instrumentation.metric2("ChangeNotice-count", ret.length);
+      }
+      return ret;
+    } finally {
+      instrumentation.log();
+    }
+  }
+  void recordLibraryElements(Map<Source, LibraryElement> elementMap) {
+    _basis.recordLibraryElements(elementMap);
+  }
+  void recordResolutionErrors(Source source, List<AnalysisError> errors, LineInfo lineInfo) {
+    _basis.recordResolutionErrors(source, errors, lineInfo);
+  }
+  void recordResolvedCompilationUnit(Source source, CompilationUnit unit) {
+    _basis.recordResolvedCompilationUnit(source, unit);
+  }
+  CompilationUnit resolveCompilationUnit(Source unitSource, LibraryElement library) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-resolveCompilationUnit");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.resolveCompilationUnit(unitSource, library);
+    } on AnalysisException catch (e) {
+      recordAnalysisException(instrumentation, e);
+      throw e;
+    } finally {
+      instrumentation.log();
+    }
+  }
+  CompilationUnit resolveCompilationUnit2(Source unitSource, Source librarySource) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-resolveCompilationUnit");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.resolveCompilationUnit2(unitSource, librarySource);
+    } on AnalysisException catch (e) {
+      recordAnalysisException(instrumentation, e);
+      throw e;
+    } finally {
+      instrumentation.log();
+    }
+  }
+  HtmlUnit resolveHtmlUnit(Source htmlSource) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-resolveHtmlUnit");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.resolveHtmlUnit(htmlSource);
+    } on AnalysisException catch (e) {
+      recordAnalysisException(instrumentation, e);
+      throw e;
+    } finally {
+      instrumentation.log();
+    }
+  }
+  void setContents(Source source, String contents) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-setContents");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      _basis.setContents(source, contents);
+    } finally {
+      instrumentation.log();
+    }
+  }
+  void set sourceFactory(SourceFactory factory) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-setSourceFactory");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      _basis.sourceFactory = factory;
+    } finally {
+      instrumentation.log();
+    }
+  }
+  Iterable<Source> sourcesToResolve(List<Source> changedSources) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-sourcesToResolve");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.sourcesToResolve(changedSources);
+    } finally {
+      instrumentation.log();
+    }
+  }
+}
+/**
+ * The interface {@code InternalAnalysisContext} defines additional behavior for an analysis context
+ * that is required by internal users of the context.
+ */
+abstract class InternalAnalysisContext implements AnalysisContext {
+  /**
+   * Add the given source with the given information to this context.
+   * @param source the source to be added
+   * @param info the information about the source
+   */
+  void addSourceInfo(Source source, SourceInfo info);
+  /**
+   * Return an AST structure corresponding to the given source, but ensure that the structure has
+   * not already been resolved and will not be resolved by any other threads or in any other
+   * library.
+   * @param source the compilation unit for which an AST structure should be returned
+   * @return the AST structure representing the content of the source
+   * @throws AnalysisException if the analysis could not be performed
+   */
+  CompilationUnit computeResolvableCompilationUnit(Source source);
+  /**
+   * Initialize the specified context by removing the specified sources from the receiver and adding
+   * them to the specified context.
+   * @param container the container containing sources that should be removed from this context and
+   * added to the returned context
+   * @param newContext the context to be initialized
+   * @return the analysis context that was initialized
+   */
+  InternalAnalysisContext extractContextInto(SourceContainer container, InternalAnalysisContext newContext);
+  /**
+   * Return a namespace containing mappings for all of the public names defined by the given
+   * library.
+   * @param library the library whose public namespace is to be returned
+   * @return the public namespace of the given library
+   */
+  Namespace getPublicNamespace(LibraryElement library);
+  /**
+   * Return a namespace containing mappings for all of the public names defined by the library
+   * defined by the given source.
+   * @param source the source defining the library whose public namespace is to be returned
+   * @return the public namespace corresponding to the library defined by the given source
+   * @throws AnalysisException if the public namespace could not be computed
+   */
+  Namespace getPublicNamespace2(Source source);
+  /**
+   * Given a table mapping the source for the libraries represented by the corresponding elements to
+   * the elements representing the libraries, record those mappings.
+   * @param elementMap a table mapping the source for the libraries represented by the elements to
+   * the elements representing the libraries
+   */
+  void recordLibraryElements(Map<Source, LibraryElement> elementMap);
+  /**
+   * Give the resolution errors and line info associated with the given source, add the information
+   * to the cache.
+   * @param source the source with which the information is associated
+   * @param errors the resolution errors associated with the source
+   * @param lineInfo the line information associated with the source
+   */
+  void recordResolutionErrors(Source source, List<AnalysisError> errors, LineInfo lineInfo);
+  /**
+   * Give the resolved compilation unit associated with the given source, add the unit to the cache.
+   * @param source the source with which the unit is associated
+   * @param unit the compilation unit associated with the source
+   */
+  void recordResolvedCompilationUnit(Source source, CompilationUnit unit);
+}
+/**
  * Instances of the class {@code LibraryInfo} maintain the information cached by an analysis context
  * about an individual library.
  * @coverage dart.engine
@@ -2113,6 +3143,15 @@
    */
   LibraryElement _element;
   /**
+   * The state of the cached unit sources.
+   */
+  CacheState _unitSourcesState = CacheState.INVALID;
+  /**
+   * The sources of the compilation units that compose the library, including both the defining
+   * compilation unit and any parts.
+   */
+  List<Source> _unitSources = Source.EMPTY_ARRAY;
+  /**
    * The state of the cached public namespace.
    */
   CacheState _publicNamespaceState = CacheState.INVALID;
@@ -2133,35 +3172,23 @@
    */
   int _bitmask = 0;
   /**
-   * The sources for the HTML files that reference this library (via a script tag), or {@code null}if there are no HTML files that reference the library or if the HTML files are not yet known.
-   */
-  List<Source> _htmlSources = null;
-  /**
    * Initialize a newly created information holder to be empty.
    */
   LibraryInfo() : super() {
   }
   /**
-   * Add the given source to the list of sources for the HTML files that reference this library.
-   * @param source the source to be added to the list
-   */
-  void addHtmlSource(Source source) {
-    if (_htmlSources == null) {
-      _htmlSources = new List<Source>();
-    }
-    _htmlSources.add(source);
-  }
-  /**
    * Remove the library element from the cache.
    */
   void clearElement() {
     _element = null;
+    _elementState = CacheState.FLUSHED;
   }
   /**
    * Remove the public namespace from the cache.
    */
   void clearPublicNamespace() {
     _publicNamespace = null;
+    _publicNamespaceState = CacheState.FLUSHED;
   }
   LibraryInfo copy() {
     LibraryInfo copy = new LibraryInfo();
@@ -2174,16 +3201,6 @@
    * @return the element representing the library
    */
   LibraryElement get element => _element;
-  /**
-   * Return the sources for the HTML files that reference this library.
-   * @return the sources for the HTML files that reference this library
-   */
-  List<Source> get htmlSources {
-    if (_htmlSources == null) {
-      return Source.EMPTY_ARRAY;
-    }
-    return new List.from(_htmlSources);
-  }
   SourceKind get kind => SourceKind.LIBRARY;
   /**
    * Return the public namespace of the library, or {@code null} if the namespace is not currently
@@ -2192,6 +3209,12 @@
    */
   Namespace get publicNamespace => _publicNamespace;
   /**
+   * Return the sources of the compilation units that compose the library, including both the
+   * defining compilation unit and any parts.
+   * @return the sources of the compilation units that compose the library
+   */
+  List<Source> get unitSources => _unitSources;
+  /**
    * Return {@code true} if the client/ server flag needs to be recomputed.
    * @return {@code true} if the client/ server flag needs to be recomputed
    */
@@ -2240,38 +3263,32 @@
     _publicNamespace = null;
   }
   /**
-   * Return <code>true</code> if this library is client based code: the library depends on the html
+   * Mark the compilation unit sources as needing to be recomputed.
+   */
+  void invalidateUnitSources() {
+    _unitSourcesState = CacheState.INVALID;
+    _unitSources = Source.EMPTY_ARRAY;
+  }
+  /**
+   * Return {@code true} if this library is client based code: the library depends on the html
    * library.
-   * @return <code>true</code> if this library is client based code: the library depends on the html
+   * @return {@code true} if this library is client based code: the library depends on the html
    * library
    */
   bool isClient() => (_bitmask & _CLIENT_CODE) != 0;
   /**
-   * Return <code>true</code> if this library is launchable: the file includes a main method.
-   * @return <code>true</code> if this library is launchable: the file includes a main method
+   * Return {@code true} if this library is launchable: the file includes a main method.
+   * @return {@code true} if this library is launchable: the file includes a main method
    */
   bool isLaunchable() => (_bitmask & _LAUNCHABLE) != 0;
   /**
-   * Return <code>true</code> if this library is server based code: the library does not depends on
-   * the html library.
-   * @return <code>true</code> if this library is server based code: the library does not depends on
-   * the html library
+   * Return {@code true} if this library is server based code: the library does not depends on the
+   * html library.
+   * @return {@code true} if this library is server based code: the library does not depends on the
+   * html library
    */
   bool isServer() => (_bitmask & _CLIENT_CODE) == 0;
   /**
-   * Remove the given source from the list of sources for the HTML files that reference this
-   * library.
-   * @param source the source to be removed to the list
-   */
-  void removeHtmlSource(Source source) {
-    if (_htmlSources != null) {
-      _htmlSources.remove(source);
-      if (_htmlSources.isEmpty) {
-        _htmlSources = null;
-      }
-    }
-  }
-  /**
    * Sets the value of the client/ server flag.
    * <p>
    * <b>Note:</b> Do not use this method to invalidate the flag, use{@link #invalidateClientServer()}.
@@ -2291,8 +3308,8 @@
    * <b>Note:</b> Do not use this method to clear or invalidate the element. Use either{@link #clearElement()} or {@link #invalidateElement()}.
    * @param element the element representing the library
    */
-  void set element(LibraryElement element20) {
-    this._element = element20;
+  void set element(LibraryElement element2) {
+    this._element = element2;
     _elementState = CacheState.VALID;
   }
   /**
@@ -2319,6 +3336,14 @@
     _publicNamespace = namespace;
     _publicNamespaceState = CacheState.VALID;
   }
+  /**
+   * Set the sources of the compilation units that compose the library to the given sources.
+   * @param sources the sources of the compilation units that compose the library
+   */
+  void set unitSources(List<Source> sources) {
+    _unitSourcesState = CacheState.VALID;
+    _unitSources = sources;
+  }
   void copyFrom(SourceInfo info) {
     super.copyFrom(info);
   }
@@ -2364,16 +3389,87 @@
     }
   }
   void onError(AnalysisError event) {
-    Source source9 = event.source;
-    List<AnalysisError> errorsForSource = _errors[source9];
-    if (_errors[source9] == null) {
+    Source source2 = event.source;
+    List<AnalysisError> errorsForSource = _errors[source2];
+    if (_errors[source2] == null) {
       errorsForSource = new List<AnalysisError>();
-      _errors[source9] = errorsForSource;
+      _errors[source2] = errorsForSource;
     }
     errorsForSource.add(event);
   }
 }
 /**
+ * Instances of the class {@code ResolutionEraser} remove any resolution information from an AST
+ * structure when used to visit that structure.
+ */
+class ResolutionEraser extends GeneralizingASTVisitor<Object> {
+  Object visitAssignmentExpression(AssignmentExpression node) {
+    node.element = null;
+    return super.visitAssignmentExpression(node);
+  }
+  Object visitBinaryExpression(BinaryExpression node) {
+    node.element = null;
+    return super.visitBinaryExpression(node);
+  }
+  Object visitCompilationUnit(CompilationUnit node) {
+    node.element = null;
+    return super.visitCompilationUnit(node);
+  }
+  Object visitConstructorDeclaration(ConstructorDeclaration node) {
+    node.element = null;
+    return super.visitConstructorDeclaration(node);
+  }
+  Object visitConstructorName(ConstructorName node) {
+    node.element = null;
+    return super.visitConstructorName(node);
+  }
+  Object visitDirective(Directive node) {
+    node.element = null;
+    return super.visitDirective(node);
+  }
+  Object visitExpression(Expression node) {
+    node.staticType = null;
+    node.propagatedType = null;
+    return super.visitExpression(node);
+  }
+  Object visitFunctionExpression(FunctionExpression node) {
+    node.element = null;
+    return super.visitFunctionExpression(node);
+  }
+  Object visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
+    node.element = null;
+    return super.visitFunctionExpressionInvocation(node);
+  }
+  Object visitIndexExpression(IndexExpression node) {
+    node.element = null;
+    return super.visitIndexExpression(node);
+  }
+  Object visitInstanceCreationExpression(InstanceCreationExpression node) {
+    node.element = null;
+    return super.visitInstanceCreationExpression(node);
+  }
+  Object visitPostfixExpression(PostfixExpression node) {
+    node.element = null;
+    return super.visitPostfixExpression(node);
+  }
+  Object visitPrefixExpression(PrefixExpression node) {
+    node.element = null;
+    return super.visitPrefixExpression(node);
+  }
+  Object visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
+    node.element = null;
+    return super.visitRedirectingConstructorInvocation(node);
+  }
+  Object visitSimpleIdentifier(SimpleIdentifier node) {
+    node.element = null;
+    return super.visitSimpleIdentifier(node);
+  }
+  Object visitSuperConstructorInvocation(SuperConstructorInvocation node) {
+    node.element = null;
+    return super.visitSuperConstructorInvocation(node);
+  }
+}
+/**
  * Instances of the class {@code SourceInfo} maintain the information cached by an analysis context
  * about an individual source.
  * @coverage dart.engine
@@ -2398,6 +3494,7 @@
    */
   void clearLineInfo() {
     _lineInfo = null;
+    _lineInfoState = CacheState.FLUSHED;
   }
   /**
    * Return a copy of this information holder.
diff --git a/pkg/analyzer_experimental/lib/src/generated/error.dart b/pkg/analyzer_experimental/lib/src/generated/error.dart
index 39e05e7..177546d 100644
--- a/pkg/analyzer_experimental/lib/src/generated/error.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/error.dart
@@ -12,7 +12,7 @@
  * Instances of the enumeration {@code ErrorSeverity} represent the severity of an {@link ErrorCode}.
  * @coverage dart.engine.error
  */
-class ErrorSeverity {
+class ErrorSeverity implements Comparable<ErrorSeverity> {
   /**
    * The severity representing a non-error. This is never used for any error code, but is useful for
    * clients.
@@ -64,6 +64,7 @@
    * @return the most sever of this or the given severity
    */
   ErrorSeverity max(ErrorSeverity severity) => this.ordinal >= severity.ordinal ? this : severity;
+  int compareTo(ErrorSeverity other) => __ordinal - other.__ordinal;
   String toString() => __name;
 }
 /**
@@ -122,8 +123,8 @@
    * the default source to be used.
    * @param source the source to be used when reporting errors
    */
-  void set source(Source source7) {
-    this._source = source7 == null ? _defaultSource : source7;
+  void set source(Source source2) {
+    this._source = source2 == null ? _defaultSource : source2;
   }
 }
 /**
@@ -138,6 +139,28 @@
    */
   static List<AnalysisError> NO_ERRORS = new List<AnalysisError>(0);
   /**
+   * A {@link Comparator} that sorts by the name of the file that the {@link AnalysisError} was
+   * found.
+   */
+  static Comparator<AnalysisError> FILE_COMPARATOR = (AnalysisError o1, AnalysisError o2) => o1.source.shortName.compareTo(o2.source.shortName);
+  /**
+   * A {@link Comparator} that sorts error codes first by their severity (errors first, warnings
+   * second), and then by the the error code type.
+   */
+  static Comparator<AnalysisError> ERROR_CODE_COMPARATOR = (AnalysisError o1, AnalysisError o2) {
+    ErrorCode errorCode1 = o1.errorCode;
+    ErrorCode errorCode2 = o2.errorCode;
+    ErrorSeverity errorSeverity1 = errorCode1.errorSeverity;
+    ErrorSeverity errorSeverity2 = errorCode2.errorSeverity;
+    ErrorType errorType1 = errorCode1.type;
+    ErrorType errorType2 = errorCode2.type;
+    if (errorSeverity1 == errorSeverity2) {
+      return errorType1.compareTo(errorType2);
+    } else {
+      return errorSeverity2.compareTo(errorSeverity1);
+    }
+  };
+  /**
    * The error code associated with the error.
    */
   ErrorCode _errorCode;
@@ -166,9 +189,9 @@
    * @param arguments the arguments used to build the error message
    */
   AnalysisError.con1(Source source2, ErrorCode errorCode2, List<Object> arguments) {
-    _jtd_constructor_130_impl(source2, errorCode2, arguments);
+    _jtd_constructor_131_impl(source2, errorCode2, arguments);
   }
-  _jtd_constructor_130_impl(Source source2, ErrorCode errorCode2, List<Object> arguments) {
+  _jtd_constructor_131_impl(Source source2, ErrorCode errorCode2, List<Object> arguments) {
     this._source = source2;
     this._errorCode = errorCode2;
     this._message = JavaString.format(errorCode2.message, arguments);
@@ -181,15 +204,15 @@
    * @param errorCode the error code to be associated with this error
    * @param arguments the arguments used to build the error message
    */
-  AnalysisError.con2(Source source3, int offset2, int length11, ErrorCode errorCode3, List<Object> arguments) {
-    _jtd_constructor_131_impl(source3, offset2, length11, errorCode3, arguments);
+  AnalysisError.con2(Source source2, int offset2, int length2, ErrorCode errorCode2, List<Object> arguments) {
+    _jtd_constructor_132_impl(source2, offset2, length2, errorCode2, arguments);
   }
-  _jtd_constructor_131_impl(Source source3, int offset2, int length11, ErrorCode errorCode3, List<Object> arguments) {
-    this._source = source3;
+  _jtd_constructor_132_impl(Source source2, int offset2, int length2, ErrorCode errorCode2, List<Object> arguments) {
+    this._source = source2;
     this._offset = offset2;
-    this._length = length11;
-    this._errorCode = errorCode3;
-    this._message = JavaString.format(errorCode3.message, arguments);
+    this._length = length2;
+    this._errorCode = errorCode2;
+    this._message = JavaString.format(errorCode2.message, arguments);
   }
   /**
    * Return the error code associated with the error.
@@ -228,8 +251,8 @@
    * Set the source in which the error occurred to the given source.
    * @param source the source in which the error occurred
    */
-  void set source(Source source4) {
-    this._source = source4;
+  void set source(Source source2) {
+    this._source = source2;
   }
   String toString() {
     JavaStringBuilder builder = new JavaStringBuilder();
@@ -276,7 +299,7 @@
  * Instances of the enumeration {@code ErrorType} represent the type of an {@link ErrorCode}.
  * @coverage dart.engine.error
  */
-class ErrorType {
+class ErrorType implements Comparable<ErrorType> {
   /**
    * Compile-time errors are errors that preclude execution. A compile time error must be reported
    * by a Dart compiler before the erroneous code is executed.
@@ -316,6 +339,7 @@
    * @return the severity of this type of error
    */
   ErrorSeverity get severity => _severity;
+  int compareTo(ErrorType other) => __ordinal - other.__ordinal;
   String toString() => __name;
 }
 /**
@@ -325,7 +349,7 @@
  * when appropriate, how the problem can be corrected.
  * @coverage dart.engine.error
  */
-class CompileTimeErrorCode implements ErrorCode {
+class CompileTimeErrorCode implements Comparable<CompileTimeErrorCode>, ErrorCode {
   /**
    * 14.2 Exports: It is a compile-time error if a name <i>N</i> is re-exported by a library
    * <i>L</i> and <i>N</i> is introduced into the export namespace of <i>L</i> by more than one
@@ -380,65 +404,60 @@
    */
   static final CompileTimeErrorCode COMPILE_TIME_CONSTANT_RAISES_EXCEPTION = new CompileTimeErrorCode('COMPILE_TIME_CONSTANT_RAISES_EXCEPTION', 8, "");
   /**
-   * 12.1 Constants: It is a compile-time error if evaluation of a compile-time constant would raise
-   * an exception.
+   * 7.6 Constructors: A constructor name always begins with the name of its immediately enclosing
+   * class, and may optionally be followed by a dot and an identifier <i>id</i>. It is a
+   * compile-time error if <i>id</i> is the name of a member declared in the immediately enclosing
+   * class.
    */
-  static final CompileTimeErrorCode COMPILE_TIME_CONSTANT_RAISES_EXCEPTION_DIVIDE_BY_ZERO = new CompileTimeErrorCode('COMPILE_TIME_CONSTANT_RAISES_EXCEPTION_DIVIDE_BY_ZERO', 9, "Cannot divide by zero");
+  static final CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD = new CompileTimeErrorCode('CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD', 9, "'%s' cannot be used to name a constructor and a method in this class");
   /**
    * 7.6 Constructors: A constructor name always begins with the name of its immediately enclosing
    * class, and may optionally be followed by a dot and an identifier <i>id</i>. It is a
    * compile-time error if <i>id</i> is the name of a member declared in the immediately enclosing
    * class.
    */
-  static final CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD = new CompileTimeErrorCode('CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD', 10, "'%s' cannot be used to name a constructor and a method in this class");
-  /**
-   * 7.6 Constructors: A constructor name always begins with the name of its immediately enclosing
-   * class, and may optionally be followed by a dot and an identifier <i>id</i>. It is a
-   * compile-time error if <i>id</i> is the name of a member declared in the immediately enclosing
-   * class.
-   */
-  static final CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD = new CompileTimeErrorCode('CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD', 11, "'%s' cannot be used to name a constructor and a field in this class");
+  static final CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD = new CompileTimeErrorCode('CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD', 10, "'%s' cannot be used to name a constructor and a field in this class");
   /**
    * 7.6.3 Constant Constructors: It is a compile-time error if a constant constructor is declared
    * by a class that has a non-final instance variable.
    */
-  static final CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD = new CompileTimeErrorCode('CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD', 12, "Classes with non-final fields cannot define 'const' constructors");
+  static final CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD = new CompileTimeErrorCode('CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD', 11, "Classes with non-final fields cannot define 'const' constructors");
   /**
    * 6.2 Formal Parameters: It is a compile-time error if a formal parameter is declared as a
    * constant variable.
    */
-  static final CompileTimeErrorCode CONST_FORMAL_PARAMETER = new CompileTimeErrorCode('CONST_FORMAL_PARAMETER', 13, "Parameters cannot be 'const'");
+  static final CompileTimeErrorCode CONST_FORMAL_PARAMETER = new CompileTimeErrorCode('CONST_FORMAL_PARAMETER', 12, "Parameters cannot be 'const'");
   /**
    * 5 Variables: A constant variable must be initialized to a compile-time constant or a
    * compile-time error occurs.
    */
-  static final CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE = new CompileTimeErrorCode('CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE', 14, "'const' variables must be constant value");
+  static final CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE = new CompileTimeErrorCode('CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE', 13, "'const' variables must be constant value");
   /**
    * 12.11.2 Const: It is a compile-time error if evaluation of a constant object results in an
    * uncaught exception being thrown.
    */
-  static final CompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION = new CompileTimeErrorCode('CONST_EVAL_THROWS_EXCEPTION', 15, "'const' constructors cannot throw exceptions");
+  static final CompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION = new CompileTimeErrorCode('CONST_EVAL_THROWS_EXCEPTION', 14, "'const' constructors cannot throw exceptions");
   /**
    * 12.11.2 Const: If <i>T</i> is a parameterized type <i>S&lt;U<sub>1</sub>, &hellip;,
    * U<sub>m</sub>&gt;</i>, let <i>R = S</i>; It is a compile time error if <i>S</i> is not a
    * generic type with <i>m</i> type parameters.
    * @param typeName the name of the type being referenced (<i>S</i>)
-   * @param argumentCount the number of type arguments provided
    * @param parameterCount the number of type parameters that were declared
+   * @param argumentCount the number of type arguments provided
    */
-  static final CompileTimeErrorCode CONST_WITH_INVALID_TYPE_PARAMETERS = new CompileTimeErrorCode('CONST_WITH_INVALID_TYPE_PARAMETERS', 16, "The type '%s' is declared with %d type parameters, but %d type arguments were given");
+  static final CompileTimeErrorCode CONST_WITH_INVALID_TYPE_PARAMETERS = new CompileTimeErrorCode('CONST_WITH_INVALID_TYPE_PARAMETERS', 15, "The type '%s' is declared with %d type parameters, but %d type arguments were given");
   /**
    * 12.11.2 Const: If <i>e</i> is of the form <i>const T(a<sub>1</sub>, &hellip;, a<sub>n</sub>,
    * x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>: a<sub>n+k</sub>)</i> it is a
    * compile-time error if the type <i>T</i> does not declare a constant constructor with the same
    * name as the declaration of <i>T</i>.
    */
-  static final CompileTimeErrorCode CONST_WITH_NON_CONST = new CompileTimeErrorCode('CONST_WITH_NON_CONST', 17, "The constructor being called is not a 'const' constructor");
+  static final CompileTimeErrorCode CONST_WITH_NON_CONST = new CompileTimeErrorCode('CONST_WITH_NON_CONST', 16, "The constructor being called is not a 'const' constructor");
   /**
    * 12.11.2 Const: In all of the above cases, it is a compile-time error if <i>a<sub>i</sub>, 1
    * &lt;= i &lt;= n + k</i>, is not a compile-time constant expression.
    */
-  static final CompileTimeErrorCode CONST_WITH_NON_CONSTANT_ARGUMENT = new CompileTimeErrorCode('CONST_WITH_NON_CONSTANT_ARGUMENT', 18, "");
+  static final CompileTimeErrorCode CONST_WITH_NON_CONSTANT_ARGUMENT = new CompileTimeErrorCode('CONST_WITH_NON_CONSTANT_ARGUMENT', 17, "");
   /**
    * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class accessible in the current
    * scope, optionally followed by type arguments.
@@ -448,53 +467,54 @@
    * compile-time error if <i>T</i> is not a class accessible in the current scope, optionally
    * followed by type arguments.
    */
-  static final CompileTimeErrorCode CONST_WITH_NON_TYPE = new CompileTimeErrorCode('CONST_WITH_NON_TYPE', 19, "");
+  static final CompileTimeErrorCode CONST_WITH_NON_TYPE = new CompileTimeErrorCode('CONST_WITH_NON_TYPE', 18, "");
   /**
    * 12.11.2 Const: It is a compile-time error if <i>T</i> includes any type parameters.
    */
-  static final CompileTimeErrorCode CONST_WITH_TYPE_PARAMETERS = new CompileTimeErrorCode('CONST_WITH_TYPE_PARAMETERS', 20, "");
+  static final CompileTimeErrorCode CONST_WITH_TYPE_PARAMETERS = new CompileTimeErrorCode('CONST_WITH_TYPE_PARAMETERS', 19, "");
   /**
    * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of a constant
    * constructor declared by the type <i>T</i>.
    */
-  static final CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR = new CompileTimeErrorCode('CONST_WITH_UNDEFINED_CONSTRUCTOR', 21, "");
+  static final CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR = new CompileTimeErrorCode('CONST_WITH_UNDEFINED_CONSTRUCTOR', 20, "");
   /**
    * 15.3.1 Typedef: It is a compile-time error if any default values are specified in the signature
    * of a function type alias.
    */
-  static final CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS = new CompileTimeErrorCode('DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS', 22, "Default values aren't allowed in typedefs");
+  static final CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS = new CompileTimeErrorCode('DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS', 21, "Default values aren't allowed in typedefs");
   /**
    * 3.1 Scoping: It is a compile-time error if there is more than one entity with the same name
    * declared in the same scope.
    * @param duplicateName the name of the duplicate entity
    */
-  static final CompileTimeErrorCode DUPLICATE_DEFINITION = new CompileTimeErrorCode('DUPLICATE_DEFINITION', 23, "The name '%s' is already defined");
+  static final CompileTimeErrorCode DUPLICATE_DEFINITION = new CompileTimeErrorCode('DUPLICATE_DEFINITION', 22, "The name '%s' is already defined");
   /**
    * 7 Classes: It is a compile-time error if a class declares two members of the same name.
    */
-  static final CompileTimeErrorCode DUPLICATE_MEMBER_NAME = new CompileTimeErrorCode('DUPLICATE_MEMBER_NAME', 24, "");
+  static final CompileTimeErrorCode DUPLICATE_MEMBER_NAME = new CompileTimeErrorCode('DUPLICATE_MEMBER_NAME', 23, "");
   /**
    * 7 Classes: It is a compile-time error if a class has an instance member and a static member
    * with the same name.
    */
-  static final CompileTimeErrorCode DUPLICATE_MEMBER_NAME_INSTANCE_STATIC = new CompileTimeErrorCode('DUPLICATE_MEMBER_NAME_INSTANCE_STATIC', 25, "");
+  static final CompileTimeErrorCode DUPLICATE_MEMBER_NAME_INSTANCE_STATIC = new CompileTimeErrorCode('DUPLICATE_MEMBER_NAME_INSTANCE_STATIC', 24, "");
   /**
    * 12.14.2 Binding Actuals to Formals: It is a compile-time error if <i>q<sub>i</sub> =
    * q<sub>j</sub></i> for any <i>i != j</i> [where <i>q<sub>i</sub></i> is the label for a named
    * argument].
    */
-  static final CompileTimeErrorCode DUPLICATE_NAMED_ARGUMENT = new CompileTimeErrorCode('DUPLICATE_NAMED_ARGUMENT', 26, "");
+  static final CompileTimeErrorCode DUPLICATE_NAMED_ARGUMENT = new CompileTimeErrorCode('DUPLICATE_NAMED_ARGUMENT', 25, "");
   /**
    * 14.2 Exports: It is a compile-time error if the compilation unit found at the specified URI is
    * not a library declaration.
+   * @param uri the uri pointing to a non-library declaration
    */
-  static final CompileTimeErrorCode EXPORT_OF_NON_LIBRARY = new CompileTimeErrorCode('EXPORT_OF_NON_LIBRARY', 27, "");
+  static final CompileTimeErrorCode EXPORT_OF_NON_LIBRARY = new CompileTimeErrorCode('EXPORT_OF_NON_LIBRARY', 26, "The exported library '%s' must not have a part-of directive");
   /**
    * 7.9 Superclasses: It is a compile-time error if the extends clause of a class <i>C</i> includes
    * a type expression that does not denote a class available in the lexical scope of <i>C</i>.
    * @param typeName the name of the superclass that was not found
    */
-  static final CompileTimeErrorCode EXTENDS_NON_CLASS = new CompileTimeErrorCode('EXTENDS_NON_CLASS', 28, "Classes can only extend other classes");
+  static final CompileTimeErrorCode EXTENDS_NON_CLASS = new CompileTimeErrorCode('EXTENDS_NON_CLASS', 27, "Classes can only extend other classes");
   /**
    * 12.2 Null: It is a compile-time error for a class to attempt to extend or implement Null.
    * <p>
@@ -511,7 +531,7 @@
    * @param typeName the name of the type that cannot be extended
    * @see #IMPLEMENTS_DISALLOWED_CLASS
    */
-  static final CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS = new CompileTimeErrorCode('EXTENDS_DISALLOWED_CLASS', 29, "Classes cannot extend '%s'");
+  static final CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS = new CompileTimeErrorCode('EXTENDS_DISALLOWED_CLASS', 28, "Classes cannot extend '%s'");
   /**
    * 12.2 Null: It is a compile-time error for a class to attempt to extend or implement Null.
    * <p>
@@ -528,158 +548,203 @@
    * @param typeName the name of the type that cannot be implemented
    * @see #EXTENDS_DISALLOWED_CLASS
    */
-  static final CompileTimeErrorCode IMPLEMENTS_DISALLOWED_CLASS = new CompileTimeErrorCode('IMPLEMENTS_DISALLOWED_CLASS', 30, "Classes cannot implement '%s'");
+  static final CompileTimeErrorCode IMPLEMENTS_DISALLOWED_CLASS = new CompileTimeErrorCode('IMPLEMENTS_DISALLOWED_CLASS', 29, "Classes cannot implement '%s'");
   /**
    * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile time
    * error if more than one initializer corresponding to a given instance variable appears in
    * <i>k</i>’s list.
    */
-  static final CompileTimeErrorCode FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS = new CompileTimeErrorCode('FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS', 31, "");
+  static final CompileTimeErrorCode FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS = new CompileTimeErrorCode('FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS', 30, "The field '%s' cannot be initialized twice in the same constructor");
   /**
    * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile time
    * error if <i>k</i>’s initializer list contains an initializer for a final variable <i>f</i>
    * whose declaration includes an initialization expression.
    */
-  static final CompileTimeErrorCode FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION = new CompileTimeErrorCode('FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION', 32, "Values cannot be set in the constructor if they are final, and have already been set");
+  static final CompileTimeErrorCode FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION = new CompileTimeErrorCode('FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION', 31, "Values cannot be set in the constructor if they are final, and have already been set");
   /**
    * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile time
    * error if <i>k</i>’s initializer list contains an initializer for a variable that is initialized
    * by means of an initializing formal of <i>k</i>.
    */
-  static final CompileTimeErrorCode FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER = new CompileTimeErrorCode('FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER', 33, "Fields cannot be initialized in both the parameter list and the initializers");
+  static final CompileTimeErrorCode FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER = new CompileTimeErrorCode('FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER', 32, "Fields cannot be initialized in both the parameter list and the initializers");
   /**
    * 7.6.1 Generative Constructors: It is a compile-time error if an initializing formal is used by
    * a function other than a non-redirecting generative constructor.
    */
-  static final CompileTimeErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = new CompileTimeErrorCode('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', 34, "Initializing formal fields can only be used in constructors");
+  static final CompileTimeErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = new CompileTimeErrorCode('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', 33, "Initializing formal fields can only be used in constructors");
   /**
    * 5 Variables: It is a compile-time error if a final instance variable that has been initialized
    * at its point of declaration is also initialized in a constructor.
+   * @param name the name of the field in question
    */
-  static final CompileTimeErrorCode FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR = new CompileTimeErrorCode('FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR', 35, "");
+  static final CompileTimeErrorCode FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR = new CompileTimeErrorCode('FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR', 34, "'%s' is final and was given a value when it was declared, so it cannot be set to a new value");
   /**
    * 5 Variables: It is a compile-time error if a final instance variable that has is initialized by
    * means of an initializing formal of a constructor is also initialized elsewhere in the same
    * constructor.
+   * @param name the name of the field in question
    */
-  static final CompileTimeErrorCode FINAL_INITIALIZED_MULTIPLE_TIMES = new CompileTimeErrorCode('FINAL_INITIALIZED_MULTIPLE_TIMES', 36, "");
+  static final CompileTimeErrorCode FINAL_INITIALIZED_MULTIPLE_TIMES = new CompileTimeErrorCode('FINAL_INITIALIZED_MULTIPLE_TIMES', 35, "'%s' is a final field and so can only be set once");
   /**
    * 5 Variables: It is a compile-time error if a library, static or local variable <i>v</i> is
    * final and <i>v</i> is not initialized at its point of declaration.
+   * @param name the name of the variable in question
    */
-  static final CompileTimeErrorCode FINAL_NOT_INITIALIZED = new CompileTimeErrorCode('FINAL_NOT_INITIALIZED', 37, "");
+  static final CompileTimeErrorCode FINAL_NOT_INITIALIZED = new CompileTimeErrorCode('FINAL_NOT_INITIALIZED', 36, "The final variable '%s' must be initialized");
   /**
    * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same
    * name.
    */
-  static final CompileTimeErrorCode GETTER_AND_METHOD_WITH_SAME_NAME = new CompileTimeErrorCode('GETTER_AND_METHOD_WITH_SAME_NAME', 38, "");
+  static final CompileTimeErrorCode GETTER_AND_METHOD_WITH_SAME_NAME = new CompileTimeErrorCode('GETTER_AND_METHOD_WITH_SAME_NAME', 37, "");
   /**
    * 7.10 Superinterfaces: It is a compile-time error if the implements clause of a class includes
    * type dynamic.
    */
-  static final CompileTimeErrorCode IMPLEMENTS_DYNAMIC = new CompileTimeErrorCode('IMPLEMENTS_DYNAMIC', 39, "");
+  static final CompileTimeErrorCode IMPLEMENTS_DYNAMIC = new CompileTimeErrorCode('IMPLEMENTS_DYNAMIC', 38, "Classes cannot implement 'dynamic'");
   /**
    * 7.10 Superinterfaces: It is a compile-time error if the implements clause of a class <i>C</i>
    * includes a type expression that does not denote a class available in the lexical scope of
    * <i>C</i>.
    * @param typeName the name of the interface that was not found
    */
-  static final CompileTimeErrorCode IMPLEMENTS_NON_CLASS = new CompileTimeErrorCode('IMPLEMENTS_NON_CLASS', 40, "Classes can only implement other classes");
+  static final CompileTimeErrorCode IMPLEMENTS_NON_CLASS = new CompileTimeErrorCode('IMPLEMENTS_NON_CLASS', 39, "Classes can only implement other classes");
   /**
    * 7.10 Superinterfaces: It is a compile-time error if a type <i>T</i> appears more than once in
    * the implements clause of a class.
+   * @param name the name of the type in question
    */
-  static final CompileTimeErrorCode IMPLEMENTS_REPEATED = new CompileTimeErrorCode('IMPLEMENTS_REPEATED', 41, "");
+  static final CompileTimeErrorCode IMPLEMENTS_REPEATED = new CompileTimeErrorCode('IMPLEMENTS_REPEATED', 40, "'%s' can only be implemented once");
   /**
    * 7.10 Superinterfaces: It is a compile-time error if the interface of a class <i>C</i> is a
    * superinterface of itself.
+   * @param name the name of the type in question
    */
-  static final CompileTimeErrorCode IMPLEMENTS_SELF = new CompileTimeErrorCode('IMPLEMENTS_SELF', 42, "");
+  static final CompileTimeErrorCode IMPLEMENTS_SELF = new CompileTimeErrorCode('IMPLEMENTS_SELF', 41, "'%s' cannot implement itself");
   /**
    * 14.1 Imports: It is a compile-time error to import two different libraries with the same name.
    */
-  static final CompileTimeErrorCode IMPORT_DUPLICATED_LIBRARY_NAME = new CompileTimeErrorCode('IMPORT_DUPLICATED_LIBRARY_NAME', 43, "");
+  static final CompileTimeErrorCode IMPORT_DUPLICATED_LIBRARY_NAME = new CompileTimeErrorCode('IMPORT_DUPLICATED_LIBRARY_NAME', 42, "");
   /**
    * 14.1 Imports: It is a compile-time error if the compilation unit found at the specified URI is
    * not a library declaration.
+   * @param uri the uri pointing to a non-library declaration
    */
-  static final CompileTimeErrorCode IMPORT_OF_NON_LIBRARY = new CompileTimeErrorCode('IMPORT_OF_NON_LIBRARY', 44, "");
+  static final CompileTimeErrorCode IMPORT_OF_NON_LIBRARY = new CompileTimeErrorCode('IMPORT_OF_NON_LIBRARY', 43, "The imported library '%s' must not have a part-of directive");
   /**
    * 13.9 Switch: It is a compile-time error if values of the expressions <i>e<sub>k</sub></i> are
    * not instances of the same class <i>C</i>, for all <i>1 &lt;= k &lt;= n</i>.
+   * @param expressionSource the expression source code that is the unexpected type
+   * @param expectedType the name of the expected type
    */
-  static final CompileTimeErrorCode INCONSITENT_CASE_EXPRESSION_TYPES = new CompileTimeErrorCode('INCONSITENT_CASE_EXPRESSION_TYPES', 45, "");
+  static final CompileTimeErrorCode INCONSISTENT_CASE_EXPRESSION_TYPES = new CompileTimeErrorCode('INCONSISTENT_CASE_EXPRESSION_TYPES', 44, "Case expressions must have the same types, '%s' is not a %s'");
+  /**
+   * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time
+   * error if <i>k</i>'s initializer list contains an initializer for a variable that is not an
+   * instance variable declared in the immediately surrounding class.
+   * @param id the name of the initializing formal that is not an instance variable in the
+   * immediately enclosing class
+   * @see #INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD
+   */
+  static final CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTANT_FIELD = new CompileTimeErrorCode('INITIALIZER_FOR_NON_EXISTANT_FIELD', 45, "'%s' is not a variable in the enclosing class");
+  /**
+   * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time
+   * error if <i>k</i>'s initializer list contains an initializer for a variable that is not an
+   * instance variable declared in the immediately surrounding class.
+   * @param id the name of the initializing formal that is a static variable in the immediately
+   * enclosing class
+   * @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD
+   */
+  static final CompileTimeErrorCode INITIALIZER_FOR_STATIC_FIELD = new CompileTimeErrorCode('INITIALIZER_FOR_STATIC_FIELD', 46, "'%s' is a static variable in the enclosing class, variables initialized in a constructor cannot be static");
   /**
    * 7.6.1 Generative Constructors: An initializing formal has the form <i>this.id</i>. It is a
    * compile-time error if <i>id</i> is not the name of an instance variable of the immediately
    * enclosing class.
+   * @param id the name of the initializing formal that is not an instance variable in the
+   * immediately enclosing class
+   * @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD
+   * @see #INITIALIZER_FOR_NON_EXISTANT_FIELD
    */
-  static final CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTANT_FIELD = new CompileTimeErrorCode('INITIALIZER_FOR_NON_EXISTANT_FIELD', 46, "");
+  static final CompileTimeErrorCode INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD = new CompileTimeErrorCode('INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD', 47, "'%s' is not a variable in the enclosing class");
+  /**
+   * 7.6.1 Generative Constructors: An initializing formal has the form <i>this.id</i>. It is a
+   * compile-time error if <i>id</i> is not the name of an instance variable of the immediately
+   * enclosing class.
+   * @param id the name of the initializing formal that is a static variable in the immediately
+   * enclosing class
+   * @see #INITIALIZER_FOR_STATIC_FIELD
+   */
+  static final CompileTimeErrorCode INITIALIZING_FORMAL_FOR_STATIC_FIELD = new CompileTimeErrorCode('INITIALIZING_FORMAL_FOR_STATIC_FIELD', 48, "'%s' is a static variable in the enclosing class, variables initialized in a constructor cannot be static");
   /**
    * TODO(brianwilkerson) Remove this when we have decided on how to report errors in compile-time
    * constants. Until then, this acts as a placeholder for more informative errors.
    */
-  static final CompileTimeErrorCode INVALID_CONSTANT = new CompileTimeErrorCode('INVALID_CONSTANT', 47, "");
+  static final CompileTimeErrorCode INVALID_CONSTANT = new CompileTimeErrorCode('INVALID_CONSTANT', 49, "");
   /**
    * 7.6 Constructors: It is a compile-time error if the name of a constructor is not a constructor
    * name.
    */
-  static final CompileTimeErrorCode INVALID_CONSTRUCTOR_NAME = new CompileTimeErrorCode('INVALID_CONSTRUCTOR_NAME', 48, "");
+  static final CompileTimeErrorCode INVALID_CONSTRUCTOR_NAME = new CompileTimeErrorCode('INVALID_CONSTRUCTOR_NAME', 50, "");
   /**
    * 7.6.2 Factories: It is a compile-time error if <i>M</i> is not the name of the immediately
    * enclosing class.
    */
-  static final CompileTimeErrorCode INVALID_FACTORY_NAME_NOT_A_CLASS = new CompileTimeErrorCode('INVALID_FACTORY_NAME_NOT_A_CLASS', 49, "");
+  static final CompileTimeErrorCode INVALID_FACTORY_NAME_NOT_A_CLASS = new CompileTimeErrorCode('INVALID_FACTORY_NAME_NOT_A_CLASS', 51, "");
   /**
    * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i> overrides an
    * instance member <i>m2</i>, the signature of <i>m2</i> explicitly specifies a default value for
    * a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a different default value
    * for <i>p</i>.
    */
-  static final CompileTimeErrorCode INVALID_OVERRIDE_DEFAULT_VALUE = new CompileTimeErrorCode('INVALID_OVERRIDE_DEFAULT_VALUE', 50, "");
+  static final CompileTimeErrorCode INVALID_OVERRIDE_DEFAULT_VALUE = new CompileTimeErrorCode('INVALID_OVERRIDE_DEFAULT_VALUE', 52, "");
   /**
    * 7.1: It is a compile-time error if an instance method <i>m1</i> overrides an instance member
    * <i>m2</i> and <i>m1</i> does not declare all the named parameters declared by <i>m2</i>.
    */
-  static final CompileTimeErrorCode INVALID_OVERRIDE_NAMED = new CompileTimeErrorCode('INVALID_OVERRIDE_NAMED', 51, "");
+  static final CompileTimeErrorCode INVALID_OVERRIDE_NAMED = new CompileTimeErrorCode('INVALID_OVERRIDE_NAMED', 53, "");
   /**
    * 7.1 Instance Methods: It is a compile-time error if an instance method m1 overrides an instance
    * member <i>m2</i> and <i>m1</i> has fewer optional positional parameters than <i>m2</i>.
    */
-  static final CompileTimeErrorCode INVALID_OVERRIDE_POSITIONAL = new CompileTimeErrorCode('INVALID_OVERRIDE_POSITIONAL', 52, "");
+  static final CompileTimeErrorCode INVALID_OVERRIDE_POSITIONAL = new CompileTimeErrorCode('INVALID_OVERRIDE_POSITIONAL', 54, "");
   /**
    * 7.1 Instance Methods: It is a compile-time error if an instance method <i>m1</i> overrides an
    * instance member <i>m2</i> and <i>m1</i> has a different number of required parameters than
    * <i>m2</i>.
    */
-  static final CompileTimeErrorCode INVALID_OVERRIDE_REQUIRED = new CompileTimeErrorCode('INVALID_OVERRIDE_REQUIRED', 53, "");
+  static final CompileTimeErrorCode INVALID_OVERRIDE_REQUIRED = new CompileTimeErrorCode('INVALID_OVERRIDE_REQUIRED', 55, "");
   /**
    * 12.10 This: It is a compile-time error if this appears in a top-level function or variable
    * initializer, in a factory constructor, or in a static method or variable initializer, or in the
    * initializer of an instance variable.
    */
-  static final CompileTimeErrorCode INVALID_REFERENCE_TO_THIS = new CompileTimeErrorCode('INVALID_REFERENCE_TO_THIS', 54, "");
+  static final CompileTimeErrorCode INVALID_REFERENCE_TO_THIS = new CompileTimeErrorCode('INVALID_REFERENCE_TO_THIS', 56, "");
   /**
    * 12.7 Maps: It is a compile-time error if the first type argument to a map literal is not
    * String.
    */
-  static final CompileTimeErrorCode INVALID_TYPE_ARGUMENT_FOR_KEY = new CompileTimeErrorCode('INVALID_TYPE_ARGUMENT_FOR_KEY', 55, "");
+  static final CompileTimeErrorCode INVALID_TYPE_ARGUMENT_FOR_KEY = new CompileTimeErrorCode('INVALID_TYPE_ARGUMENT_FOR_KEY', 57, "The first type argument to a map literal must be 'String'");
   /**
    * 12.6 Lists: It is a compile time error if the type argument of a constant list literal includes
    * a type parameter.
    */
-  static final CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST = new CompileTimeErrorCode('INVALID_TYPE_ARGUMENT_IN_CONST_LIST', 56, "");
+  static final CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST = new CompileTimeErrorCode('INVALID_TYPE_ARGUMENT_IN_CONST_LIST', 58, "");
   /**
    * 12.7 Maps: It is a compile time error if the type arguments of a constant map literal include a
    * type parameter.
    */
-  static final CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP = new CompileTimeErrorCode('INVALID_TYPE_ARGUMENT_IN_CONST_MAP', 57, "");
+  static final CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP = new CompileTimeErrorCode('INVALID_TYPE_ARGUMENT_IN_CONST_MAP', 59, "");
   /**
-   * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time
-   * error if <i>k</i>'s initializer list contains an initializer for a variable that is not an
-   * instance variable declared in the immediately surrounding class.
+   * 14.2 Exports: It is a compile-time error if the compilation unit found at the specified URI is
+   * not a library declaration.
+   * <p>
+   * 14.1 Imports: It is a compile-time error if the compilation unit found at the specified URI is
+   * not a library declaration.
+   * <p>
+   * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part
+   * declaration.
+   * @param uri the uri pointing to a non-library declaration
    */
-  static final CompileTimeErrorCode INVALID_VARIABLE_IN_INITIALIZER = new CompileTimeErrorCode('INVALID_VARIABLE_IN_INITIALIZER', 58, "");
+  static final CompileTimeErrorCode INVALID_URI = new CompileTimeErrorCode('INVALID_URI', 60, "'%s' is not a valid uri");
   /**
    * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</sub></i> exists within
    * the innermost function in which <i>s<sub>b</sub></i> occurs.
@@ -688,7 +753,7 @@
    * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub>c</sub></i> occurs.
    * @param labelName the name of the unresolvable label
    */
-  static final CompileTimeErrorCode LABEL_IN_OUTER_SCOPE = new CompileTimeErrorCode('LABEL_IN_OUTER_SCOPE', 59, "Cannot reference label '%s' declared in an outer method");
+  static final CompileTimeErrorCode LABEL_IN_OUTER_SCOPE = new CompileTimeErrorCode('LABEL_IN_OUTER_SCOPE', 61, "Cannot reference label '%s' declared in an outer method");
   /**
    * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</sub></i> exists within
    * the innermost function in which <i>s<sub>b</sub></i> occurs.
@@ -697,60 +762,60 @@
    * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub>c</sub></i> occurs.
    * @param labelName the name of the unresolvable label
    */
-  static final CompileTimeErrorCode LABEL_UNDEFINED = new CompileTimeErrorCode('LABEL_UNDEFINED', 60, "Cannot reference undefined label '%s'");
+  static final CompileTimeErrorCode LABEL_UNDEFINED = new CompileTimeErrorCode('LABEL_UNDEFINED', 62, "Cannot reference undefined label '%s'");
   /**
    * 7 Classes: It is a compile time error if a class <i>C</i> declares a member with the same name
    * as <i>C</i>.
    */
-  static final CompileTimeErrorCode MEMBER_WITH_CLASS_NAME = new CompileTimeErrorCode('MEMBER_WITH_CLASS_NAME', 61, "");
+  static final CompileTimeErrorCode MEMBER_WITH_CLASS_NAME = new CompileTimeErrorCode('MEMBER_WITH_CLASS_NAME', 63, "");
   /**
    * 9 Mixins: It is a compile-time error if a declared or derived mixin explicitly declares a
    * constructor.
    */
-  static final CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR = new CompileTimeErrorCode('MIXIN_DECLARES_CONSTRUCTOR', 62, "");
+  static final CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR = new CompileTimeErrorCode('MIXIN_DECLARES_CONSTRUCTOR', 64, "");
   /**
    * 9 Mixins: It is a compile-time error if a mixin is derived from a class whose superclass is not
    * Object.
    */
-  static final CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT = new CompileTimeErrorCode('MIXIN_INHERITS_FROM_NOT_OBJECT', 63, "");
+  static final CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT = new CompileTimeErrorCode('MIXIN_INHERITS_FROM_NOT_OBJECT', 65, "");
   /**
    * 9.1 Mixin Application: It is a compile-time error if <i>M</i> does not denote a class or mixin
    * available in the immediately enclosing scope.
    * @param typeName the name of the mixin that was not found
    */
-  static final CompileTimeErrorCode MIXIN_OF_NON_CLASS = new CompileTimeErrorCode('MIXIN_OF_NON_CLASS', 64, "Classes can only mixin other classes");
+  static final CompileTimeErrorCode MIXIN_OF_NON_CLASS = new CompileTimeErrorCode('MIXIN_OF_NON_CLASS', 66, "Classes can only mixin other classes");
   /**
    * 9.1 Mixin Application: If <i>M</i> is a class, it is a compile time error if a well formed
    * mixin cannot be derived from <i>M</i>.
    */
-  static final CompileTimeErrorCode MIXIN_OF_NON_MIXIN = new CompileTimeErrorCode('MIXIN_OF_NON_MIXIN', 65, "");
+  static final CompileTimeErrorCode MIXIN_OF_NON_MIXIN = new CompileTimeErrorCode('MIXIN_OF_NON_MIXIN', 67, "");
   /**
    * 9 Mixins: It is a compile-time error if a declared or derived mixin refers to super.
    */
-  static final CompileTimeErrorCode MIXIN_REFERENCES_SUPER = new CompileTimeErrorCode('MIXIN_REFERENCES_SUPER', 66, "");
+  static final CompileTimeErrorCode MIXIN_REFERENCES_SUPER = new CompileTimeErrorCode('MIXIN_REFERENCES_SUPER', 68, "");
   /**
    * 9.1 Mixin Application: It is a compile-time error if <i>S</i> does not denote a class available
    * in the immediately enclosing scope.
    */
-  static final CompileTimeErrorCode MIXIN_WITH_NON_CLASS_SUPERCLASS = new CompileTimeErrorCode('MIXIN_WITH_NON_CLASS_SUPERCLASS', 67, "");
+  static final CompileTimeErrorCode MIXIN_WITH_NON_CLASS_SUPERCLASS = new CompileTimeErrorCode('MIXIN_WITH_NON_CLASS_SUPERCLASS', 69, "");
   /**
    * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. Then <i>k</i> may
    * include at most one superinitializer in its initializer list or a compile time error occurs.
    */
-  static final CompileTimeErrorCode MULTIPLE_SUPER_INITIALIZERS = new CompileTimeErrorCode('MULTIPLE_SUPER_INITIALIZERS', 68, "");
+  static final CompileTimeErrorCode MULTIPLE_SUPER_INITIALIZERS = new CompileTimeErrorCode('MULTIPLE_SUPER_INITIALIZERS', 70, "");
   /**
    * 12.11.1 New: It is a compile time error if <i>S</i> is not a generic type with <i>m</i> type
    * parameters.
    * @param typeName the name of the type being referenced (<i>S</i>)
-   * @param argumentCount the number of type arguments provided
    * @param parameterCount the number of type parameters that were declared
+   * @param argumentCount the number of type arguments provided
    */
-  static final CompileTimeErrorCode NEW_WITH_INVALID_TYPE_PARAMETERS = new CompileTimeErrorCode('NEW_WITH_INVALID_TYPE_PARAMETERS', 69, "The type '%s' is declared with %d type parameters, but %d type arguments were given");
+  static final CompileTimeErrorCode NEW_WITH_INVALID_TYPE_PARAMETERS = new CompileTimeErrorCode('NEW_WITH_INVALID_TYPE_PARAMETERS', 71, "The type '%s' is declared with %d type parameters, but %d type arguments were given");
   /**
    * 13.2 Expression Statements: It is a compile-time error if a non-constant map literal that has
    * no explicit type arguments appears in a place where a statement is expected.
    */
-  static final CompileTimeErrorCode NON_CONST_MAP_AS_EXPRESSION_STATEMENT = new CompileTimeErrorCode('NON_CONST_MAP_AS_EXPRESSION_STATEMENT', 70, "");
+  static final CompileTimeErrorCode NON_CONST_MAP_AS_EXPRESSION_STATEMENT = new CompileTimeErrorCode('NON_CONST_MAP_AS_EXPRESSION_STATEMENT', 72, "");
   /**
    * 13.9 Switch: Given a switch statement of the form <i>switch (e) { label<sub>11</sub> &hellip;
    * label<sub>1j1</sub> case e<sub>1</sub>: s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip;
@@ -760,121 +825,122 @@
    * s<sub>n</sub>}</i>, it is a compile-time error if the expressions <i>e<sub>k</sub></i> are not
    * compile-time constants, for all <i>1 &lt;= k &lt;= n</i>.
    */
-  static final CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION = new CompileTimeErrorCode('NON_CONSTANT_CASE_EXPRESSION', 71, "Case expressions must be constant");
+  static final CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION = new CompileTimeErrorCode('NON_CONSTANT_CASE_EXPRESSION', 73, "Case expressions must be constant");
   /**
    * 6.2.2 Optional Formals: It is a compile-time error if the default value of an optional
    * parameter is not a compile-time constant.
    */
-  static final CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE = new CompileTimeErrorCode('NON_CONSTANT_DEFAULT_VALUE', 72, "Default values of an optional parameter must be constant");
+  static final CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE = new CompileTimeErrorCode('NON_CONSTANT_DEFAULT_VALUE', 74, "Default values of an optional parameter must be constant");
   /**
    * 12.6 Lists: It is a compile time error if an element of a constant list literal is not a
    * compile-time constant.
    */
-  static final CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT = new CompileTimeErrorCode('NON_CONSTANT_LIST_ELEMENT', 73, "'const' lists must have all constant values");
+  static final CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT = new CompileTimeErrorCode('NON_CONSTANT_LIST_ELEMENT', 75, "'const' lists must have all constant values");
   /**
    * 12.7 Maps: It is a compile time error if either a key or a value of an entry in a constant map
    * literal is not a compile-time constant.
    */
-  static final CompileTimeErrorCode NON_CONSTANT_MAP_KEY = new CompileTimeErrorCode('NON_CONSTANT_MAP_KEY', 74, "The keys in a map must be constant");
+  static final CompileTimeErrorCode NON_CONSTANT_MAP_KEY = new CompileTimeErrorCode('NON_CONSTANT_MAP_KEY', 76, "The keys in a map must be constant");
   /**
    * 12.7 Maps: It is a compile time error if either a key or a value of an entry in a constant map
    * literal is not a compile-time constant.
    */
-  static final CompileTimeErrorCode NON_CONSTANT_MAP_VALUE = new CompileTimeErrorCode('NON_CONSTANT_MAP_VALUE', 75, "The values in a 'const' map must be constant");
+  static final CompileTimeErrorCode NON_CONSTANT_MAP_VALUE = new CompileTimeErrorCode('NON_CONSTANT_MAP_VALUE', 77, "The values in a 'const' map must be constant");
   /**
    * 7.6.3 Constant Constructors: Any expression that appears within the initializer list of a
    * constant constructor must be a potentially constant expression, or a compile-time error occurs.
    */
-  static final CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER = new CompileTimeErrorCode('NON_CONSTANT_VALUE_IN_INITIALIZER', 76, "");
+  static final CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER = new CompileTimeErrorCode('NON_CONSTANT_VALUE_IN_INITIALIZER', 78, "");
   /**
    * 7.9 Superclasses: It is a compile-time error to specify an extends clause for class Object.
    */
-  static final CompileTimeErrorCode OBJECT_CANNOT_EXTEND_ANOTHER_CLASS = new CompileTimeErrorCode('OBJECT_CANNOT_EXTEND_ANOTHER_CLASS', 77, "");
+  static final CompileTimeErrorCode OBJECT_CANNOT_EXTEND_ANOTHER_CLASS = new CompileTimeErrorCode('OBJECT_CANNOT_EXTEND_ANOTHER_CLASS', 79, "");
   /**
    * 7.1.1 Operators: It is a compile-time error to declare an optional parameter in an operator.
    */
-  static final CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR = new CompileTimeErrorCode('OPTIONAL_PARAMETER_IN_OPERATOR', 78, "");
+  static final CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR = new CompileTimeErrorCode('OPTIONAL_PARAMETER_IN_OPERATOR', 80, "");
   /**
    * 8 Interfaces: It is a compile-time error if an interface member <i>m1</i> overrides an
    * interface member <i>m2</i> and <i>m1</i> does not declare all the named parameters declared by
    * <i>m2</i> in the same order.
    */
-  static final CompileTimeErrorCode OVERRIDE_MISSING_NAMED_PARAMETERS = new CompileTimeErrorCode('OVERRIDE_MISSING_NAMED_PARAMETERS', 79, "");
+  static final CompileTimeErrorCode OVERRIDE_MISSING_NAMED_PARAMETERS = new CompileTimeErrorCode('OVERRIDE_MISSING_NAMED_PARAMETERS', 81, "");
   /**
    * 8 Interfaces: It is a compile-time error if an interface member <i>m1</i> overrides an
    * interface member <i>m2</i> and <i>m1</i> has a different number of required parameters than
    * <i>m2</i>.
    */
-  static final CompileTimeErrorCode OVERRIDE_MISSING_REQUIRED_PARAMETERS = new CompileTimeErrorCode('OVERRIDE_MISSING_REQUIRED_PARAMETERS', 80, "");
+  static final CompileTimeErrorCode OVERRIDE_MISSING_REQUIRED_PARAMETERS = new CompileTimeErrorCode('OVERRIDE_MISSING_REQUIRED_PARAMETERS', 82, "");
   /**
    * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part
    * declaration.
+   * @param uri the uri pointing to a non-library declaration
    */
-  static final CompileTimeErrorCode PART_OF_NON_PART = new CompileTimeErrorCode('PART_OF_NON_PART', 81, "");
+  static final CompileTimeErrorCode PART_OF_NON_PART = new CompileTimeErrorCode('PART_OF_NON_PART', 83, "The included part '%s' must have a part-of directive");
   /**
    * 14.1 Imports: It is a compile-time error if the current library declares a top-level member
    * named <i>p</i>.
    */
-  static final CompileTimeErrorCode PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER = new CompileTimeErrorCode('PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER', 82, "");
+  static final CompileTimeErrorCode PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER = new CompileTimeErrorCode('PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER', 84, "");
   /**
    * 6.2.2 Optional Formals: It is a compile-time error if the name of a named optional parameter
    * begins with an ‘_’ character.
    */
-  static final CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER = new CompileTimeErrorCode('PRIVATE_OPTIONAL_PARAMETER', 83, "");
+  static final CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER = new CompileTimeErrorCode('PRIVATE_OPTIONAL_PARAMETER', 85, "");
   /**
    * 12.1 Constants: It is a compile-time error if the value of a compile-time constant expression
    * depends on itself.
    */
-  static final CompileTimeErrorCode RECURSIVE_COMPILE_TIME_CONSTANT = new CompileTimeErrorCode('RECURSIVE_COMPILE_TIME_CONSTANT', 84, "");
+  static final CompileTimeErrorCode RECURSIVE_COMPILE_TIME_CONSTANT = new CompileTimeErrorCode('RECURSIVE_COMPILE_TIME_CONSTANT', 86, "");
   /**
    * 7.6.2 Factories: It is a compile-time error if a redirecting factory constructor redirects to
    * itself, either directly or indirectly via a sequence of redirections.
    */
-  static final CompileTimeErrorCode RECURSIVE_FACTORY_REDIRECT = new CompileTimeErrorCode('RECURSIVE_FACTORY_REDIRECT', 85, "");
+  static final CompileTimeErrorCode RECURSIVE_FACTORY_REDIRECT = new CompileTimeErrorCode('RECURSIVE_FACTORY_REDIRECT', 87, "");
   /**
    * 15.3.1 Typedef: It is a compile-time error if a typedef refers to itself via a chain of
    * references that does not include a class type.
    */
-  static final CompileTimeErrorCode RECURSIVE_FUNCTION_TYPE_ALIAS = new CompileTimeErrorCode('RECURSIVE_FUNCTION_TYPE_ALIAS', 86, "");
+  static final CompileTimeErrorCode RECURSIVE_FUNCTION_TYPE_ALIAS = new CompileTimeErrorCode('RECURSIVE_FUNCTION_TYPE_ALIAS', 88, "");
   /**
    * 8.1 Superinterfaces: It is a compile-time error if an interface is a superinterface of itself.
    */
-  static final CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE = new CompileTimeErrorCode('RECURSIVE_INTERFACE_INHERITANCE', 87, "");
+  static final CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE = new CompileTimeErrorCode('RECURSIVE_INTERFACE_INHERITANCE', 89, "");
   /**
    * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with the const modifier but
    * <i>k’</i> is not a constant constructor.
    */
-  static final CompileTimeErrorCode REDIRECT_TO_NON_CONST_CONSTRUCTOR = new CompileTimeErrorCode('REDIRECT_TO_NON_CONST_CONSTRUCTOR', 88, "");
+  static final CompileTimeErrorCode REDIRECT_TO_NON_CONST_CONSTRUCTOR = new CompileTimeErrorCode('REDIRECT_TO_NON_CONST_CONSTRUCTOR', 90, "");
   /**
    * 13.3 Local Variable Declaration: It is a compile-time error if <i>e</i> refers to the name
    * <i>v</i> or the name <i>v=</i>.
    */
-  static final CompileTimeErrorCode REFERENCE_TO_DECLARED_VARIABLE_IN_INITIALIZER = new CompileTimeErrorCode('REFERENCE_TO_DECLARED_VARIABLE_IN_INITIALIZER', 89, "");
+  static final CompileTimeErrorCode REFERENCE_TO_DECLARED_VARIABLE_IN_INITIALIZER = new CompileTimeErrorCode('REFERENCE_TO_DECLARED_VARIABLE_IN_INITIALIZER', 91, "");
   /**
    * 16.1.1 Reserved Words: A reserved word may not be used as an identifier; it is a compile-time
    * error if a reserved word is used where an identifier is expected.
    */
-  static final CompileTimeErrorCode RESERVED_WORD_AS_IDENTIFIER = new CompileTimeErrorCode('RESERVED_WORD_AS_IDENTIFIER', 90, "");
+  static final CompileTimeErrorCode RESERVED_WORD_AS_IDENTIFIER = new CompileTimeErrorCode('RESERVED_WORD_AS_IDENTIFIER', 92, "");
   /**
    * 12.8.1 Rethrow: It is a compile-time error if an expression of the form <i>rethrow;</i> is not
    * enclosed within a on-catch clause.
    */
-  static final CompileTimeErrorCode RETHROW_OUTSIDE_CATCH = new CompileTimeErrorCode('RETHROW_OUTSIDE_CATCH', 91, "rethrow must be inside of a catch clause");
+  static final CompileTimeErrorCode RETHROW_OUTSIDE_CATCH = new CompileTimeErrorCode('RETHROW_OUTSIDE_CATCH', 93, "rethrow must be inside of a catch clause");
   /**
    * 13.11 Return: It is a compile-time error if a return statement of the form <i>return e;</i>
    * appears in a generative constructor.
    */
-  static final CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR = new CompileTimeErrorCode('RETURN_IN_GENERATIVE_CONSTRUCTOR', 92, "");
+  static final CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR = new CompileTimeErrorCode('RETURN_IN_GENERATIVE_CONSTRUCTOR', 94, "");
   /**
    * 6.1 Function Declarations: It is a compile-time error to preface a function declaration with
    * the built-in identifier static.
    */
-  static final CompileTimeErrorCode STATIC_TOP_LEVEL_FUNCTION = new CompileTimeErrorCode('STATIC_TOP_LEVEL_FUNCTION', 93, "");
+  static final CompileTimeErrorCode STATIC_TOP_LEVEL_FUNCTION = new CompileTimeErrorCode('STATIC_TOP_LEVEL_FUNCTION', 95, "");
   /**
    * 5 Variables: It is a compile-time error to preface a top level variable declaration with the
    * built-in identifier static.
    */
-  static final CompileTimeErrorCode STATIC_TOP_LEVEL_VARIABLE = new CompileTimeErrorCode('STATIC_TOP_LEVEL_VARIABLE', 94, "");
+  static final CompileTimeErrorCode STATIC_TOP_LEVEL_VARIABLE = new CompileTimeErrorCode('STATIC_TOP_LEVEL_VARIABLE', 96, "");
   /**
    * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form
    * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;
@@ -883,12 +949,12 @@
    * initializer list, in class Object, in a factory constructor, or in a static method or variable
    * initializer.
    */
-  static final CompileTimeErrorCode SUPER_IN_INVALID_CONTEXT = new CompileTimeErrorCode('SUPER_IN_INVALID_CONTEXT', 95, "");
+  static final CompileTimeErrorCode SUPER_IN_INVALID_CONTEXT = new CompileTimeErrorCode('SUPER_IN_INVALID_CONTEXT', 97, "");
   /**
    * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time
    * error if a generative constructor of class Object includes a superinitializer.
    */
-  static final CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT = new CompileTimeErrorCode('SUPER_INITIALIZER_IN_OBJECT', 96, "");
+  static final CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT = new CompileTimeErrorCode('SUPER_INITIALIZER_IN_OBJECT', 98, "");
   /**
    * 12.11 Instance Creation: It is a compile-time error if a constructor of a non-generic type
    * invoked by a new expression or a constant object expression is passed any type arguments.
@@ -897,14 +963,14 @@
    * <i>G&lt;T<sub>1</sub>, &hellip;, T<sub>n</sub>&gt;</i> and <i>G</i> is not a generic type with
    * <i>n</i> type parameters.
    */
-  static final CompileTimeErrorCode TYPE_ARGUMENTS_FOR_NON_GENERIC_CLASS = new CompileTimeErrorCode('TYPE_ARGUMENTS_FOR_NON_GENERIC_CLASS', 97, "");
+  static final CompileTimeErrorCode TYPE_ARGUMENTS_FOR_NON_GENERIC_CLASS = new CompileTimeErrorCode('TYPE_ARGUMENTS_FOR_NON_GENERIC_CLASS', 99, "");
   /**
    * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the superinitializer appears
    * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generative constructor. It is
    * a compile-time error if class <i>S</i> does not declare a generative constructor named <i>S</i>
    * (respectively <i>S.id</i>)
    */
-  static final CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER = new CompileTimeErrorCode('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER', 98, "");
+  static final CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER = new CompileTimeErrorCode('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER', 100, "");
   /**
    * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. Each final instance
    * variable <i>f</i> declared in the immediately enclosing class must have an initializer in
@@ -916,7 +982,7 @@
    * </ol>
    * or a compile-time error occurs.
    */
-  static final CompileTimeErrorCode UNINITIALIZED_FINAL_FIELD = new CompileTimeErrorCode('UNINITIALIZED_FINAL_FIELD', 99, "");
+  static final CompileTimeErrorCode UNINITIALIZED_FINAL_FIELD = new CompileTimeErrorCode('UNINITIALIZED_FINAL_FIELD', 101, "");
   /**
    * 14.1 Imports: It is a compile-time error if <i>x</i> is not a compile-time constant, or if
    * <i>x</i> involves string interpolation.
@@ -927,7 +993,7 @@
    * 14.5 URIs: It is a compile-time error if the string literal <i>x</i> that describes a URI is
    * not a compile-time constant, or if <i>x</i> involves string interpolation.
    */
-  static final CompileTimeErrorCode URI_WITH_INTERPOLATION = new CompileTimeErrorCode('URI_WITH_INTERPOLATION', 100, "URIs cannot use string interpolation");
+  static final CompileTimeErrorCode URI_WITH_INTERPOLATION = new CompileTimeErrorCode('URI_WITH_INTERPOLATION', 102, "URIs cannot use string interpolation");
   /**
    * 7.1.1 Operators: It is a compile-time error if the arity of the user-declared operator []= is
    * not 2. It is a compile time error if the arity of a user-declared operator with one of the
@@ -935,12 +1001,12 @@
    * It is a compile time error if the arity of the user-declared operator - is not 0 or 1. It is a
    * compile time error if the arity of the user-declared operator ~ is not 0.
    */
-  static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR = new CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR', 101, "");
+  static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR = new CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR', 103, "");
   /**
    * 7.3 Setters: It is a compile-time error if a setter’s formal parameter list does not include
    * exactly one required formal parameter <i>p</i>.
    */
-  static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER = new CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER', 102, "");
+  static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER = new CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER', 104, "");
   /**
    * 12.11 Instance Creation: It is a compile-time error if a constructor of a generic type with
    * <i>n</i> type parameters invoked by a new expression or a constant object expression is passed
@@ -950,8 +1016,8 @@
    * <i>G&lt;T<sub>1</sub>, &hellip;, T<sub>n</sub>&gt;</i> and <i>G</i> is not a generic type with
    * <i>n</i> type parameters.
    */
-  static final CompileTimeErrorCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = new CompileTimeErrorCode('WRONG_NUMBER_OF_TYPE_ARGUMENTS', 103, "");
-  static final List<CompileTimeErrorCode> values = [AMBIGUOUS_EXPORT, AMBIGUOUS_IMPORT, ARGUMENT_DEFINITION_TEST_NON_PARAMETER, BUILT_IN_IDENTIFIER_AS_TYPE, BUILT_IN_IDENTIFIER_AS_TYPE_NAME, BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, BUILT_IN_IDENTIFIER_AS_TYPE_VARIABLE_NAME, CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, COMPILE_TIME_CONSTANT_RAISES_EXCEPTION, COMPILE_TIME_CONSTANT_RAISES_EXCEPTION_DIVIDE_BY_ZERO, CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD, CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD, CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD, CONST_FORMAL_PARAMETER, CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, CONST_EVAL_THROWS_EXCEPTION, CONST_WITH_INVALID_TYPE_PARAMETERS, CONST_WITH_NON_CONST, CONST_WITH_NON_CONSTANT_ARGUMENT, CONST_WITH_NON_TYPE, CONST_WITH_TYPE_PARAMETERS, CONST_WITH_UNDEFINED_CONSTRUCTOR, DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS, DUPLICATE_DEFINITION, DUPLICATE_MEMBER_NAME, DUPLICATE_MEMBER_NAME_INSTANCE_STATIC, DUPLICATE_NAMED_ARGUMENT, EXPORT_OF_NON_LIBRARY, EXTENDS_NON_CLASS, EXTENDS_DISALLOWED_CLASS, IMPLEMENTS_DISALLOWED_CLASS, FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS, FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION, FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER, FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR, FINAL_INITIALIZED_MULTIPLE_TIMES, FINAL_NOT_INITIALIZED, GETTER_AND_METHOD_WITH_SAME_NAME, IMPLEMENTS_DYNAMIC, IMPLEMENTS_NON_CLASS, IMPLEMENTS_REPEATED, IMPLEMENTS_SELF, IMPORT_DUPLICATED_LIBRARY_NAME, IMPORT_OF_NON_LIBRARY, INCONSITENT_CASE_EXPRESSION_TYPES, INITIALIZER_FOR_NON_EXISTANT_FIELD, INVALID_CONSTANT, INVALID_CONSTRUCTOR_NAME, INVALID_FACTORY_NAME_NOT_A_CLASS, INVALID_OVERRIDE_DEFAULT_VALUE, INVALID_OVERRIDE_NAMED, INVALID_OVERRIDE_POSITIONAL, INVALID_OVERRIDE_REQUIRED, INVALID_REFERENCE_TO_THIS, INVALID_TYPE_ARGUMENT_FOR_KEY, INVALID_TYPE_ARGUMENT_IN_CONST_LIST, INVALID_TYPE_ARGUMENT_IN_CONST_MAP, INVALID_VARIABLE_IN_INITIALIZER, LABEL_IN_OUTER_SCOPE, LABEL_UNDEFINED, MEMBER_WITH_CLASS_NAME, MIXIN_DECLARES_CONSTRUCTOR, MIXIN_INHERITS_FROM_NOT_OBJECT, MIXIN_OF_NON_CLASS, MIXIN_OF_NON_MIXIN, MIXIN_REFERENCES_SUPER, MIXIN_WITH_NON_CLASS_SUPERCLASS, MULTIPLE_SUPER_INITIALIZERS, NEW_WITH_INVALID_TYPE_PARAMETERS, NON_CONST_MAP_AS_EXPRESSION_STATEMENT, NON_CONSTANT_CASE_EXPRESSION, NON_CONSTANT_DEFAULT_VALUE, NON_CONSTANT_LIST_ELEMENT, NON_CONSTANT_MAP_KEY, NON_CONSTANT_MAP_VALUE, NON_CONSTANT_VALUE_IN_INITIALIZER, OBJECT_CANNOT_EXTEND_ANOTHER_CLASS, OPTIONAL_PARAMETER_IN_OPERATOR, OVERRIDE_MISSING_NAMED_PARAMETERS, OVERRIDE_MISSING_REQUIRED_PARAMETERS, PART_OF_NON_PART, PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER, PRIVATE_OPTIONAL_PARAMETER, RECURSIVE_COMPILE_TIME_CONSTANT, RECURSIVE_FACTORY_REDIRECT, RECURSIVE_FUNCTION_TYPE_ALIAS, RECURSIVE_INTERFACE_INHERITANCE, REDIRECT_TO_NON_CONST_CONSTRUCTOR, REFERENCE_TO_DECLARED_VARIABLE_IN_INITIALIZER, RESERVED_WORD_AS_IDENTIFIER, RETHROW_OUTSIDE_CATCH, RETURN_IN_GENERATIVE_CONSTRUCTOR, STATIC_TOP_LEVEL_FUNCTION, STATIC_TOP_LEVEL_VARIABLE, SUPER_IN_INVALID_CONTEXT, SUPER_INITIALIZER_IN_OBJECT, TYPE_ARGUMENTS_FOR_NON_GENERIC_CLASS, UNDEFINED_CONSTRUCTOR_IN_INITIALIZER, UNINITIALIZED_FINAL_FIELD, URI_WITH_INTERPOLATION, WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR, WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER, WRONG_NUMBER_OF_TYPE_ARGUMENTS];
+  static final CompileTimeErrorCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = new CompileTimeErrorCode('WRONG_NUMBER_OF_TYPE_ARGUMENTS', 105, "");
+  static final List<CompileTimeErrorCode> values = [AMBIGUOUS_EXPORT, AMBIGUOUS_IMPORT, ARGUMENT_DEFINITION_TEST_NON_PARAMETER, BUILT_IN_IDENTIFIER_AS_TYPE, BUILT_IN_IDENTIFIER_AS_TYPE_NAME, BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, BUILT_IN_IDENTIFIER_AS_TYPE_VARIABLE_NAME, CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, COMPILE_TIME_CONSTANT_RAISES_EXCEPTION, CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD, CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD, CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD, CONST_FORMAL_PARAMETER, CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, CONST_EVAL_THROWS_EXCEPTION, CONST_WITH_INVALID_TYPE_PARAMETERS, CONST_WITH_NON_CONST, CONST_WITH_NON_CONSTANT_ARGUMENT, CONST_WITH_NON_TYPE, CONST_WITH_TYPE_PARAMETERS, CONST_WITH_UNDEFINED_CONSTRUCTOR, DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS, DUPLICATE_DEFINITION, DUPLICATE_MEMBER_NAME, DUPLICATE_MEMBER_NAME_INSTANCE_STATIC, DUPLICATE_NAMED_ARGUMENT, EXPORT_OF_NON_LIBRARY, EXTENDS_NON_CLASS, EXTENDS_DISALLOWED_CLASS, IMPLEMENTS_DISALLOWED_CLASS, FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS, FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION, FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER, FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR, FINAL_INITIALIZED_MULTIPLE_TIMES, FINAL_NOT_INITIALIZED, GETTER_AND_METHOD_WITH_SAME_NAME, IMPLEMENTS_DYNAMIC, IMPLEMENTS_NON_CLASS, IMPLEMENTS_REPEATED, IMPLEMENTS_SELF, IMPORT_DUPLICATED_LIBRARY_NAME, IMPORT_OF_NON_LIBRARY, INCONSISTENT_CASE_EXPRESSION_TYPES, INITIALIZER_FOR_NON_EXISTANT_FIELD, INITIALIZER_FOR_STATIC_FIELD, INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD, INITIALIZING_FORMAL_FOR_STATIC_FIELD, INVALID_CONSTANT, INVALID_CONSTRUCTOR_NAME, INVALID_FACTORY_NAME_NOT_A_CLASS, INVALID_OVERRIDE_DEFAULT_VALUE, INVALID_OVERRIDE_NAMED, INVALID_OVERRIDE_POSITIONAL, INVALID_OVERRIDE_REQUIRED, INVALID_REFERENCE_TO_THIS, INVALID_TYPE_ARGUMENT_FOR_KEY, INVALID_TYPE_ARGUMENT_IN_CONST_LIST, INVALID_TYPE_ARGUMENT_IN_CONST_MAP, INVALID_URI, LABEL_IN_OUTER_SCOPE, LABEL_UNDEFINED, MEMBER_WITH_CLASS_NAME, MIXIN_DECLARES_CONSTRUCTOR, MIXIN_INHERITS_FROM_NOT_OBJECT, MIXIN_OF_NON_CLASS, MIXIN_OF_NON_MIXIN, MIXIN_REFERENCES_SUPER, MIXIN_WITH_NON_CLASS_SUPERCLASS, MULTIPLE_SUPER_INITIALIZERS, NEW_WITH_INVALID_TYPE_PARAMETERS, NON_CONST_MAP_AS_EXPRESSION_STATEMENT, NON_CONSTANT_CASE_EXPRESSION, NON_CONSTANT_DEFAULT_VALUE, NON_CONSTANT_LIST_ELEMENT, NON_CONSTANT_MAP_KEY, NON_CONSTANT_MAP_VALUE, NON_CONSTANT_VALUE_IN_INITIALIZER, OBJECT_CANNOT_EXTEND_ANOTHER_CLASS, OPTIONAL_PARAMETER_IN_OPERATOR, OVERRIDE_MISSING_NAMED_PARAMETERS, OVERRIDE_MISSING_REQUIRED_PARAMETERS, PART_OF_NON_PART, PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER, PRIVATE_OPTIONAL_PARAMETER, RECURSIVE_COMPILE_TIME_CONSTANT, RECURSIVE_FACTORY_REDIRECT, RECURSIVE_FUNCTION_TYPE_ALIAS, RECURSIVE_INTERFACE_INHERITANCE, REDIRECT_TO_NON_CONST_CONSTRUCTOR, REFERENCE_TO_DECLARED_VARIABLE_IN_INITIALIZER, RESERVED_WORD_AS_IDENTIFIER, RETHROW_OUTSIDE_CATCH, RETURN_IN_GENERATIVE_CONSTRUCTOR, STATIC_TOP_LEVEL_FUNCTION, STATIC_TOP_LEVEL_VARIABLE, SUPER_IN_INVALID_CONTEXT, SUPER_INITIALIZER_IN_OBJECT, TYPE_ARGUMENTS_FOR_NON_GENERIC_CLASS, UNDEFINED_CONSTRUCTOR_IN_INITIALIZER, UNINITIALIZED_FINAL_FIELD, URI_WITH_INTERPOLATION, WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR, WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER, WRONG_NUMBER_OF_TYPE_ARGUMENTS];
   final String __name;
   final int __ordinal;
   int get ordinal => __ordinal;
@@ -970,6 +1036,7 @@
   String get message => _message;
   ErrorType get type => ErrorType.COMPILE_TIME_ERROR;
   bool needsRecompilation() => true;
+  int compareTo(CompileTimeErrorCode other) => __ordinal - other.__ordinal;
   String toString() => __name;
 }
 /**
@@ -979,7 +1046,7 @@
  * appropriate, how the problem can be corrected.
  * @coverage dart.engine.error
  */
-class StaticWarningCode implements ErrorCode {
+class StaticWarningCode implements Comparable<StaticWarningCode>, ErrorCode {
   /**
    * 12.11.1 New: It is a static warning if the static type of <i>a<sub>i</sub>, 1 &lt;= i &lt;= n+
    * k</i> may not be assigned to the type of the corresponding formal parameter of the constructor
@@ -1243,20 +1310,31 @@
    * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a static warning if <i>C</i> does not denote a
    * class in the current scope.
    */
-  static final StaticWarningCode UNDEFINED_CLASS = new StaticWarningCode('UNDEFINED_CLASS', 42, "");
+  static final StaticWarningCode UNDEFINED_CLASS = new StaticWarningCode('UNDEFINED_CLASS', 42, "Undefined class '%s'");
   /**
    * 12.17 Getter Invocation: It is a static warning if there is no class <i>C</i> in the enclosing
    * lexical scope of <i>i</i>, or if <i>C</i> does not declare, implicitly or explicitly, a getter
    * named <i>m</i>.
+   * @param getterName the name of the getter
+   * @param enclosingType the name of the enclosing type where the getter is being looked for
    */
-  static final StaticWarningCode UNDEFINED_GETTER = new StaticWarningCode('UNDEFINED_GETTER', 43, "");
+  static final StaticWarningCode UNDEFINED_GETTER = new StaticWarningCode('UNDEFINED_GETTER', 43, "There is no such getter '%s' in '%s'");
   /**
    * 12.30 Identifier Reference: It is as static warning if an identifier expression of the form
    * <i>id</i> occurs inside a top level or static function (be it function, method, getter, or
    * setter) or variable initializer and there is no declaration <i>d</i> with name <i>id</i> in the
    * lexical scope enclosing the expression.
    */
-  static final StaticWarningCode UNDEFINED_IDENTIFIER = new StaticWarningCode('UNDEFINED_IDENTIFIER', 44, "");
+  static final StaticWarningCode UNDEFINED_IDENTIFIER = new StaticWarningCode('UNDEFINED_IDENTIFIER', 44, "Undefined name '%s'");
+  /**
+   * 12.30 Identifier Reference: It is as static warning if an identifier expression of the form
+   * <i>id</i> occurs inside a top level or static function (be it function, method, getter, or
+   * setter) or variable initializer and there is no declaration <i>d</i> with name <i>id</i> in the
+   * lexical scope enclosing the expression.
+   * @param operator the name of the operator
+   * @param enclosingType the name of the enclosing type where the operator is being looked for
+   */
+  static final StaticWarningCode UNDEFINED_OPERATOR = new StaticWarningCode('UNDEFINED_OPERATOR', 45, "There is no such operator '%s' in '%s'");
   /**
    * 12.18 Assignment: It is as static warning if an assignment of the form <i>v = e</i> occurs
    * inside a top level or static function (be it function, method, getter, or setter) or variable
@@ -1266,14 +1344,18 @@
    * 12.18 Assignment: It is a static warning if there is no class <i>C</i> in the enclosing lexical
    * scope of the assignment, or if <i>C</i> does not declare, implicitly or explicitly, a setter
    * <i>v=</i>.
+   * @param setterName the name of the getter
+   * @param enclosingType the name of the enclosing type where the setter is being looked for
    */
-  static final StaticWarningCode UNDEFINED_SETTER = new StaticWarningCode('UNDEFINED_SETTER', 45, "");
+  static final StaticWarningCode UNDEFINED_SETTER = new StaticWarningCode('UNDEFINED_SETTER', 46, "There is no such setter '%s' in '%s'");
   /**
    * 12.15.3 Static Invocation: It is a static warning if <i>C</i> does not declare a static method
    * or getter <i>m</i>.
+   * @param methodName the name of the method
+   * @param enclosingType the name of the enclosing type where the method is being looked for
    */
-  static final StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER = new StaticWarningCode('UNDEFINED_STATIC_METHOD_OR_GETTER', 46, "");
-  static final List<StaticWarningCode> values = [ARGUMENT_TYPE_NOT_ASSIGNABLE, ASSIGNMENT_TO_FINAL, CASE_BLOCK_NOT_TERMINATED, CAST_TO_NON_TYPE, COMMENT_REFERENCE_CONSTRUCTOR_NOT_VISIBLE, COMMENT_REFERENCE_IDENTIFIER_NOT_VISIBLE, COMMENT_REFERENCE_UNDECLARED_CONSTRUCTOR, COMMENT_REFERENCE_UNDECLARED_IDENTIFIER, COMMENT_REFERENCE_URI_NOT_LIBRARY, CONCRETE_CLASS_WITH_ABSTRACT_MEMBER, CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER, CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER, CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER, CONFLICTING_STATIC_SETTER_AND_INSTANCE_GETTER, CONST_WITH_ABSTRACT_CLASS, EQUAL_KEYS_IN_MAP, FIELD_INITIALIZER_WITH_INVALID_TYPE, INCORRECT_NUMBER_OF_ARGUMENTS, INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC, INVALID_FACTORY_NAME, INVALID_OVERRIDE_GETTER_TYPE, INVALID_OVERRIDE_RETURN_TYPE, INVALID_OVERRIDE_SETTER_RETURN_TYPE, INVOCATION_OF_NON_FUNCTION, MISMATCHED_GETTER_AND_SETTER_TYPES, NEW_WITH_ABSTRACT_CLASS, NEW_WITH_NON_TYPE, NEW_WITH_UNDEFINED_CONSTRUCTOR, NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER, NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_METHOD, NON_TYPE, NON_TYPE_IN_CATCH_CLAUSE, NON_VOID_RETURN_FOR_OPERATOR, NON_VOID_RETURN_FOR_SETTER, OVERRIDE_NOT_SUBTYPE, OVERRIDE_WITH_DIFFERENT_DEFAULT, PART_OF_DIFFERENT_LIBRARY, REDIRECT_TO_INVALID_RETURN_TYPE, REDIRECT_TO_MISSING_CONSTRUCTOR, REDIRECT_TO_NON_CLASS, RETURN_WITHOUT_VALUE, SWITCH_EXPRESSION_NOT_ASSIGNABLE, UNDEFINED_CLASS, UNDEFINED_GETTER, UNDEFINED_IDENTIFIER, UNDEFINED_SETTER, UNDEFINED_STATIC_METHOD_OR_GETTER];
+  static final StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER = new StaticWarningCode('UNDEFINED_STATIC_METHOD_OR_GETTER', 47, "There is no such static method '%s' in '%s'");
+  static final List<StaticWarningCode> values = [ARGUMENT_TYPE_NOT_ASSIGNABLE, ASSIGNMENT_TO_FINAL, CASE_BLOCK_NOT_TERMINATED, CAST_TO_NON_TYPE, COMMENT_REFERENCE_CONSTRUCTOR_NOT_VISIBLE, COMMENT_REFERENCE_IDENTIFIER_NOT_VISIBLE, COMMENT_REFERENCE_UNDECLARED_CONSTRUCTOR, COMMENT_REFERENCE_UNDECLARED_IDENTIFIER, COMMENT_REFERENCE_URI_NOT_LIBRARY, CONCRETE_CLASS_WITH_ABSTRACT_MEMBER, CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER, CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER, CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER, CONFLICTING_STATIC_SETTER_AND_INSTANCE_GETTER, CONST_WITH_ABSTRACT_CLASS, EQUAL_KEYS_IN_MAP, FIELD_INITIALIZER_WITH_INVALID_TYPE, INCORRECT_NUMBER_OF_ARGUMENTS, INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC, INVALID_FACTORY_NAME, INVALID_OVERRIDE_GETTER_TYPE, INVALID_OVERRIDE_RETURN_TYPE, INVALID_OVERRIDE_SETTER_RETURN_TYPE, INVOCATION_OF_NON_FUNCTION, MISMATCHED_GETTER_AND_SETTER_TYPES, NEW_WITH_ABSTRACT_CLASS, NEW_WITH_NON_TYPE, NEW_WITH_UNDEFINED_CONSTRUCTOR, NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER, NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_METHOD, NON_TYPE, NON_TYPE_IN_CATCH_CLAUSE, NON_VOID_RETURN_FOR_OPERATOR, NON_VOID_RETURN_FOR_SETTER, OVERRIDE_NOT_SUBTYPE, OVERRIDE_WITH_DIFFERENT_DEFAULT, PART_OF_DIFFERENT_LIBRARY, REDIRECT_TO_INVALID_RETURN_TYPE, REDIRECT_TO_MISSING_CONSTRUCTOR, REDIRECT_TO_NON_CLASS, RETURN_WITHOUT_VALUE, SWITCH_EXPRESSION_NOT_ASSIGNABLE, UNDEFINED_CLASS, UNDEFINED_GETTER, UNDEFINED_IDENTIFIER, UNDEFINED_OPERATOR, UNDEFINED_SETTER, UNDEFINED_STATIC_METHOD_OR_GETTER];
   final String __name;
   final int __ordinal;
   int get ordinal => __ordinal;
@@ -1292,6 +1374,7 @@
   String get message => _message;
   ErrorType get type => ErrorType.STATIC_WARNING;
   bool needsRecompilation() => true;
+  int compareTo(StaticWarningCode other) => __ordinal - other.__ordinal;
   String toString() => __name;
 }
 /**
@@ -1300,11 +1383,19 @@
  */
 abstract class AnalysisErrorListener {
   /**
+   * An error listener that ignores errors that are reported to it.
+   */
+  AnalysisErrorListener _NULL_LISTENER = new AnalysisErrorListener_4();
+  /**
    * This method is invoked when an error has been found by the analysis engine.
    * @param error the error that was just found (not {@code null})
    */
   void onError(AnalysisError error);
 }
+class AnalysisErrorListener_4 implements AnalysisErrorListener {
+  void onError(AnalysisError event) {
+  }
+}
 /**
  * The enumeration {@code StaticTypeWarningCode} defines the error codes used for static type
  * warnings. The convention for this class is for the name of the error code to indicate the problem
@@ -1312,7 +1403,7 @@
  * when appropriate, how the problem can be corrected.
  * @coverage dart.engine.error
  */
-class StaticTypeWarningCode implements ErrorCode {
+class StaticTypeWarningCode implements Comparable<StaticTypeWarningCode>, ErrorCode {
   /**
    * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type
    * warning if <i>T</i> does not have an accessible instance setter named <i>v=</i>.
@@ -1349,10 +1440,10 @@
    * <p>
    * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type
    * warning if the static type of <i>e<sub>2</sub></i> may not be assigned to <i>T</i>.
-   * @param lhsTypeName the name of the left hand side type
    * @param rhsTypeName the name of the right hand side type
+   * @param lhsTypeName the name of the left hand side type
    */
-  static final StaticTypeWarningCode INVALID_ASSIGNMENT = new StaticTypeWarningCode('INVALID_ASSIGNMENT', 2, "The type '%s' can't be assigned a '%s'");
+  static final StaticTypeWarningCode INVALID_ASSIGNMENT = new StaticTypeWarningCode('INVALID_ASSIGNMENT', 2, "A value of type '%s' cannot be assigned to a variable of type '%s'");
   /**
    * 12.14.4 Function Expression Invocation: A function expression invocation <i>i</i> has the form
    * <i>e<sub>f</sub>(a<sub>1</sub>, &hellip; a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>,
@@ -1405,8 +1496,11 @@
   /**
    * 13.11 Return: It is a static type warning if the type of <i>e</i> may not be assigned to the
    * declared return type of the immediately enclosing function.
+   * @param actualReturnType the return type as declared in the return statement
+   * @param expectedReturnType the expected return type as defined by the method
+   * @param methodName the name of the method
    */
-  static final StaticTypeWarningCode RETURN_OF_INVALID_TYPE = new StaticTypeWarningCode('RETURN_OF_INVALID_TYPE', 8, "The return type '%s' is not a '%s', as defined by the method");
+  static final StaticTypeWarningCode RETURN_OF_INVALID_TYPE = new StaticTypeWarningCode('RETURN_OF_INVALID_TYPE', 8, "The return type '%s' is not a '%s', as defined by the method '%s'");
   /**
    * 12.11 Instance Creation: It is a static type warning if any of the type arguments to a
    * constructor of a generic type <i>G</i> invoked by a new expression or a constant object
@@ -1430,16 +1524,33 @@
    */
   static final StaticTypeWarningCode TYPE_ARGUMENT_VIOLATES_BOUNDS = new StaticTypeWarningCode('TYPE_ARGUMENT_VIOLATES_BOUNDS', 10, "");
   /**
+   * Specification reference needed. This is equivalent to {@link #UNDEFINED_METHOD}, but for
+   * top-level functions.
+   * @param methodName the name of the method that is undefined
+   */
+  static final StaticTypeWarningCode UNDEFINED_FUNCTION = new StaticTypeWarningCode('UNDEFINED_FUNCTION', 11, "The FUNCTION '%s' is not defined");
+  /**
    * 12.17 Getter Invocation: Let <i>T</i> be the static type of <i>e</i>. It is a static type
    * warning if <i>T</i> does not have a getter named <i>m</i>.
+   * @param getterName the name of the getter
+   * @param enclosingType the name of the enclosing type where the getter is being looked for
    */
-  static final StaticTypeWarningCode UNDEFINED_GETTER = new StaticTypeWarningCode('UNDEFINED_GETTER', 11, "There is no such getter '%s' in '%s'");
+  static final StaticTypeWarningCode UNDEFINED_GETTER = new StaticTypeWarningCode('UNDEFINED_GETTER', 12, "There is no such getter '%s' in '%s'");
+  /**
+   * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. It is a static type
+   * warning if <i>T</i> does not have an accessible instance member named <i>m</i>.
+   * @param methodName the name of the method that is undefined
+   * @param typeName the resolved type name that the method lookup is happening on
+   */
+  static final StaticTypeWarningCode UNDEFINED_METHOD = new StaticTypeWarningCode('UNDEFINED_METHOD', 13, "The method '%s' is not defined for the class '%s'");
   /**
    * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type
    * warning if <i>T</i> does not have an accessible instance setter named <i>v=</i>.
+   * @param setterName the name of the setter
+   * @param enclosingType the name of the enclosing type where the setter is being looked for
    * @see #INACCESSIBLE_SETTER
    */
-  static final StaticTypeWarningCode UNDEFINED_SETTER = new StaticTypeWarningCode('UNDEFINED_SETTER', 12, "There is no such setter '%s' in '%s'");
+  static final StaticTypeWarningCode UNDEFINED_SETTER = new StaticTypeWarningCode('UNDEFINED_SETTER', 14, "There is no such setter '%s' in '%s'");
   /**
    * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form
    * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;
@@ -1448,16 +1559,16 @@
    * @param methodName the name of the method that is undefined
    * @param typeName the resolved type name that the method lookup is happening on
    */
-  static final StaticTypeWarningCode UNDEFINED_SUPER_METHOD = new StaticTypeWarningCode('UNDEFINED_SUPER_METHOD', 13, "There is no such method '%s' in '%s'");
+  static final StaticTypeWarningCode UNDEFINED_SUPER_METHOD = new StaticTypeWarningCode('UNDEFINED_SUPER_METHOD', 15, "There is no such method '%s' in '%s'");
   /**
    * 15.8 Parameterized Types: It is a static type warning if <i>G</i> is not an accessible generic
    * type declaration with <i>n</i> type parameters.
    * @param typeName the name of the type being referenced (<i>G</i>)
-   * @param argumentCount the number of type arguments provided
    * @param parameterCount the number of type parameters that were declared
+   * @param argumentCount the number of type arguments provided
    */
-  static final StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = new StaticTypeWarningCode('WRONG_NUMBER_OF_TYPE_ARGUMENTS', 14, "The type '%s' is declared with %d type parameters, but %d type arguments were given");
-  static final List<StaticTypeWarningCode> values = [INACCESSIBLE_SETTER, INCONSISTENT_METHOD_INHERITANCE, INVALID_ASSIGNMENT, INVOCATION_OF_NON_FUNCTION, NON_BOOL_CONDITION, NON_BOOL_EXPRESSION, NON_TYPE_AS_TYPE_ARGUMENT, REDIRECT_WITH_INVALID_TYPE_PARAMETERS, RETURN_OF_INVALID_TYPE, TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, TYPE_ARGUMENT_VIOLATES_BOUNDS, UNDEFINED_GETTER, UNDEFINED_SETTER, UNDEFINED_SUPER_METHOD, WRONG_NUMBER_OF_TYPE_ARGUMENTS];
+  static final StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = new StaticTypeWarningCode('WRONG_NUMBER_OF_TYPE_ARGUMENTS', 16, "The type '%s' is declared with %d type parameters, but %d type arguments were given");
+  static final List<StaticTypeWarningCode> values = [INACCESSIBLE_SETTER, INCONSISTENT_METHOD_INHERITANCE, INVALID_ASSIGNMENT, INVOCATION_OF_NON_FUNCTION, NON_BOOL_CONDITION, NON_BOOL_EXPRESSION, NON_TYPE_AS_TYPE_ARGUMENT, REDIRECT_WITH_INVALID_TYPE_PARAMETERS, RETURN_OF_INVALID_TYPE, TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, TYPE_ARGUMENT_VIOLATES_BOUNDS, UNDEFINED_FUNCTION, UNDEFINED_GETTER, UNDEFINED_METHOD, UNDEFINED_SETTER, UNDEFINED_SUPER_METHOD, WRONG_NUMBER_OF_TYPE_ARGUMENTS];
   final String __name;
   final int __ordinal;
   int get ordinal => __ordinal;
@@ -1476,5 +1587,6 @@
   String get message => _message;
   ErrorType get type => ErrorType.STATIC_TYPE_WARNING;
   bool needsRecompilation() => true;
+  int compareTo(StaticTypeWarningCode other) => __ordinal - other.__ordinal;
   String toString() => __name;
 }
\ No newline at end of file
diff --git a/pkg/analyzer_experimental/lib/src/generated/html.dart b/pkg/analyzer_experimental/lib/src/generated/html.dart
index 3ec31be..58f2161 100644
--- a/pkg/analyzer_experimental/lib/src/generated/html.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/html.dart
@@ -5,6 +5,7 @@
 
 import 'dart:collection';
 import 'java_core.dart';
+import 'java_engine.dart';
 import 'source.dart';
 import 'error.dart';
 import 'instrumentation.dart';
@@ -42,10 +43,10 @@
    * @param offset the offset from the beginning of the file to the first character in the token
    */
   Token.con1(TokenType type, int offset) {
-    _jtd_constructor_148_impl(type, offset);
+    _jtd_constructor_150_impl(type, offset);
   }
-  _jtd_constructor_148_impl(TokenType type, int offset) {
-    _jtd_constructor_149_impl(type, offset, type.lexeme);
+  _jtd_constructor_150_impl(TokenType type, int offset) {
+    _jtd_constructor_151_impl(type, offset, type.lexeme);
   }
   /**
    * Initialize a newly created token.
@@ -53,13 +54,13 @@
    * @param offset the offset from the beginning of the file to the first character in the token
    * @param value the lexeme represented by this token (not {@code null})
    */
-  Token.con2(TokenType type4, int offset3, String value7) {
-    _jtd_constructor_149_impl(type4, offset3, value7);
+  Token.con2(TokenType type2, int offset2, String value2) {
+    _jtd_constructor_151_impl(type2, offset2, value2);
   }
-  _jtd_constructor_149_impl(TokenType type4, int offset3, String value7) {
-    this._type = type4;
-    this._value = value7;
-    this._offset = offset3;
+  _jtd_constructor_151_impl(TokenType type2, int offset2, String value2) {
+    this._type = type2;
+    this._value = StringUtilities.intern(value2);
+    this._offset = offset2;
   }
   /**
    * Return the offset from the beginning of the file to the character after last character of the
@@ -134,7 +135,7 @@
    * The unit containing the parsed information (not {@code null}).
    */
   HtmlUnit _unit;
-  HtmlParseResult(Token token, List<int> lineStarts, HtmlUnit unit) : super(token, lineStarts) {
+  HtmlParseResult(int modificationTime, Token token, List<int> lineStarts, HtmlUnit unit) : super(modificationTime, token, lineStarts) {
     this._unit = unit;
   }
   /**
@@ -204,12 +205,12 @@
    * @return the number of characters in the node's source range
    */
   int get length {
-    Token beginToken4 = beginToken;
-    Token endToken4 = endToken;
-    if (beginToken4 == null || endToken4 == null) {
+    Token beginToken2 = beginToken;
+    Token endToken2 = endToken;
+    if (beginToken2 == null || endToken2 == null) {
       return -1;
     }
-    return endToken4.offset + endToken4.length - beginToken4.offset;
+    return endToken2.offset + endToken2.length - beginToken2.offset;
   }
   /**
    * Return the offset from the beginning of the file to the first character in the node's source
@@ -218,8 +219,8 @@
    * range
    */
   int get offset {
-    Token beginToken5 = beginToken;
-    if (beginToken5 == null) {
+    Token beginToken2 = beginToken;
+    if (beginToken2 == null) {
       return -1;
     }
     return beginToken.offset;
@@ -232,6 +233,11 @@
    * @return the parent of this node, or {@code null} if none
    */
   XmlNode get parent => _parent;
+  String toString() {
+    PrintStringWriter writer = new PrintStringWriter();
+    accept(new ToSourceVisitor(writer));
+    return writer.toString();
+  }
   /**
    * Use the given visitor to visit all of the children of this node. The children will be visited
    * in source order.
@@ -243,12 +249,13 @@
    * @param children the nodes that will become the children of this node
    * @return the nodes that were made children of this node
    */
-  List<XmlNode> becomeParentOf(List<XmlNode> children) {
+  List becomeParentOf(List children) {
     if (children != null) {
-      for (JavaIterator<XmlNode> iter = new JavaIterator(children); iter.hasNext;) {
+      for (JavaIterator iter = new JavaIterator(children); iter.hasNext;) {
         XmlNode node = iter.next();
         node.parent = this;
       }
+      return new List.from(children);
     }
     return children;
   }
@@ -548,6 +555,10 @@
  */
 class HtmlScanResult {
   /**
+   * The time at which the contents of the source were last set.
+   */
+  int _modificationTime = 0;
+  /**
    * The first token in the token stream (not {@code null}).
    */
   Token _token;
@@ -555,7 +566,8 @@
    * The line start information that was produced.
    */
   List<int> _lineStarts;
-  HtmlScanResult(Token token, List<int> lineStarts) {
+  HtmlScanResult(int modificationTime, Token token, List<int> lineStarts) {
+    this._modificationTime = modificationTime;
     this._token = token;
     this._lineStarts = lineStarts;
   }
@@ -565,6 +577,11 @@
    */
   List<int> get lineStarts => _lineStarts;
   /**
+   * Return the time at which the contents of the source were last set.
+   * @return the time at which the contents of the source were last set
+   */
+  int get modificationTime => _modificationTime;
+  /**
    * Answer the first token in the token stream.
    * @return the token (not {@code null})
    */
@@ -599,8 +616,8 @@
     this._charOffset = -1;
   }
   int get offset => _charOffset;
-  void set offset(int offset12) {
-    _charOffset = offset12;
+  void set offset(int offset2) {
+    _charOffset = offset2;
   }
   int advance() {
     if (++_charOffset < _stringLength) {
@@ -662,11 +679,80 @@
   }
 }
 /**
+ * Instances of the class {@code ToSourceVisitor} write a source representation of a visited XML
+ * node (and all of it's children) to a writer.
+ * @coverage dart.engine.html
+ */
+class ToSourceVisitor implements XmlVisitor<Object> {
+  /**
+   * The writer to which the source is to be written.
+   */
+  PrintWriter _writer;
+  /**
+   * Initialize a newly created visitor to write source code representing the visited nodes to the
+   * given writer.
+   * @param writer the writer to which the source is to be written
+   */
+  ToSourceVisitor(PrintWriter writer) {
+    this._writer = writer;
+  }
+  Object visitHtmlUnit(HtmlUnit node) {
+    for (XmlTagNode child in node.tagNodes) {
+      visit(child);
+    }
+    return null;
+  }
+  Object visitXmlAttributeNode(XmlAttributeNode node) {
+    String name2 = node.name.lexeme;
+    Token value2 = node.value;
+    if (name2.length == 0) {
+      _writer.print("__");
+    } else {
+      _writer.print(name2);
+    }
+    _writer.print("=");
+    if (value2 == null) {
+      _writer.print("__");
+    } else {
+      _writer.print(value2.lexeme);
+    }
+    return null;
+  }
+  Object visitXmlTagNode(XmlTagNode node) {
+    _writer.print("<");
+    String tagName = node.tag.lexeme;
+    _writer.print(tagName);
+    for (XmlAttributeNode attribute in node.attributes) {
+      _writer.print(" ");
+      visit(attribute);
+    }
+    _writer.print(node.attributeEnd.lexeme);
+    if (node.closingTag != null) {
+      for (XmlTagNode child in node.tagNodes) {
+        visit(child);
+      }
+      _writer.print("</");
+      _writer.print(tagName);
+      _writer.print(">");
+    }
+    return null;
+  }
+  /**
+   * Safely visit the given node.
+   * @param node the node to be visited
+   */
+  void visit(XmlNode node) {
+    if (node != null) {
+      node.accept(this);
+    }
+  }
+}
+/**
  * The enumeration {@code TokenType} defines the types of tokens that can be returned by the
  * scanner.
  * @coverage dart.engine.html
  */
-class TokenType {
+class TokenType implements Comparable<TokenType> {
   /**
    * The type of the token that marks the end of the input.
    */
@@ -700,6 +786,7 @@
    * @return the lexeme that defines this type of token
    */
   String get lexeme => _lexeme;
+  int compareTo(TokenType other) => __ordinal - other.__ordinal;
   String toString() => __name;
 }
 class TokenType_EOF extends TokenType {
@@ -801,6 +888,10 @@
    */
   Source _source;
   /**
+   * The time at which the contents of the source were last set.
+   */
+  int _modificationTime = 0;
+  /**
    * The scanner used to scan the source
    */
   AbstractScanner _scanner;
@@ -815,12 +906,14 @@
   HtmlScanner(Source source) {
     this._source = source;
   }
-  accept(CharBuffer contents) {
+  void accept(CharBuffer contents, int modificationTime2) {
+    this._modificationTime = modificationTime2;
     _scanner = new CharBufferScanner(_source, contents);
     _scanner.passThroughElements = _SCRIPT_TAG;
     _token = _scanner.tokenize();
   }
-  void accept2(String contents) {
+  void accept2(String contents, int modificationTime2) {
+    this._modificationTime = modificationTime2;
     _scanner = new StringScanner(_source, contents);
     _scanner.passThroughElements = _SCRIPT_TAG;
     _token = _scanner.tokenize();
@@ -829,7 +922,7 @@
    * Answer the result of scanning the source
    * @return the result (not {@code null})
    */
-  HtmlScanResult get result => new HtmlScanResult(_token, _scanner.lineStarts);
+  HtmlScanResult get result => new HtmlScanResult(_modificationTime, _token, _scanner.lineStarts);
 }
 /**
  * Instances of the class {@code XmlParser} are used to parse tokens into a AST structure comprised
@@ -936,8 +1029,8 @@
    * @return a collection of zero or more attributes (not {@code null}, contains no {@code null}s)
    */
   List<XmlAttributeNode> parseAttributes() {
-    TokenType type11 = _currentToken.type;
-    if (identical(type11, TokenType.GT) || identical(type11, TokenType.SLASH_GT) || identical(type11, TokenType.EOF)) {
+    TokenType type2 = _currentToken.type;
+    if (identical(type2, TokenType.GT) || identical(type2, TokenType.SLASH_GT) || identical(type2, TokenType.EOF)) {
       return XmlTagNode.NO_ATTRIBUTES;
     }
     List<XmlAttributeNode> attributes = new List<XmlAttributeNode>();
@@ -961,8 +1054,8 @@
    * @return a list of nodes (not {@code null}, contains no {@code null}s)
    */
   List<XmlTagNode> parseChildTagNodes() {
-    TokenType type12 = _currentToken.type;
-    if (identical(type12, TokenType.LT_SLASH) || identical(type12, TokenType.EOF)) {
+    TokenType type2 = _currentToken.type;
+    if (identical(type2, TokenType.LT_SLASH) || identical(type2, TokenType.EOF)) {
       return XmlTagNode.NO_TAG_NODES;
     }
     List<XmlTagNode> nodes = new List<XmlTagNode>();
@@ -1122,9 +1215,9 @@
   XmlTagNode(Token nodeStart, Token tag, List<XmlAttributeNode> attributes, Token attributeEnd, List<XmlTagNode> tagNodes, Token contentEnd, Token closingTag, Token nodeEnd) {
     this._nodeStart = nodeStart;
     this._tag = tag;
-    this._attributes = becomeParentOf(attributes);
+    this._attributes = becomeParentOfEmpty(attributes, NO_ATTRIBUTES);
     this._attributeEnd = attributeEnd;
-    this._tagNodes = becomeParentOf(tagNodes);
+    this._tagNodes = becomeParentOfEmpty(tagNodes, NO_TAG_NODES);
     this._contentEnd = contentEnd;
     this._closingTag = closingTag;
     this._nodeEnd = nodeEnd;
@@ -1234,6 +1327,15 @@
       node.accept(visitor);
     }
   }
+  /**
+   * Same as {@link #becomeParentOf(List)}, but returns given "ifEmpty" if "children" is empty
+   */
+  List becomeParentOfEmpty(List children, List ifEmpty) {
+    if (children != null && children.isEmpty) {
+      return ifEmpty;
+    }
+    return becomeParentOf(children);
+  }
 }
 /**
  * Instances of the class {@code HtmlParser} are used to parse tokens into a AST structure comprised
@@ -1257,7 +1359,7 @@
     Token firstToken = scanResult.token;
     List<XmlTagNode> tagNodes = parseTopTagNodes(firstToken);
     HtmlUnit unit = new HtmlUnit(firstToken, tagNodes, currentToken);
-    return new HtmlParseResult(firstToken, scanResult.lineStarts, unit);
+    return new HtmlParseResult(scanResult.modificationTime, firstToken, scanResult.lineStarts, unit);
   }
   /**
    * Scan then parse the specified source.
@@ -1322,8 +1424,8 @@
    * Set the element associated with this HTML unit.
    * @param element the element
    */
-  void set element(HtmlElementImpl element18) {
-    this._element = element18;
+  void set element(HtmlElementImpl element2) {
+    this._element = element2;
   }
   void visitChildren(XmlVisitor<Object> visitor) {
     for (XmlTagNode node in _tagNodes) {
diff --git a/pkg/analyzer_experimental/lib/src/generated/instrumentation.dart b/pkg/analyzer_experimental/lib/src/generated/instrumentation.dart
index 1de88d7..29c963d 100644
--- a/pkg/analyzer_experimental/lib/src/generated/instrumentation.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/instrumentation.dart
@@ -34,12 +34,12 @@
   /**
    * A builder that will silently ignore all data and logging requests.
    */
-  static InstrumentationBuilder _NULL_INSTRUMENTATION_BUILDER = new InstrumentationBuilder_9();
+  static InstrumentationBuilder _NULL_INSTRUMENTATION_BUILDER = new InstrumentationBuilder_13();
   /**
    * An instrumentation logger that can be used when no other instrumentation logger has been
    * configured. This logger will silently ignore all data and logging requests.
    */
-  static InstrumentationLogger _NULL_LOGGER = new InstrumentationLogger_10();
+  static InstrumentationLogger _NULL_LOGGER = new InstrumentationLogger_14();
   /**
    * The current instrumentation logger.
    */
@@ -57,16 +57,26 @@
    */
   static InstrumentationBuilder builder2(String name) => _CURRENT_LOGGER.createBuilder(name);
   /**
+   * Get the currently active instrumentation logger
+   */
+  static InstrumentationLogger get logger => _CURRENT_LOGGER;
+  /**
    * Return a builder that will silently ignore all data and logging requests.
    * @return the builder (not {@code null})
    */
   static InstrumentationBuilder get nullBuilder => _NULL_INSTRUMENTATION_BUILDER;
   /**
+   * Is this instrumentation system currently configured to drop instrumentation data provided to
+   * it?
+   * @return
+   */
+  static bool isNullLogger() => identical(_CURRENT_LOGGER, _NULL_LOGGER);
+  /**
    * Set the logger that should receive instrumentation information to the given logger.
    * @param logger the logger that should receive instrumentation information
    */
-  static void set logger(InstrumentationLogger logger3) {
-    _CURRENT_LOGGER = logger3 == null ? _NULL_LOGGER : logger3;
+  static void set logger(InstrumentationLogger logger2) {
+    _CURRENT_LOGGER = logger2 == null ? _NULL_LOGGER : logger2;
   }
   /**
    * Prevent the creation of instances of this class
@@ -74,7 +84,7 @@
   Instrumentation() {
   }
 }
-class InstrumentationBuilder_9 implements InstrumentationBuilder {
+class InstrumentationBuilder_13 implements InstrumentationBuilder {
   InstrumentationBuilder data(String name, bool value) => this;
   InstrumentationBuilder data2(String name, int value) => this;
   InstrumentationBuilder data3(String name, String value) => this;
@@ -86,8 +96,9 @@
   InstrumentationBuilder metric2(String name, int value) => this;
   InstrumentationBuilder metric3(String name, String value) => this;
   InstrumentationBuilder metric4(String name, List<String> value) => this;
+  InstrumentationBuilder record(Exception exception) => this;
 }
-class InstrumentationLogger_10 implements InstrumentationLogger {
+class InstrumentationLogger_14 implements InstrumentationLogger {
   InstrumentationBuilder createBuilder(String name) => Instrumentation._NULL_INSTRUMENTATION_BUILDER;
 }
 /**
@@ -181,6 +192,14 @@
    * @return this builder
    */
   InstrumentationBuilder metric4(String name, List<String> value);
+  /**
+   * Append the given exception to the information being collected by this builder. The exception's
+   * class name is captured using {@link #metric(String,String)}. Other aspects of the exception
+   * may contain either user identifiable or contains user intellectual property (but is not
+   * guaranteed to contain either) and thus are captured using the various data methods such as{@link #data(String,String)}.
+   * @param exception the exception (may be {@code null})
+   */
+  InstrumentationBuilder record(Exception exception);
 }
 /**
  * The instrumentation recording level representing (1) recording {@link #EVERYTHING} recording of
@@ -188,7 +207,7 @@
  * turned {@link #OFF} in which case nothing is recorded.
  * @coverage dart.engine.utilities
  */
-class InstrumentationLevel {
+class InstrumentationLevel implements Comparable<InstrumentationLevel> {
   /**
    * Recording all instrumented information
    */
@@ -219,6 +238,7 @@
   }
   InstrumentationLevel(this.__name, this.__ordinal) {
   }
+  int compareTo(InstrumentationLevel other) => __ordinal - other.__ordinal;
   String toString() => __name;
 }
 /**
diff --git a/pkg/analyzer_experimental/lib/src/generated/java_core.dart b/pkg/analyzer_experimental/lib/src/generated/java_core.dart
index d90e510..0c40a7e 100644
--- a/pkg/analyzer_experimental/lib/src/generated/java_core.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/java_core.dart
@@ -42,6 +42,11 @@
   if (oTypeName == "${tTypeName}Impl") {
     return true;
   }
+  if (tTypeName == "MethodElement") {
+    if (oTypeName == "MethodMember") {
+      return true;
+    }
+  }
   if (tTypeName == "ExecutableElement") {
     if (oTypeName == "MethodElementImpl" || oTypeName == "FunctionElementImpl") {
       return true;
@@ -171,13 +176,13 @@
 abstract class PrintWriter {
   void print(x);
 
-  void println() {
+  void newLine() {
     this.print('\n');
   }
 
-  void printlnObject(String s) {
+  void println(String s) {
     this.print(s);
-    this.println();
+    this.newLine();
   }
 
   void printf(String fmt, List args) {
@@ -291,6 +296,10 @@
     elements.addAll(iterable);
   }
 
+  void setAll(int index, Iterable<E> iterable) {
+    elements.setAll(iterable);
+  }
+
   void sort([int compare(E a, E b)]) {
     elements.sort(compare);
   }
@@ -303,6 +312,10 @@
     elements.insert(index, element);
   }
 
+  void insertAll(int index, Iterable<E> iterable) {
+    elements.insertAll(index, iterable);
+  }
+
   int lastIndexOf(E element, [int start]) {
     return elements.lastIndexOf(element, start);
   }
@@ -329,16 +342,20 @@
 
   List<E> getRange(int start, int length) => sublist(start, start + length);
 
-  void setRange(int start, int length, List<E> from, [int startFrom]) {
-    elements.setRange(start, length, from, startFrom);
+  void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
+    elements.setRange(start, end, iterable, skipCount);
   }
 
-  void removeRange(int start, int length) {
-    elements.removeRange(start, length);
+  void removeRange(int start, int end) {
+    elements.removeRange(start, end);
   }
 
-  void insertRange(int start, int length, [E fill]) {
-    elements.insertRange(start, length, fill);
+  void replaceRange(int start, int end, Iterable<E> iterable) {
+    elements.replaceRange(start, end, iterable);
+  }
+
+  void fillRange(int start, int end, [E fillValue]) {
+    elements.fillRange(start, end, fillValue);
   }
 
   Map<int, E> asMap() {
diff --git a/pkg/analyzer_experimental/lib/src/generated/java_engine.dart b/pkg/analyzer_experimental/lib/src/generated/java_engine.dart
index 770acf5..e507ea3 100644
--- a/pkg/analyzer_experimental/lib/src/generated/java_engine.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/java_engine.dart
@@ -2,6 +2,17 @@
 
 class StringUtilities {
   static List<String> EMPTY_ARRAY = new List(0);
+  static String intern(String s) => s;
+  static String substringBefore(String str, String separator) {
+    if (str == null || str.isEmpty) {
+      return str;
+    }
+    int pos = str.indexOf(separator);
+    if (pos < 0) {
+      return str;
+    }
+    return str.substring(0, pos);
+  }
 }
 
 class FileNameUtilities {
@@ -16,3 +27,19 @@
     return "";
   }
 }
+
+class ArrayUtils {
+  static List addAll(List target, List source) {
+    List result = new List.from(target);
+    result.addAll(source);
+    return result;
+  }
+}
+
+class UUID {
+  static int __nextId = 0;
+  final String id;
+  UUID(this.id);
+  String toString() => id;
+  static UUID randomUUID() => new UUID((__nextId).toString());
+}
diff --git a/pkg/analyzer_experimental/lib/src/generated/java_junit.dart b/pkg/analyzer_experimental/lib/src/generated/java_junit.dart
index 8d284eb..2ff97ad 100644
--- a/pkg/analyzer_experimental/lib/src/generated/java_junit.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/java_junit.dart
@@ -28,6 +28,9 @@
   static void assertNotNull(x) {
     expect(x, isNotNull);
   }
+  static void assertNotNullMsg(String msg, x) {
+    expect(x, isNotNullMsg(msg));
+  }
   static void assertEquals(expected, actual) {
     expect(actual, equals(expected));
   }
@@ -110,3 +113,19 @@
     return mismatchDescription.replace(msg).add(" $item is not false");
   }
 }
+
+Matcher isNotNullMsg(String msg) => new _IsNotNullWithMessage(msg);
+class _IsNotNullWithMessage extends BaseMatcher {
+  final String msg;
+  const _IsNotNullWithMessage(this.msg);
+  bool matches(item, MatchState matchState) {
+    return item != null;
+  }
+  Description describe(Description mismatchDescription) {
+    return mismatchDescription.replace(msg);
+  }
+  Description describeMismatch(item, Description mismatchDescription,
+                               MatchState matchState, bool verbose) {
+    return mismatchDescription.replace(msg).add(" $item is null");
+  }
+}
diff --git a/pkg/analyzer_experimental/lib/src/generated/parser.dart b/pkg/analyzer_experimental/lib/src/generated/parser.dart
index 7593ab6..2c0da74 100644
--- a/pkg/analyzer_experimental/lib/src/generated/parser.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/parser.dart
@@ -6,6 +6,7 @@
 import 'dart:collection';
 import 'java_core.dart';
 import 'java_engine.dart';
+import 'instrumentation.dart';
 import 'error.dart';
 import 'source.dart';
 import 'scanner.dart';
@@ -164,29 +165,29 @@
    * Set the token representing the keyword 'abstract' to the given token.
    * @param abstractKeyword the token representing the keyword 'abstract'
    */
-  void set abstractKeyword(Token abstractKeyword4) {
-    this._abstractKeyword = abstractKeyword4;
+  void set abstractKeyword(Token abstractKeyword2) {
+    this._abstractKeyword = abstractKeyword2;
   }
   /**
    * Set the token representing the keyword 'const' to the given token.
    * @param constKeyword the token representing the keyword 'const'
    */
-  void set constKeyword(Token constKeyword3) {
-    this._constKeyword = constKeyword3;
+  void set constKeyword(Token constKeyword2) {
+    this._constKeyword = constKeyword2;
   }
   /**
    * Set the token representing the keyword 'external' to the given token.
    * @param externalKeyword the token representing the keyword 'external'
    */
-  void set externalKeyword(Token externalKeyword5) {
-    this._externalKeyword = externalKeyword5;
+  void set externalKeyword(Token externalKeyword2) {
+    this._externalKeyword = externalKeyword2;
   }
   /**
    * Set the token representing the keyword 'factory' to the given token.
    * @param factoryKeyword the token representing the keyword 'factory'
    */
-  void set factoryKeyword(Token factoryKeyword3) {
-    this._factoryKeyword = factoryKeyword3;
+  void set factoryKeyword(Token factoryKeyword2) {
+    this._factoryKeyword = factoryKeyword2;
   }
   /**
    * Set the token representing the keyword 'final' to the given token.
@@ -268,6 +269,7 @@
   static String _OF = "of";
   static String _ON = "on";
   static String _SHOW = "show";
+  static String _NATIVE = "native";
   /**
    * Initialize a newly created parser.
    * @param source the source being parsed
@@ -284,8 +286,13 @@
    * @return the compilation unit that was parsed
    */
   CompilationUnit parseCompilationUnit(Token token) {
-    _currentToken = token;
-    return parseCompilationUnit2();
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engine.Parser.parseCompilationUnit");
+    try {
+      _currentToken = token;
+      return parseCompilationUnit2();
+    } finally {
+      instrumentation.log();
+    }
   }
   /**
    * Parse an expression, starting with the given token.
@@ -294,8 +301,13 @@
    * recognizable expression
    */
   Expression parseExpression(Token token) {
-    _currentToken = token;
-    return parseExpression2();
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engine.Parser.parseExpression");
+    try {
+      _currentToken = token;
+      return parseExpression2();
+    } finally {
+      instrumentation.log();
+    }
   }
   /**
    * Parse a statement, starting with the given token.
@@ -304,8 +316,13 @@
    * recognizable statement
    */
   Statement parseStatement(Token token) {
-    _currentToken = token;
-    return parseStatement2();
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engine.Parser.parseStatement");
+    try {
+      _currentToken = token;
+      return parseStatement2();
+    } finally {
+      instrumentation.log();
+    }
   }
   /**
    * Parse a sequence of statements, starting with the given token.
@@ -314,8 +331,13 @@
    * recognizable sequence of statements
    */
   List<Statement> parseStatements(Token token) {
-    _currentToken = token;
-    return parseStatements2();
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engine.Parser.parseStatements");
+    try {
+      _currentToken = token;
+      return parseStatements2();
+    } finally {
+      instrumentation.log();
+    }
   }
   void set currentToken(Token currentToken2) {
     this._currentToken = currentToken2;
@@ -385,17 +407,22 @@
    * Create a synthetic identifier.
    * @return the synthetic identifier that was created
    */
-  SimpleIdentifier createSyntheticIdentifier() => new SimpleIdentifier.full(createSyntheticToken(TokenType.IDENTIFIER));
+  SimpleIdentifier createSyntheticIdentifier() => new SimpleIdentifier.full(createSyntheticToken2(TokenType.IDENTIFIER));
   /**
    * Create a synthetic string literal.
    * @return the synthetic string literal that was created
    */
-  SimpleStringLiteral createSyntheticStringLiteral() => new SimpleStringLiteral.full(createSyntheticToken(TokenType.STRING), "");
+  SimpleStringLiteral createSyntheticStringLiteral() => new SimpleStringLiteral.full(createSyntheticToken2(TokenType.STRING), "");
+  /**
+   * Create a synthetic token representing the given keyword.
+   * @return the synthetic token that was created
+   */
+  Token createSyntheticToken(Keyword keyword) => new KeywordToken_11(keyword, _currentToken.offset);
   /**
    * Create a synthetic token with the given type.
    * @return the synthetic token that was created
    */
-  Token createSyntheticToken(TokenType type) => new StringToken(type, "", _currentToken.offset);
+  Token createSyntheticToken2(TokenType type) => new StringToken(type, "", _currentToken.offset);
   /**
    * Check that the given expression is assignable and report an error if it isn't.
    * <pre>
@@ -541,8 +568,23 @@
     if (token == null) {
       return false;
     }
-    TokenType type21 = token.type;
-    return identical(type21, TokenType.EQ) || identical(type21, TokenType.COMMA) || identical(type21, TokenType.SEMICOLON) || matches3(token, Keyword.IN);
+    TokenType type2 = token.type;
+    return identical(type2, TokenType.EQ) || identical(type2, TokenType.COMMA) || identical(type2, TokenType.SEMICOLON) || matches3(token, Keyword.IN);
+  }
+  /**
+   * Return {@code true} if the given token appears to be the beginning of an operator declaration.
+   * @param startToken the token that might be the start of an operator declaration
+   * @return {@code true} if the given token appears to be the beginning of an operator declaration
+   */
+  bool isOperator(Token startToken) {
+    if (startToken.isOperator()) {
+      Token token = startToken.next;
+      while (token.isOperator()) {
+        token = token.next;
+      }
+      return matches4(token, TokenType.OPEN_PAREN);
+    }
+    return false;
   }
   /**
    * Return {@code true} if the current token appears to be the beginning of a switch member.
@@ -554,8 +596,8 @@
       token = token.next.next;
     }
     if (identical(token.type, TokenType.KEYWORD)) {
-      Keyword keyword30 = ((token as KeywordToken)).keyword;
-      return identical(keyword30, Keyword.CASE) || identical(keyword30, Keyword.DEFAULT);
+      Keyword keyword2 = ((token as KeywordToken)).keyword;
+      return identical(keyword2, Keyword.CASE) || identical(keyword2, Keyword.DEFAULT);
     }
     return false;
   }
@@ -572,8 +614,8 @@
     int firstOffset = 2147483647;
     for (Token token in tokens) {
       if (token != null) {
-        int offset5 = token.offset;
-        if (offset5 < firstOffset) {
+        int offset2 = token.offset;
+        if (offset2 < firstOffset) {
           first = token;
         }
       }
@@ -598,14 +640,14 @@
    * @param keyword the keyword that is being tested for
    * @return {@code true} if the given token matches the given keyword
    */
-  bool matches3(Token token, Keyword keyword38) => identical(token.type, TokenType.KEYWORD) && identical(((token as KeywordToken)).keyword, keyword38);
+  bool matches3(Token token, Keyword keyword2) => identical(token.type, TokenType.KEYWORD) && identical(((token as KeywordToken)).keyword, keyword2);
   /**
    * Return {@code true} if the given token has the given type.
    * @param token the token being tested
    * @param type the type of token that is being tested for
    * @return {@code true} if the given token has the given type
    */
-  bool matches4(Token token, TokenType type31) => identical(token.type, type31);
+  bool matches4(Token token, TokenType type2) => identical(token.type, type2);
   /**
    * Return {@code true} if the current token has the given type. Note that this method, unlike
    * other variants, will modify the token stream if possible to match a wider range of tokens. In
@@ -614,33 +656,33 @@
    * @param type the type of token that can optionally appear in the current location
    * @return {@code true} if the current token has the given type
    */
-  bool matches5(TokenType type32) {
+  bool matches5(TokenType type2) {
     TokenType currentType = _currentToken.type;
-    if (currentType != type32) {
-      if (identical(type32, TokenType.GT)) {
+    if (currentType != type2) {
+      if (identical(type2, TokenType.GT)) {
         if (identical(currentType, TokenType.GT_GT)) {
-          int offset6 = _currentToken.offset;
-          Token first = new Token(TokenType.GT, offset6);
-          Token second = new Token(TokenType.GT, offset6 + 1);
+          int offset2 = _currentToken.offset;
+          Token first = new Token(TokenType.GT, offset2);
+          Token second = new Token(TokenType.GT, offset2 + 1);
           second.setNext(_currentToken.next);
           first.setNext(second);
           _currentToken.previous.setNext(first);
           _currentToken = first;
           return true;
         } else if (identical(currentType, TokenType.GT_EQ)) {
-          int offset7 = _currentToken.offset;
-          Token first = new Token(TokenType.GT, offset7);
-          Token second = new Token(TokenType.EQ, offset7 + 1);
+          int offset3 = _currentToken.offset;
+          Token first = new Token(TokenType.GT, offset3);
+          Token second = new Token(TokenType.EQ, offset3 + 1);
           second.setNext(_currentToken.next);
           first.setNext(second);
           _currentToken.previous.setNext(first);
           _currentToken = first;
           return true;
         } else if (identical(currentType, TokenType.GT_GT_EQ)) {
-          int offset8 = _currentToken.offset;
-          Token first = new Token(TokenType.GT, offset8);
-          Token second = new Token(TokenType.GT, offset8 + 1);
-          Token third = new Token(TokenType.EQ, offset8 + 2);
+          int offset4 = _currentToken.offset;
+          Token first = new Token(TokenType.GT, offset4);
+          Token second = new Token(TokenType.GT, offset4 + 1);
+          Token third = new Token(TokenType.EQ, offset4 + 2);
           third.setNext(_currentToken.next);
           second.setNext(third);
           first.setNext(second);
@@ -718,7 +760,7 @@
    * Parse an annotation.
    * <pre>
    * annotation ::=
-   * '@' qualified (‘.’ identifier)? arguments?
+   * '@' qualified ('.' identifier)? arguments?
    * </pre>
    * @return the annotation that was parsed
    */
@@ -1141,8 +1183,8 @@
       members = parseClassMembers(className, ((leftBracket as BeginToken)).endToken != null);
       rightBracket = expect2(TokenType.CLOSE_CURLY_BRACKET);
     } else {
-      leftBracket = createSyntheticToken(TokenType.OPEN_CURLY_BRACKET);
-      rightBracket = createSyntheticToken(TokenType.CLOSE_CURLY_BRACKET);
+      leftBracket = createSyntheticToken2(TokenType.OPEN_CURLY_BRACKET);
+      rightBracket = createSyntheticToken2(TokenType.CLOSE_CURLY_BRACKET);
       reportError4(ParserErrorCode.MISSING_CLASS_BODY, []);
     }
     return new ClassDeclaration.full(commentAndMetadata.comment, commentAndMetadata.metadata, abstractKeyword, keyword, name, typeParameters, extendsClause, withClause, implementsClause, leftBracket, members, rightBracket);
@@ -1168,7 +1210,7 @@
       } else if (matches(Keyword.SET) && matchesIdentifier2(peek())) {
         validateModifiersForGetterOrSetterOrMethod(modifiers);
         return parseSetter(commentAndMetadata, modifiers.externalKeyword, modifiers.staticKeyword, returnType);
-      } else if (matches(Keyword.OPERATOR) && peek().isOperator()) {
+      } else if (matches(Keyword.OPERATOR) && isOperator(peek())) {
         validateModifiersForOperator(modifiers);
         return parseOperator(commentAndMetadata, modifiers.externalKeyword, returnType);
       } else if (matchesIdentifier() && matchesAny(peek(), [TokenType.OPEN_PAREN, TokenType.OPEN_CURLY_BRACKET, TokenType.FUNCTION])) {
@@ -1181,6 +1223,11 @@
             return parseInitializedIdentifierList(commentAndMetadata, modifiers.staticKeyword, validateModifiersForField(modifiers), returnType);
           }
         }
+        if (isOperator(peek())) {
+          validateModifiersForOperator(modifiers);
+          return parseOperator(commentAndMetadata, modifiers.externalKeyword, returnType);
+        }
+        reportError5(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken, []);
         return null;
       }
     } else if (matches(Keyword.GET) && matchesIdentifier2(peek())) {
@@ -1189,10 +1236,15 @@
     } else if (matches(Keyword.SET) && matchesIdentifier2(peek())) {
       validateModifiersForGetterOrSetterOrMethod(modifiers);
       return parseSetter(commentAndMetadata, modifiers.externalKeyword, modifiers.staticKeyword, null);
-    } else if (matches(Keyword.OPERATOR) && peek().isOperator() && matches4(peek2(2), TokenType.OPEN_PAREN)) {
+    } else if (matches(Keyword.OPERATOR) && isOperator(peek())) {
       validateModifiersForOperator(modifiers);
       return parseOperator(commentAndMetadata, modifiers.externalKeyword, null);
     } else if (!matchesIdentifier()) {
+      if (isOperator(peek())) {
+        validateModifiersForOperator(modifiers);
+        return parseOperator(commentAndMetadata, modifiers.externalKeyword, null);
+      }
+      reportError5(ParserErrorCode.EXPECTED_CLASS_MEMBER, _currentToken, []);
       return null;
     } else if (matches4(peek(), TokenType.PERIOD) && matchesIdentifier2(peek2(2)) && matches4(peek2(3), TokenType.OPEN_PAREN)) {
       return parseConstructor(commentAndMetadata, modifiers.externalKeyword, validateModifiersForConstructor(modifiers), modifiers.factoryKeyword, parseSimpleIdentifier(), andAdvance, parseSimpleIdentifier(), parseFormalParameterList());
@@ -1215,10 +1267,19 @@
     } else if (matches(Keyword.SET) && matchesIdentifier2(peek())) {
       validateModifiersForGetterOrSetterOrMethod(modifiers);
       return parseSetter(commentAndMetadata, modifiers.externalKeyword, modifiers.staticKeyword, type);
-    } else if (matches(Keyword.OPERATOR) && peek().isOperator() && matches4(peek2(2), TokenType.OPEN_PAREN)) {
+    } else if (matches(Keyword.OPERATOR) && isOperator(peek())) {
       validateModifiersForOperator(modifiers);
       return parseOperator(commentAndMetadata, modifiers.externalKeyword, type);
     } else if (!matchesIdentifier()) {
+      if (matches5(TokenType.CLOSE_CURLY_BRACKET)) {
+        return parseInitializedIdentifierList(commentAndMetadata, modifiers.staticKeyword, validateModifiersForField(modifiers), type);
+      }
+      if (isOperator(peek())) {
+        validateModifiersForOperator(modifiers);
+        return parseOperator(commentAndMetadata, modifiers.externalKeyword, type);
+      }
+      reportError5(ParserErrorCode.EXPECTED_CLASS_MEMBER, _currentToken, []);
+      return null;
     } else if (matches4(peek(), TokenType.OPEN_PAREN)) {
       validateModifiersForGetterOrSetterOrMethod(modifiers);
       return parseMethodDeclaration(commentAndMetadata, modifiers.externalKeyword, modifiers.staticKeyword, type);
@@ -1281,7 +1342,10 @@
       abstractKeyword = andAdvance;
     }
     TypeName superclass = parseTypeName();
-    WithClause withClause = parseWithClause();
+    WithClause withClause = null;
+    if (matches(Keyword.WITH)) {
+      withClause = parseWithClause();
+    }
     ImplementsClause implementsClause = null;
     if (matches(Keyword.IMPLEMENTS)) {
       implementsClause = parseImplementsClause();
@@ -1351,7 +1415,7 @@
     }
     try {
       List<bool> errorFound = [false];
-      AnalysisErrorListener listener = new AnalysisErrorListener_8(errorFound);
+      AnalysisErrorListener listener = new AnalysisErrorListener_12(errorFound);
       StringScanner scanner = new StringScanner(null, referenceSource, listener);
       scanner.setSourceStart(1, 1, sourceOffset);
       Token firstToken = scanner.tokenize();
@@ -1539,11 +1603,12 @@
       if ((matches(Keyword.GET) || matches(Keyword.SET)) && matchesIdentifier2(peek())) {
         validateModifiersForTopLevelFunction(modifiers);
         return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyword, null);
-      } else if (matches(Keyword.OPERATOR) && peek().isOperator()) {
+      } else if (matches(Keyword.OPERATOR) && isOperator(peek())) {
+        reportError5(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken, []);
         return null;
       } else if (matchesIdentifier() && matchesAny(peek(), [TokenType.OPEN_PAREN, TokenType.OPEN_CURLY_BRACKET, TokenType.FUNCTION])) {
         validateModifiersForTopLevelFunction(modifiers);
-        return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyword, null);
+        return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyword, returnType);
       } else {
         if (matchesIdentifier()) {
           if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEMICOLON])) {
@@ -1551,14 +1616,17 @@
             return new TopLevelVariableDeclaration.full(commentAndMetadata.comment, commentAndMetadata.metadata, parseVariableDeclarationList2(null, validateModifiersForTopLevelVariable(modifiers), null), expect2(TokenType.SEMICOLON));
           }
         }
+        reportError5(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken, []);
         return null;
       }
     } else if ((matches(Keyword.GET) || matches(Keyword.SET)) && matchesIdentifier2(peek())) {
       validateModifiersForTopLevelFunction(modifiers);
       return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyword, null);
-    } else if (matches(Keyword.OPERATOR) && peek().isOperator() && matches4(peek2(2), TokenType.OPEN_PAREN)) {
+    } else if (matches(Keyword.OPERATOR) && isOperator(peek())) {
+      reportError5(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken, []);
       return null;
     } else if (!matchesIdentifier()) {
+      reportError5(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken, []);
       return null;
     } else if (matches4(peek(), TokenType.OPEN_PAREN)) {
       validateModifiersForTopLevelFunction(modifiers);
@@ -1570,7 +1638,11 @@
     if (matches(Keyword.GET) || matches(Keyword.SET)) {
       validateModifiersForTopLevelFunction(modifiers);
       return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyword, returnType);
+    } else if (matches(Keyword.OPERATOR) && isOperator(peek())) {
+      reportError5(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken, []);
+      return null;
     } else if (!matchesIdentifier()) {
+      reportError5(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken, []);
       return null;
     }
     if (matchesAny(peek(), [TokenType.OPEN_PAREN, TokenType.FUNCTION, TokenType.OPEN_CURLY_BRACKET])) {
@@ -2038,12 +2110,6 @@
    * @return the formal parameters that were parsed
    */
   FormalParameterList parseFormalParameterList() {
-    if (matches5(TokenType.EQ) && matches4(peek(), TokenType.OPEN_PAREN)) {
-      Token previous4 = _currentToken.previous;
-      if ((matches4(previous4, TokenType.EQ_EQ) || matches4(previous4, TokenType.BANG_EQ)) && _currentToken.offset == previous4.offset + 2) {
-        advance();
-      }
-    }
     Token leftParenthesis = expect2(TokenType.OPEN_PAREN);
     if (matches5(TokenType.CLOSE_PAREN)) {
       return new FormalParameterList.full(leftParenthesis, null, null, null, andAdvance);
@@ -2067,9 +2133,10 @@
       if (firstParameter) {
         firstParameter = false;
       } else if (!optional(TokenType.COMMA)) {
-        if (((leftParenthesis as BeginToken)).endToken != null) {
+        if ((leftParenthesis is BeginToken) && ((leftParenthesis as BeginToken)).endToken != null) {
           reportError4(ParserErrorCode.EXPECTED_TOKEN, [TokenType.COMMA.lexeme]);
         } else {
+          reportError5(ParserErrorCode.MISSING_CLOSING_PARENTHESIS, _currentToken.previous, []);
           break;
         }
       }
@@ -2185,11 +2252,11 @@
           if (variableList == null) {
             reportError4(ParserErrorCode.MISSING_VARIABLE_IN_FOR_EACH, []);
           } else {
-            NodeList<VariableDeclaration> variables3 = variableList.variables;
-            if (variables3.length > 1) {
-              reportError4(ParserErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH, [variables3.length.toString()]);
+            NodeList<VariableDeclaration> variables2 = variableList.variables;
+            if (variables2.length > 1) {
+              reportError4(ParserErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH, [variables2.length.toString()]);
             }
-            VariableDeclaration variable = variables3[0];
+            VariableDeclaration variable = variables2[0];
             if (variable.initializer != null) {
               reportError4(ParserErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH, []);
             }
@@ -2255,13 +2322,13 @@
         return new ExpressionFunctionBody.full(functionDefinition, expression, semicolon);
       } else if (matches5(TokenType.OPEN_CURLY_BRACKET)) {
         return new BlockFunctionBody.full(parseBlock());
-      } else if (matches2("native")) {
-        advance();
-        parseStringLiteral();
-        return new EmptyFunctionBody.full(andAdvance);
+      } else if (matches2(_NATIVE)) {
+        Token nativeToken = andAdvance;
+        StringLiteral stringLiteral = parseStringLiteral();
+        return new NativeFunctionBody.full(nativeToken, stringLiteral, expect2(TokenType.SEMICOLON));
       } else {
         reportError4(ParserErrorCode.MISSING_FUNCTION_BODY, []);
-        return new EmptyFunctionBody.full(createSyntheticToken(TokenType.SEMICOLON));
+        return new EmptyFunctionBody.full(createSyntheticToken2(TokenType.SEMICOLON));
       }
     } finally {
       _inLoop = wasInLoop;
@@ -2337,7 +2404,7 @@
    * Parse a function expression.
    * <pre>
    * functionExpression ::=
-   * (returnType? identifier)? formalParameterList functionExpressionBody
+   * formalParameterList functionExpressionBody
    * </pre>
    * @return the function expression that was parsed
    */
@@ -2371,10 +2438,11 @@
     }
     if (matches5(TokenType.SEMICOLON) || matches5(TokenType.EOF)) {
       reportError4(ParserErrorCode.MISSING_TYPEDEF_PARAMETERS, []);
-      FormalParameterList parameters = new FormalParameterList.full(createSyntheticToken(TokenType.OPEN_PAREN), null, null, null, createSyntheticToken(TokenType.CLOSE_PAREN));
+      FormalParameterList parameters = new FormalParameterList.full(createSyntheticToken2(TokenType.OPEN_PAREN), null, null, null, createSyntheticToken2(TokenType.CLOSE_PAREN));
       Token semicolon = expect2(TokenType.SEMICOLON);
       return new FunctionTypeAlias.full(commentAndMetadata.comment, commentAndMetadata.metadata, keyword, returnType, name, typeParameters, parameters, semicolon);
     } else if (!matches5(TokenType.OPEN_PAREN)) {
+      reportError4(ParserErrorCode.MISSING_TYPEDEF_PARAMETERS, []);
       return null;
     }
     FormalParameterList parameters = parseFormalParameterList();
@@ -2643,7 +2711,7 @@
       return parseListLiteral(modifier, typeArguments);
     }
     reportError4(ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL, []);
-    return new ListLiteral.full(modifier, typeArguments, createSyntheticToken(TokenType.OPEN_SQUARE_BRACKET), null, createSyntheticToken(TokenType.CLOSE_SQUARE_BRACKET));
+    return new ListLiteral.full(modifier, typeArguments, createSyntheticToken2(TokenType.OPEN_SQUARE_BRACKET), null, createSyntheticToken2(TokenType.CLOSE_SQUARE_BRACKET));
   }
   /**
    * Parse a logical and expression.
@@ -2901,34 +2969,34 @@
       }
       return parseBlock();
     } else if (matches5(TokenType.KEYWORD) && !((_currentToken as KeywordToken)).keyword.isPseudoKeyword()) {
-      Keyword keyword31 = ((_currentToken as KeywordToken)).keyword;
-      if (identical(keyword31, Keyword.ASSERT)) {
+      Keyword keyword2 = ((_currentToken as KeywordToken)).keyword;
+      if (identical(keyword2, Keyword.ASSERT)) {
         return parseAssertStatement();
-      } else if (identical(keyword31, Keyword.BREAK)) {
+      } else if (identical(keyword2, Keyword.BREAK)) {
         return parseBreakStatement();
-      } else if (identical(keyword31, Keyword.CONTINUE)) {
+      } else if (identical(keyword2, Keyword.CONTINUE)) {
         return parseContinueStatement();
-      } else if (identical(keyword31, Keyword.DO)) {
+      } else if (identical(keyword2, Keyword.DO)) {
         return parseDoStatement();
-      } else if (identical(keyword31, Keyword.FOR)) {
+      } else if (identical(keyword2, Keyword.FOR)) {
         return parseForStatement();
-      } else if (identical(keyword31, Keyword.IF)) {
+      } else if (identical(keyword2, Keyword.IF)) {
         return parseIfStatement();
-      } else if (identical(keyword31, Keyword.RETHROW)) {
+      } else if (identical(keyword2, Keyword.RETHROW)) {
         return new ExpressionStatement.full(parseRethrowExpression(), expect2(TokenType.SEMICOLON));
-      } else if (identical(keyword31, Keyword.RETURN)) {
+      } else if (identical(keyword2, Keyword.RETURN)) {
         return parseReturnStatement();
-      } else if (identical(keyword31, Keyword.SWITCH)) {
+      } else if (identical(keyword2, Keyword.SWITCH)) {
         return parseSwitchStatement();
-      } else if (identical(keyword31, Keyword.THROW)) {
+      } else if (identical(keyword2, Keyword.THROW)) {
         return new ExpressionStatement.full(parseThrowExpression(), expect2(TokenType.SEMICOLON));
-      } else if (identical(keyword31, Keyword.TRY)) {
+      } else if (identical(keyword2, Keyword.TRY)) {
         return parseTryStatement();
-      } else if (identical(keyword31, Keyword.WHILE)) {
+      } else if (identical(keyword2, Keyword.WHILE)) {
         return parseWhileStatement();
-      } else if (identical(keyword31, Keyword.VAR) || identical(keyword31, Keyword.FINAL)) {
+      } else if (identical(keyword2, Keyword.VAR) || identical(keyword2, Keyword.FINAL)) {
         return parseVariableDeclarationStatement(commentAndMetadata);
-      } else if (identical(keyword31, Keyword.VOID)) {
+      } else if (identical(keyword2, Keyword.VOID)) {
         TypeName returnType = parseReturnType();
         if (matchesIdentifier() && matchesAny(peek(), [TokenType.OPEN_PAREN, TokenType.OPEN_CURLY_BRACKET, TokenType.FUNCTION])) {
           return parseFunctionDeclarationStatement2(commentAndMetadata, returnType);
@@ -2938,10 +3006,13 @@
               reportError(ParserErrorCode.VOID_VARIABLE, returnType, []);
               return parseVariableDeclarationStatement(commentAndMetadata);
             }
+          } else if (matches5(TokenType.CLOSE_CURLY_BRACKET)) {
+            return parseVariableDeclarationStatement2(commentAndMetadata, null, returnType);
           }
+          reportError4(ParserErrorCode.MISSING_STATEMENT, []);
           return null;
         }
-      } else if (identical(keyword31, Keyword.CONST)) {
+      } else if (identical(keyword2, Keyword.CONST)) {
         if (matchesAny(peek(), [TokenType.LT, TokenType.OPEN_CURLY_BRACKET, TokenType.OPEN_SQUARE_BRACKET, TokenType.INDEX])) {
           return new ExpressionStatement.full(parseExpression2(), expect2(TokenType.SEMICOLON));
         } else if (matches4(peek(), TokenType.IDENTIFIER)) {
@@ -2953,9 +3024,10 @@
           }
         }
         return parseVariableDeclarationStatement(commentAndMetadata);
-      } else if (identical(keyword31, Keyword.NEW) || identical(keyword31, Keyword.TRUE) || identical(keyword31, Keyword.FALSE) || identical(keyword31, Keyword.NULL) || identical(keyword31, Keyword.SUPER) || identical(keyword31, Keyword.THIS)) {
+      } else if (identical(keyword2, Keyword.NEW) || identical(keyword2, Keyword.TRUE) || identical(keyword2, Keyword.FALSE) || identical(keyword2, Keyword.NULL) || identical(keyword2, Keyword.SUPER) || identical(keyword2, Keyword.THIS)) {
         return new ExpressionStatement.full(parseExpression2(), expect2(TokenType.SEMICOLON));
       } else {
+        reportError4(ParserErrorCode.MISSING_STATEMENT, []);
         return null;
       }
     } else if (matches5(TokenType.SEMICOLON)) {
@@ -2966,7 +3038,7 @@
       return parseFunctionDeclarationStatement();
     } else if (matches5(TokenType.CLOSE_CURLY_BRACKET)) {
       reportError4(ParserErrorCode.MISSING_STATEMENT, []);
-      return new EmptyStatement.full(createSyntheticToken(TokenType.SEMICOLON));
+      return new EmptyStatement.full(createSyntheticToken2(TokenType.SEMICOLON));
     } else {
       return new ExpressionStatement.full(parseExpression2(), expect2(TokenType.SEMICOLON));
     }
@@ -3004,9 +3076,9 @@
       FormalParameterList parameters = parseFormalParameterList();
       return new FunctionTypedFormalParameter.full(commentAndMetadata.comment, commentAndMetadata.metadata, holder.type, identifier, parameters);
     }
-    TypeName type22 = holder.type;
-    if (type22 != null && matches3(type22.name.beginToken, Keyword.VOID)) {
-      reportError5(ParserErrorCode.VOID_PARAMETER, type22.name.beginToken, []);
+    TypeName type2 = holder.type;
+    if (type2 != null && matches3(type2.name.beginToken, Keyword.VOID)) {
+      reportError5(ParserErrorCode.VOID_PARAMETER, type2.name.beginToken, []);
     }
     if (thisKeyword != null) {
       return new FieldFormalParameter.full(commentAndMetadata.comment, commentAndMetadata.metadata, holder.keyword, holder.type, thisKeyword, period, identifier);
@@ -3029,11 +3101,24 @@
    * @return the operator declaration that was parsed
    */
   MethodDeclaration parseOperator(CommentAndMetadata commentAndMetadata, Token externalKeyword, TypeName returnType) {
-    Token operatorKeyword = expect(Keyword.OPERATOR);
+    Token operatorKeyword;
+    if (matches(Keyword.OPERATOR)) {
+      operatorKeyword = andAdvance;
+    } else {
+      reportError5(ParserErrorCode.MISSING_KEYWORD_OPERATOR, _currentToken, []);
+      operatorKeyword = createSyntheticToken(Keyword.OPERATOR);
+    }
     if (!_currentToken.isUserDefinableOperator()) {
       reportError4(ParserErrorCode.NON_USER_DEFINABLE_OPERATOR, [_currentToken.lexeme]);
     }
     SimpleIdentifier name = new SimpleIdentifier.full(andAdvance);
+    if (matches5(TokenType.EQ)) {
+      Token previous2 = _currentToken.previous;
+      if ((matches4(previous2, TokenType.EQ_EQ) || matches4(previous2, TokenType.BANG_EQ)) && _currentToken.offset == previous2.offset + 2) {
+        reportError4(ParserErrorCode.INVALID_OPERATOR, ["${previous2.lexeme}${_currentToken.lexeme}"]);
+        advance();
+      }
+    }
     FormalParameterList parameters = parseFormalParameterList();
     validateFormalParameterList(parameters);
     FunctionBody body = parseFunctionBody(true, false);
@@ -3524,6 +3609,7 @@
       Expression expression = parseExpression2();
       Token rightParenthesis = expect2(TokenType.CLOSE_PAREN);
       Token leftBracket = expect2(TokenType.OPEN_CURLY_BRACKET);
+      Token defaultKeyword = null;
       List<SwitchMember> members = new List<SwitchMember>();
       while (!matches5(TokenType.EOF) && !matches5(TokenType.CLOSE_CURLY_BRACKET)) {
         List<Label> labels = new List<Label>();
@@ -3543,8 +3629,14 @@
           Expression caseExpression = parseExpression2();
           Token colon = expect2(TokenType.COLON);
           members.add(new SwitchCase.full(labels, caseKeyword, caseExpression, colon, parseStatements2()));
+          if (defaultKeyword != null) {
+            reportError5(ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE, caseKeyword, []);
+          }
         } else if (matches(Keyword.DEFAULT)) {
-          Token defaultKeyword = andAdvance;
+          if (defaultKeyword != null) {
+            reportError5(ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES, peek(), []);
+          }
+          defaultKeyword = andAdvance;
           Token colon = expect2(TokenType.COLON);
           members.add(new SwitchDefault.full(labels, defaultKeyword, colon, parseStatements2()));
         } else {
@@ -3785,9 +3877,9 @@
           return new PrefixExpression.full(operator, parseUnaryExpression());
         }
         if (identical(operator.type, TokenType.MINUS_MINUS)) {
-          int offset9 = operator.offset;
-          Token firstOperator = new Token(TokenType.MINUS, offset9);
-          Token secondOperator = new Token(TokenType.MINUS, offset9 + 1);
+          int offset2 = operator.offset;
+          Token firstOperator = new Token(TokenType.MINUS, offset2);
+          Token secondOperator = new Token(TokenType.MINUS, offset2 + 1);
           secondOperator.setNext(_currentToken);
           firstOperator.setNext(secondOperator);
           operator.previous.setNext(firstOperator);
@@ -3841,8 +3933,7 @@
    * variableDeclarationList ::=
    * finalConstVarOrType variableDeclaration (',' variableDeclaration)
    * </pre>
-   * @param commentAndMetadata the metadata to be associated with the variable declaration list, or
-   * <code>null</code> if there is no attempt at parsing the comment and metadata
+   * @param commentAndMetadata the metadata to be associated with the variable declaration list, or{@code null} if there is no attempt at parsing the comment and metadata
    * @param keyword the token representing the 'final', 'const' or 'var' keyword, or {@code null} if
    * there is no keyword
    * @param type the type of the variables in the list
@@ -3863,6 +3954,8 @@
    * variableDeclarationStatement ::=
    * variableDeclarationList ';'
    * </pre>
+   * @param commentAndMetadata the metadata to be associated with the variable declaration
+   * statement, or {@code null} if there is no attempt at parsing the comment and metadata
    * @return the variable declaration statement that was parsed
    */
   VariableDeclarationStatement parseVariableDeclarationStatement(CommentAndMetadata commentAndMetadata) {
@@ -3871,6 +3964,24 @@
     return new VariableDeclarationStatement.full(variableList, semicolon);
   }
   /**
+   * Parse a variable declaration statement.
+   * <pre>
+   * variableDeclarationStatement ::=
+   * variableDeclarationList ';'
+   * </pre>
+   * @param commentAndMetadata the metadata to be associated with the variable declaration
+   * statement, or {@code null} if there is no attempt at parsing the comment and metadata
+   * @param keyword the token representing the 'final', 'const' or 'var' keyword, or {@code null} if
+   * there is no keyword
+   * @param type the type of the variables in the list
+   * @return the variable declaration statement that was parsed
+   */
+  VariableDeclarationStatement parseVariableDeclarationStatement2(CommentAndMetadata commentAndMetadata, Token keyword, TypeName type) {
+    VariableDeclarationList variableList = parseVariableDeclarationList2(commentAndMetadata, keyword, type);
+    Token semicolon = expect2(TokenType.SEMICOLON);
+    return new VariableDeclarationStatement.full(variableList, semicolon);
+  }
+  /**
    * Parse a while statement.
    * <pre>
    * whileStatement ::=
@@ -3969,15 +4080,15 @@
    */
   Token skipFinalConstVarOrType(Token startToken) {
     if (matches3(startToken, Keyword.FINAL) || matches3(startToken, Keyword.CONST)) {
-      Token next3 = startToken.next;
-      if (matchesIdentifier2(next3.next) || matches4(next3.next, TokenType.LT) || matches3(next3.next, Keyword.THIS)) {
-        return skipTypeName(next3);
+      Token next2 = startToken.next;
+      if (matchesIdentifier2(next2.next) || matches4(next2.next, TokenType.LT) || matches3(next2.next, Keyword.THIS)) {
+        return skipTypeName(next2);
       }
     } else if (matches3(startToken, Keyword.VAR)) {
       return startToken.next;
     } else if (matchesIdentifier2(startToken)) {
-      Token next4 = startToken.next;
-      if (matchesIdentifier2(next4) || matches4(next4, TokenType.LT) || matches3(next4, Keyword.THIS) || (matches4(next4, TokenType.PERIOD) && matchesIdentifier2(next4.next) && (matchesIdentifier2(next4.next.next) || matches4(next4.next.next, TokenType.LT) || matches3(next4.next.next, Keyword.THIS)))) {
+      Token next3 = startToken.next;
+      if (matchesIdentifier2(next3) || matches4(next3, TokenType.LT) || matches3(next3, Keyword.THIS) || (matches4(next3, TokenType.PERIOD) && matchesIdentifier2(next3.next) && (matchesIdentifier2(next3.next.next) || matches4(next3.next.next, TokenType.LT) || matches3(next3.next.next, Keyword.THIS)))) {
         return skipReturnType(startToken);
       }
     }
@@ -4018,20 +4129,20 @@
     if (!matches4(startToken, TokenType.OPEN_PAREN)) {
       return null;
     }
-    Token next5 = startToken.next;
-    if (matches4(next5, TokenType.CLOSE_PAREN)) {
-      return next5.next;
+    Token next2 = startToken.next;
+    if (matches4(next2, TokenType.CLOSE_PAREN)) {
+      return next2.next;
     }
-    if (matchesAny(next5, [TokenType.AT, TokenType.OPEN_SQUARE_BRACKET, TokenType.OPEN_CURLY_BRACKET]) || matches3(next5, Keyword.VOID) || (matchesIdentifier2(next5) && (matchesAny(next5.next, [TokenType.COMMA, TokenType.CLOSE_PAREN])))) {
+    if (matchesAny(next2, [TokenType.AT, TokenType.OPEN_SQUARE_BRACKET, TokenType.OPEN_CURLY_BRACKET]) || matches3(next2, Keyword.VOID) || (matchesIdentifier2(next2) && (matchesAny(next2.next, [TokenType.COMMA, TokenType.CLOSE_PAREN])))) {
       return skipPastMatchingToken(startToken);
     }
-    if (matchesIdentifier2(next5) && matches4(next5.next, TokenType.OPEN_PAREN)) {
-      Token afterParameters = skipFormalParameterList(next5.next);
+    if (matchesIdentifier2(next2) && matches4(next2.next, TokenType.OPEN_PAREN)) {
+      Token afterParameters = skipFormalParameterList(next2.next);
       if (afterParameters != null && (matchesAny(afterParameters, [TokenType.COMMA, TokenType.CLOSE_PAREN]))) {
         return skipPastMatchingToken(startToken);
       }
     }
-    Token afterType = skipFinalConstVarOrType(next5);
+    Token afterType = skipFinalConstVarOrType(next2);
     if (afterType == null) {
       return null;
     }
@@ -4131,20 +4242,20 @@
    */
   Token skipStringInterpolation(Token startToken) {
     Token token = startToken;
-    TokenType type23 = token.type;
-    while (identical(type23, TokenType.STRING_INTERPOLATION_EXPRESSION) || identical(type23, TokenType.STRING_INTERPOLATION_IDENTIFIER)) {
-      if (identical(type23, TokenType.STRING_INTERPOLATION_EXPRESSION)) {
+    TokenType type2 = token.type;
+    while (identical(type2, TokenType.STRING_INTERPOLATION_EXPRESSION) || identical(type2, TokenType.STRING_INTERPOLATION_IDENTIFIER)) {
+      if (identical(type2, TokenType.STRING_INTERPOLATION_EXPRESSION)) {
         token = token.next;
-        type23 = token.type;
+        type2 = token.type;
         int bracketNestingLevel = 1;
         while (bracketNestingLevel > 0) {
-          if (identical(type23, TokenType.EOF)) {
+          if (identical(type2, TokenType.EOF)) {
             return null;
-          } else if (identical(type23, TokenType.OPEN_CURLY_BRACKET)) {
+          } else if (identical(type2, TokenType.OPEN_CURLY_BRACKET)) {
             bracketNestingLevel++;
-          } else if (identical(type23, TokenType.CLOSE_CURLY_BRACKET)) {
+          } else if (identical(type2, TokenType.CLOSE_CURLY_BRACKET)) {
             bracketNestingLevel--;
-          } else if (identical(type23, TokenType.STRING)) {
+          } else if (identical(type2, TokenType.STRING)) {
             token = skipStringLiteral(token);
             if (token == null) {
               return null;
@@ -4152,10 +4263,10 @@
           } else {
             token = token.next;
           }
-          type23 = token.type;
+          type2 = token.type;
         }
         token = token.next;
-        type23 = token.type;
+        type2 = token.type;
       } else {
         token = token.next;
         if (token.type != TokenType.IDENTIFIER) {
@@ -4163,10 +4274,10 @@
         }
         token = token.next;
       }
-      type23 = token.type;
-      if (identical(type23, TokenType.STRING)) {
+      type2 = token.type;
+      if (identical(type2, TokenType.STRING)) {
         token = token.next;
-        type23 = token.type;
+        type2 = token.type;
       }
     }
     return token;
@@ -4189,8 +4300,8 @@
     Token token = startToken;
     while (token != null && matches4(token, TokenType.STRING)) {
       token = token.next;
-      TokenType type24 = token.type;
-      if (identical(type24, TokenType.STRING_INTERPOLATION_EXPRESSION) || identical(type24, TokenType.STRING_INTERPOLATION_IDENTIFIER)) {
+      TokenType type2 = token.type;
+      if (identical(type2, TokenType.STRING_INTERPOLATION_EXPRESSION) || identical(type2, TokenType.STRING_INTERPOLATION_IDENTIFIER)) {
         token = skipStringInterpolation(token);
       }
     }
@@ -4279,36 +4390,36 @@
       return null;
     }
     int depth = 1;
-    Token next6 = startToken.next;
+    Token next2 = startToken.next;
     while (depth > 0) {
-      if (matches4(next6, TokenType.EOF)) {
+      if (matches4(next2, TokenType.EOF)) {
         return null;
-      } else if (matches4(next6, TokenType.LT)) {
+      } else if (matches4(next2, TokenType.LT)) {
         depth++;
-      } else if (matches4(next6, TokenType.GT)) {
+      } else if (matches4(next2, TokenType.GT)) {
         depth--;
-      } else if (matches4(next6, TokenType.GT_EQ)) {
+      } else if (matches4(next2, TokenType.GT_EQ)) {
         if (depth == 1) {
-          Token fakeEquals = new Token(TokenType.EQ, next6.offset + 2);
-          fakeEquals.setNextWithoutSettingPrevious(next6.next);
+          Token fakeEquals = new Token(TokenType.EQ, next2.offset + 2);
+          fakeEquals.setNextWithoutSettingPrevious(next2.next);
           return fakeEquals;
         }
         depth--;
-      } else if (matches4(next6, TokenType.GT_GT)) {
+      } else if (matches4(next2, TokenType.GT_GT)) {
         depth -= 2;
-      } else if (matches4(next6, TokenType.GT_GT_EQ)) {
+      } else if (matches4(next2, TokenType.GT_GT_EQ)) {
         if (depth < 2) {
           return null;
         } else if (depth == 2) {
-          Token fakeEquals = new Token(TokenType.EQ, next6.offset + 2);
-          fakeEquals.setNextWithoutSettingPrevious(next6.next);
+          Token fakeEquals = new Token(TokenType.EQ, next2.offset + 2);
+          fakeEquals.setNextWithoutSettingPrevious(next2.next);
           return fakeEquals;
         }
         depth -= 2;
       }
-      next6 = next6.next;
+      next2 = next2.next;
     }
-    return next6;
+    return next2;
   }
   /**
    * Translate the characters at the given index in the given string, appending the translated
@@ -4324,10 +4435,10 @@
       builder.appendChar(currentChar);
       return index + 1;
     }
-    int length8 = lexeme.length;
+    int length2 = lexeme.length;
     int currentIndex = index + 1;
-    if (currentIndex >= length8) {
-      return length8;
+    if (currentIndex >= length2) {
+      return length2;
     }
     currentChar = lexeme.codeUnitAt(currentIndex);
     if (currentChar == 0x6E) {
@@ -4343,9 +4454,9 @@
     } else if (currentChar == 0x76) {
       builder.appendChar(0xB);
     } else if (currentChar == 0x78) {
-      if (currentIndex + 2 >= length8) {
+      if (currentIndex + 2 >= length2) {
         reportError4(ParserErrorCode.INVALID_HEX_ESCAPE, []);
-        return length8;
+        return length2;
       }
       int firstDigit = lexeme.codeUnitAt(currentIndex + 1);
       int secondDigit = lexeme.codeUnitAt(currentIndex + 2);
@@ -4357,16 +4468,16 @@
       return currentIndex + 3;
     } else if (currentChar == 0x75) {
       currentIndex++;
-      if (currentIndex >= length8) {
+      if (currentIndex >= length2) {
         reportError4(ParserErrorCode.INVALID_UNICODE_ESCAPE, []);
-        return length8;
+        return length2;
       }
       currentChar = lexeme.codeUnitAt(currentIndex);
       if (currentChar == 0x7B) {
         currentIndex++;
-        if (currentIndex >= length8) {
+        if (currentIndex >= length2) {
           reportError4(ParserErrorCode.INVALID_UNICODE_ESCAPE, []);
-          return length8;
+          return length2;
         }
         currentChar = lexeme.codeUnitAt(currentIndex);
         int digitCount = 0;
@@ -4375,7 +4486,7 @@
           if (!isHexDigit(currentChar)) {
             reportError4(ParserErrorCode.INVALID_UNICODE_ESCAPE, []);
             currentIndex++;
-            while (currentIndex < length8 && lexeme.codeUnitAt(currentIndex) != 0x7D) {
+            while (currentIndex < length2 && lexeme.codeUnitAt(currentIndex) != 0x7D) {
               currentIndex++;
             }
             return currentIndex + 1;
@@ -4383,9 +4494,9 @@
           digitCount++;
           value = (value << 4) + Character.digit(currentChar, 16);
           currentIndex++;
-          if (currentIndex >= length8) {
+          if (currentIndex >= length2) {
             reportError4(ParserErrorCode.INVALID_UNICODE_ESCAPE, []);
-            return length8;
+            return length2;
           }
           currentChar = lexeme.codeUnitAt(currentIndex);
         }
@@ -4395,9 +4506,9 @@
         appendScalarValue(builder, lexeme.substring(index, currentIndex + 1), value, index, currentIndex);
         return currentIndex + 1;
       } else {
-        if (currentIndex + 3 >= length8) {
+        if (currentIndex + 3 >= length2) {
           reportError4(ParserErrorCode.INVALID_UNICODE_ESCAPE, []);
-          return length8;
+          return length2;
         }
         int firstDigit = currentChar;
         int secondDigit = lexeme.codeUnitAt(currentIndex + 1);
@@ -4466,16 +4577,16 @@
     if (modifiers.varKeyword != null) {
       reportError5(ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE, modifiers.varKeyword, []);
     }
-    Token externalKeyword6 = modifiers.externalKeyword;
-    Token constKeyword4 = modifiers.constKeyword;
-    Token factoryKeyword4 = modifiers.factoryKeyword;
-    if (externalKeyword6 != null && constKeyword4 != null && constKeyword4.offset < externalKeyword6.offset) {
-      reportError5(ParserErrorCode.EXTERNAL_AFTER_CONST, externalKeyword6, []);
+    Token externalKeyword2 = modifiers.externalKeyword;
+    Token constKeyword2 = modifiers.constKeyword;
+    Token factoryKeyword2 = modifiers.factoryKeyword;
+    if (externalKeyword2 != null && constKeyword2 != null && constKeyword2.offset < externalKeyword2.offset) {
+      reportError5(ParserErrorCode.EXTERNAL_AFTER_CONST, externalKeyword2, []);
     }
-    if (externalKeyword6 != null && factoryKeyword4 != null && factoryKeyword4.offset < externalKeyword6.offset) {
-      reportError5(ParserErrorCode.EXTERNAL_AFTER_FACTORY, externalKeyword6, []);
+    if (externalKeyword2 != null && factoryKeyword2 != null && factoryKeyword2.offset < externalKeyword2.offset) {
+      reportError5(ParserErrorCode.EXTERNAL_AFTER_FACTORY, externalKeyword2, []);
     }
-    return constKeyword4;
+    return constKeyword2;
   }
   /**
    * Validate that the given set of modifiers is appropriate for a field and return the 'final',
@@ -4493,31 +4604,31 @@
     if (modifiers.factoryKeyword != null) {
       reportError5(ParserErrorCode.NON_CONSTRUCTOR_FACTORY, modifiers.factoryKeyword, []);
     }
-    Token staticKeyword3 = modifiers.staticKeyword;
-    Token constKeyword5 = modifiers.constKeyword;
-    Token finalKeyword3 = modifiers.finalKeyword;
-    Token varKeyword3 = modifiers.varKeyword;
-    if (constKeyword5 != null) {
-      if (finalKeyword3 != null) {
-        reportError5(ParserErrorCode.CONST_AND_FINAL, finalKeyword3, []);
+    Token staticKeyword2 = modifiers.staticKeyword;
+    Token constKeyword2 = modifiers.constKeyword;
+    Token finalKeyword2 = modifiers.finalKeyword;
+    Token varKeyword2 = modifiers.varKeyword;
+    if (constKeyword2 != null) {
+      if (finalKeyword2 != null) {
+        reportError5(ParserErrorCode.CONST_AND_FINAL, finalKeyword2, []);
       }
-      if (varKeyword3 != null) {
-        reportError5(ParserErrorCode.CONST_AND_VAR, varKeyword3, []);
+      if (varKeyword2 != null) {
+        reportError5(ParserErrorCode.CONST_AND_VAR, varKeyword2, []);
       }
-      if (staticKeyword3 != null && constKeyword5.offset < staticKeyword3.offset) {
-        reportError5(ParserErrorCode.STATIC_AFTER_CONST, staticKeyword3, []);
+      if (staticKeyword2 != null && constKeyword2.offset < staticKeyword2.offset) {
+        reportError5(ParserErrorCode.STATIC_AFTER_CONST, staticKeyword2, []);
       }
-    } else if (finalKeyword3 != null) {
-      if (varKeyword3 != null) {
-        reportError5(ParserErrorCode.FINAL_AND_VAR, varKeyword3, []);
+    } else if (finalKeyword2 != null) {
+      if (varKeyword2 != null) {
+        reportError5(ParserErrorCode.FINAL_AND_VAR, varKeyword2, []);
       }
-      if (staticKeyword3 != null && finalKeyword3.offset < staticKeyword3.offset) {
-        reportError5(ParserErrorCode.STATIC_AFTER_FINAL, staticKeyword3, []);
+      if (staticKeyword2 != null && finalKeyword2.offset < staticKeyword2.offset) {
+        reportError5(ParserErrorCode.STATIC_AFTER_FINAL, staticKeyword2, []);
       }
-    } else if (varKeyword3 != null && staticKeyword3 != null && varKeyword3.offset < staticKeyword3.offset) {
-      reportError5(ParserErrorCode.STATIC_AFTER_VAR, staticKeyword3, []);
+    } else if (varKeyword2 != null && staticKeyword2 != null && varKeyword2.offset < staticKeyword2.offset) {
+      reportError5(ParserErrorCode.STATIC_AFTER_VAR, staticKeyword2, []);
     }
-    return lexicallyFirst([constKeyword5, finalKeyword3, varKeyword3]);
+    return lexicallyFirst([constKeyword2, finalKeyword2, varKeyword2]);
   }
   /**
    * Validate that the given set of modifiers is appropriate for a getter, setter, or method.
@@ -4539,10 +4650,10 @@
     if (modifiers.varKeyword != null) {
       reportError5(ParserErrorCode.VAR_RETURN_TYPE, modifiers.varKeyword, []);
     }
-    Token externalKeyword7 = modifiers.externalKeyword;
-    Token staticKeyword4 = modifiers.staticKeyword;
-    if (externalKeyword7 != null && staticKeyword4 != null && staticKeyword4.offset < externalKeyword7.offset) {
-      reportError5(ParserErrorCode.EXTERNAL_AFTER_STATIC, externalKeyword7, []);
+    Token externalKeyword2 = modifiers.externalKeyword;
+    Token staticKeyword2 = modifiers.staticKeyword;
+    if (externalKeyword2 != null && staticKeyword2 != null && staticKeyword2.offset < externalKeyword2.offset) {
+      reportError5(ParserErrorCode.EXTERNAL_AFTER_STATIC, externalKeyword2, []);
     }
   }
   /**
@@ -4614,22 +4725,22 @@
     if (modifiers.externalKeyword != null) {
       reportError5(ParserErrorCode.EXTERNAL_FIELD, modifiers.externalKeyword, []);
     }
-    Token constKeyword6 = modifiers.constKeyword;
-    Token finalKeyword4 = modifiers.finalKeyword;
-    Token varKeyword4 = modifiers.varKeyword;
-    if (constKeyword6 != null) {
-      if (finalKeyword4 != null) {
-        reportError5(ParserErrorCode.CONST_AND_FINAL, finalKeyword4, []);
+    Token constKeyword2 = modifiers.constKeyword;
+    Token finalKeyword2 = modifiers.finalKeyword;
+    Token varKeyword2 = modifiers.varKeyword;
+    if (constKeyword2 != null) {
+      if (finalKeyword2 != null) {
+        reportError5(ParserErrorCode.CONST_AND_FINAL, finalKeyword2, []);
       }
-      if (varKeyword4 != null) {
-        reportError5(ParserErrorCode.CONST_AND_VAR, varKeyword4, []);
+      if (varKeyword2 != null) {
+        reportError5(ParserErrorCode.CONST_AND_VAR, varKeyword2, []);
       }
-    } else if (finalKeyword4 != null) {
-      if (varKeyword4 != null) {
-        reportError5(ParserErrorCode.FINAL_AND_VAR, varKeyword4, []);
+    } else if (finalKeyword2 != null) {
+      if (varKeyword2 != null) {
+        reportError5(ParserErrorCode.FINAL_AND_VAR, varKeyword2, []);
       }
     }
-    return lexicallyFirst([constKeyword6, finalKeyword4, varKeyword4]);
+    return lexicallyFirst([constKeyword2, finalKeyword2, varKeyword2]);
   }
   /**
    * Validate that the given set of modifiers is appropriate for a class and return the 'abstract'
@@ -4655,9 +4766,13 @@
     }
   }
 }
-class AnalysisErrorListener_8 implements AnalysisErrorListener {
+class KeywordToken_11 extends KeywordToken {
+  KeywordToken_11(Keyword arg0, int arg1) : super(arg0, arg1);
+  int get length => 0;
+}
+class AnalysisErrorListener_12 implements AnalysisErrorListener {
   List<bool> errorFound;
-  AnalysisErrorListener_8(this.errorFound);
+  AnalysisErrorListener_12(this.errorFound);
   void onError(AnalysisError error) {
     errorFound[0] = true;
   }
@@ -4669,7 +4784,7 @@
  * when appropriate, how the problem can be corrected.
  * @coverage dart.engine.parser
  */
-class ParserErrorCode implements ErrorCode {
+class ParserErrorCode implements Comparable<ParserErrorCode>, ErrorCode {
   static final ParserErrorCode ABSTRACT_CLASS_MEMBER = new ParserErrorCode.con2('ABSTRACT_CLASS_MEMBER', 0, "Members of classes cannot be declared to be 'abstract'");
   static final ParserErrorCode ABSTRACT_STATIC_METHOD = new ParserErrorCode.con2('ABSTRACT_STATIC_METHOD', 1, "Static methods cannot be declared to be 'abstract'");
   static final ParserErrorCode ABSTRACT_TOP_LEVEL_FUNCTION = new ParserErrorCode.con2('ABSTRACT_TOP_LEVEL_FUNCTION', 2, "Top-level functions cannot be declared to be 'abstract'");
@@ -4688,90 +4803,100 @@
   static final ParserErrorCode DUPLICATE_LABEL_IN_SWITCH_STATEMENT = new ParserErrorCode.con2('DUPLICATE_LABEL_IN_SWITCH_STATEMENT', 15, "The label %s was already used in this switch statement");
   static final ParserErrorCode DUPLICATED_MODIFIER = new ParserErrorCode.con2('DUPLICATED_MODIFIER', 16, "The modifier '%s' was already specified.");
   static final ParserErrorCode EXPECTED_CASE_OR_DEFAULT = new ParserErrorCode.con2('EXPECTED_CASE_OR_DEFAULT', 17, "Expected 'case' or 'default'");
-  static final ParserErrorCode EXPECTED_LIST_OR_MAP_LITERAL = new ParserErrorCode.con2('EXPECTED_LIST_OR_MAP_LITERAL', 18, "Expected a list or map literal");
-  static final ParserErrorCode EXPECTED_STRING_LITERAL = new ParserErrorCode.con2('EXPECTED_STRING_LITERAL', 19, "Expected a string literal");
-  static final ParserErrorCode EXPECTED_TOKEN = new ParserErrorCode.con2('EXPECTED_TOKEN', 20, "Expected to find '%s'");
-  static final ParserErrorCode EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE = new ParserErrorCode.con2('EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', 21, "Export directives must preceed part directives");
-  static final ParserErrorCode EXTERNAL_AFTER_CONST = new ParserErrorCode.con2('EXTERNAL_AFTER_CONST', 22, "The modifier 'external' should be before the modifier 'const'");
-  static final ParserErrorCode EXTERNAL_AFTER_FACTORY = new ParserErrorCode.con2('EXTERNAL_AFTER_FACTORY', 23, "The modifier 'external' should be before the modifier 'factory'");
-  static final ParserErrorCode EXTERNAL_AFTER_STATIC = new ParserErrorCode.con2('EXTERNAL_AFTER_STATIC', 24, "The modifier 'external' should be before the modifier 'static'");
-  static final ParserErrorCode EXTERNAL_CLASS = new ParserErrorCode.con2('EXTERNAL_CLASS', 25, "Classes cannot be declared to be 'external'");
-  static final ParserErrorCode EXTERNAL_CONSTRUCTOR_WITH_BODY = new ParserErrorCode.con2('EXTERNAL_CONSTRUCTOR_WITH_BODY', 26, "External constructors cannot have a body");
-  static final ParserErrorCode EXTERNAL_FIELD = new ParserErrorCode.con2('EXTERNAL_FIELD', 27, "Fields cannot be declared to be 'external'");
-  static final ParserErrorCode EXTERNAL_GETTER_WITH_BODY = new ParserErrorCode.con2('EXTERNAL_GETTER_WITH_BODY', 28, "External getters cannot have a body");
-  static final ParserErrorCode EXTERNAL_METHOD_WITH_BODY = new ParserErrorCode.con2('EXTERNAL_METHOD_WITH_BODY', 29, "External methods cannot have a body");
-  static final ParserErrorCode EXTERNAL_OPERATOR_WITH_BODY = new ParserErrorCode.con2('EXTERNAL_OPERATOR_WITH_BODY', 30, "External operators cannot have a body");
-  static final ParserErrorCode EXTERNAL_SETTER_WITH_BODY = new ParserErrorCode.con2('EXTERNAL_SETTER_WITH_BODY', 31, "External setters cannot have a body");
-  static final ParserErrorCode EXTERNAL_TYPEDEF = new ParserErrorCode.con2('EXTERNAL_TYPEDEF', 32, "Type aliases cannot be declared to be 'external'");
-  static final ParserErrorCode FACTORY_TOP_LEVEL_DECLARATION = new ParserErrorCode.con2('FACTORY_TOP_LEVEL_DECLARATION', 33, "Top-level declarations cannot be declared to be 'factory'");
-  static final ParserErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = new ParserErrorCode.con2('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', 34, "Field initializers can only be used in a constructor");
-  static final ParserErrorCode FINAL_AND_VAR = new ParserErrorCode.con2('FINAL_AND_VAR', 35, "Members cannot be declared to be both 'final' and 'var'");
-  static final ParserErrorCode FINAL_CLASS = new ParserErrorCode.con2('FINAL_CLASS', 36, "Classes cannot be declared to be 'final'");
-  static final ParserErrorCode FINAL_CONSTRUCTOR = new ParserErrorCode.con2('FINAL_CONSTRUCTOR', 37, "A constructor cannot be declared to be 'final'");
-  static final ParserErrorCode FINAL_METHOD = new ParserErrorCode.con2('FINAL_METHOD', 38, "Getters, setters and methods cannot be declared to be 'final'");
-  static final ParserErrorCode FINAL_TYPEDEF = new ParserErrorCode.con2('FINAL_TYPEDEF', 39, "Type aliases cannot be declared to be 'final'");
-  static final ParserErrorCode GETTER_WITH_PARAMETERS = new ParserErrorCode.con2('GETTER_WITH_PARAMETERS', 40, "Getter should be declared without a parameter list");
-  static final ParserErrorCode ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE = new ParserErrorCode.con2('ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE', 41, "Illegal assignment to non-assignable expression");
-  static final ParserErrorCode IMPLEMENTS_BEFORE_EXTENDS = new ParserErrorCode.con2('IMPLEMENTS_BEFORE_EXTENDS', 42, "The extends clause must be before the implements clause");
-  static final ParserErrorCode IMPLEMENTS_BEFORE_WITH = new ParserErrorCode.con2('IMPLEMENTS_BEFORE_WITH', 43, "The with clause must be before the implements clause");
-  static final ParserErrorCode IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE = new ParserErrorCode.con2('IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', 44, "Import directives must preceed part directives");
-  static final ParserErrorCode INITIALIZED_VARIABLE_IN_FOR_EACH = new ParserErrorCode.con2('INITIALIZED_VARIABLE_IN_FOR_EACH', 45, "The loop variable in a for-each loop cannot be initialized");
-  static final ParserErrorCode INVALID_CODE_POINT = new ParserErrorCode.con2('INVALID_CODE_POINT', 46, "The escape sequence '%s' is not a valid code point");
-  static final ParserErrorCode INVALID_COMMENT_REFERENCE = new ParserErrorCode.con2('INVALID_COMMENT_REFERENCE', 47, "Comment references should contain a possibly prefixed identifier and can start with 'new', but should not contain anything else");
-  static final ParserErrorCode INVALID_HEX_ESCAPE = new ParserErrorCode.con2('INVALID_HEX_ESCAPE', 48, "An escape sequence starting with '\\x' must be followed by 2 hexidecimal digits");
-  static final ParserErrorCode INVALID_OPERATOR_FOR_SUPER = new ParserErrorCode.con2('INVALID_OPERATOR_FOR_SUPER', 49, "The operator '%s' cannot be used with 'super'");
-  static final ParserErrorCode INVALID_UNICODE_ESCAPE = new ParserErrorCode.con2('INVALID_UNICODE_ESCAPE', 50, "An escape sequence starting with '\\u' must be followed by 4 hexidecimal digits or from 1 to 6 digits between '{' and '}'");
-  static final ParserErrorCode LIBRARY_DIRECTIVE_NOT_FIRST = new ParserErrorCode.con2('LIBRARY_DIRECTIVE_NOT_FIRST', 51, "The library directive must appear before all other directives");
-  static final ParserErrorCode MISSING_ASSIGNABLE_SELECTOR = new ParserErrorCode.con2('MISSING_ASSIGNABLE_SELECTOR', 52, "Missing selector such as \".<identifier>\" or \"[0]\"");
-  static final ParserErrorCode MISSING_CATCH_OR_FINALLY = new ParserErrorCode.con2('MISSING_CATCH_OR_FINALLY', 53, "A try statement must have either a catch or finally clause");
-  static final ParserErrorCode MISSING_CLASS_BODY = new ParserErrorCode.con2('MISSING_CLASS_BODY', 54, "A class definition must have a body, even if it is empty");
-  static final ParserErrorCode MISSING_CONST_FINAL_VAR_OR_TYPE = new ParserErrorCode.con2('MISSING_CONST_FINAL_VAR_OR_TYPE', 55, "Variables must be declared using the keywords 'const', 'final', 'var' or a type name");
-  static final ParserErrorCode MISSING_EXPRESSION_IN_THROW = new ParserErrorCode.con2('MISSING_EXPRESSION_IN_THROW', 56, "Throw expressions must compute the object to be thrown");
-  static final ParserErrorCode MISSING_FUNCTION_BODY = new ParserErrorCode.con2('MISSING_FUNCTION_BODY', 57, "A function body must be provided");
-  static final ParserErrorCode MISSING_FUNCTION_PARAMETERS = new ParserErrorCode.con2('MISSING_FUNCTION_PARAMETERS', 58, "Functions must have an explicit list of parameters");
-  static final ParserErrorCode MISSING_IDENTIFIER = new ParserErrorCode.con2('MISSING_IDENTIFIER', 59, "Expected an identifier");
-  static final ParserErrorCode MISSING_NAME_IN_LIBRARY_DIRECTIVE = new ParserErrorCode.con2('MISSING_NAME_IN_LIBRARY_DIRECTIVE', 60, "Library directives must include a library name");
-  static final ParserErrorCode MISSING_NAME_IN_PART_OF_DIRECTIVE = new ParserErrorCode.con2('MISSING_NAME_IN_PART_OF_DIRECTIVE', 61, "Library directives must include a library name");
-  static final ParserErrorCode MISSING_STATEMENT = new ParserErrorCode.con2('MISSING_STATEMENT', 62, "Expected a statement");
-  static final ParserErrorCode MISSING_TERMINATOR_FOR_PARAMETER_GROUP = new ParserErrorCode.con2('MISSING_TERMINATOR_FOR_PARAMETER_GROUP', 63, "There is no '%s' to close the parameter group");
-  static final ParserErrorCode MISSING_TYPEDEF_PARAMETERS = new ParserErrorCode.con2('MISSING_TYPEDEF_PARAMETERS', 64, "Type aliases for functions must have an explicit list of parameters");
-  static final ParserErrorCode MISSING_VARIABLE_IN_FOR_EACH = new ParserErrorCode.con2('MISSING_VARIABLE_IN_FOR_EACH', 65, "A loop variable must be declared in a for-each loop before the 'in', but none were found");
-  static final ParserErrorCode MIXED_PARAMETER_GROUPS = new ParserErrorCode.con2('MIXED_PARAMETER_GROUPS', 66, "Cannot have both positional and named parameters in a single parameter list");
-  static final ParserErrorCode MULTIPLE_EXTENDS_CLAUSES = new ParserErrorCode.con2('MULTIPLE_EXTENDS_CLAUSES', 67, "Each class definition can have at most one extends clause");
-  static final ParserErrorCode MULTIPLE_IMPLEMENTS_CLAUSES = new ParserErrorCode.con2('MULTIPLE_IMPLEMENTS_CLAUSES', 68, "Each class definition can have at most one implements clause");
-  static final ParserErrorCode MULTIPLE_LIBRARY_DIRECTIVES = new ParserErrorCode.con2('MULTIPLE_LIBRARY_DIRECTIVES', 69, "Only one library directive may be declared in a file");
-  static final ParserErrorCode MULTIPLE_NAMED_PARAMETER_GROUPS = new ParserErrorCode.con2('MULTIPLE_NAMED_PARAMETER_GROUPS', 70, "Cannot have multiple groups of named parameters in a single parameter list");
-  static final ParserErrorCode MULTIPLE_PART_OF_DIRECTIVES = new ParserErrorCode.con2('MULTIPLE_PART_OF_DIRECTIVES', 71, "Only one part-of directive may be declared in a file");
-  static final ParserErrorCode MULTIPLE_POSITIONAL_PARAMETER_GROUPS = new ParserErrorCode.con2('MULTIPLE_POSITIONAL_PARAMETER_GROUPS', 72, "Cannot have multiple groups of positional parameters in a single parameter list");
-  static final ParserErrorCode MULTIPLE_VARIABLES_IN_FOR_EACH = new ParserErrorCode.con2('MULTIPLE_VARIABLES_IN_FOR_EACH', 73, "A single loop variable must be declared in a for-each loop before the 'in', but %s were found");
-  static final ParserErrorCode MULTIPLE_WITH_CLAUSES = new ParserErrorCode.con2('MULTIPLE_WITH_CLAUSES', 74, "Each class definition can have at most one with clause");
-  static final ParserErrorCode NAMED_PARAMETER_OUTSIDE_GROUP = new ParserErrorCode.con2('NAMED_PARAMETER_OUTSIDE_GROUP', 75, "Named parameters must be enclosed in curly braces ('{' and '}')");
-  static final ParserErrorCode NON_CONSTRUCTOR_FACTORY = new ParserErrorCode.con2('NON_CONSTRUCTOR_FACTORY', 76, "Only constructors can be declared to be a 'factory'");
-  static final ParserErrorCode NON_IDENTIFIER_LIBRARY_NAME = new ParserErrorCode.con2('NON_IDENTIFIER_LIBRARY_NAME', 77, "The name of a library must be an identifier");
-  static final ParserErrorCode NON_PART_OF_DIRECTIVE_IN_PART = new ParserErrorCode.con2('NON_PART_OF_DIRECTIVE_IN_PART', 78, "The part-of directive must be the only directive in a part");
-  static final ParserErrorCode NON_USER_DEFINABLE_OPERATOR = new ParserErrorCode.con2('NON_USER_DEFINABLE_OPERATOR', 79, "The operator '%s' is not user definable");
-  static final ParserErrorCode POSITIONAL_AFTER_NAMED_ARGUMENT = new ParserErrorCode.con2('POSITIONAL_AFTER_NAMED_ARGUMENT', 80, "Positional arguments must occur before named arguments");
-  static final ParserErrorCode POSITIONAL_PARAMETER_OUTSIDE_GROUP = new ParserErrorCode.con2('POSITIONAL_PARAMETER_OUTSIDE_GROUP', 81, "Positional parameters must be enclosed in square brackets ('[' and ']')");
-  static final ParserErrorCode STATIC_AFTER_CONST = new ParserErrorCode.con2('STATIC_AFTER_CONST', 82, "The modifier 'static' should be before the modifier 'const'");
-  static final ParserErrorCode STATIC_AFTER_FINAL = new ParserErrorCode.con2('STATIC_AFTER_FINAL', 83, "The modifier 'static' should be before the modifier 'final'");
-  static final ParserErrorCode STATIC_AFTER_VAR = new ParserErrorCode.con2('STATIC_AFTER_VAR', 84, "The modifier 'static' should be before the modifier 'var'");
-  static final ParserErrorCode STATIC_CONSTRUCTOR = new ParserErrorCode.con2('STATIC_CONSTRUCTOR', 85, "Constructors cannot be static");
-  static final ParserErrorCode STATIC_OPERATOR = new ParserErrorCode.con2('STATIC_OPERATOR', 86, "Operators cannot be static");
-  static final ParserErrorCode STATIC_TOP_LEVEL_DECLARATION = new ParserErrorCode.con2('STATIC_TOP_LEVEL_DECLARATION', 87, "Top-level declarations cannot be declared to be 'static'");
-  static final ParserErrorCode UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP = new ParserErrorCode.con2('UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP', 88, "There is no '%s' to open a parameter group");
-  static final ParserErrorCode UNEXPECTED_TOKEN = new ParserErrorCode.con2('UNEXPECTED_TOKEN', 89, "Unexpected token '%s'");
-  static final ParserErrorCode USE_OF_UNARY_PLUS_OPERATOR = new ParserErrorCode.con2('USE_OF_UNARY_PLUS_OPERATOR', 90, "There is no unary plus operator in Dart");
-  static final ParserErrorCode WITH_BEFORE_EXTENDS = new ParserErrorCode.con2('WITH_BEFORE_EXTENDS', 91, "The extends clause must be before the with clause");
-  static final ParserErrorCode WITH_WITHOUT_EXTENDS = new ParserErrorCode.con2('WITH_WITHOUT_EXTENDS', 92, "The with clause cannot be used without an extends clause");
-  static final ParserErrorCode WRONG_SEPARATOR_FOR_NAMED_PARAMETER = new ParserErrorCode.con2('WRONG_SEPARATOR_FOR_NAMED_PARAMETER', 93, "The default value of a named parameter should be preceeded by ':'");
-  static final ParserErrorCode WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER = new ParserErrorCode.con2('WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER', 94, "The default value of a positional parameter should be preceeded by '='");
-  static final ParserErrorCode WRONG_TERMINATOR_FOR_PARAMETER_GROUP = new ParserErrorCode.con2('WRONG_TERMINATOR_FOR_PARAMETER_GROUP', 95, "Expected '%s' to close parameter group");
-  static final ParserErrorCode VAR_CLASS = new ParserErrorCode.con2('VAR_CLASS', 96, "Classes cannot be declared to be 'var'");
-  static final ParserErrorCode VAR_RETURN_TYPE = new ParserErrorCode.con2('VAR_RETURN_TYPE', 97, "The return type cannot be 'var'");
-  static final ParserErrorCode VAR_TYPEDEF = new ParserErrorCode.con2('VAR_TYPEDEF', 98, "Type aliases cannot be declared to be 'var'");
-  static final ParserErrorCode VOID_PARAMETER = new ParserErrorCode.con2('VOID_PARAMETER', 99, "Parameters cannot have a type of 'void'");
-  static final ParserErrorCode VOID_VARIABLE = new ParserErrorCode.con2('VOID_VARIABLE', 100, "Variables cannot have a type of 'void'");
-  static final List<ParserErrorCode> values = [ABSTRACT_CLASS_MEMBER, ABSTRACT_STATIC_METHOD, ABSTRACT_TOP_LEVEL_FUNCTION, ABSTRACT_TOP_LEVEL_VARIABLE, ABSTRACT_TYPEDEF, BREAK_OUTSIDE_OF_LOOP, CONST_AND_FINAL, CONST_AND_VAR, CONST_CLASS, CONST_METHOD, CONST_TYPEDEF, CONSTRUCTOR_WITH_RETURN_TYPE, CONTINUE_OUTSIDE_OF_LOOP, CONTINUE_WITHOUT_LABEL_IN_CASE, DIRECTIVE_AFTER_DECLARATION, DUPLICATE_LABEL_IN_SWITCH_STATEMENT, DUPLICATED_MODIFIER, EXPECTED_CASE_OR_DEFAULT, EXPECTED_LIST_OR_MAP_LITERAL, EXPECTED_STRING_LITERAL, EXPECTED_TOKEN, EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, EXTERNAL_AFTER_CONST, EXTERNAL_AFTER_FACTORY, EXTERNAL_AFTER_STATIC, EXTERNAL_CLASS, EXTERNAL_CONSTRUCTOR_WITH_BODY, EXTERNAL_FIELD, EXTERNAL_GETTER_WITH_BODY, EXTERNAL_METHOD_WITH_BODY, EXTERNAL_OPERATOR_WITH_BODY, EXTERNAL_SETTER_WITH_BODY, EXTERNAL_TYPEDEF, FACTORY_TOP_LEVEL_DECLARATION, FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, FINAL_AND_VAR, FINAL_CLASS, FINAL_CONSTRUCTOR, FINAL_METHOD, FINAL_TYPEDEF, GETTER_WITH_PARAMETERS, ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, IMPLEMENTS_BEFORE_EXTENDS, IMPLEMENTS_BEFORE_WITH, IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, INITIALIZED_VARIABLE_IN_FOR_EACH, INVALID_CODE_POINT, INVALID_COMMENT_REFERENCE, INVALID_HEX_ESCAPE, INVALID_OPERATOR_FOR_SUPER, INVALID_UNICODE_ESCAPE, LIBRARY_DIRECTIVE_NOT_FIRST, MISSING_ASSIGNABLE_SELECTOR, MISSING_CATCH_OR_FINALLY, MISSING_CLASS_BODY, MISSING_CONST_FINAL_VAR_OR_TYPE, MISSING_EXPRESSION_IN_THROW, MISSING_FUNCTION_BODY, MISSING_FUNCTION_PARAMETERS, MISSING_IDENTIFIER, MISSING_NAME_IN_LIBRARY_DIRECTIVE, MISSING_NAME_IN_PART_OF_DIRECTIVE, MISSING_STATEMENT, MISSING_TERMINATOR_FOR_PARAMETER_GROUP, MISSING_TYPEDEF_PARAMETERS, MISSING_VARIABLE_IN_FOR_EACH, MIXED_PARAMETER_GROUPS, MULTIPLE_EXTENDS_CLAUSES, MULTIPLE_IMPLEMENTS_CLAUSES, MULTIPLE_LIBRARY_DIRECTIVES, MULTIPLE_NAMED_PARAMETER_GROUPS, MULTIPLE_PART_OF_DIRECTIVES, MULTIPLE_POSITIONAL_PARAMETER_GROUPS, MULTIPLE_VARIABLES_IN_FOR_EACH, MULTIPLE_WITH_CLAUSES, NAMED_PARAMETER_OUTSIDE_GROUP, NON_CONSTRUCTOR_FACTORY, NON_IDENTIFIER_LIBRARY_NAME, NON_PART_OF_DIRECTIVE_IN_PART, NON_USER_DEFINABLE_OPERATOR, POSITIONAL_AFTER_NAMED_ARGUMENT, POSITIONAL_PARAMETER_OUTSIDE_GROUP, STATIC_AFTER_CONST, STATIC_AFTER_FINAL, STATIC_AFTER_VAR, STATIC_CONSTRUCTOR, STATIC_OPERATOR, STATIC_TOP_LEVEL_DECLARATION, UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP, UNEXPECTED_TOKEN, USE_OF_UNARY_PLUS_OPERATOR, WITH_BEFORE_EXTENDS, WITH_WITHOUT_EXTENDS, WRONG_SEPARATOR_FOR_NAMED_PARAMETER, WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER, WRONG_TERMINATOR_FOR_PARAMETER_GROUP, VAR_CLASS, VAR_RETURN_TYPE, VAR_TYPEDEF, VOID_PARAMETER, VOID_VARIABLE];
+  static final ParserErrorCode EXPECTED_CLASS_MEMBER = new ParserErrorCode.con2('EXPECTED_CLASS_MEMBER', 18, "Expected a class member");
+  static final ParserErrorCode EXPECTED_EXECUTABLE = new ParserErrorCode.con2('EXPECTED_EXECUTABLE', 19, "Expected a method, getter, setter or operator declaration");
+  static final ParserErrorCode EXPECTED_LIST_OR_MAP_LITERAL = new ParserErrorCode.con2('EXPECTED_LIST_OR_MAP_LITERAL', 20, "Expected a list or map literal");
+  static final ParserErrorCode EXPECTED_STRING_LITERAL = new ParserErrorCode.con2('EXPECTED_STRING_LITERAL', 21, "Expected a string literal");
+  static final ParserErrorCode EXPECTED_TOKEN = new ParserErrorCode.con2('EXPECTED_TOKEN', 22, "Expected to find '%s'");
+  static final ParserErrorCode EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE = new ParserErrorCode.con2('EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', 23, "Export directives must preceed part directives");
+  static final ParserErrorCode EXTERNAL_AFTER_CONST = new ParserErrorCode.con2('EXTERNAL_AFTER_CONST', 24, "The modifier 'external' should be before the modifier 'const'");
+  static final ParserErrorCode EXTERNAL_AFTER_FACTORY = new ParserErrorCode.con2('EXTERNAL_AFTER_FACTORY', 25, "The modifier 'external' should be before the modifier 'factory'");
+  static final ParserErrorCode EXTERNAL_AFTER_STATIC = new ParserErrorCode.con2('EXTERNAL_AFTER_STATIC', 26, "The modifier 'external' should be before the modifier 'static'");
+  static final ParserErrorCode EXTERNAL_CLASS = new ParserErrorCode.con2('EXTERNAL_CLASS', 27, "Classes cannot be declared to be 'external'");
+  static final ParserErrorCode EXTERNAL_CONSTRUCTOR_WITH_BODY = new ParserErrorCode.con2('EXTERNAL_CONSTRUCTOR_WITH_BODY', 28, "External constructors cannot have a body");
+  static final ParserErrorCode EXTERNAL_FIELD = new ParserErrorCode.con2('EXTERNAL_FIELD', 29, "Fields cannot be declared to be 'external'");
+  static final ParserErrorCode EXTERNAL_GETTER_WITH_BODY = new ParserErrorCode.con2('EXTERNAL_GETTER_WITH_BODY', 30, "External getters cannot have a body");
+  static final ParserErrorCode EXTERNAL_METHOD_WITH_BODY = new ParserErrorCode.con2('EXTERNAL_METHOD_WITH_BODY', 31, "External methods cannot have a body");
+  static final ParserErrorCode EXTERNAL_OPERATOR_WITH_BODY = new ParserErrorCode.con2('EXTERNAL_OPERATOR_WITH_BODY', 32, "External operators cannot have a body");
+  static final ParserErrorCode EXTERNAL_SETTER_WITH_BODY = new ParserErrorCode.con2('EXTERNAL_SETTER_WITH_BODY', 33, "External setters cannot have a body");
+  static final ParserErrorCode EXTERNAL_TYPEDEF = new ParserErrorCode.con2('EXTERNAL_TYPEDEF', 34, "Type aliases cannot be declared to be 'external'");
+  static final ParserErrorCode FACTORY_TOP_LEVEL_DECLARATION = new ParserErrorCode.con2('FACTORY_TOP_LEVEL_DECLARATION', 35, "Top-level declarations cannot be declared to be 'factory'");
+  static final ParserErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = new ParserErrorCode.con2('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', 36, "Field initializers can only be used in a constructor");
+  static final ParserErrorCode FINAL_AND_VAR = new ParserErrorCode.con2('FINAL_AND_VAR', 37, "Members cannot be declared to be both 'final' and 'var'");
+  static final ParserErrorCode FINAL_CLASS = new ParserErrorCode.con2('FINAL_CLASS', 38, "Classes cannot be declared to be 'final'");
+  static final ParserErrorCode FINAL_CONSTRUCTOR = new ParserErrorCode.con2('FINAL_CONSTRUCTOR', 39, "A constructor cannot be declared to be 'final'");
+  static final ParserErrorCode FINAL_METHOD = new ParserErrorCode.con2('FINAL_METHOD', 40, "Getters, setters and methods cannot be declared to be 'final'");
+  static final ParserErrorCode FINAL_TYPEDEF = new ParserErrorCode.con2('FINAL_TYPEDEF', 41, "Type aliases cannot be declared to be 'final'");
+  static final ParserErrorCode GETTER_WITH_PARAMETERS = new ParserErrorCode.con2('GETTER_WITH_PARAMETERS', 42, "Getter should be declared without a parameter list");
+  static final ParserErrorCode ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE = new ParserErrorCode.con2('ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE', 43, "Illegal assignment to non-assignable expression");
+  static final ParserErrorCode IMPLEMENTS_BEFORE_EXTENDS = new ParserErrorCode.con2('IMPLEMENTS_BEFORE_EXTENDS', 44, "The extends clause must be before the implements clause");
+  static final ParserErrorCode IMPLEMENTS_BEFORE_WITH = new ParserErrorCode.con2('IMPLEMENTS_BEFORE_WITH', 45, "The with clause must be before the implements clause");
+  static final ParserErrorCode IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE = new ParserErrorCode.con2('IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', 46, "Import directives must preceed part directives");
+  static final ParserErrorCode INITIALIZED_VARIABLE_IN_FOR_EACH = new ParserErrorCode.con2('INITIALIZED_VARIABLE_IN_FOR_EACH', 47, "The loop variable in a for-each loop cannot be initialized");
+  static final ParserErrorCode INVALID_CODE_POINT = new ParserErrorCode.con2('INVALID_CODE_POINT', 48, "The escape sequence '%s' is not a valid code point");
+  static final ParserErrorCode INVALID_COMMENT_REFERENCE = new ParserErrorCode.con2('INVALID_COMMENT_REFERENCE', 49, "Comment references should contain a possibly prefixed identifier and can start with 'new', but should not contain anything else");
+  static final ParserErrorCode INVALID_HEX_ESCAPE = new ParserErrorCode.con2('INVALID_HEX_ESCAPE', 50, "An escape sequence starting with '\\x' must be followed by 2 hexidecimal digits");
+  static final ParserErrorCode INVALID_OPERATOR = new ParserErrorCode.con2('INVALID_OPERATOR', 51, "The string '%s' is not a valid operator");
+  static final ParserErrorCode INVALID_OPERATOR_FOR_SUPER = new ParserErrorCode.con2('INVALID_OPERATOR_FOR_SUPER', 52, "The operator '%s' cannot be used with 'super'");
+  static final ParserErrorCode INVALID_UNICODE_ESCAPE = new ParserErrorCode.con2('INVALID_UNICODE_ESCAPE', 53, "An escape sequence starting with '\\u' must be followed by 4 hexidecimal digits or from 1 to 6 digits between '{' and '}'");
+  static final ParserErrorCode LIBRARY_DIRECTIVE_NOT_FIRST = new ParserErrorCode.con2('LIBRARY_DIRECTIVE_NOT_FIRST', 54, "The library directive must appear before all other directives");
+  static final ParserErrorCode MISSING_ASSIGNABLE_SELECTOR = new ParserErrorCode.con2('MISSING_ASSIGNABLE_SELECTOR', 55, "Missing selector such as \".<identifier>\" or \"[0]\"");
+  static final ParserErrorCode MISSING_CATCH_OR_FINALLY = new ParserErrorCode.con2('MISSING_CATCH_OR_FINALLY', 56, "A try statement must have either a catch or finally clause");
+  static final ParserErrorCode MISSING_CLASS_BODY = new ParserErrorCode.con2('MISSING_CLASS_BODY', 57, "A class definition must have a body, even if it is empty");
+  static final ParserErrorCode MISSING_CLOSING_PARENTHESIS = new ParserErrorCode.con2('MISSING_CLOSING_PARENTHESIS', 58, "The closing parenthesis is missing");
+  static final ParserErrorCode MISSING_CONST_FINAL_VAR_OR_TYPE = new ParserErrorCode.con2('MISSING_CONST_FINAL_VAR_OR_TYPE', 59, "Variables must be declared using the keywords 'const', 'final', 'var' or a type name");
+  static final ParserErrorCode MISSING_EXPRESSION_IN_THROW = new ParserErrorCode.con2('MISSING_EXPRESSION_IN_THROW', 60, "Throw expressions must compute the object to be thrown");
+  static final ParserErrorCode MISSING_FUNCTION_BODY = new ParserErrorCode.con2('MISSING_FUNCTION_BODY', 61, "A function body must be provided");
+  static final ParserErrorCode MISSING_FUNCTION_PARAMETERS = new ParserErrorCode.con2('MISSING_FUNCTION_PARAMETERS', 62, "Functions must have an explicit list of parameters");
+  static final ParserErrorCode MISSING_IDENTIFIER = new ParserErrorCode.con2('MISSING_IDENTIFIER', 63, "Expected an identifier");
+  static final ParserErrorCode MISSING_KEYWORD_OPERATOR = new ParserErrorCode.con2('MISSING_KEYWORD_OPERATOR', 64, "Operator declarations must be preceeded by the keyword 'operator'");
+  static final ParserErrorCode MISSING_NAME_IN_LIBRARY_DIRECTIVE = new ParserErrorCode.con2('MISSING_NAME_IN_LIBRARY_DIRECTIVE', 65, "Library directives must include a library name");
+  static final ParserErrorCode MISSING_NAME_IN_PART_OF_DIRECTIVE = new ParserErrorCode.con2('MISSING_NAME_IN_PART_OF_DIRECTIVE', 66, "Library directives must include a library name");
+  static final ParserErrorCode MISSING_STATEMENT = new ParserErrorCode.con2('MISSING_STATEMENT', 67, "Expected a statement");
+  static final ParserErrorCode MISSING_TERMINATOR_FOR_PARAMETER_GROUP = new ParserErrorCode.con2('MISSING_TERMINATOR_FOR_PARAMETER_GROUP', 68, "There is no '%s' to close the parameter group");
+  static final ParserErrorCode MISSING_TYPEDEF_PARAMETERS = new ParserErrorCode.con2('MISSING_TYPEDEF_PARAMETERS', 69, "Type aliases for functions must have an explicit list of parameters");
+  static final ParserErrorCode MISSING_VARIABLE_IN_FOR_EACH = new ParserErrorCode.con2('MISSING_VARIABLE_IN_FOR_EACH', 70, "A loop variable must be declared in a for-each loop before the 'in', but none were found");
+  static final ParserErrorCode MIXED_PARAMETER_GROUPS = new ParserErrorCode.con2('MIXED_PARAMETER_GROUPS', 71, "Cannot have both positional and named parameters in a single parameter list");
+  static final ParserErrorCode MULTIPLE_EXTENDS_CLAUSES = new ParserErrorCode.con2('MULTIPLE_EXTENDS_CLAUSES', 72, "Each class definition can have at most one extends clause");
+  static final ParserErrorCode MULTIPLE_IMPLEMENTS_CLAUSES = new ParserErrorCode.con2('MULTIPLE_IMPLEMENTS_CLAUSES', 73, "Each class definition can have at most one implements clause");
+  static final ParserErrorCode MULTIPLE_LIBRARY_DIRECTIVES = new ParserErrorCode.con2('MULTIPLE_LIBRARY_DIRECTIVES', 74, "Only one library directive may be declared in a file");
+  static final ParserErrorCode MULTIPLE_NAMED_PARAMETER_GROUPS = new ParserErrorCode.con2('MULTIPLE_NAMED_PARAMETER_GROUPS', 75, "Cannot have multiple groups of named parameters in a single parameter list");
+  static final ParserErrorCode MULTIPLE_PART_OF_DIRECTIVES = new ParserErrorCode.con2('MULTIPLE_PART_OF_DIRECTIVES', 76, "Only one part-of directive may be declared in a file");
+  static final ParserErrorCode MULTIPLE_POSITIONAL_PARAMETER_GROUPS = new ParserErrorCode.con2('MULTIPLE_POSITIONAL_PARAMETER_GROUPS', 77, "Cannot have multiple groups of positional parameters in a single parameter list");
+  static final ParserErrorCode MULTIPLE_VARIABLES_IN_FOR_EACH = new ParserErrorCode.con2('MULTIPLE_VARIABLES_IN_FOR_EACH', 78, "A single loop variable must be declared in a for-each loop before the 'in', but %s were found");
+  static final ParserErrorCode MULTIPLE_WITH_CLAUSES = new ParserErrorCode.con2('MULTIPLE_WITH_CLAUSES', 79, "Each class definition can have at most one with clause");
+  static final ParserErrorCode NAMED_FUNCTION_EXPRESSION = new ParserErrorCode.con2('NAMED_FUNCTION_EXPRESSION', 80, "Function expressions cannot be named");
+  static final ParserErrorCode NAMED_PARAMETER_OUTSIDE_GROUP = new ParserErrorCode.con2('NAMED_PARAMETER_OUTSIDE_GROUP', 81, "Named parameters must be enclosed in curly braces ('{' and '}')");
+  static final ParserErrorCode NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE = new ParserErrorCode.con2('NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE', 82, "Native functions can only be declared in the SDK and code that is loaded through native extensions");
+  static final ParserErrorCode NON_CONSTRUCTOR_FACTORY = new ParserErrorCode.con2('NON_CONSTRUCTOR_FACTORY', 83, "Only constructors can be declared to be a 'factory'");
+  static final ParserErrorCode NON_IDENTIFIER_LIBRARY_NAME = new ParserErrorCode.con2('NON_IDENTIFIER_LIBRARY_NAME', 84, "The name of a library must be an identifier");
+  static final ParserErrorCode NON_PART_OF_DIRECTIVE_IN_PART = new ParserErrorCode.con2('NON_PART_OF_DIRECTIVE_IN_PART', 85, "The part-of directive must be the only directive in a part");
+  static final ParserErrorCode NON_USER_DEFINABLE_OPERATOR = new ParserErrorCode.con2('NON_USER_DEFINABLE_OPERATOR', 86, "The operator '%s' is not user definable");
+  static final ParserErrorCode POSITIONAL_AFTER_NAMED_ARGUMENT = new ParserErrorCode.con2('POSITIONAL_AFTER_NAMED_ARGUMENT', 87, "Positional arguments must occur before named arguments");
+  static final ParserErrorCode POSITIONAL_PARAMETER_OUTSIDE_GROUP = new ParserErrorCode.con2('POSITIONAL_PARAMETER_OUTSIDE_GROUP', 88, "Positional parameters must be enclosed in square brackets ('[' and ']')");
+  static final ParserErrorCode STATIC_AFTER_CONST = new ParserErrorCode.con2('STATIC_AFTER_CONST', 89, "The modifier 'static' should be before the modifier 'const'");
+  static final ParserErrorCode STATIC_AFTER_FINAL = new ParserErrorCode.con2('STATIC_AFTER_FINAL', 90, "The modifier 'static' should be before the modifier 'final'");
+  static final ParserErrorCode STATIC_AFTER_VAR = new ParserErrorCode.con2('STATIC_AFTER_VAR', 91, "The modifier 'static' should be before the modifier 'var'");
+  static final ParserErrorCode STATIC_CONSTRUCTOR = new ParserErrorCode.con2('STATIC_CONSTRUCTOR', 92, "Constructors cannot be static");
+  static final ParserErrorCode STATIC_OPERATOR = new ParserErrorCode.con2('STATIC_OPERATOR', 93, "Operators cannot be static");
+  static final ParserErrorCode STATIC_TOP_LEVEL_DECLARATION = new ParserErrorCode.con2('STATIC_TOP_LEVEL_DECLARATION', 94, "Top-level declarations cannot be declared to be 'static'");
+  static final ParserErrorCode SWITCH_HAS_CASE_AFTER_DEFAULT_CASE = new ParserErrorCode.con2('SWITCH_HAS_CASE_AFTER_DEFAULT_CASE', 95, "The 'default' case should be the last case in a switch statement");
+  static final ParserErrorCode SWITCH_HAS_MULTIPLE_DEFAULT_CASES = new ParserErrorCode.con2('SWITCH_HAS_MULTIPLE_DEFAULT_CASES', 96, "The 'default' case can only be declared once");
+  static final ParserErrorCode TOP_LEVEL_OPERATOR = new ParserErrorCode.con2('TOP_LEVEL_OPERATOR', 97, "Operators must be declared within a class");
+  static final ParserErrorCode UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP = new ParserErrorCode.con2('UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP', 98, "There is no '%s' to open a parameter group");
+  static final ParserErrorCode UNEXPECTED_TOKEN = new ParserErrorCode.con2('UNEXPECTED_TOKEN', 99, "Unexpected token '%s'");
+  static final ParserErrorCode USE_OF_UNARY_PLUS_OPERATOR = new ParserErrorCode.con2('USE_OF_UNARY_PLUS_OPERATOR', 100, "There is no unary plus operator in Dart");
+  static final ParserErrorCode WITH_BEFORE_EXTENDS = new ParserErrorCode.con2('WITH_BEFORE_EXTENDS', 101, "The extends clause must be before the with clause");
+  static final ParserErrorCode WITH_WITHOUT_EXTENDS = new ParserErrorCode.con2('WITH_WITHOUT_EXTENDS', 102, "The with clause cannot be used without an extends clause");
+  static final ParserErrorCode WRONG_SEPARATOR_FOR_NAMED_PARAMETER = new ParserErrorCode.con2('WRONG_SEPARATOR_FOR_NAMED_PARAMETER', 103, "The default value of a named parameter should be preceeded by ':'");
+  static final ParserErrorCode WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER = new ParserErrorCode.con2('WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER', 104, "The default value of a positional parameter should be preceeded by '='");
+  static final ParserErrorCode WRONG_TERMINATOR_FOR_PARAMETER_GROUP = new ParserErrorCode.con2('WRONG_TERMINATOR_FOR_PARAMETER_GROUP', 105, "Expected '%s' to close parameter group");
+  static final ParserErrorCode VAR_CLASS = new ParserErrorCode.con2('VAR_CLASS', 106, "Classes cannot be declared to be 'var'");
+  static final ParserErrorCode VAR_RETURN_TYPE = new ParserErrorCode.con2('VAR_RETURN_TYPE', 107, "The return type cannot be 'var'");
+  static final ParserErrorCode VAR_TYPEDEF = new ParserErrorCode.con2('VAR_TYPEDEF', 108, "Type aliases cannot be declared to be 'var'");
+  static final ParserErrorCode VOID_PARAMETER = new ParserErrorCode.con2('VOID_PARAMETER', 109, "Parameters cannot have a type of 'void'");
+  static final ParserErrorCode VOID_VARIABLE = new ParserErrorCode.con2('VOID_VARIABLE', 110, "Variables cannot have a type of 'void'");
+  static final List<ParserErrorCode> values = [ABSTRACT_CLASS_MEMBER, ABSTRACT_STATIC_METHOD, ABSTRACT_TOP_LEVEL_FUNCTION, ABSTRACT_TOP_LEVEL_VARIABLE, ABSTRACT_TYPEDEF, BREAK_OUTSIDE_OF_LOOP, CONST_AND_FINAL, CONST_AND_VAR, CONST_CLASS, CONST_METHOD, CONST_TYPEDEF, CONSTRUCTOR_WITH_RETURN_TYPE, CONTINUE_OUTSIDE_OF_LOOP, CONTINUE_WITHOUT_LABEL_IN_CASE, DIRECTIVE_AFTER_DECLARATION, DUPLICATE_LABEL_IN_SWITCH_STATEMENT, DUPLICATED_MODIFIER, EXPECTED_CASE_OR_DEFAULT, EXPECTED_CLASS_MEMBER, EXPECTED_EXECUTABLE, EXPECTED_LIST_OR_MAP_LITERAL, EXPECTED_STRING_LITERAL, EXPECTED_TOKEN, EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, EXTERNAL_AFTER_CONST, EXTERNAL_AFTER_FACTORY, EXTERNAL_AFTER_STATIC, EXTERNAL_CLASS, EXTERNAL_CONSTRUCTOR_WITH_BODY, EXTERNAL_FIELD, EXTERNAL_GETTER_WITH_BODY, EXTERNAL_METHOD_WITH_BODY, EXTERNAL_OPERATOR_WITH_BODY, EXTERNAL_SETTER_WITH_BODY, EXTERNAL_TYPEDEF, FACTORY_TOP_LEVEL_DECLARATION, FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, FINAL_AND_VAR, FINAL_CLASS, FINAL_CONSTRUCTOR, FINAL_METHOD, FINAL_TYPEDEF, GETTER_WITH_PARAMETERS, ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, IMPLEMENTS_BEFORE_EXTENDS, IMPLEMENTS_BEFORE_WITH, IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, INITIALIZED_VARIABLE_IN_FOR_EACH, INVALID_CODE_POINT, INVALID_COMMENT_REFERENCE, INVALID_HEX_ESCAPE, INVALID_OPERATOR, INVALID_OPERATOR_FOR_SUPER, INVALID_UNICODE_ESCAPE, LIBRARY_DIRECTIVE_NOT_FIRST, MISSING_ASSIGNABLE_SELECTOR, MISSING_CATCH_OR_FINALLY, MISSING_CLASS_BODY, MISSING_CLOSING_PARENTHESIS, MISSING_CONST_FINAL_VAR_OR_TYPE, MISSING_EXPRESSION_IN_THROW, MISSING_FUNCTION_BODY, MISSING_FUNCTION_PARAMETERS, MISSING_IDENTIFIER, MISSING_KEYWORD_OPERATOR, MISSING_NAME_IN_LIBRARY_DIRECTIVE, MISSING_NAME_IN_PART_OF_DIRECTIVE, MISSING_STATEMENT, MISSING_TERMINATOR_FOR_PARAMETER_GROUP, MISSING_TYPEDEF_PARAMETERS, MISSING_VARIABLE_IN_FOR_EACH, MIXED_PARAMETER_GROUPS, MULTIPLE_EXTENDS_CLAUSES, MULTIPLE_IMPLEMENTS_CLAUSES, MULTIPLE_LIBRARY_DIRECTIVES, MULTIPLE_NAMED_PARAMETER_GROUPS, MULTIPLE_PART_OF_DIRECTIVES, MULTIPLE_POSITIONAL_PARAMETER_GROUPS, MULTIPLE_VARIABLES_IN_FOR_EACH, MULTIPLE_WITH_CLAUSES, NAMED_FUNCTION_EXPRESSION, NAMED_PARAMETER_OUTSIDE_GROUP, NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE, NON_CONSTRUCTOR_FACTORY, NON_IDENTIFIER_LIBRARY_NAME, NON_PART_OF_DIRECTIVE_IN_PART, NON_USER_DEFINABLE_OPERATOR, POSITIONAL_AFTER_NAMED_ARGUMENT, POSITIONAL_PARAMETER_OUTSIDE_GROUP, STATIC_AFTER_CONST, STATIC_AFTER_FINAL, STATIC_AFTER_VAR, STATIC_CONSTRUCTOR, STATIC_OPERATOR, STATIC_TOP_LEVEL_DECLARATION, SWITCH_HAS_CASE_AFTER_DEFAULT_CASE, SWITCH_HAS_MULTIPLE_DEFAULT_CASES, TOP_LEVEL_OPERATOR, UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP, UNEXPECTED_TOKEN, USE_OF_UNARY_PLUS_OPERATOR, WITH_BEFORE_EXTENDS, WITH_WITHOUT_EXTENDS, WRONG_SEPARATOR_FOR_NAMED_PARAMETER, WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER, WRONG_TERMINATOR_FOR_PARAMETER_GROUP, VAR_CLASS, VAR_RETURN_TYPE, VAR_TYPEDEF, VOID_PARAMETER, VOID_VARIABLE];
   String __name;
   int __ordinal = 0;
   int get ordinal => __ordinal;
@@ -4789,9 +4914,9 @@
    * @param message the message template used to create the message to be displayed for the error
    */
   ParserErrorCode.con1(String ___name, int ___ordinal, ErrorSeverity severity2, String message2) {
-    _jtd_constructor_275_impl(___name, ___ordinal, severity2, message2);
+    _jtd_constructor_301_impl(___name, ___ordinal, severity2, message2);
   }
-  _jtd_constructor_275_impl(String ___name, int ___ordinal, ErrorSeverity severity2, String message2) {
+  _jtd_constructor_301_impl(String ___name, int ___ordinal, ErrorSeverity severity2, String message2) {
     __name = ___name;
     __ordinal = ___ordinal;
     this._severity = severity2;
@@ -4802,15 +4927,16 @@
    * @param message the message template used to create the message to be displayed for the error
    */
   ParserErrorCode.con2(String ___name, int ___ordinal, String message) {
-    _jtd_constructor_276_impl(___name, ___ordinal, message);
+    _jtd_constructor_302_impl(___name, ___ordinal, message);
   }
-  _jtd_constructor_276_impl(String ___name, int ___ordinal, String message) {
-    _jtd_constructor_275_impl(___name, ___ordinal, ErrorSeverity.ERROR, message);
+  _jtd_constructor_302_impl(String ___name, int ___ordinal, String message) {
+    _jtd_constructor_301_impl(___name, ___ordinal, ErrorSeverity.ERROR, message);
   }
   ErrorSeverity get errorSeverity => _severity;
   String get message => _message;
   ErrorType get type => ErrorType.SYNTACTIC_ERROR;
   bool needsRecompilation() => true;
+  int compareTo(ParserErrorCode other) => __ordinal - other.__ordinal;
   String toString() => __name;
 }
 /**
@@ -4983,12 +5109,12 @@
   }
   Object visitCommentReference(CommentReference node) => null;
   Object visitCompilationUnit(CompilationUnit node) {
-    ScriptTag scriptTag7 = node.scriptTag;
-    NodeList<Directive> directives4 = node.directives;
-    visit(scriptTag7);
-    String prefix = scriptTag7 == null ? "" : " ";
-    visitList7(prefix, directives4, "\n");
-    prefix = scriptTag7 == null && directives4.isEmpty ? "" : "\n\n";
+    ScriptTag scriptTag2 = node.scriptTag;
+    NodeList<Directive> directives2 = node.directives;
+    visit(scriptTag2);
+    String prefix = scriptTag2 == null ? "" : " ";
+    visitList7(prefix, directives2, "\n");
+    prefix = scriptTag2 == null && directives2.isEmpty ? "" : "\n\n";
     visitList7(prefix, node.declarations, "\n");
     return null;
   }
@@ -5120,10 +5246,10 @@
   Object visitFormalParameterList(FormalParameterList node) {
     String groupEnd = null;
     _writer.print('(');
-    NodeList<FormalParameter> parameters14 = node.parameters;
-    int size7 = parameters14.length;
-    for (int i = 0; i < size7; i++) {
-      FormalParameter parameter = parameters14[i];
+    NodeList<FormalParameter> parameters2 = node.parameters;
+    int size2 = parameters2.length;
+    for (int i = 0; i < size2; i++) {
+      FormalParameter parameter = parameters2[i];
       if (i > 0) {
         _writer.print(", ");
       }
@@ -5145,10 +5271,10 @@
     return null;
   }
   Object visitForStatement(ForStatement node) {
-    Expression initialization4 = node.initialization;
+    Expression initialization2 = node.initialization;
     _writer.print("for (");
-    if (initialization4 != null) {
-      visit(initialization4);
+    if (initialization2 != null) {
+      visit(initialization2);
     } else {
       visit(node.variables);
     }
@@ -5351,6 +5477,12 @@
     visit7(" ", node.expression);
     return null;
   }
+  Object visitNativeFunctionBody(NativeFunctionBody node) {
+    _writer.print("native ");
+    visit(node.stringLiteral);
+    _writer.print(';');
+    return null;
+  }
   Object visitNullLiteral(NullLiteral node) {
     _writer.print("null");
     return null;
@@ -5409,12 +5541,12 @@
     return null;
   }
   Object visitReturnStatement(ReturnStatement node) {
-    Expression expression17 = node.expression;
-    if (expression17 == null) {
+    Expression expression2 = node.expression;
+    if (expression2 == null) {
       _writer.print("return;");
     } else {
       _writer.print("return ");
-      expression17.accept(this);
+      expression2.accept(this);
       _writer.print(";");
     }
     return null;
@@ -5637,8 +5769,8 @@
    */
   void visitList5(NodeList<ASTNode> nodes, String separator) {
     if (nodes != null) {
-      int size8 = nodes.length;
-      for (int i = 0; i < size8; i++) {
+      int size2 = nodes.length;
+      for (int i = 0; i < size2; i++) {
         if ("\n" == separator) {
           _writer.print("\n");
           indent();
@@ -5657,9 +5789,9 @@
    */
   void visitList6(NodeList<ASTNode> nodes, String separator, String suffix) {
     if (nodes != null) {
-      int size9 = nodes.length;
-      if (size9 > 0) {
-        for (int i = 0; i < size9; i++) {
+      int size2 = nodes.length;
+      if (size2 > 0) {
+        for (int i = 0; i < size2; i++) {
           if (i > 0) {
             _writer.print(separator);
           }
@@ -5677,10 +5809,10 @@
    */
   void visitList7(String prefix, NodeList<ASTNode> nodes, String separator) {
     if (nodes != null) {
-      int size10 = nodes.length;
-      if (size10 > 0) {
+      int size2 = nodes.length;
+      if (size2 > 0) {
         _writer.print(prefix);
-        for (int i = 0; i < size10; i++) {
+        for (int i = 0; i < size2; i++) {
           if (i > 0) {
             _writer.print(separator);
           }
diff --git a/pkg/analyzer_experimental/lib/src/generated/resolver.dart b/pkg/analyzer_experimental/lib/src/generated/resolver.dart
index 4305b1a..ddfe703 100644
--- a/pkg/analyzer_experimental/lib/src/generated/resolver.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/resolver.dart
@@ -6,12 +6,14 @@
 import 'dart:collection';
 import 'java_core.dart';
 import 'java_engine.dart';
+import 'instrumentation.dart';
 import 'source.dart';
 import 'error.dart';
 import 'scanner.dart' as sc;
 import 'utilities_dart.dart';
 import 'ast.dart';
-import 'parser.dart' show Parser;
+import 'parser.dart' show Parser, ParserErrorCode;
+import 'sdk.dart' show DartSdk;
 import 'element.dart' hide HideCombinator, ShowCombinator;
 import 'html.dart' as ht;
 import 'engine.dart';
@@ -25,41 +27,29 @@
  */
 class CompilationUnitBuilder {
   /**
-   * The analysis context in which the element model will be built.
-   */
-  AnalysisContextImpl _analysisContext;
-  /**
    * Initialize a newly created compilation unit element builder.
    * @param analysisContext the analysis context in which the element model will be built
    */
-  CompilationUnitBuilder(AnalysisContextImpl analysisContext) {
-    this._analysisContext = analysisContext;
+  CompilationUnitBuilder() : super() {
   }
   /**
    * Build the compilation unit element for the given source.
    * @param source the source describing the compilation unit
-   * @return the compilation unit element that was built
-   * @throws AnalysisException if the analysis could not be performed
-   */
-  CompilationUnitElementImpl buildCompilationUnit(Source source) => buildCompilationUnit2(source, _analysisContext.parseCompilationUnit(source));
-  /**
-   * Build the compilation unit element for the given source.
-   * @param source the source describing the compilation unit
    * @param unit the AST structure representing the compilation unit
    * @return the compilation unit element that was built
    * @throws AnalysisException if the analysis could not be performed
    */
-  CompilationUnitElementImpl buildCompilationUnit2(Source source13, CompilationUnit unit) {
+  CompilationUnitElementImpl buildCompilationUnit(Source source2, CompilationUnit unit) {
     if (unit == null) {
       return null;
     }
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     unit.accept(builder);
-    CompilationUnitElementImpl element = new CompilationUnitElementImpl(source13.shortName);
+    CompilationUnitElementImpl element = new CompilationUnitElementImpl(source2.shortName);
     element.accessors = holder.accessors;
     element.functions = holder.functions;
-    element.source = source13;
+    element.source = source2;
     element.typeAliases = holder.typeAliases;
     element.types = holder.types;
     element.topLevelVariables = holder.topLevelVariables;
@@ -96,6 +86,16 @@
   ElementBuilder(ElementHolder initialHolder) {
     _currentHolder = initialHolder;
   }
+  Object visitBlock(Block node) {
+    bool wasInField = _inFieldContext;
+    _inFieldContext = false;
+    try {
+      node.visitChildren(this);
+    } finally {
+      _inFieldContext = wasInField;
+    }
+    return null;
+  }
   Object visitCatchClause(CatchClause node) {
     SimpleIdentifier exceptionParameter2 = node.exceptionParameter;
     if (exceptionParameter2 != null) {
@@ -117,25 +117,25 @@
     visitChildren(holder, node);
     SimpleIdentifier className = node.name;
     ClassElementImpl element = new ClassElementImpl(className);
-    List<TypeVariableElement> typeVariables4 = holder.typeVariables;
+    List<TypeVariableElement> typeVariables2 = holder.typeVariables;
     InterfaceTypeImpl interfaceType = new InterfaceTypeImpl.con1(element);
-    interfaceType.typeArguments = createTypeVariableTypes(typeVariables4);
+    interfaceType.typeArguments = createTypeVariableTypes(typeVariables2);
     element.type = interfaceType;
-    List<ConstructorElement> constructors3 = holder.constructors;
-    if (constructors3.length == 0) {
+    List<ConstructorElement> constructors2 = holder.constructors;
+    if (constructors2.length == 0) {
       ConstructorElementImpl constructor = new ConstructorElementImpl(null);
       constructor.synthetic = true;
       FunctionTypeImpl type = new FunctionTypeImpl.con1(constructor);
       type.returnType = interfaceType;
       constructor.type = type;
-      constructors3 = <ConstructorElement> [constructor];
+      constructors2 = <ConstructorElement> [constructor];
     }
     element.abstract = node.abstractKeyword != null;
     element.accessors = holder.accessors;
-    element.constructors = constructors3;
+    element.constructors = constructors2;
     element.fields = holder.fields;
     element.methods = holder.methods;
-    element.typeVariables = typeVariables4;
+    element.typeVariables = typeVariables2;
     element.validMixin = _isValidMixin;
     _currentHolder.addType(element);
     className.element = element;
@@ -148,10 +148,10 @@
     ClassElementImpl element = new ClassElementImpl(className);
     element.abstract = node.abstractKeyword != null;
     element.typedef = true;
-    List<TypeVariableElement> typeVariables5 = holder.typeVariables;
-    element.typeVariables = typeVariables5;
+    List<TypeVariableElement> typeVariables2 = holder.typeVariables;
+    element.typeVariables = typeVariables2;
     InterfaceTypeImpl interfaceType = new InterfaceTypeImpl.con1(element);
-    interfaceType.typeArguments = createTypeVariableTypes(typeVariables5);
+    interfaceType.typeArguments = createTypeVariableTypes(typeVariables2);
     element.type = interfaceType;
     _currentHolder.addType(element);
     className.element = element;
@@ -160,7 +160,13 @@
   Object visitConstructorDeclaration(ConstructorDeclaration node) {
     _isValidMixin = false;
     ElementHolder holder = new ElementHolder();
-    visitChildren(holder, node);
+    bool wasInFunction = _inFunction;
+    _inFunction = true;
+    try {
+      visitChildren(holder, node);
+    } finally {
+      _inFunction = wasInFunction;
+    }
     SimpleIdentifier constructorName = node.name;
     ConstructorElementImpl element = new ConstructorElementImpl(constructorName);
     if (node.factoryKeyword != null) {
@@ -174,9 +180,9 @@
     _currentHolder.addConstructor(element);
     node.element = element;
     if (constructorName == null) {
-      Identifier returnType4 = node.returnType;
-      if (returnType4 != null) {
-        element.nameOffset = returnType4.offset;
+      Identifier returnType2 = node.returnType;
+      if (returnType2 != null) {
+        element.nameOffset = returnType2.offset;
       }
     } else {
       constructorName.element = element;
@@ -185,14 +191,14 @@
   }
   Object visitDeclaredIdentifier(DeclaredIdentifier node) {
     SimpleIdentifier variableName = node.identifier;
-    sc.Token keyword28 = node.keyword;
+    sc.Token keyword2 = node.keyword;
     LocalVariableElementImpl element = new LocalVariableElementImpl(variableName);
     ForEachStatement statement = node.parent as ForEachStatement;
     int declarationEnd = node.offset + node.length;
     int statementEnd = statement.offset + statement.length;
     element.setVisibleRange(declarationEnd, statementEnd - declarationEnd - 1);
-    element.const3 = matches(keyword28, sc.Keyword.CONST);
-    element.final2 = matches(keyword28, sc.Keyword.FINAL);
+    element.const3 = matches(keyword2, sc.Keyword.CONST);
+    element.final2 = matches(keyword2, sc.Keyword.FINAL);
     _currentHolder.addLocalVariable(element);
     variableName.element = element;
     return super.visitDeclaredIdentifier(node);
@@ -210,6 +216,8 @@
     if (node.isConst()) {
       parameter = new ConstParameterElementImpl(parameterName);
       parameter.const3 = true;
+    } else if (node.parameter is FieldFormalParameter) {
+      parameter = new FieldFormalParameterElementImpl(parameterName);
     } else {
       parameter = new ParameterElementImpl(parameterName);
     }
@@ -238,7 +246,7 @@
   Object visitFieldFormalParameter(FieldFormalParameter node) {
     if (node.parent is! DefaultFormalParameter) {
       SimpleIdentifier parameterName = node.identifier;
-      ParameterElementImpl parameter = new ParameterElementImpl(parameterName);
+      FieldFormalParameterElementImpl parameter = new FieldFormalParameterElementImpl(parameterName);
       parameter.const3 = node.isConst();
       parameter.initializingFormal = true;
       parameter.final2 = node.isFinal();
@@ -320,8 +328,7 @@
     } finally {
       _inFunction = wasInFunction;
     }
-    SimpleIdentifier functionName = null;
-    FunctionElementImpl element = new FunctionElementImpl.con1(functionName);
+    FunctionElementImpl element = new FunctionElementImpl.con2(node.beginToken.offset);
     element.functions = holder.functions;
     element.labels = holder.labels;
     element.localVariables = holder.localVariables;
@@ -344,13 +351,13 @@
     ElementHolder holder = new ElementHolder();
     visitChildren(holder, node);
     SimpleIdentifier aliasName = node.name;
-    List<ParameterElement> parameters10 = holder.parameters;
-    List<TypeVariableElement> typeVariables6 = holder.typeVariables;
+    List<ParameterElement> parameters2 = holder.parameters;
+    List<TypeVariableElement> typeVariables2 = holder.typeVariables;
     FunctionTypeAliasElementImpl element = new FunctionTypeAliasElementImpl(aliasName);
-    element.parameters = parameters10;
-    element.typeVariables = typeVariables6;
+    element.parameters = parameters2;
+    element.typeVariables = typeVariables2;
     FunctionTypeImpl type = new FunctionTypeImpl.con2(element);
-    type.typeArguments = createTypeVariableTypes(typeVariables6);
+    type.typeArguments = createTypeVariableTypes(typeVariables2);
     element.type = type;
     _currentHolder.addTypeAlias(element);
     aliasName.element = element;
@@ -364,7 +371,9 @@
       _currentHolder.addParameter(parameter);
       parameterName.element = parameter;
     }
-    visitChildren(new ElementHolder(), node);
+    ElementHolder holder = new ElementHolder();
+    visitChildren(holder, node);
+    ((node.element as ParameterElementImpl)).parameters = holder.parameters;
     return null;
   }
   Object visitLabeledStatement(LabeledStatement node) {
@@ -482,9 +491,9 @@
     return super.visitTypeParameter(node);
   }
   Object visitVariableDeclaration(VariableDeclaration node) {
-    sc.Token keyword29 = ((node.parent as VariableDeclarationList)).keyword;
-    bool isConst = matches(keyword29, sc.Keyword.CONST);
-    bool isFinal = matches(keyword29, sc.Keyword.FINAL);
+    sc.Token keyword2 = ((node.parent as VariableDeclarationList)).keyword;
+    bool isConst = matches(keyword2, sc.Keyword.CONST);
+    bool isFinal = matches(keyword2, sc.Keyword.FINAL);
     bool hasInitializer = node.initializer != null;
     VariableElementImpl element;
     if (_inFieldContext) {
@@ -579,14 +588,14 @@
    * @return the body of the function that contains the given parameter
    */
   FunctionBody getFunctionBody(FormalParameter node) {
-    ASTNode parent13 = node.parent;
-    while (parent13 != null) {
-      if (parent13 is FunctionExpression) {
-        return ((parent13 as FunctionExpression)).body;
-      } else if (parent13 is MethodDeclaration) {
-        return ((parent13 as MethodDeclaration)).body;
+    ASTNode parent2 = node.parent;
+    while (parent2 != null) {
+      if (parent2 is FunctionExpression) {
+        return ((parent2 as FunctionExpression)).body;
+      } else if (parent2 is MethodDeclaration) {
+        return ((parent2 as MethodDeclaration)).body;
       }
-      parent13 = parent13.parent;
+      parent2 = parent2.parent;
     }
     return null;
   }
@@ -596,7 +605,7 @@
    * @param keyword the keyword being tested for
    * @return {@code true} if the given token is a token for the given keyword
    */
-  bool matches(sc.Token token, sc.Keyword keyword37) => token != null && identical(token.type, sc.TokenType.KEYWORD) && identical(((token as sc.KeywordToken)).keyword, keyword37);
+  bool matches(sc.Token token, sc.Keyword keyword2) => token != null && identical(token.type, sc.TokenType.KEYWORD) && identical(((token as sc.KeywordToken)).keyword, keyword2);
   /**
    * Make the given holder be the current holder while visiting the given node.
    * @param holder the holder that will gather elements that are built while visiting the children
@@ -689,8 +698,18 @@
   void addTypeVariable(TypeVariableElement element) {
     _typeVariables.add(element);
   }
-  List<PropertyAccessorElement> get accessors => new List.from(_accessors);
-  List<ConstructorElement> get constructors => new List.from(_constructors);
+  List<PropertyAccessorElement> get accessors {
+    if (_accessors.isEmpty) {
+      return PropertyAccessorElementImpl.EMPTY_ARRAY;
+    }
+    return new List.from(_accessors);
+  }
+  List<ConstructorElement> get constructors {
+    if (_constructors.isEmpty) {
+      return ConstructorElementImpl.EMPTY_ARRAY;
+    }
+    return new List.from(_constructors);
+  }
   FieldElement getField(String fieldName) {
     for (FieldElement field in _fields) {
       if (field.name == fieldName) {
@@ -699,16 +718,66 @@
     }
     return null;
   }
-  List<FieldElement> get fields => new List.from(_fields);
-  List<FunctionElement> get functions => new List.from(_functions);
-  List<LabelElement> get labels => new List.from(_labels);
-  List<LocalVariableElement> get localVariables => new List.from(_localVariables);
-  List<MethodElement> get methods => new List.from(_methods);
-  List<ParameterElement> get parameters => new List.from(_parameters);
-  List<TopLevelVariableElement> get topLevelVariables => new List.from(_topLevelVariables);
-  List<FunctionTypeAliasElement> get typeAliases => new List.from(_typeAliases);
-  List<ClassElement> get types => new List.from(_types);
-  List<TypeVariableElement> get typeVariables => new List.from(_typeVariables);
+  List<FieldElement> get fields {
+    if (_fields.isEmpty) {
+      return FieldElementImpl.EMPTY_ARRAY;
+    }
+    return new List.from(_fields);
+  }
+  List<FunctionElement> get functions {
+    if (_functions.isEmpty) {
+      return FunctionElementImpl.EMPTY_ARRAY;
+    }
+    return new List.from(_functions);
+  }
+  List<LabelElement> get labels {
+    if (_labels.isEmpty) {
+      return LabelElementImpl.EMPTY_ARRAY;
+    }
+    return new List.from(_labels);
+  }
+  List<LocalVariableElement> get localVariables {
+    if (_localVariables.isEmpty) {
+      return LocalVariableElementImpl.EMPTY_ARRAY;
+    }
+    return new List.from(_localVariables);
+  }
+  List<MethodElement> get methods {
+    if (_methods.isEmpty) {
+      return MethodElementImpl.EMPTY_ARRAY;
+    }
+    return new List.from(_methods);
+  }
+  List<ParameterElement> get parameters {
+    if (_parameters.isEmpty) {
+      return ParameterElementImpl.EMPTY_ARRAY;
+    }
+    return new List.from(_parameters);
+  }
+  List<TopLevelVariableElement> get topLevelVariables {
+    if (_topLevelVariables.isEmpty) {
+      return TopLevelVariableElementImpl.EMPTY_ARRAY;
+    }
+    return new List.from(_topLevelVariables);
+  }
+  List<FunctionTypeAliasElement> get typeAliases {
+    if (_typeAliases.isEmpty) {
+      return FunctionTypeAliasElementImpl.EMPTY_ARRAY;
+    }
+    return new List.from(_typeAliases);
+  }
+  List<ClassElement> get types {
+    if (_types.isEmpty) {
+      return ClassElementImpl.EMPTY_ARRAY;
+    }
+    return new List.from(_types);
+  }
+  List<TypeVariableElement> get typeVariables {
+    if (_typeVariables.isEmpty) {
+      return TypeVariableElementImpl.EMPTY_ARRAY;
+    }
+    return new List.from(_typeVariables);
+  }
 }
 /**
  * Instances of the class {@code HtmlUnitBuilder} build an element model for a single HTML unit.
@@ -722,7 +791,7 @@
   /**
    * The analysis context in which the element model will be built.
    */
-  AnalysisContextImpl _context;
+  InternalAnalysisContext _context;
   /**
    * The HTML element being built.
    */
@@ -735,7 +804,7 @@
    * Initialize a newly created HTML unit builder.
    * @param context the analysis context in which the element model will be built
    */
-  HtmlUnitBuilder(AnalysisContextImpl context) {
+  HtmlUnitBuilder(InternalAnalysisContext context) {
     this._context = context;
   }
   /**
@@ -751,9 +820,9 @@
    * @param unit the AST structure representing the HTML
    * @throws AnalysisException if the analysis could not be performed
    */
-  HtmlElementImpl buildHtmlElement2(Source source14, ht.HtmlUnit unit) {
-    HtmlElementImpl result = new HtmlElementImpl(_context, source14.shortName);
-    result.source = source14;
+  HtmlElementImpl buildHtmlElement2(Source source2, ht.HtmlUnit unit) {
+    HtmlElementImpl result = new HtmlElementImpl(_context, source2.shortName);
+    result.source = source2;
     _htmlElement = result;
     unit.accept(this);
     _htmlElement = null;
@@ -775,15 +844,15 @@
       if (identical(node.attributeEnd.type, ht.TokenType.GT) && scriptSourcePath == null) {
         EmbeddedHtmlScriptElementImpl script = new EmbeddedHtmlScriptElementImpl(node);
         String contents = node.content;
-        AnalysisErrorListener errorListener = new AnalysisErrorListener_2();
+        AnalysisErrorListener errorListener = new AnalysisErrorListener_5();
         sc.StringScanner scanner = new sc.StringScanner(null, contents, errorListener);
         sc.Token firstToken = scanner.tokenize();
         List<int> lineStarts2 = scanner.lineStarts;
         Parser parser = new Parser(null, errorListener);
         CompilationUnit unit = parser.parseCompilationUnit(firstToken);
         try {
-          CompilationUnitBuilder builder = new CompilationUnitBuilder(_context);
-          CompilationUnitElementImpl elem = builder.buildCompilationUnit2(htmlSource, unit);
+          CompilationUnitBuilder builder = new CompilationUnitBuilder();
+          CompilationUnitElementImpl elem = builder.buildCompilationUnit(htmlSource, unit);
           LibraryElementImpl library = new LibraryElementImpl(_context, null);
           library.definingCompilationUnit = elem;
           script.scriptLibrary = library;
@@ -794,7 +863,7 @@
       } else {
         ExternalHtmlScriptElementImpl script = new ExternalHtmlScriptElementImpl(node);
         if (scriptSourcePath != null) {
-          script.scriptSource = htmlSource.resolve(scriptSourcePath);
+          script.scriptSource = _context.sourceFactory.resolveUri(htmlSource, scriptSourcePath);
         }
         _scripts.add(script);
       }
@@ -840,11 +909,494 @@
     return false;
   }
 }
-class AnalysisErrorListener_2 implements AnalysisErrorListener {
+class AnalysisErrorListener_5 implements AnalysisErrorListener {
   void onError(AnalysisError error) {
   }
 }
 /**
+ * Instances of the class {@code DeclarationResolver} are used to resolve declarations in an AST
+ * structure to already built elements.
+ */
+class DeclarationResolver extends RecursiveASTVisitor<Object> {
+  /**
+   * The compilation unit containing the AST nodes being visited.
+   */
+  CompilationUnitElement _enclosingUnit;
+  /**
+   * The function type alias containing the AST nodes being visited, or {@code null} if we are not
+   * in the scope of a function type alias.
+   */
+  FunctionTypeAliasElement _enclosingAlias;
+  /**
+   * The class containing the AST nodes being visited, or {@code null} if we are not in the scope of
+   * a class.
+   */
+  ClassElement _enclosingClass;
+  /**
+   * The method or function containing the AST nodes being visited, or {@code null} if we are not in
+   * the scope of a method or function.
+   */
+  ExecutableElement _enclosingExecutable;
+  /**
+   * The parameter containing the AST nodes being visited, or {@code null} if we are not in the
+   * scope of a parameter.
+   */
+  ParameterElement _enclosingParameter;
+  /**
+   * Initialize a newly created resolver.
+   */
+  DeclarationResolver() : super() {
+  }
+  /**
+   * Resolve the declarations within the given compilation unit to the elements rooted at the given
+   * element.
+   * @param unit the compilation unit to be resolved
+   * @param element the root of the element model used to resolve the AST nodes
+   */
+  void resolve(CompilationUnit unit, CompilationUnitElement element2) {
+    _enclosingUnit = element2;
+    unit.element = element2;
+    unit.accept(this);
+  }
+  Object visitCatchClause(CatchClause node) {
+    SimpleIdentifier exceptionParameter2 = node.exceptionParameter;
+    if (exceptionParameter2 != null) {
+      List<LocalVariableElement> localVariables2 = _enclosingExecutable.localVariables;
+      find3(localVariables2, exceptionParameter2);
+      SimpleIdentifier stackTraceParameter2 = node.stackTraceParameter;
+      if (stackTraceParameter2 != null) {
+        find3(localVariables2, stackTraceParameter2);
+      }
+    }
+    return super.visitCatchClause(node);
+  }
+  Object visitClassDeclaration(ClassDeclaration node) {
+    ClassElement outerClass = _enclosingClass;
+    try {
+      SimpleIdentifier className = node.name;
+      _enclosingClass = find3(_enclosingUnit.types, className);
+      return super.visitClassDeclaration(node);
+    } finally {
+      _enclosingClass = outerClass;
+    }
+  }
+  Object visitClassTypeAlias(ClassTypeAlias node) {
+    ClassElement outerClass = _enclosingClass;
+    try {
+      SimpleIdentifier className = node.name;
+      _enclosingClass = find3(_enclosingUnit.types, className);
+      return super.visitClassTypeAlias(node);
+    } finally {
+      _enclosingClass = outerClass;
+    }
+  }
+  Object visitConstructorDeclaration(ConstructorDeclaration node) {
+    ExecutableElement outerExecutable = _enclosingExecutable;
+    try {
+      SimpleIdentifier constructorName = node.name;
+      if (constructorName == null) {
+        _enclosingExecutable = _enclosingClass.unnamedConstructor;
+      } else {
+        _enclosingExecutable = _enclosingClass.getNamedConstructor(constructorName.name);
+        constructorName.element = _enclosingExecutable;
+      }
+      node.element = _enclosingExecutable as ConstructorElement;
+      return super.visitConstructorDeclaration(node);
+    } finally {
+      _enclosingExecutable = outerExecutable;
+    }
+  }
+  Object visitDeclaredIdentifier(DeclaredIdentifier node) {
+    SimpleIdentifier variableName = node.identifier;
+    find3(_enclosingExecutable.localVariables, variableName);
+    return super.visitDeclaredIdentifier(node);
+  }
+  Object visitDefaultFormalParameter(DefaultFormalParameter node) {
+    SimpleIdentifier parameterName = node.parameter.identifier;
+    ParameterElement element = null;
+    if (_enclosingExecutable != null) {
+      element = find3(_enclosingExecutable.parameters, parameterName);
+    } else {
+      PrintStringWriter writer = new PrintStringWriter();
+      writer.println("Invalid state found in the Analysis Engine:");
+      writer.println("DeclarationResolver.visitDefaultFormalParameter() is visiting a parameter that does not appear to be in a method or function.");
+      writer.println("Ancestors:");
+      ASTNode parent2 = node.parent;
+      while (parent2 != null) {
+        writer.println(parent2.runtimeType.toString());
+        writer.println("---------");
+        parent2 = parent2.parent;
+      }
+      AnalysisEngine.instance.logger.logError2(writer.toString(), new AnalysisException());
+    }
+    Expression defaultValue2 = node.defaultValue;
+    if (defaultValue2 != null) {
+      ExecutableElement outerExecutable = _enclosingExecutable;
+      try {
+        if (element == null) {
+        } else {
+          _enclosingExecutable = element.initializer;
+        }
+        defaultValue2.accept(this);
+      } finally {
+        _enclosingExecutable = outerExecutable;
+      }
+    }
+    ParameterElement outerParameter = _enclosingParameter;
+    try {
+      _enclosingParameter = element;
+      return super.visitDefaultFormalParameter(node);
+    } finally {
+      _enclosingParameter = outerParameter;
+    }
+  }
+  Object visitExportDirective(ExportDirective node) {
+    String uri2 = getStringValue(node.uri);
+    if (uri2 != null) {
+      LibraryElement library2 = _enclosingUnit.library;
+      ExportElement exportElement = find5(library2.exports, _enclosingUnit.context.sourceFactory.resolveUri(_enclosingUnit.source, uri2));
+      node.element = exportElement;
+    }
+    return super.visitExportDirective(node);
+  }
+  Object visitFieldFormalParameter(FieldFormalParameter node) {
+    if (node.parent is! DefaultFormalParameter) {
+      SimpleIdentifier parameterName = node.identifier;
+      ParameterElement element = find3(_enclosingExecutable.parameters, parameterName);
+      ParameterElement outerParameter = _enclosingParameter;
+      try {
+        _enclosingParameter = element;
+        return super.visitFieldFormalParameter(node);
+      } finally {
+        _enclosingParameter = outerParameter;
+      }
+    } else {
+      return super.visitFieldFormalParameter(node);
+    }
+  }
+  Object visitFunctionDeclaration(FunctionDeclaration node) {
+    ExecutableElement outerExecutable = _enclosingExecutable;
+    try {
+      SimpleIdentifier functionName = node.name;
+      sc.Token property = node.propertyKeyword;
+      if (property == null) {
+        if (_enclosingExecutable != null) {
+          _enclosingExecutable = find3(_enclosingExecutable.functions, functionName);
+        } else {
+          _enclosingExecutable = find3(_enclosingUnit.functions, functionName);
+        }
+      } else {
+        PropertyAccessorElement accessor = find3(_enclosingUnit.accessors, functionName);
+        if (identical(((property as sc.KeywordToken)).keyword, sc.Keyword.SET)) {
+          accessor = accessor.variable.setter;
+          functionName.element = accessor;
+        }
+        _enclosingExecutable = accessor;
+      }
+      node.functionExpression.element = _enclosingExecutable;
+      return super.visitFunctionDeclaration(node);
+    } finally {
+      _enclosingExecutable = outerExecutable;
+    }
+  }
+  Object visitFunctionExpression(FunctionExpression node) {
+    if (node.parent is! FunctionDeclaration) {
+      FunctionElement element = find2(_enclosingExecutable.functions, node.beginToken.offset);
+      node.element = element;
+    }
+    ExecutableElement outerExecutable = _enclosingExecutable;
+    try {
+      _enclosingExecutable = node.element;
+      return super.visitFunctionExpression(node);
+    } finally {
+      _enclosingExecutable = outerExecutable;
+    }
+  }
+  Object visitFunctionTypeAlias(FunctionTypeAlias node) {
+    FunctionTypeAliasElement outerAlias = _enclosingAlias;
+    try {
+      SimpleIdentifier aliasName = node.name;
+      _enclosingAlias = find3(_enclosingUnit.functionTypeAliases, aliasName);
+      return super.visitFunctionTypeAlias(node);
+    } finally {
+      _enclosingAlias = outerAlias;
+    }
+  }
+  Object visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
+    if (node.parent is! DefaultFormalParameter) {
+      SimpleIdentifier parameterName = node.identifier;
+      ParameterElement element = find3(_enclosingExecutable.parameters, parameterName);
+      ParameterElement outerParameter = _enclosingParameter;
+      try {
+        _enclosingParameter = element;
+        return super.visitFunctionTypedFormalParameter(node);
+      } finally {
+        _enclosingParameter = outerParameter;
+      }
+    } else {
+      return super.visitFunctionTypedFormalParameter(node);
+    }
+  }
+  Object visitImportDirective(ImportDirective node) {
+    String uri2 = getStringValue(node.uri);
+    if (uri2 != null) {
+      LibraryElement library2 = _enclosingUnit.library;
+      ImportElement importElement = find6(library2.imports, _enclosingUnit.context.sourceFactory.resolveUri(_enclosingUnit.source, uri2), node.prefix);
+      node.element = importElement;
+    }
+    return super.visitImportDirective(node);
+  }
+  Object visitLabeledStatement(LabeledStatement node) {
+    for (Label label in node.labels) {
+      SimpleIdentifier labelName = label.label;
+      find3(_enclosingExecutable.labels, labelName);
+    }
+    return super.visitLabeledStatement(node);
+  }
+  Object visitLibraryDirective(LibraryDirective node) {
+    node.element = _enclosingUnit.library;
+    return super.visitLibraryDirective(node);
+  }
+  Object visitMethodDeclaration(MethodDeclaration node) {
+    ExecutableElement outerExecutable = _enclosingExecutable;
+    try {
+      sc.Token property = node.propertyKeyword;
+      SimpleIdentifier methodName = node.name;
+      String nameOfMethod = methodName.name;
+      if (nameOfMethod == sc.TokenType.MINUS.lexeme && node.parameters.parameters.length == 0) {
+        nameOfMethod = "unary-";
+      }
+      if (property == null) {
+        _enclosingExecutable = find4(_enclosingClass.methods, nameOfMethod, methodName.offset);
+        methodName.element = _enclosingExecutable;
+      } else {
+        PropertyAccessorElement accessor = find3(_enclosingClass.accessors, methodName);
+        if (identical(((property as sc.KeywordToken)).keyword, sc.Keyword.SET)) {
+          accessor = accessor.variable.setter;
+          methodName.element = accessor;
+        }
+        _enclosingExecutable = accessor;
+      }
+      return super.visitMethodDeclaration(node);
+    } finally {
+      _enclosingExecutable = outerExecutable;
+    }
+  }
+  Object visitPartDirective(PartDirective node) {
+    String uri2 = getStringValue(node.uri);
+    if (uri2 != null) {
+      Source partSource = _enclosingUnit.context.sourceFactory.resolveUri(_enclosingUnit.source, uri2);
+      node.element = find(_enclosingUnit.library.parts, partSource);
+    }
+    return super.visitPartDirective(node);
+  }
+  Object visitPartOfDirective(PartOfDirective node) {
+    node.element = _enclosingUnit.library;
+    return super.visitPartOfDirective(node);
+  }
+  Object visitSimpleFormalParameter(SimpleFormalParameter node) {
+    if (node.parent is! DefaultFormalParameter) {
+      SimpleIdentifier parameterName = node.identifier;
+      ParameterElement element = null;
+      if (_enclosingParameter != null) {
+        element = find3(_enclosingParameter.parameters, parameterName);
+      } else if (_enclosingExecutable != null) {
+        element = find3(_enclosingExecutable.parameters, parameterName);
+      } else if (_enclosingAlias != null) {
+        element = find3(_enclosingAlias.parameters, parameterName);
+      } else {
+      }
+      ParameterElement outerParameter = _enclosingParameter;
+      try {
+        _enclosingParameter = element;
+        return super.visitSimpleFormalParameter(node);
+      } finally {
+        _enclosingParameter = outerParameter;
+      }
+    } else {
+    }
+    return super.visitSimpleFormalParameter(node);
+  }
+  Object visitSwitchCase(SwitchCase node) {
+    for (Label label in node.labels) {
+      SimpleIdentifier labelName = label.label;
+      find3(_enclosingExecutable.labels, labelName);
+    }
+    return super.visitSwitchCase(node);
+  }
+  Object visitSwitchDefault(SwitchDefault node) {
+    for (Label label in node.labels) {
+      SimpleIdentifier labelName = label.label;
+      find3(_enclosingExecutable.labels, labelName);
+    }
+    return super.visitSwitchDefault(node);
+  }
+  Object visitTypeParameter(TypeParameter node) {
+    SimpleIdentifier parameterName = node.name;
+    if (_enclosingClass != null) {
+      find3(_enclosingClass.typeVariables, parameterName);
+    } else if (_enclosingAlias != null) {
+      find3(_enclosingAlias.typeVariables, parameterName);
+    }
+    return super.visitTypeParameter(node);
+  }
+  Object visitVariableDeclaration(VariableDeclaration node) {
+    VariableElement element = null;
+    SimpleIdentifier variableName = node.name;
+    if (_enclosingExecutable != null) {
+      element = find3(_enclosingExecutable.localVariables, variableName);
+    }
+    if (element == null && _enclosingClass != null) {
+      element = find3(_enclosingClass.fields, variableName);
+    }
+    if (element == null && _enclosingUnit != null) {
+      element = find3(_enclosingUnit.topLevelVariables, variableName);
+    }
+    Expression initializer2 = node.initializer;
+    if (initializer2 != null) {
+      ExecutableElement outerExecutable = _enclosingExecutable;
+      try {
+        if (element == null) {
+        } else {
+          _enclosingExecutable = element.initializer;
+        }
+        return super.visitVariableDeclaration(node);
+      } finally {
+        _enclosingExecutable = outerExecutable;
+      }
+    }
+    return super.visitVariableDeclaration(node);
+  }
+  /**
+   * Append the value of the given string literal to the given string builder.
+   * @param builder the builder to which the string's value is to be appended
+   * @param literal the string literal whose value is to be appended to the builder
+   * @throws IllegalArgumentException if the string is not a constant string without any string
+   * interpolation
+   */
+  void appendStringValue(JavaStringBuilder builder, StringLiteral literal) {
+    if (literal is SimpleStringLiteral) {
+      builder.append(((literal as SimpleStringLiteral)).value);
+    } else if (literal is AdjacentStrings) {
+      for (StringLiteral stringLiteral in ((literal as AdjacentStrings)).strings) {
+        appendStringValue(builder, stringLiteral);
+      }
+    } else {
+      throw new IllegalArgumentException();
+    }
+  }
+  /**
+   * Return the element for the part with the given source, or {@code null} if there is no element
+   * for the given source.
+   * @param parts the elements for the parts
+   * @param partSource the source for the part whose element is to be returned
+   * @return the element for the part with the given source
+   */
+  CompilationUnitElement find(List<CompilationUnitElement> parts, Source partSource) {
+    for (CompilationUnitElement part in parts) {
+      if (part.source == partSource) {
+        return part;
+      }
+    }
+    return null;
+  }
+  /**
+   * Return the element in the given array of elements that was created for the declaration at the
+   * given offset. This method should only be used when there is no name
+   * @param elements the elements of the appropriate kind that exist in the current context
+   * @param offset the offset of the name of the element to be returned
+   * @return the element at the given offset
+   */
+  Element find2(List<Element> elements, int offset) => find4(elements, "", offset);
+  /**
+   * Return the element in the given array of elements that was created for the declaration with the
+   * given name.
+   * @param elements the elements of the appropriate kind that exist in the current context
+   * @param identifier the name node in the declaration of the element to be returned
+   * @return the element created for the declaration with the given name
+   */
+  Element find3(List<Element> elements, SimpleIdentifier identifier) {
+    Element element = find4(elements, identifier.name, identifier.offset);
+    identifier.element = element;
+    return element;
+  }
+  /**
+   * Return the element in the given array of elements that was created for the declaration with the
+   * given name at the given offset.
+   * @param elements the elements of the appropriate kind that exist in the current context
+   * @param name the name of the element to be returned
+   * @param offset the offset of the name of the element to be returned
+   * @return the element with the given name and offset
+   */
+  Element find4(List<Element> elements, String name2, int offset) {
+    for (Element element in elements) {
+      if (element.name == name2 && element.nameOffset == offset) {
+        return element;
+      }
+    }
+    return null;
+  }
+  /**
+   * Return the export element from the given array whose library has the given source, or{@code null} if there is no such export.
+   * @param exports the export elements being searched
+   * @param source the source of the library associated with the export element to being searched
+   * for
+   * @return the export element whose library has the given source
+   */
+  ExportElement find5(List<ExportElement> exports, Source source2) {
+    for (ExportElement export in exports) {
+      if (export.exportedLibrary.source == source2) {
+        return export;
+      }
+    }
+    return null;
+  }
+  /**
+   * Return the import element from the given array whose library has the given source and that has
+   * the given prefix, or {@code null} if there is no such import.
+   * @param imports the import elements being searched
+   * @param source the source of the library associated with the import element to being searched
+   * for
+   * @param prefix the prefix with which the library was imported
+   * @return the import element whose library has the given source and prefix
+   */
+  ImportElement find6(List<ImportElement> imports, Source source2, SimpleIdentifier prefix2) {
+    for (ImportElement element in imports) {
+      if (element.importedLibrary.source == source2) {
+        PrefixElement prefixElement = element.prefix;
+        if (prefix2 == null) {
+          if (prefixElement == null) {
+            return element;
+          }
+        } else {
+          if (prefixElement != null && prefix2.name == prefixElement.name) {
+            return element;
+          }
+        }
+      }
+    }
+    return null;
+  }
+  /**
+   * Return the value of the given string literal, or {@code null} if the string is not a constant
+   * string without any string interpolation.
+   * @param literal the string literal whose value is to be returned
+   * @return the value of the given string literal
+   */
+  String getStringValue(StringLiteral literal) {
+    if (literal is StringInterpolation) {
+      return null;
+    }
+    JavaStringBuilder builder = new JavaStringBuilder();
+    try {
+      appendStringValue(builder, literal);
+    } on IllegalArgumentException catch (exception) {
+      return null;
+    }
+    return builder.toString().trim();
+  }
+}
+/**
  * Instances of the class {@code ElementResolver} are used by instances of {@link ResolverVisitor}to resolve references within the AST structure to the elements being referenced. The requirements
  * for the element resolver are:
  * <ol>
@@ -904,20 +1456,17 @@
     this._resolver = resolver;
   }
   Object visitAssignmentExpression(AssignmentExpression node) {
-    sc.TokenType operator7 = node.operator.type;
-    if (operator7 != sc.TokenType.EQ) {
-      operator7 = operatorFromCompoundAssignment(operator7);
+    sc.TokenType operator2 = node.operator.type;
+    if (operator2 != sc.TokenType.EQ) {
+      operator2 = operatorFromCompoundAssignment(operator2);
       Expression leftNode = node.leftHandSide;
       if (leftNode != null) {
         Type2 leftType = getType(leftNode);
         if (leftType != null) {
-          Element leftElement = leftType.element;
-          if (leftElement != null) {
-            MethodElement method = lookUpMethod(leftElement, operator7.lexeme);
-            if (method != null) {
-              node.element = method;
-            } else {
-            }
+          MethodElement method = lookUpMethod(leftType, operator2.lexeme);
+          if (method != null) {
+            node.element = method;
+          } else {
           }
         }
       }
@@ -925,21 +1474,18 @@
     return null;
   }
   Object visitBinaryExpression(BinaryExpression node) {
-    sc.Token operator8 = node.operator;
-    if (operator8.isUserDefinableOperator()) {
+    sc.Token operator2 = node.operator;
+    if (operator2.isUserDefinableOperator()) {
       Type2 leftType = getType(node.leftOperand);
-      Element leftTypeElement;
       if (leftType == null || leftType.isDynamic()) {
         return null;
       } else if (leftType is FunctionType) {
-        leftTypeElement = _resolver.typeProvider.functionType.element;
-      } else {
-        leftTypeElement = leftType.element;
+        leftType = _resolver.typeProvider.functionType;
       }
-      String methodName = operator8.lexeme;
-      MethodElement member = lookUpMethod(leftTypeElement, methodName);
+      String methodName = operator2.lexeme;
+      MethodElement member = lookUpMethod(leftType, methodName);
       if (member == null) {
-        _resolver.reportError3(ResolverErrorCode.CANNOT_BE_RESOLVED, operator8, [methodName]);
+        _resolver.reportError3(StaticWarningCode.UNDEFINED_OPERATOR, operator2, [methodName, leftType.name]);
       } else {
         node.element = member;
       }
@@ -954,28 +1500,43 @@
     }
     return null;
   }
+  Object visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
+    FieldElement fieldElement = null;
+    SimpleIdentifier fieldName2 = node.fieldName;
+    ClassElement enclosingClass2 = _resolver.enclosingClass;
+    fieldElement = ((enclosingClass2 as ClassElementImpl)).getField(fieldName2.name);
+    if (fieldElement == null) {
+      _resolver.reportError(CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTANT_FIELD, node, [fieldName2]);
+    } else if (!fieldElement.isSynthetic()) {
+      recordResolution(fieldName2, fieldElement);
+      if (fieldElement.isStatic()) {
+        _resolver.reportError(CompileTimeErrorCode.INITIALIZER_FOR_STATIC_FIELD, node, [fieldName2]);
+      }
+    }
+    return null;
+  }
   Object visitConstructorName(ConstructorName node) {
-    Type2 type13 = node.type.type;
-    if (type13 is DynamicTypeImpl) {
+    Type2 type2 = node.type.type;
+    if (type2 is DynamicTypeImpl) {
       return null;
-    } else if (type13 is! InterfaceType) {
-      ASTNode parent14 = node.parent;
-      if (parent14 is InstanceCreationExpression) {
-        if (((parent14 as InstanceCreationExpression)).isConst()) {
+    } else if (type2 is! InterfaceType) {
+      ASTNode parent2 = node.parent;
+      if (parent2 is InstanceCreationExpression) {
+        if (((parent2 as InstanceCreationExpression)).isConst()) {
         } else {
         }
       } else {
       }
       return null;
     }
-    ClassElement classElement = ((type13 as InterfaceType)).element;
+    ClassElement classElement = ((type2 as InterfaceType)).element;
     ConstructorElement constructor;
-    SimpleIdentifier name15 = node.name;
-    if (name15 == null) {
+    SimpleIdentifier name2 = node.name;
+    if (name2 == null) {
       constructor = classElement.unnamedConstructor;
     } else {
-      constructor = classElement.getNamedConstructor(name15.name);
-      name15.element = constructor;
+      constructor = classElement.getNamedConstructor(name2.name);
+      name2.element = constructor;
     }
     node.element = constructor;
     return null;
@@ -989,12 +1550,33 @@
     return null;
   }
   Object visitExportDirective(ExportDirective node) {
-    Element element26 = node.element;
-    if (element26 is ExportElement) {
-      resolveCombinators(((element26 as ExportElement)).exportedLibrary, node.combinators);
+    Element element2 = node.element;
+    if (element2 is ExportElement) {
+      resolveCombinators(((element2 as ExportElement)).exportedLibrary, node.combinators);
     }
     return null;
   }
+  Object visitFieldFormalParameter(FieldFormalParameter node) {
+    String fieldName = node.identifier.name;
+    ClassElement classElement = _resolver.enclosingClass;
+    if (classElement != null) {
+      FieldElement fieldElement = ((classElement as ClassElementImpl)).getField(fieldName);
+      if (fieldElement != null) {
+        if (!fieldElement.isSynthetic()) {
+          ParameterElement parameterElement = node.element;
+          if (parameterElement is FieldFormalParameterElementImpl) {
+            ((parameterElement as FieldFormalParameterElementImpl)).field = fieldElement;
+            if (fieldElement.isStatic()) {
+              _resolver.reportError(CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_STATIC_FIELD, node, [fieldName]);
+            }
+          }
+        }
+      } else {
+        _resolver.reportError(CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD, node, [fieldName]);
+      }
+    }
+    return super.visitFieldFormalParameter(node);
+  }
   Object visitFunctionExpressionInvocation(FunctionExpressionInvocation node) => null;
   Object visitImportDirective(ImportDirective node) {
     SimpleIdentifier prefixNode = node.prefix;
@@ -1007,9 +1589,9 @@
         }
       }
     }
-    Element element27 = node.element;
-    if (element27 is ImportElement) {
-      resolveCombinators(((element27 as ImportElement)).importedLibrary, node.combinators);
+    Element element2 = node.element;
+    if (element2 is ImportElement) {
+      resolveCombinators(((element2 as ImportElement)).importedLibrary, node.combinators);
     }
     return null;
   }
@@ -1018,16 +1600,15 @@
     if (arrayType == null || arrayType.isDynamic()) {
       return null;
     }
-    Element arrayTypeElement = arrayType.element;
     String operator;
     if (node.inSetterContext()) {
       operator = sc.TokenType.INDEX_EQ.lexeme;
     } else {
       operator = sc.TokenType.INDEX.lexeme;
     }
-    MethodElement member = lookUpMethod(arrayTypeElement, operator);
+    MethodElement member = lookUpMethod(arrayType, operator);
     if (member == null) {
-      _resolver.reportError(ResolverErrorCode.CANNOT_BE_RESOLVED, node, [operator]);
+      _resolver.reportError(StaticWarningCode.UNDEFINED_OPERATOR, node, [operator, arrayType.name]);
     } else {
       node.element = member;
     }
@@ -1046,32 +1627,36 @@
     if (target == null) {
       element = _resolver.nameScope.lookup(methodName2, _resolver.definingLibrary);
       if (element == null) {
-        element = lookUpMethod(_resolver.enclosingClass, methodName2.name);
-        if (element == null) {
-          PropertyAccessorElement getter = lookUpGetter(_resolver.enclosingClass, methodName2.name);
-          if (getter != null) {
-            FunctionType getterType = getter.type;
-            if (getterType != null) {
-              Type2 returnType5 = getterType.returnType;
-              if (!isExecutableType(returnType5)) {
-                _resolver.reportError(StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION, methodName2, [methodName2.name]);
+        ClassElement enclosingClass2 = _resolver.enclosingClass;
+        if (enclosingClass2 != null) {
+          InterfaceType enclosingType = enclosingClass2.type;
+          element = lookUpMethod(enclosingType, methodName2.name);
+          if (element == null) {
+            PropertyAccessorElement getter = lookUpGetter(enclosingType, methodName2.name);
+            if (getter != null) {
+              FunctionType getterType = getter.type;
+              if (getterType != null) {
+                Type2 returnType2 = getterType.returnType;
+                if (!isExecutableType(returnType2)) {
+                  _resolver.reportError(StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION, methodName2, [methodName2.name]);
+                }
               }
+              recordResolution(methodName2, getter);
+              return null;
             }
-            recordResolution(methodName2, getter);
-            return null;
           }
         }
       }
     } else {
       Type2 targetType = getType(target);
       if (targetType is InterfaceType) {
-        element = lookUpMethod(targetType.element, methodName2.name);
+        InterfaceType classType = targetType as InterfaceType;
+        element = lookUpMethod(classType, methodName2.name);
         if (element == null) {
-          ClassElement targetClass = targetType.element as ClassElement;
-          PropertyAccessorElement accessor = lookUpGetterInType(targetClass, methodName2.name);
+          PropertyAccessorElement accessor = classType.getGetter(methodName2.name);
           if (accessor != null) {
-            Type2 returnType6 = accessor.type.returnType.substitute2(((targetType as InterfaceType)).typeArguments, TypeVariableTypeImpl.getTypes(targetClass.typeVariables));
-            if (!isExecutableType(returnType6)) {
+            Type2 returnType3 = accessor.type.returnType;
+            if (!isExecutableType(returnType3)) {
               _resolver.reportError(StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION, methodName2, [methodName2.name]);
               return null;
             }
@@ -1085,8 +1670,8 @@
       } else if (target is SimpleIdentifier) {
         Element targetElement = ((target as SimpleIdentifier)).element;
         if (targetElement is PrefixElement) {
-          String name9 = "${((target as SimpleIdentifier)).name}.${methodName2}";
-          Identifier functionName = new Identifier_5(name9);
+          String name3 = "${((target as SimpleIdentifier)).name}.${methodName2}";
+          Identifier functionName = new Identifier_8(name3);
           element = _resolver.nameScope.lookup(functionName, _resolver.definingLibrary);
         } else {
           return null;
@@ -1096,29 +1681,60 @@
       }
     }
     ExecutableElement invokedMethod = null;
-    if (element is ExecutableElement) {
+    if (element is PropertyAccessorElement) {
+      PropertyAccessorElement getter = element as PropertyAccessorElement;
+      FunctionType getterType = getter.type;
+      if (getterType != null) {
+        Type2 returnType4 = getterType.returnType;
+        if (!isExecutableType(returnType4)) {
+          _resolver.reportError(StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION, methodName2, [methodName2.name]);
+        }
+      }
+      recordResolution(methodName2, element);
+      return null;
+    } else if (element is ExecutableElement) {
       invokedMethod = element as ExecutableElement;
     } else {
       if (element is PropertyInducingElement) {
-        PropertyAccessorElement getter3 = ((element as PropertyInducingElement)).getter;
-        FunctionType getterType = getter3.type;
+        PropertyAccessorElement getter2 = ((element as PropertyInducingElement)).getter;
+        FunctionType getterType = getter2.type;
         if (getterType != null) {
-          Type2 returnType7 = getterType.returnType;
-          if (!isExecutableType(returnType7)) {
+          Type2 returnType5 = getterType.returnType;
+          if (!isExecutableType(returnType5)) {
             _resolver.reportError(StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION, methodName2, [methodName2.name]);
           }
         }
         recordResolution(methodName2, element);
         return null;
       } else if (element is VariableElement) {
-        Type2 variableType = ((element as VariableElement)).type;
+        Type2 variableType = _resolver.overrideManager.getType(element);
+        if (variableType == null) {
+          variableType = ((element as VariableElement)).type;
+        }
         if (!isExecutableType(variableType)) {
           _resolver.reportError(StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION, methodName2, [methodName2.name]);
         }
         recordResolution(methodName2, element);
         return null;
       } else {
-        _resolver.reportError(StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION, methodName2, [methodName2.name]);
+        if (target == null) {
+          ClassElement enclosingClass3 = _resolver.enclosingClass;
+          if (enclosingClass3 == null) {
+            _resolver.reportError(StaticTypeWarningCode.UNDEFINED_FUNCTION, methodName2, [methodName2.name]);
+          } else if (element == null) {
+            _resolver.reportError(StaticTypeWarningCode.UNDEFINED_METHOD, methodName2, [methodName2.name, enclosingClass3.name]);
+          } else {
+            _resolver.reportError(StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION, methodName2, [methodName2.name]);
+          }
+        } else {
+          Type2 targetType = getType(target);
+          String targetTypeName = targetType == null ? null : targetType.name;
+          if (targetTypeName == null) {
+            _resolver.reportError(StaticTypeWarningCode.UNDEFINED_FUNCTION, methodName2, [methodName2.name]);
+          } else {
+            _resolver.reportError(StaticTypeWarningCode.UNDEFINED_METHOD, methodName2, [methodName2.name, targetTypeName]);
+          }
+        }
         return null;
       }
     }
@@ -1127,115 +1743,113 @@
     return null;
   }
   Object visitPostfixExpression(PostfixExpression node) {
-    sc.Token operator9 = node.operator;
+    sc.Token operator2 = node.operator;
     Type2 operandType = getType(node.operand);
     if (operandType == null || operandType.isDynamic()) {
       return null;
     }
-    Element operandTypeElement = operandType.element;
     String methodName;
-    if (identical(operator9.type, sc.TokenType.PLUS_PLUS)) {
+    if (identical(operator2.type, sc.TokenType.PLUS_PLUS)) {
       methodName = sc.TokenType.PLUS.lexeme;
     } else {
       methodName = sc.TokenType.MINUS.lexeme;
     }
-    MethodElement member = lookUpMethod(operandTypeElement, methodName);
+    MethodElement member = lookUpMethod(operandType, methodName);
     if (member == null) {
-      _resolver.reportError3(ResolverErrorCode.CANNOT_BE_RESOLVED, operator9, [methodName]);
+      _resolver.reportError3(StaticWarningCode.UNDEFINED_OPERATOR, operator2, [methodName, operandType.name]);
     } else {
       node.element = member;
     }
     return null;
   }
   Object visitPrefixedIdentifier(PrefixedIdentifier node) {
-    SimpleIdentifier prefix6 = node.prefix;
-    SimpleIdentifier identifier13 = node.identifier;
-    Element prefixElement = prefix6.element;
+    SimpleIdentifier prefix2 = node.prefix;
+    SimpleIdentifier identifier2 = node.identifier;
+    Element prefixElement = prefix2.element;
     if (prefixElement is PrefixElement) {
       Element element = _resolver.nameScope.lookup(node, _resolver.definingLibrary);
       if (element == null) {
         return null;
       }
-      recordResolution(identifier13, element);
+      recordResolution(identifier2, element);
       return null;
     }
     if (prefixElement is ClassElement) {
       Element memberElement;
       if (node.identifier.inSetterContext()) {
-        memberElement = lookUpSetterInType((prefixElement as ClassElement), identifier13.name);
+        memberElement = ((prefixElement as ClassElementImpl)).getSetter(identifier2.name);
       } else {
-        memberElement = lookUpGetterInType((prefixElement as ClassElement), identifier13.name);
+        memberElement = ((prefixElement as ClassElementImpl)).getGetter(identifier2.name);
       }
       if (memberElement == null) {
-        MethodElement methodElement = lookUpMethod(prefixElement, identifier13.name);
+        MethodElement methodElement = lookUpMethod(((prefixElement as ClassElement)).type, identifier2.name);
         if (methodElement != null) {
-          recordResolution(identifier13, methodElement);
+          recordResolution(identifier2, methodElement);
           return null;
         }
       }
       if (memberElement == null) {
-        reportGetterOrSetterNotFound(node, identifier13, prefixElement.name);
+        reportGetterOrSetterNotFound(node, identifier2, prefixElement.name);
       } else {
-        recordResolution(identifier13, memberElement);
+        recordResolution(identifier2, memberElement);
       }
       return null;
     }
-    Element variableTypeElement;
+    Type2 variableType;
     if (prefixElement is PropertyAccessorElement) {
       PropertyAccessorElement accessor = prefixElement as PropertyAccessorElement;
-      FunctionType type14 = accessor.type;
-      if (type14 == null) {
+      FunctionType type2 = accessor.type;
+      if (type2 == null) {
         return null;
       }
-      Type2 variableType;
       if (accessor.isGetter()) {
-        variableType = type14.returnType;
+        variableType = type2.returnType;
       } else {
-        variableType = type14.normalParameterTypes[0];
+        variableType = type2.normalParameterTypes[0];
       }
       if (variableType == null || variableType.isDynamic()) {
         return null;
       }
-      variableTypeElement = variableType.element;
     } else if (prefixElement is VariableElement) {
-      Type2 prefixType = ((prefixElement as VariableElement)).type;
-      if (prefixType == null || prefixType.isDynamic()) {
+      variableType = _resolver.overrideManager.getType(prefixElement);
+      if (variableType == null) {
+        variableType = ((prefixElement as VariableElement)).type;
+      }
+      if (variableType == null || variableType.isDynamic()) {
         return null;
       }
-      variableTypeElement = prefixType.element;
     } else {
       return null;
     }
     PropertyAccessorElement memberElement = null;
     if (node.identifier.inSetterContext()) {
-      memberElement = lookUpSetter(variableTypeElement, identifier13.name);
+      memberElement = lookUpSetter(variableType, identifier2.name);
     }
     if (memberElement == null && node.identifier.inGetterContext()) {
-      memberElement = lookUpGetter(variableTypeElement, identifier13.name);
+      memberElement = lookUpGetter(variableType, identifier2.name);
     }
     if (memberElement == null) {
-      MethodElement methodElement = lookUpMethod(variableTypeElement, identifier13.name);
+      MethodElement methodElement = lookUpMethod(variableType, identifier2.name);
       if (methodElement != null) {
-        recordResolution(identifier13, methodElement);
+        recordResolution(identifier2, methodElement);
         return null;
       }
     }
     if (memberElement == null) {
-      reportGetterOrSetterNotFound(node, identifier13, variableTypeElement.name);
+      reportGetterOrSetterNotFound(node, identifier2, variableType.element.name);
     } else {
-      recordResolution(identifier13, memberElement);
+      recordResolution(identifier2, memberElement);
     }
     return null;
   }
   Object visitPrefixExpression(PrefixExpression node) {
-    sc.Token operator10 = node.operator;
-    sc.TokenType operatorType = operator10.type;
+    sc.Token operator2 = node.operator;
+    sc.TokenType operatorType = operator2.type;
     if (operatorType.isUserDefinableOperator() || identical(operatorType, sc.TokenType.PLUS_PLUS) || identical(operatorType, sc.TokenType.MINUS_MINUS)) {
       Type2 operandType = getType(node.operand);
       if (operandType == null || operandType.isDynamic()) {
         return null;
       }
-      Element operandTypeElement = operandType.element;
       String methodName;
       if (identical(operatorType, sc.TokenType.PLUS_PLUS)) {
         methodName = sc.TokenType.PLUS.lexeme;
@@ -1244,11 +1858,11 @@
       } else if (identical(operatorType, sc.TokenType.MINUS)) {
         methodName = "unary-";
       } else {
-        methodName = operator10.lexeme;
+        methodName = operator2.lexeme;
       }
-      MethodElement member = lookUpMethod(operandTypeElement, methodName);
+      MethodElement member = lookUpMethod(operandType, methodName);
       if (member == null) {
-        _resolver.reportError3(ResolverErrorCode.CANNOT_BE_RESOLVED, operator10, [methodName]);
+        _resolver.reportError3(StaticWarningCode.UNDEFINED_OPERATOR, operator2, [methodName, operandType.name]);
       } else {
         node.element = member;
       }
@@ -1260,24 +1874,29 @@
     if (targetType is! InterfaceType) {
       return null;
     }
-    ClassElement targetElement = ((targetType as InterfaceType)).element;
     SimpleIdentifier identifier = node.propertyName;
     PropertyAccessorElement memberElement = null;
     if (identifier.inSetterContext()) {
-      memberElement = lookUpSetter(targetElement, identifier.name);
+      memberElement = lookUpSetter(targetType, identifier.name);
     }
     if (memberElement == null && identifier.inGetterContext()) {
-      memberElement = lookUpGetter(targetElement, identifier.name);
+      memberElement = lookUpGetter(targetType, identifier.name);
     }
     if (memberElement == null) {
-      MethodElement methodElement = lookUpMethod(targetElement, identifier.name);
+      MethodElement methodElement = lookUpMethod(targetType, identifier.name);
       if (methodElement != null) {
         recordResolution(identifier, methodElement);
         return null;
       }
     }
     if (memberElement == null) {
-      _resolver.reportError(ResolverErrorCode.CANNOT_BE_RESOLVED, identifier, [identifier.name]);
+      if (identifier.inSetterContext()) {
+        _resolver.reportError(StaticWarningCode.UNDEFINED_SETTER, identifier, [identifier.name, targetType.name]);
+      } else if (identifier.inGetterContext()) {
+        _resolver.reportError(StaticWarningCode.UNDEFINED_GETTER, identifier, [identifier.name, targetType.name]);
+      } else {
+        _resolver.reportError(StaticWarningCode.UNDEFINED_IDENTIFIER, identifier, [identifier.name]);
+      }
     } else {
       recordResolution(identifier, memberElement);
     }
@@ -1311,34 +1930,39 @@
     }
     Element element = _resolver.nameScope.lookup(node, _resolver.definingLibrary);
     if (element is PropertyAccessorElement && node.inSetterContext()) {
-      PropertyInducingElement variable4 = ((element as PropertyAccessorElement)).variable;
-      if (variable4 != null) {
-        PropertyAccessorElement setter3 = variable4.setter;
-        if (setter3 != null) {
-          element = setter3;
+      PropertyInducingElement variable2 = ((element as PropertyAccessorElement)).variable;
+      if (variable2 != null) {
+        PropertyAccessorElement setter2 = variable2.setter;
+        if (setter2 != null) {
+          element = setter2;
         }
       }
     }
-    if (element == null && node.inSetterContext()) {
-      element = lookUpSetter(_resolver.enclosingClass, node.name);
-    }
-    if (element == null && node.inGetterContext()) {
-      element = lookUpGetter(_resolver.enclosingClass, node.name);
+    ClassElement enclosingClass2 = _resolver.enclosingClass;
+    if (element == null && enclosingClass2 != null) {
+      InterfaceType enclosingType = enclosingClass2.type;
+      if (element == null && node.inSetterContext()) {
+        element = lookUpSetter(enclosingType, node.name);
+      }
+      if (element == null && node.inGetterContext()) {
+        element = lookUpGetter(enclosingType, node.name);
+      }
+      if (element == null) {
+        element = lookUpMethod(enclosingType, node.name);
+      }
     }
     if (element == null) {
-      element = lookUpMethod(_resolver.enclosingClass, node.name);
-    }
-    if (element == null) {
+      _resolver.reportError(StaticWarningCode.UNDEFINED_IDENTIFIER, node, [node.name]);
     }
     recordResolution(node, element);
     return null;
   }
   Object visitSuperConstructorInvocation(SuperConstructorInvocation node) {
-    ClassElement enclosingClass3 = _resolver.enclosingClass;
-    if (enclosingClass3 == null) {
+    ClassElement enclosingClass2 = _resolver.enclosingClass;
+    if (enclosingClass2 == null) {
       return null;
     }
-    ClassElement superclass = getSuperclass(enclosingClass3);
+    ClassElement superclass = getSuperclass(enclosingClass2);
     if (superclass == null) {
       return null;
     }
@@ -1360,11 +1984,11 @@
     return null;
   }
   Object visitTypeParameter(TypeParameter node) {
-    TypeName bound3 = node.bound;
-    if (bound3 != null) {
+    TypeName bound2 = node.bound;
+    if (bound2 != null) {
       TypeVariableElementImpl variable = node.name.element as TypeVariableElementImpl;
       if (variable != null) {
-        variable.bound = bound3.type;
+        variable.bound = bound2.type;
       }
     }
     return null;
@@ -1376,11 +2000,11 @@
    * @param name the name being searched for
    * @return the parameter with the given name
    */
-  ParameterElement findNamedParameter(List<ParameterElement> parameters, String name26) {
+  ParameterElement findNamedParameter(List<ParameterElement> parameters, String name2) {
     for (ParameterElement parameter in parameters) {
       if (identical(parameter.parameterKind, ParameterKind.NAMED)) {
         String parameteName = parameter.name;
-        if (parameteName != null && parameteName == name26) {
+        if (parameteName != null && parameteName == name2) {
           return parameter;
         }
       }
@@ -1416,74 +2040,65 @@
    * @param type the type being tested
    * @return {@code true} if the given type represents an object that could be invoked
    */
-  bool isExecutableType(Type2 type) => type.isDynamic() || (type is FunctionType) || type.isDartCoreFunction();
+  bool isExecutableType(Type2 type) {
+    if (type.isDynamic() || (type is FunctionType) || type.isDartCoreFunction()) {
+      return true;
+    } else if (type is InterfaceType) {
+      ClassElement classElement = ((type as InterfaceType)).element;
+      MethodElement methodElement = classElement.lookUpMethod("call", _resolver.definingLibrary);
+      return methodElement != null;
+    }
+    return false;
+  }
   /**
    * Look up the getter with the given name in the given type. Return the element representing the
    * getter that was found, or {@code null} if there is no getter with the given name.
-   * @param element the element representing the type in which the getter is defined
+   * @param type the type in which the getter is defined
    * @param getterName the name of the getter being looked up
    * @return the element representing the getter that was found
    */
-  PropertyAccessorElement lookUpGetter(Element element, String getterName) {
-    if (identical(element, DynamicTypeImpl.instance)) {
-      return null;
-    }
-    element = resolveTypeVariable(element);
-    if (element is ClassElement) {
-      ClassElement classElement = element as ClassElement;
-      PropertyAccessorElement member = classElement.lookUpGetter(getterName, _resolver.definingLibrary);
-      if (member != null) {
-        return member;
+  PropertyAccessorElement lookUpGetter(Type2 type, String getterName) {
+    type = resolveTypeVariable(type);
+    if (type is InterfaceType) {
+      InterfaceType interfaceType = type as InterfaceType;
+      PropertyAccessorElement accessor = interfaceType.lookUpGetter(getterName, _resolver.definingLibrary);
+      if (accessor != null) {
+        return accessor;
       }
-      return lookUpGetterInInterfaces((element as ClassElement), getterName, new Set<ClassElement>());
+      return lookUpGetterInInterfaces(interfaceType, getterName, new Set<ClassElement>());
     }
     return null;
   }
   /**
-   * Look up the name of a getter in the interfaces implemented by the given type, either directly
-   * or indirectly. Return the element representing the getter that was found, or {@code null} if
-   * there is no getter with the given name.
-   * @param element the element representing the type in which the getter is defined
-   * @param memberName the name of the getter being looked up
+   * Look up the getter with the given name in the interfaces implemented by the given type, either
+   * directly or indirectly. Return the element representing the getter that was found, or{@code null} if there is no getter with the given name.
+   * @param targetType the type in which the getter might be defined
+   * @param getterName the name of the getter being looked up
    * @param visitedInterfaces a set containing all of the interfaces that have been examined, used
    * to prevent infinite recursion and to optimize the search
    * @return the element representing the getter that was found
    */
-  PropertyAccessorElement lookUpGetterInInterfaces(ClassElement targetClass, String memberName, Set<ClassElement> visitedInterfaces) {
+  PropertyAccessorElement lookUpGetterInInterfaces(InterfaceType targetType, String getterName, Set<ClassElement> visitedInterfaces) {
+    ClassElement targetClass = targetType.element;
     if (visitedInterfaces.contains(targetClass)) {
       return null;
     }
     javaSetAdd(visitedInterfaces, targetClass);
-    PropertyAccessorElement member = lookUpGetterInType(targetClass, memberName);
-    if (member != null) {
-      return member;
+    PropertyAccessorElement getter = targetType.getGetter(getterName);
+    if (getter != null) {
+      return getter;
     }
-    for (InterfaceType interfaceType in targetClass.interfaces) {
-      member = lookUpGetterInInterfaces(interfaceType.element, memberName, visitedInterfaces);
-      if (member != null) {
-        return member;
+    for (InterfaceType interfaceType in targetType.interfaces) {
+      getter = lookUpGetterInInterfaces(interfaceType, getterName, visitedInterfaces);
+      if (getter != null) {
+        return getter;
       }
     }
-    ClassElement superclass = getSuperclass(targetClass);
-    if (superclass == null) {
+    InterfaceType superclass2 = targetType.superclass;
+    if (superclass2 == null) {
       return null;
     }
-    return lookUpGetterInInterfaces(superclass, memberName, visitedInterfaces);
-  }
-  /**
-   * Look up the name of a getter in the given type. Return the element representing the getter that
-   * was found, or {@code null} if there is no getter with the given name.
-   * @param element the element representing the type in which the getter is defined
-   * @param memberName the name of the getter being looked up
-   * @return the element representing the getter that was found
-   */
-  PropertyAccessorElement lookUpGetterInType(ClassElement element, String memberName) {
-    for (PropertyAccessorElement accessor in element.accessors) {
-      if (accessor.isGetter() && accessor.name == memberName) {
-        return accessor;
-      }
-    }
-    return null;
+    return lookUpGetterInInterfaces(superclass2, getterName, visitedInterfaces);
   }
   /**
    * Find the element corresponding to the given label node in the current label scope.
@@ -1526,138 +2141,102 @@
   /**
    * Look up the method with the given name in the given type. Return the element representing the
    * method that was found, or {@code null} if there is no method with the given name.
-   * @param element the element representing the type in which the method is defined
+   * @param type the type in which the method is defined
    * @param methodName the name of the method being looked up
    * @return the element representing the method that was found
    */
-  MethodElement lookUpMethod(Element element, String methodName) {
-    if (identical(element, DynamicTypeImpl.instance)) {
-      return null;
-    }
-    element = resolveTypeVariable(element);
-    if (element is ClassElement) {
-      ClassElement classElement = element as ClassElement;
-      MethodElement member = classElement.lookUpMethod(methodName, _resolver.definingLibrary);
-      if (member != null) {
-        return member;
+  MethodElement lookUpMethod(Type2 type, String methodName) {
+    type = resolveTypeVariable(type);
+    if (type is InterfaceType) {
+      InterfaceType interfaceType = type as InterfaceType;
+      MethodElement method = interfaceType.lookUpMethod(methodName, _resolver.definingLibrary);
+      if (method != null) {
+        return method;
       }
-      return lookUpMethodInInterfaces((element as ClassElement), methodName, new Set<ClassElement>());
+      return lookUpMethodInInterfaces(interfaceType, methodName, new Set<ClassElement>());
     }
     return null;
   }
   /**
-   * Look up the name of a member in the interfaces implemented by the given type, either directly
-   * or indirectly. Return the element representing the member that was found, or {@code null} if
-   * there is no member with the given name.
-   * @param element the element representing the type in which the member is defined
-   * @param memberName the name of the member being looked up
+   * Look up the method with the given name in the interfaces implemented by the given type, either
+   * directly or indirectly. Return the element representing the method that was found, or{@code null} if there is no method with the given name.
+   * @param targetType the type in which the member might be defined
+   * @param methodName the name of the method being looked up
    * @param visitedInterfaces a set containing all of the interfaces that have been examined, used
    * to prevent infinite recursion and to optimize the search
-   * @return the element representing the member that was found
+   * @return the element representing the method that was found
    */
-  MethodElement lookUpMethodInInterfaces(ClassElement targetClass, String memberName, Set<ClassElement> visitedInterfaces) {
+  MethodElement lookUpMethodInInterfaces(InterfaceType targetType, String methodName, Set<ClassElement> visitedInterfaces) {
+    ClassElement targetClass = targetType.element;
     if (visitedInterfaces.contains(targetClass)) {
       return null;
     }
     javaSetAdd(visitedInterfaces, targetClass);
-    MethodElement member = lookUpMethodInType(targetClass, memberName);
-    if (member != null) {
-      return member;
+    MethodElement method = targetType.getMethod(methodName);
+    if (method != null) {
+      return method;
     }
-    for (InterfaceType interfaceType in targetClass.interfaces) {
-      member = lookUpMethodInInterfaces(interfaceType.element, memberName, visitedInterfaces);
-      if (member != null) {
-        return member;
-      }
-    }
-    ClassElement superclass = getSuperclass(targetClass);
-    if (superclass == null) {
-      return null;
-    }
-    return lookUpMethodInInterfaces(superclass, memberName, visitedInterfaces);
-  }
-  /**
-   * Look up the name of a method in the given type. Return the element representing the method that
-   * was found, or {@code null} if there is no method with the given name.
-   * @param element the element representing the type in which the method is defined
-   * @param memberName the name of the method being looked up
-   * @return the element representing the method that was found
-   */
-  MethodElement lookUpMethodInType(ClassElement element, String memberName) {
-    for (MethodElement method in element.methods) {
-      if (method.name == memberName) {
+    for (InterfaceType interfaceType in targetType.interfaces) {
+      method = lookUpMethodInInterfaces(interfaceType, methodName, visitedInterfaces);
+      if (method != null) {
         return method;
       }
     }
-    return null;
+    InterfaceType superclass2 = targetType.superclass;
+    if (superclass2 == null) {
+      return null;
+    }
+    return lookUpMethodInInterfaces(superclass2, methodName, visitedInterfaces);
   }
   /**
    * Look up the setter with the given name in the given type. Return the element representing the
    * setter that was found, or {@code null} if there is no setter with the given name.
-   * @param element the element representing the type in which the setter is defined
+   * @param type the type in which the setter is defined
    * @param setterName the name of the setter being looked up
    * @return the element representing the setter that was found
    */
-  PropertyAccessorElement lookUpSetter(Element element, String setterName) {
-    if (identical(element, DynamicTypeImpl.instance)) {
-      return null;
-    }
-    element = resolveTypeVariable(element);
-    if (element is ClassElement) {
-      ClassElement classElement = element as ClassElement;
-      PropertyAccessorElement member = classElement.lookUpSetter(setterName, _resolver.definingLibrary);
-      if (member != null) {
-        return member;
+  PropertyAccessorElement lookUpSetter(Type2 type, String setterName) {
+    type = resolveTypeVariable(type);
+    if (type is InterfaceType) {
+      InterfaceType interfaceType = type as InterfaceType;
+      PropertyAccessorElement accessor = interfaceType.lookUpSetter(setterName, _resolver.definingLibrary);
+      if (accessor != null) {
+        return accessor;
       }
-      return lookUpSetterInInterfaces((element as ClassElement), setterName, new Set<ClassElement>());
+      return lookUpSetterInInterfaces(interfaceType, setterName, new Set<ClassElement>());
     }
     return null;
   }
   /**
-   * Look up the name of a setter in the interfaces implemented by the given type, either directly
-   * or indirectly. Return the element representing the setter that was found, or {@code null} if
-   * there is no setter with the given name.
-   * @param element the element representing the type in which the setter is defined
-   * @param memberName the name of the setter being looked up
+   * Look up the setter with the given name in the interfaces implemented by the given type, either
+   * directly or indirectly. Return the element representing the setter that was found, or{@code null} if there is no setter with the given name.
+   * @param targetType the type in which the setter might be defined
+   * @param setterName the name of the setter being looked up
    * @param visitedInterfaces a set containing all of the interfaces that have been examined, used
    * to prevent infinite recursion and to optimize the search
    * @return the element representing the setter that was found
    */
-  PropertyAccessorElement lookUpSetterInInterfaces(ClassElement targetClass, String memberName, Set<ClassElement> visitedInterfaces) {
+  PropertyAccessorElement lookUpSetterInInterfaces(InterfaceType targetType, String setterName, Set<ClassElement> visitedInterfaces) {
+    ClassElement targetClass = targetType.element;
     if (visitedInterfaces.contains(targetClass)) {
       return null;
     }
     javaSetAdd(visitedInterfaces, targetClass);
-    PropertyAccessorElement member = lookUpSetterInType(targetClass, memberName);
-    if (member != null) {
-      return member;
+    PropertyAccessorElement setter = targetType.getGetter(setterName);
+    if (setter != null) {
+      return setter;
     }
-    for (InterfaceType interfaceType in targetClass.interfaces) {
-      member = lookUpSetterInInterfaces(interfaceType.element, memberName, visitedInterfaces);
-      if (member != null) {
-        return member;
+    for (InterfaceType interfaceType in targetType.interfaces) {
+      setter = lookUpSetterInInterfaces(interfaceType, setterName, visitedInterfaces);
+      if (setter != null) {
+        return setter;
       }
     }
-    ClassElement superclass = getSuperclass(targetClass);
-    if (superclass == null) {
+    InterfaceType superclass2 = targetType.superclass;
+    if (superclass2 == null) {
       return null;
     }
-    return lookUpSetterInInterfaces(superclass, memberName, visitedInterfaces);
-  }
-  /**
-   * Look up the name of a setter in the given type. Return the element representing the setter that
-   * was found, or {@code null} if there is no setter with the given name.
-   * @param element the element representing the type in which the setter is defined
-   * @param memberName the name of the setter being looked up
-   * @return the element representing the setter that was found
-   */
-  PropertyAccessorElement lookUpSetterInType(ClassElement element, String memberName) {
-    for (PropertyAccessorElement accessor in element.accessors) {
-      if (accessor.isSetter() && accessor.name == memberName) {
-        return accessor;
-      }
-    }
-    return null;
+    return lookUpSetterInInterfaces(superclass2, setterName, visitedInterfaces);
   }
   /**
    * Return the binary operator that is invoked by the given compound assignment operator.
@@ -1699,9 +2278,9 @@
    * @param node the AST node that was resolved
    * @param element the element to which the AST node was resolved
    */
-  void recordResolution(SimpleIdentifier node, Element element58) {
-    if (element58 != null) {
-      node.element = element58;
+  void recordResolution(SimpleIdentifier node, Element element2) {
+    if (element2 != null) {
+      node.element = element2;
     }
   }
   /**
@@ -1712,10 +2291,10 @@
    * @param identifier the identifier in the passed prefix identifier
    * @param typeName the name of the type of the left hand side of the passed prefixed identifier
    */
-  void reportGetterOrSetterNotFound(PrefixedIdentifier node, SimpleIdentifier identifier30, String typeName) {
+  void reportGetterOrSetterNotFound(PrefixedIdentifier node, SimpleIdentifier identifier2, String typeName) {
     bool isSetterContext = node.identifier.inSetterContext();
     ErrorCode errorCode = isSetterContext ? StaticTypeWarningCode.UNDEFINED_SETTER : StaticTypeWarningCode.UNDEFINED_GETTER;
-    _resolver.reportError(errorCode, identifier30, [identifier30.name, typeName]);
+    _resolver.reportError(errorCode, identifier2, [identifier2.name, typeName]);
   }
   /**
    * Resolve the names in the given combinators in the scope of the given library.
@@ -1753,43 +2332,43 @@
     if (invokedMethod == null) {
       return;
     }
-    List<ParameterElement> parameters11 = invokedMethod.parameters;
+    List<ParameterElement> parameters2 = invokedMethod.parameters;
     for (Expression argument in argumentList.arguments) {
       if (argument is NamedExpression) {
-        SimpleIdentifier name16 = ((argument as NamedExpression)).name.label;
-        ParameterElement parameter = findNamedParameter(parameters11, name16.name);
+        SimpleIdentifier name2 = ((argument as NamedExpression)).name.label;
+        ParameterElement parameter = findNamedParameter(parameters2, name2.name);
         if (parameter != null) {
-          recordResolution(name16, parameter);
+          recordResolution(name2, parameter);
         }
       }
     }
   }
   /**
-   * If the given element is a type variable, resolve it to the class that should be used when
-   * looking up members. Otherwise, return the original element.
-   * @param element the element that is to be resolved if it is a type variable
-   * @return the class that should be used in place of the argument if it is a type variable, or the
+   * If the given type is a type variable, resolve it to the type that should be used when looking
+   * up members. Otherwise, return the original type.
+   * @param type the type that is to be resolved if it is a type variable
+   * @return the type that should be used in place of the argument if it is a type variable, or the
    * original argument if it isn't a type variable
    */
-  Element resolveTypeVariable(Element element59) {
-    if (element59 is TypeVariableElement) {
-      Type2 bound4 = ((element59 as TypeVariableElement)).bound;
-      if (bound4 == null) {
-        return _resolver.typeProvider.objectType.element;
+  Type2 resolveTypeVariable(Type2 type) {
+    if (type is TypeVariableType) {
+      Type2 bound2 = ((type as TypeVariableType)).element.bound;
+      if (bound2 == null) {
+        return _resolver.typeProvider.objectType;
       }
-      return bound4.element;
+      return bound2;
     }
-    return element59;
+    return type;
   }
 }
-class Identifier_5 extends Identifier {
-  String name9;
-  Identifier_5(this.name9) : super();
+class Identifier_8 extends Identifier {
+  String name3;
+  Identifier_8(this.name3) : super();
   accept(ASTVisitor visitor) => null;
   sc.Token get beginToken => null;
   Element get element => null;
   sc.Token get endToken => null;
-  String get name => name9;
+  String get name => name3;
   void visitChildren(ASTVisitor<Object> visitor) {
   }
 }
@@ -1803,7 +2382,7 @@
   /**
    * The analysis context in which this library is being analyzed.
    */
-  AnalysisContextImpl _analysisContext;
+  InternalAnalysisContext _analysisContext;
   /**
    * The listener to which analysis errors will be reported.
    */
@@ -1843,7 +2422,7 @@
    * @param errorListener the listener to which analysis errors will be reported
    * @param librarySource the source specifying the defining compilation unit of this library
    */
-  Library(AnalysisContextImpl analysisContext, AnalysisErrorListener errorListener, Source librarySource) {
+  Library(InternalAnalysisContext analysisContext, AnalysisErrorListener errorListener, Source librarySource) {
     this._analysisContext = analysisContext;
     this._errorListener = errorListener;
     this._librarySource = librarySource;
@@ -1872,13 +2451,14 @@
   CompilationUnit getAST(Source source) {
     CompilationUnit unit = _astMap[source];
     if (unit == null) {
-      unit = _analysisContext.parseCompilationUnit(source);
+      unit = _analysisContext.computeResolvableCompilationUnit(source);
       _astMap[source] = unit;
     }
     return unit;
   }
   /**
-   * Return a collection containing the sources for the compilation units in this library.
+   * Return a collection containing the sources for the compilation units in this library, including
+   * the defining compilation unit.
    * @return the sources for the compilation units in this library
    */
   Set<Source> get compilationUnitSources => _astMap.keys.toSet();
@@ -1975,7 +2555,11 @@
       _errorListener.onError(new AnalysisError.con2(_librarySource, uriLiteral.offset, uriLiteral.length, CompileTimeErrorCode.URI_WITH_INTERPOLATION, []));
       return null;
     }
-    return getSource2(getStringValue(uriLiteral));
+    Source source = getSource2(getStringValue(uriLiteral));
+    if (source == null || !source.exists()) {
+      _errorListener.onError(new AnalysisError.con2(_librarySource, uriLiteral.offset, uriLiteral.length, CompileTimeErrorCode.INVALID_URI, [uriLiteral.toSource()]));
+    }
+    return source;
   }
   /**
    * Set whether this library explicitly imports core to match the given value.
@@ -2020,7 +2604,7 @@
     if (uri == null) {
       return null;
     }
-    return _librarySource.resolve(uri);
+    return _analysisContext.sourceFactory.resolveUri(_librarySource, uri);
   }
   /**
    * Return the value of the given string literal, or {@code null} if the string is not a constant
@@ -2046,16 +2630,12 @@
   /**
    * The analysis context in which the element model will be built.
    */
-  AnalysisContextImpl _analysisContext;
+  InternalAnalysisContext _analysisContext;
   /**
    * The listener to which errors will be reported.
    */
   AnalysisErrorListener _errorListener;
   /**
-   * The name of the core library.
-   */
-  static String CORE_LIBRARY_URI = "dart:core";
-  /**
    * The name of the function used as an entry point.
    */
   static String _ENTRY_POINT_NAME = "main";
@@ -2074,17 +2654,17 @@
    * @throws AnalysisException if the analysis could not be performed
    */
   LibraryElementImpl buildLibrary(Library library) {
-    CompilationUnitBuilder builder = new CompilationUnitBuilder(_analysisContext);
+    CompilationUnitBuilder builder = new CompilationUnitBuilder();
     Source librarySource2 = library.librarySource;
-    CompilationUnit definingCompilationUnit3 = library.definingCompilationUnit;
-    CompilationUnitElementImpl definingCompilationUnitElement = builder.buildCompilationUnit2(librarySource2, definingCompilationUnit3);
-    NodeList<Directive> directives3 = definingCompilationUnit3.directives;
+    CompilationUnit definingCompilationUnit2 = library.definingCompilationUnit;
+    CompilationUnitElementImpl definingCompilationUnitElement = builder.buildCompilationUnit(librarySource2, definingCompilationUnit2);
+    NodeList<Directive> directives2 = definingCompilationUnit2.directives;
     LibraryIdentifier libraryNameNode = null;
     bool hasPartDirective = false;
     FunctionElement entryPoint = findEntryPoint(definingCompilationUnitElement);
     List<Directive> directivesToResolve = new List<Directive>();
     List<CompilationUnitElementImpl> sourcedCompilationUnits = new List<CompilationUnitElementImpl>();
-    for (Directive directive in directives3) {
+    for (Directive directive in directives2) {
       if (directive is LibraryDirective) {
         if (libraryNameNode == null) {
           libraryNameNode = ((directive as LibraryDirective)).name;
@@ -2095,10 +2675,10 @@
         StringLiteral partUri = ((directive as PartDirective)).uri;
         Source partSource = library.getSource(partUri);
         if (partSource != null && partSource.exists()) {
-          CompilationUnitElementImpl part = builder.buildCompilationUnit(partSource);
+          CompilationUnitElementImpl part = builder.buildCompilationUnit(partSource, library.getAST(partSource));
           String partLibraryName = getPartLibraryName(library, partSource, directivesToResolve);
           if (partLibraryName == null) {
-            _errorListener.onError(new AnalysisError.con2(librarySource2, partUri.offset, partUri.length, ResolverErrorCode.MISSING_PART_OF_DIRECTIVE, []));
+            _errorListener.onError(new AnalysisError.con2(librarySource2, partUri.offset, partUri.length, CompileTimeErrorCode.PART_OF_NON_PART, [partUri.toSource()]));
           } else if (libraryNameNode == null) {
           } else if (libraryNameNode.name != partLibraryName) {
             _errorListener.onError(new AnalysisError.con2(librarySource2, partUri.offset, partUri.length, StaticWarningCode.PART_OF_DIFFERENT_LIBRARY, [libraryNameNode.name, partLibraryName]));
@@ -2154,9 +2734,9 @@
       for (Directive directive in partUnit.directives) {
         if (directive is PartOfDirective) {
           directivesToResolve.add(directive);
-          LibraryIdentifier libraryName3 = ((directive as PartOfDirective)).libraryName;
-          if (libraryName3 != null) {
-            return libraryName3.name;
+          LibraryIdentifier libraryName2 = ((directive as PartOfDirective)).libraryName;
+          if (libraryName2 != null) {
+            return libraryName2.name;
           }
         }
       }
@@ -2174,7 +2754,7 @@
   /**
    * The analysis context in which the libraries are being analyzed.
    */
-  AnalysisContextImpl _analysisContext;
+  InternalAnalysisContext _analysisContext;
   /**
    * The listener to which analysis errors will be reported, this error listener is either
    * references {@link #recordingErrorListener}, or it unions the passed{@link AnalysisErrorListener} with the {@link #recordingErrorListener}.
@@ -2210,35 +2790,35 @@
    * Initialize a newly created library resolver to resolve libraries within the given context.
    * @param analysisContext the analysis context in which the library is being analyzed
    */
-  LibraryResolver.con1(AnalysisContextImpl analysisContext) {
-    _jtd_constructor_243_impl(analysisContext);
+  LibraryResolver.con1(InternalAnalysisContext analysisContext) {
+    _jtd_constructor_263_impl(analysisContext);
   }
-  _jtd_constructor_243_impl(AnalysisContextImpl analysisContext) {
-    _jtd_constructor_244_impl(analysisContext, null);
+  _jtd_constructor_263_impl(InternalAnalysisContext analysisContext) {
+    _jtd_constructor_264_impl(analysisContext, null);
   }
   /**
    * Initialize a newly created library resolver to resolve libraries within the given context.
    * @param analysisContext the analysis context in which the library is being analyzed
    * @param errorListener the listener to which analysis errors will be reported
    */
-  LibraryResolver.con2(AnalysisContextImpl analysisContext2, AnalysisErrorListener additionalAnalysisErrorListener) {
-    _jtd_constructor_244_impl(analysisContext2, additionalAnalysisErrorListener);
+  LibraryResolver.con2(InternalAnalysisContext analysisContext2, AnalysisErrorListener additionalAnalysisErrorListener) {
+    _jtd_constructor_264_impl(analysisContext2, additionalAnalysisErrorListener);
   }
-  _jtd_constructor_244_impl(AnalysisContextImpl analysisContext2, AnalysisErrorListener additionalAnalysisErrorListener) {
+  _jtd_constructor_264_impl(InternalAnalysisContext analysisContext2, AnalysisErrorListener additionalAnalysisErrorListener) {
     this._analysisContext = analysisContext2;
     this._recordingErrorListener = new RecordingErrorListener();
     if (additionalAnalysisErrorListener == null) {
       this._errorListener = _recordingErrorListener;
     } else {
-      this._errorListener = new AnalysisErrorListener_6(this, additionalAnalysisErrorListener);
+      this._errorListener = new AnalysisErrorListener_9(this, additionalAnalysisErrorListener);
     }
-    _coreLibrarySource = analysisContext2.sourceFactory.forUri(LibraryElementBuilder.CORE_LIBRARY_URI);
+    _coreLibrarySource = analysisContext2.sourceFactory.forUri(DartSdk.DART_CORE);
   }
   /**
    * Return the analysis context in which the libraries are being analyzed.
    * @return the analysis context in which the libraries are being analyzed
    */
-  AnalysisContextImpl get analysisContext => _analysisContext;
+  InternalAnalysisContext get analysisContext => _analysisContext;
   /**
    * Return the listener to which analysis errors will be reported.
    * @return the listener to which analysis errors will be reported
@@ -2257,23 +2837,47 @@
    * @throws AnalysisException if the library could not be resolved for some reason
    */
   LibraryElement resolveLibrary(Source librarySource, bool fullAnalysis) {
-    Library targetLibrary = createLibrary(librarySource);
-    _coreLibrary = _libraryMap[_coreLibrarySource];
-    if (_coreLibrary == null) {
-      _coreLibrary = createLibrary(_coreLibrarySource);
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engine.LibraryResolver.resolveLibrary");
+    try {
+      instrumentation.metric("fullAnalysis", fullAnalysis);
+      instrumentation.data3("fullName", librarySource.fullName);
+      Library targetLibrary = createLibrary(librarySource);
+      _coreLibrary = _libraryMap[_coreLibrarySource];
+      if (_coreLibrary == null) {
+        _coreLibrary = createLibrary(_coreLibrarySource);
+      }
+      instrumentation.metric3("createLibrary", "complete");
+      computeLibraryDependencies(targetLibrary);
+      _librariesInCycles = computeLibrariesInCycles(targetLibrary);
+      buildElementModels();
+      instrumentation.metric3("buildElementModels", "complete");
+      LibraryElement coreElement = _coreLibrary.libraryElement;
+      if (coreElement == null) {
+        throw new AnalysisException.con1("Could not resolve dart:core");
+      }
+      buildDirectiveModels();
+      instrumentation.metric3("buildDirectiveModels", "complete");
+      _typeProvider = new TypeProviderImpl(coreElement);
+      buildTypeHierarchies();
+      instrumentation.metric3("buildTypeHierarchies", "complete");
+      resolveReferencesAndTypes();
+      instrumentation.metric3("resolveReferencesAndTypes", "complete");
+      performConstantEvaluation();
+      instrumentation.metric3("performConstantEvaluation", "complete");
+      if (fullAnalysis) {
+        runAdditionalAnalyses();
+        instrumentation.metric3("runAdditionalAnalyses", "complete");
+      }
+      recordResults();
+      instrumentation.metric3("recordResults", "complete");
+      instrumentation.metric2("librariesInCycles", _librariesInCycles.length);
+      for (Library lib in _librariesInCycles) {
+        instrumentation.metric2("librariesInCycles-CompilationUnitSources-Size", lib.compilationUnitSources.length);
+      }
+      return targetLibrary.libraryElement;
+    } finally {
+      instrumentation.log();
     }
-    computeLibraryDependencies(targetLibrary);
-    _librariesInCycles = computeLibrariesInCycles(targetLibrary);
-    buildElementModels();
-    buildDirectiveModels();
-    _typeProvider = new TypeProviderImpl(_coreLibrary.libraryElement);
-    buildTypeHierarchies();
-    resolveReferencesAndTypes();
-    if (fullAnalysis) {
-      runAdditionalAnalyses();
-    }
-    recordResults();
-    return targetLibrary.libraryElement;
   }
   /**
    * Add a dependency to the given map from the referencing library to the referenced library.
@@ -2397,16 +3001,16 @@
           }
         }
       }
-      Source librarySource3 = library.librarySource;
-      if (!library.explicitlyImportsCore && _coreLibrarySource != librarySource3) {
+      Source librarySource2 = library.librarySource;
+      if (!library.explicitlyImportsCore && _coreLibrarySource != librarySource2) {
         ImportElementImpl importElement = new ImportElementImpl();
         importElement.importedLibrary = _coreLibrary.libraryElement;
         importElement.synthetic = true;
         imports.add(importElement);
       }
-      LibraryElementImpl libraryElement3 = library.libraryElement;
-      libraryElement3.imports = new List.from(imports);
-      libraryElement3.exports = new List.from(exports);
+      LibraryElementImpl libraryElement2 = library.libraryElement;
+      libraryElement2.imports = new List.from(imports);
+      libraryElement2.exports = new List.from(exports);
     }
   }
   /**
@@ -2428,7 +3032,7 @@
   void buildTypeHierarchies() {
     for (Library library in _librariesInCycles) {
       for (Source source in library.compilationUnitSources) {
-        TypeResolverVisitor visitor = new TypeResolverVisitor(library, source, _typeProvider);
+        TypeResolverVisitor visitor = new TypeResolverVisitor.con1(library, source, _typeProvider);
         library.getAST(source).accept(visitor);
       }
     }
@@ -2487,6 +3091,10 @@
           }
           if (importedLibrary != null) {
             library.addImport(importDirective, importedLibrary);
+            if (doesCompilationUnitHavePartOfDirective(importedLibrary.getAST(importedSource))) {
+              StringLiteral uriLiteral = importDirective.uri;
+              _errorListener.onError(new AnalysisError.con2(library.librarySource, uriLiteral.offset, uriLiteral.length, CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY, [uriLiteral.toSource()]));
+            }
           }
         }
       } else if (directive is ExportDirective) {
@@ -2502,6 +3110,10 @@
           }
           if (exportedLibrary != null) {
             library.addExport(exportDirective, exportedLibrary);
+            if (doesCompilationUnitHavePartOfDirective(exportedLibrary.getAST(exportedSource))) {
+              StringLiteral uriLiteral = exportDirective.uri;
+              _errorListener.onError(new AnalysisError.con2(library.librarySource, uriLiteral.offset, uriLiteral.length, CompileTimeErrorCode.EXPORT_OF_NON_LIBRARY, [uriLiteral.toSource()]));
+            }
           }
         }
       }
@@ -2551,6 +3163,20 @@
     return library;
   }
   /**
+   * Return {@code true} if and only if the passed {@link CompilationUnit} has a part-of directive.
+   * @param node the {@link CompilationUnit} to test
+   * @return {@code true} if and only if the passed {@link CompilationUnit} has a part-of directive
+   */
+  bool doesCompilationUnitHavePartOfDirective(CompilationUnit node) {
+    NodeList<Directive> directives2 = node.directives;
+    for (Directive directive in directives2) {
+      if (directive is PartOfDirective) {
+        return true;
+      }
+    }
+    return false;
+  }
+  /**
    * Return an array containing the lexical identifiers associated with the nodes in the given list.
    * @param names the AST nodes representing the identifiers
    * @return the lexical identifiers associated with the nodes in the list
@@ -2564,6 +3190,25 @@
     return identifiers;
   }
   /**
+   * Compute a value for all of the constants in the libraries being analyzed.
+   */
+  void performConstantEvaluation() {
+    ConstantValueComputer computer = new ConstantValueComputer();
+    for (Library library in _librariesInCycles) {
+      for (Source source in library.compilationUnitSources) {
+        try {
+          CompilationUnit unit = library.getAST(source);
+          if (unit != null) {
+            computer.add(unit);
+          }
+        } on AnalysisException catch (exception) {
+          AnalysisEngine.instance.logger.logError2("Internal Error: Could not access AST for ${source.fullName} during constant evaluation", exception);
+        }
+      }
+    }
+    computer.computeValues();
+  }
+  /**
    * Record the results of resolution with the analysis context. This includes recording
    * <ul>
    * <li>the resolved AST associated with each compilation unit,</li>
@@ -2606,7 +3251,7 @@
    */
   void resolveReferencesAndTypes2(Library library) {
     for (Source source in library.compilationUnitSources) {
-      ResolverVisitor visitor = new ResolverVisitor(library, source, _typeProvider);
+      ResolverVisitor visitor = new ResolverVisitor.con1(library, source, _typeProvider);
       library.getAST(source).accept(visitor);
     }
   }
@@ -2637,10 +3282,10 @@
     }
   }
 }
-class AnalysisErrorListener_6 implements AnalysisErrorListener {
+class AnalysisErrorListener_9 implements AnalysisErrorListener {
   final LibraryResolver LibraryResolver_this;
   AnalysisErrorListener additionalAnalysisErrorListener;
-  AnalysisErrorListener_6(this.LibraryResolver_this, this.additionalAnalysisErrorListener);
+  AnalysisErrorListener_9(this.LibraryResolver_this, this.additionalAnalysisErrorListener);
   void onError(AnalysisError error) {
     additionalAnalysisErrorListener.onError(error);
     LibraryResolver_this._recordingErrorListener.onError(error);
@@ -2671,15 +3316,67 @@
    */
   ExecutableElement _enclosingFunction = null;
   /**
+   * The object keeping track of which elements have had their types overridden.
+   */
+  TypeOverrideManager _overrideManager = new TypeOverrideManager();
+  /**
    * Initialize a newly created visitor to resolve the nodes in a compilation unit.
    * @param library the library containing the compilation unit being resolved
    * @param source the source representing the compilation unit being visited
    * @param typeProvider the object used to access the types from the core library
    */
-  ResolverVisitor(Library library, Source source, TypeProvider typeProvider) : super(library, source, typeProvider) {
+  ResolverVisitor.con1(Library library, Source source, TypeProvider typeProvider) : super.con1(library, source, typeProvider) {
+    _jtd_constructor_265_impl(library, source, typeProvider);
+  }
+  _jtd_constructor_265_impl(Library library, Source source, TypeProvider typeProvider) {
     this._elementResolver = new ElementResolver(this);
     this._typeAnalyzer = new StaticTypeAnalyzer(this);
   }
+  /**
+   * Initialize a newly created visitor to resolve the nodes in a compilation unit.
+   * @param definingLibrary the element for the library containing the compilation unit being
+   * visited
+   * @param source the source representing the compilation unit being visited
+   * @param typeProvider the object used to access the types from the core library
+   * @param errorListener the error listener that will be informed of any errors that are found
+   * during resolution
+   */
+  ResolverVisitor.con2(LibraryElement definingLibrary, Source source, TypeProvider typeProvider, AnalysisErrorListener errorListener) : super.con2(definingLibrary, source, typeProvider, errorListener) {
+    _jtd_constructor_266_impl(definingLibrary, source, typeProvider, errorListener);
+  }
+  _jtd_constructor_266_impl(LibraryElement definingLibrary, Source source, TypeProvider typeProvider, AnalysisErrorListener errorListener) {
+    this._elementResolver = new ElementResolver(this);
+    this._typeAnalyzer = new StaticTypeAnalyzer(this);
+  }
+  /**
+   * Return the object keeping track of which elements have had their types overridden.
+   * @return the object keeping track of which elements have had their types overridden
+   */
+  TypeOverrideManager get overrideManager => _overrideManager;
+  Object visitAsExpression(AsExpression node) {
+    super.visitAsExpression(node);
+    if (StaticTypeAnalyzer.USE_TYPE_PROPAGATION) {
+      VariableElement element = getOverridableElement(node.expression);
+      if (element != null) {
+        Type2 type2 = node.type.type;
+        if (type2 != null) {
+          _overrideManager.setType(element, type2);
+        }
+      }
+    }
+    return null;
+  }
+  Object visitAssertStatement(AssertStatement node) {
+    Expression condition2 = node.condition;
+    condition2.accept(this);
+    propagateTrueState(condition2);
+    return null;
+  }
+  Object visitBreakStatement(BreakStatement node) {
+    node.accept(_elementResolver);
+    node.accept(_typeAnalyzer);
+    return null;
+  }
   Object visitClassDeclaration(ClassDeclaration node) {
     ClassElement outerType = _enclosingClass;
     try {
@@ -2692,6 +3389,120 @@
     }
     return null;
   }
+  Object visitComment(Comment node) => null;
+  Object visitCompilationUnit(CompilationUnit node) {
+    try {
+      _overrideManager.enterScope();
+      for (Directive directive in node.directives) {
+        directive.accept(this);
+      }
+      List<CompilationUnitMember> classes = new List<CompilationUnitMember>();
+      for (CompilationUnitMember declaration in node.declarations) {
+        if (declaration is ClassDeclaration) {
+          classes.add(declaration);
+        } else {
+          declaration.accept(this);
+        }
+      }
+      for (CompilationUnitMember declaration in classes) {
+        declaration.accept(this);
+      }
+    } finally {
+      _overrideManager.exitScope();
+    }
+    return null;
+  }
+  Object visitConditionalExpression(ConditionalExpression node) {
+    Expression condition2 = node.condition;
+    condition2.accept(this);
+    Expression thenExpression2 = node.thenExpression;
+    if (thenExpression2 != null) {
+      try {
+        _overrideManager.enterScope();
+        propagateTrueState(condition2);
+        thenExpression2.accept(this);
+      } finally {
+        _overrideManager.exitScope();
+      }
+    }
+    Expression elseExpression2 = node.elseExpression;
+    if (elseExpression2 != null) {
+      try {
+        _overrideManager.enterScope();
+        propagateFalseState(condition2);
+        elseExpression2.accept(this);
+      } finally {
+        _overrideManager.exitScope();
+      }
+    }
+    if (StaticTypeAnalyzer.USE_TYPE_PROPAGATION) {
+      bool thenIsAbrupt = thenExpression2 != null && isAbruptTermination(thenExpression2);
+      bool elseIsAbrupt = elseExpression2 != null && isAbruptTermination(elseExpression2);
+      if (elseIsAbrupt && !thenIsAbrupt) {
+        propagateTrueState(condition2);
+      } else if (thenIsAbrupt && !elseIsAbrupt) {
+        propagateFalseState(condition2);
+      }
+    }
+    return null;
+  }
+  Object visitConstructorDeclaration(ConstructorDeclaration node) {
+    ExecutableElement outerFunction = _enclosingFunction;
+    try {
+      _enclosingFunction = node.element;
+      super.visitConstructorDeclaration(node);
+    } finally {
+      _enclosingFunction = outerFunction;
+    }
+    return null;
+  }
+  Object visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
+    safelyVisit(node.expression);
+    node.accept(_elementResolver);
+    node.accept(_typeAnalyzer);
+    return null;
+  }
+  Object visitConstructorName(ConstructorName node) {
+    node.accept(_elementResolver);
+    node.accept(_typeAnalyzer);
+    return null;
+  }
+  Object visitContinueStatement(ContinueStatement node) {
+    node.accept(_elementResolver);
+    node.accept(_typeAnalyzer);
+    return null;
+  }
+  Object visitFieldDeclaration(FieldDeclaration node) {
+    try {
+      _overrideManager.enterScope();
+      super.visitFieldDeclaration(node);
+    } finally {
+      Map<Element, Type2> overrides = captureOverrides(node.fields);
+      _overrideManager.exitScope();
+      for (MapEntry<Element, Type2> entry in getMapEntrySet(overrides)) {
+        _overrideManager.setType(entry.getKey(), entry.getValue());
+      }
+    }
+    return null;
+  }
+  Object visitForStatement(ForStatement node) {
+    try {
+      _overrideManager.enterScope();
+      super.visitForStatement(node);
+    } finally {
+      _overrideManager.exitScope();
+    }
+    return null;
+  }
+  Object visitFunctionBody(FunctionBody node) {
+    try {
+      _overrideManager.enterScope();
+      super.visitFunctionBody(node);
+    } finally {
+      _overrideManager.exitScope();
+    }
+    return null;
+  }
   Object visitFunctionDeclaration(FunctionDeclaration node) {
     ExecutableElement outerFunction = _enclosingFunction;
     try {
@@ -2707,12 +3518,49 @@
     ExecutableElement outerFunction = _enclosingFunction;
     try {
       _enclosingFunction = node.element;
+      _overrideManager.enterScope();
       super.visitFunctionExpression(node);
     } finally {
+      _overrideManager.exitScope();
       _enclosingFunction = outerFunction;
     }
     return null;
   }
+  Object visitHideCombinator(HideCombinator node) => null;
+  Object visitIfStatement(IfStatement node) {
+    Expression condition2 = node.condition;
+    condition2.accept(this);
+    Statement thenStatement2 = node.thenStatement;
+    if (thenStatement2 != null) {
+      try {
+        _overrideManager.enterScope();
+        propagateTrueState(condition2);
+        thenStatement2.accept(this);
+      } finally {
+        _overrideManager.exitScope();
+      }
+    }
+    Statement elseStatement2 = node.elseStatement;
+    if (elseStatement2 != null) {
+      try {
+        _overrideManager.enterScope();
+        propagateFalseState(condition2);
+        elseStatement2.accept(this);
+      } finally {
+        _overrideManager.exitScope();
+      }
+    }
+    if (StaticTypeAnalyzer.USE_TYPE_PROPAGATION) {
+      bool thenIsAbrupt = thenStatement2 != null && isAbruptTermination2(thenStatement2);
+      bool elseIsAbrupt = elseStatement2 != null && isAbruptTermination2(elseStatement2);
+      if (elseIsAbrupt && !thenIsAbrupt) {
+        propagateTrueState(condition2);
+      } else if (thenIsAbrupt && !elseIsAbrupt) {
+        propagateFalseState(condition2);
+      }
+    }
+    return null;
+  }
   Object visitLabel(Label node) => null;
   Object visitLibraryIdentifier(LibraryIdentifier node) => null;
   Object visitMethodDeclaration(MethodDeclaration node) {
@@ -2725,6 +3573,13 @@
     }
     return null;
   }
+  Object visitMethodInvocation(MethodInvocation node) {
+    safelyVisit(node.target);
+    safelyVisit(node.argumentList);
+    node.accept(_elementResolver);
+    node.accept(_typeAnalyzer);
+    return null;
+  }
   Object visitNode(ASTNode node) {
     node.visitChildren(this);
     node.accept(_elementResolver);
@@ -2732,41 +3587,61 @@
     return null;
   }
   Object visitPrefixedIdentifier(PrefixedIdentifier node) {
-    SimpleIdentifier prefix7 = node.prefix;
-    if (prefix7 != null) {
-      prefix7.accept(this);
-    }
+    safelyVisit(node.prefix);
     node.accept(_elementResolver);
     node.accept(_typeAnalyzer);
     return null;
   }
   Object visitPropertyAccess(PropertyAccess node) {
-    Expression target4 = node.target;
-    if (target4 != null) {
-      target4.accept(this);
-    }
+    safelyVisit(node.target);
     node.accept(_elementResolver);
     node.accept(_typeAnalyzer);
     return null;
   }
   Object visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
-    ArgumentList argumentList10 = node.argumentList;
-    if (argumentList10 != null) {
-      argumentList10.accept(this);
-    }
+    safelyVisit(node.argumentList);
     node.accept(_elementResolver);
     node.accept(_typeAnalyzer);
     return null;
   }
+  Object visitShowCombinator(ShowCombinator node) => null;
   Object visitSuperConstructorInvocation(SuperConstructorInvocation node) {
-    ArgumentList argumentList11 = node.argumentList;
-    if (argumentList11 != null) {
-      argumentList11.accept(this);
-    }
+    safelyVisit(node.argumentList);
     node.accept(_elementResolver);
     node.accept(_typeAnalyzer);
     return null;
   }
+  Object visitSwitchCase(SwitchCase node) {
+    try {
+      _overrideManager.enterScope();
+      super.visitSwitchCase(node);
+    } finally {
+      _overrideManager.exitScope();
+    }
+    return null;
+  }
+  Object visitSwitchDefault(SwitchDefault node) {
+    try {
+      _overrideManager.enterScope();
+      super.visitSwitchDefault(node);
+    } finally {
+      _overrideManager.exitScope();
+    }
+    return null;
+  }
+  Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
+    try {
+      _overrideManager.enterScope();
+      super.visitTopLevelVariableDeclaration(node);
+    } finally {
+      Map<Element, Type2> overrides = captureOverrides(node.variables);
+      _overrideManager.exitScope();
+      for (MapEntry<Element, Type2> entry in getMapEntrySet(overrides)) {
+        _overrideManager.setType(entry.getKey(), entry.getValue());
+      }
+    }
+    return null;
+  }
   Object visitTypeName(TypeName node) => null;
   /**
    * Return the class element representing the class containing the current node, or {@code null} if
@@ -2780,6 +3655,141 @@
    * @return the element representing the function containing the current node
    */
   ExecutableElement get enclosingFunction => _enclosingFunction;
+  /**
+   * Return the element associated with the given expression whose type can be overridden, or{@code null} if there is no element whose type can be overridden.
+   * @param expression the expression with which the element is associated
+   * @return the element associated with the given expression
+   */
+  VariableElement getOverridableElement(Expression expression) {
+    if (expression is SimpleIdentifier) {
+      Element element2 = ((expression as SimpleIdentifier)).element;
+      if (element2 is VariableElement) {
+        return element2 as VariableElement;
+      }
+    }
+    return null;
+  }
+  /**
+   * Return a map from the elements for the variables in the given list that have their types
+   * overridden to the overriding type.
+   * @param variableList the list of variables whose overriding types are to be captured
+   * @return a table mapping elements to their overriding types
+   */
+  Map<Element, Type2> captureOverrides(VariableDeclarationList variableList) {
+    Map<Element, Type2> overrides = new Map<Element, Type2>();
+    if (StaticTypeAnalyzer.USE_TYPE_PROPAGATION) {
+      if (variableList.isConst() || variableList.isFinal()) {
+        for (VariableDeclaration variable in variableList.variables) {
+          Element element2 = variable.element;
+          if (element2 != null) {
+            Type2 type = _overrideManager.getType(element2);
+            if (type != null) {
+              overrides[element2] = type;
+            }
+          }
+        }
+      }
+    }
+    return overrides;
+  }
+  /**
+   * Return {@code true} if the given expression terminates abruptly (that is, if any expression
+   * following the given expression will not be reached).
+   * @param expression the expression being tested
+   * @return {@code true} if the given expression terminates abruptly
+   */
+  bool isAbruptTermination(Expression expression2) {
+    while (expression2 is ParenthesizedExpression) {
+      expression2 = ((expression2 as ParenthesizedExpression)).expression;
+    }
+    return expression2 is ThrowExpression || expression2 is RethrowExpression;
+  }
+  /**
+   * Return {@code true} if the given statement terminates abruptly (that is, if any statement
+   * following the given statement will not be reached).
+   * @param statement the statement being tested
+   * @return {@code true} if the given statement terminates abruptly
+   */
+  bool isAbruptTermination2(Statement statement) {
+    if (statement is ReturnStatement) {
+      return true;
+    } else if (statement is ExpressionStatement) {
+      return isAbruptTermination(((statement as ExpressionStatement)).expression);
+    } else if (statement is Block) {
+      NodeList<Statement> statements2 = ((statement as Block)).statements;
+      int size2 = statements2.length;
+      if (size2 == 0) {
+        return false;
+      }
+      return isAbruptTermination2(statements2[size2 - 1]);
+    }
+    return false;
+  }
+  /**
+   * Propagate any type information that results from knowing that the given condition will have
+   * evaluated to 'false'.
+   * @param condition the condition that will have evaluated to 'false'
+   */
+  void propagateFalseState(Expression condition) {
+    while (condition is ParenthesizedExpression) {
+      condition = ((condition as ParenthesizedExpression)).expression;
+    }
+    if (condition is IsExpression) {
+      IsExpression is2 = condition as IsExpression;
+      if (is2.notOperator != null) {
+        Element element = getOverridableElement(is2.expression);
+        if (element != null) {
+          Type2 type2 = is2.type.type;
+          if (type2 != null) {
+            _overrideManager.setType(element, type2);
+          }
+        }
+      }
+    } else if (condition is BinaryExpression) {
+      BinaryExpression binary = condition as BinaryExpression;
+      if (identical(binary.operator.type, sc.TokenType.BAR_BAR)) {
+        propagateFalseState(binary.leftOperand);
+        propagateFalseState(binary.rightOperand);
+      }
+    }
+  }
+  /**
+   * Propagate any type information that results from knowing that the given condition will have
+   * evaluated to 'true'.
+   * @param condition the condition that will have evaluated to 'true'
+   */
+  void propagateTrueState(Expression condition) {
+    while (condition is ParenthesizedExpression) {
+      condition = ((condition as ParenthesizedExpression)).expression;
+    }
+    if (condition is IsExpression) {
+      IsExpression is2 = condition as IsExpression;
+      if (is2.notOperator == null) {
+        Element element = getOverridableElement(is2.expression);
+        if (element != null) {
+          Type2 type2 = is2.type.type;
+          if (type2 != null) {
+            _overrideManager.setType(element, type2);
+          }
+        }
+      }
+    } else if (condition is BinaryExpression) {
+      BinaryExpression binary = condition as BinaryExpression;
+      if (identical(binary.operator.type, sc.TokenType.AMPERSAND_AMPERSAND)) {
+        propagateTrueState(binary.leftOperand);
+        propagateTrueState(binary.rightOperand);
+      }
+    }
+  }
+  /**
+   * Visit the given AST node if it is not null.
+   * @param node the node to be visited
+   */
+  void safelyVisit(ASTNode node) {
+    if (node != null) {
+      node.accept(this);
+    }
+  }
   get elementResolver_J2DAccessor => _elementResolver;
   set elementResolver_J2DAccessor(__v) => _elementResolver = __v;
   get labelScope_J2DAccessor => _labelScope;
@@ -2827,13 +3837,35 @@
    * @param source the source representing the compilation unit being visited
    * @param typeProvider the object used to access the types from the core library
    */
-  ScopedVisitor(Library library, Source source, TypeProvider typeProvider) {
+  ScopedVisitor.con1(Library library, Source source2, TypeProvider typeProvider2) {
+    _jtd_constructor_267_impl(library, source2, typeProvider2);
+  }
+  _jtd_constructor_267_impl(Library library, Source source2, TypeProvider typeProvider2) {
     this._definingLibrary = library.libraryElement;
-    this._source = source;
+    this._source = source2;
     LibraryScope libraryScope2 = library.libraryScope;
     this._errorListener = libraryScope2.errorListener;
     this._nameScope = libraryScope2;
-    this._typeProvider = typeProvider;
+    this._typeProvider = typeProvider2;
+  }
+  /**
+   * Initialize a newly created visitor to resolve the nodes in a compilation unit.
+   * @param definingLibrary the element for the library containing the compilation unit being
+   * visited
+   * @param source the source representing the compilation unit being visited
+   * @param typeProvider the object used to access the types from the core library
+   * @param errorListener the error listener that will be informed of any errors that are found
+   * during resolution
+   */
+  ScopedVisitor.con2(LibraryElement definingLibrary2, Source source2, TypeProvider typeProvider2, AnalysisErrorListener errorListener2) {
+    _jtd_constructor_268_impl(definingLibrary2, source2, typeProvider2, errorListener2);
+  }
+  _jtd_constructor_268_impl(LibraryElement definingLibrary2, Source source2, TypeProvider typeProvider2, AnalysisErrorListener errorListener2) {
+    this._definingLibrary = definingLibrary2;
+    this._source = source2;
+    this._errorListener = errorListener2;
+    this._nameScope = new LibraryScope(definingLibrary2, errorListener2);
+    this._typeProvider = typeProvider2;
   }
   /**
    * Return the library element for the library containing the compilation unit being resolved.
@@ -2855,6 +3887,24 @@
     }
     return null;
   }
+  Object visitCatchClause(CatchClause node) {
+    SimpleIdentifier exception = node.exceptionParameter;
+    if (exception != null) {
+      Scope outerScope = _nameScope;
+      _nameScope = new EnclosedScope(_nameScope);
+      try {
+        _nameScope.define(exception.element);
+        SimpleIdentifier stackTrace = node.stackTraceParameter;
+        if (stackTrace != null) {
+          _nameScope.define(stackTrace.element);
+        }
+        super.visitCatchClause(node);
+      } finally {
+        _nameScope = outerScope;
+      }
+    }
+    return null;
+  }
   Object visitClassDeclaration(ClassDeclaration node) {
     Scope outerScope = _nameScope;
     try {
@@ -2885,6 +3935,14 @@
     }
     return null;
   }
+  Object visitDeclaredIdentifier(DeclaredIdentifier node) {
+    VariableElement element2 = node.element;
+    if (element2 != null) {
+      _nameScope.define(element2);
+    }
+    super.visitDeclaredIdentifier(node);
+    return null;
+  }
   Object visitDoStatement(DoStatement node) {
     LabelScope outerScope = _labelScope;
     _labelScope = new LabelScope.con1(outerScope, false, false);
@@ -3022,9 +4080,9 @@
   }
   Object visitVariableDeclaration(VariableDeclaration node) {
     if (node.parent.parent is! TopLevelVariableDeclaration && node.parent.parent is! FieldDeclaration) {
-      VariableElement element28 = node.element;
-      if (element28 != null) {
-        _nameScope.define(element28);
+      VariableElement element2 = node.element;
+      if (element2 != null) {
+        _nameScope.define(element2);
       }
     }
     super.visitVariableDeclaration(node);
@@ -3096,6 +4154,77 @@
  */
 class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
   /**
+   * Create a table mapping HTML tag names to the names of the classes (in 'dart:html') that
+   * implement those tags.
+   * @return the table that was created
+   */
+  static Map<String, String> createHtmlTagToClassMap() {
+    Map<String, String> map = new Map<String, String>();
+    map["a"] = "AnchorElement";
+    map["area"] = "AreaElement";
+    map["br"] = "BRElement";
+    map["base"] = "BaseElement";
+    map["body"] = "BodyElement";
+    map["button"] = "ButtonElement";
+    map["canvas"] = "CanvasElement";
+    map["content"] = "ContentElement";
+    map["dl"] = "DListElement";
+    map["datalist"] = "DataListElement";
+    map["details"] = "DetailsElement";
+    map["div"] = "DivElement";
+    map["embed"] = "EmbedElement";
+    map["fieldset"] = "FieldSetElement";
+    map["form"] = "FormElement";
+    map["hr"] = "HRElement";
+    map["head"] = "HeadElement";
+    map["h1"] = "HeadingElement";
+    map["h2"] = "HeadingElement";
+    map["h3"] = "HeadingElement";
+    map["h4"] = "HeadingElement";
+    map["h5"] = "HeadingElement";
+    map["h6"] = "HeadingElement";
+    map["html"] = "HtmlElement";
+    map["iframe"] = "IFrameElement";
+    map["img"] = "ImageElement";
+    map["input"] = "InputElement";
+    map["keygen"] = "KeygenElement";
+    map["li"] = "LIElement";
+    map["label"] = "LabelElement";
+    map["legend"] = "LegendElement";
+    map["link"] = "LinkElement";
+    map["map"] = "MapElement";
+    map["menu"] = "MenuElement";
+    map["meter"] = "MeterElement";
+    map["ol"] = "OListElement";
+    map["object"] = "ObjectElement";
+    map["optgroup"] = "OptGroupElement";
+    map["output"] = "OutputElement";
+    map["p"] = "ParagraphElement";
+    map["param"] = "ParamElement";
+    map["pre"] = "PreElement";
+    map["progress"] = "ProgressElement";
+    map["script"] = "ScriptElement";
+    map["select"] = "SelectElement";
+    map["source"] = "SourceElement";
+    map["span"] = "SpanElement";
+    map["style"] = "StyleElement";
+    map["caption"] = "TableCaptionElement";
+    map["td"] = "TableCellElement";
+    map["col"] = "TableColElement";
+    map["table"] = "TableElement";
+    map["tr"] = "TableRowElement";
+    map["textarea"] = "TextAreaElement";
+    map["title"] = "TitleElement";
+    map["track"] = "TrackElement";
+    map["ul"] = "UListElement";
+    map["video"] = "VideoElement";
+    return map;
+  }
+  /**
+   * The resolver driving the resolution and type analysis.
+   */
+  ResolverVisitor _resolver;
+  /**
    * The object providing access to the types defined by the language.
    */
   TypeProvider _typeProvider;
@@ -3109,12 +4238,27 @@
    */
   InterfaceType _thisType;
   /**
+   * The object keeping track of which elements have had their types overridden.
+   */
+  TypeOverrideManager _overrideManager;
+  /**
+   * A flag indicating whether type propagation should be enabled.
+   */
+  static bool USE_TYPE_PROPAGATION = true;
+  /**
+   * A table mapping HTML tag names to the names of the classes (in 'dart:html') that implement
+   * those tags.
+   */
+  static Map<String, String> _HTML_ELEMENT_TO_CLASS_MAP = createHtmlTagToClassMap();
+  /**
    * Initialize a newly created type analyzer.
    * @param resolver the resolver driving this participant
    */
   StaticTypeAnalyzer(ResolverVisitor resolver) {
+    this._resolver = resolver;
     _typeProvider = resolver.typeProvider;
     _dynamicType = _typeProvider.dynamicType;
+    _overrideManager = resolver.overrideManager;
   }
   /**
    * Set the type of the class being analyzed to the given type.
@@ -3140,7 +4284,7 @@
    * <p>
    * The static type of a cast expression <i>e as T</i> is <i>T</i>.</blockquote>
    */
-  Object visitAsExpression(AsExpression node) => recordType(node, getType3(node.type));
+  Object visitAsExpression(AsExpression node) => recordType(node, getType4(node.type));
   /**
    * The Dart Language Specification, 12.18: <blockquote> ... an assignment <i>a</i> of the form
    * <i>v = e</i> ...
@@ -3181,11 +4325,18 @@
    * <i>e<sub>3</sub></i>. </blockquote>
    */
   Object visitAssignmentExpression(AssignmentExpression node) {
-    sc.TokenType operator11 = node.operator.type;
-    if (operator11 != sc.TokenType.EQ) {
-      return recordReturnType(node, node.element, null);
+    sc.TokenType operator2 = node.operator.type;
+    if (operator2 != sc.TokenType.EQ) {
+      return recordReturnType(node, node.element);
     }
-    return recordType(node, getType(node.rightHandSide));
+    Type2 rightType = getType2(node.rightHandSide);
+    if (USE_TYPE_PROPAGATION) {
+      VariableElement element = _resolver.getOverridableElement(node.leftHandSide);
+      if (element != null) {
+        override(element, getType(element), rightType);
+      }
+    }
+    return recordType(node, rightType);
   }
   /**
    * The Dart Language Specification, 12.20: <blockquote>The static type of a logical boolean
@@ -3225,14 +4376,24 @@
    * <i>super.op(e<sub>2</sub>)</i>.</blockquote>
    */
   Object visitBinaryExpression(BinaryExpression node) {
-    sc.TokenType operator12 = node.operator.type;
+    sc.TokenType operator2 = node.operator.type;
     while (true) {
-      if (operator12 == sc.TokenType.AMPERSAND_AMPERSAND || operator12 == sc.TokenType.BAR_BAR || operator12 == sc.TokenType.EQ_EQ || operator12 == sc.TokenType.BANG_EQ) {
+      if (operator2 == sc.TokenType.AMPERSAND_AMPERSAND || operator2 == sc.TokenType.BAR_BAR || operator2 == sc.TokenType.EQ_EQ || operator2 == sc.TokenType.BANG_EQ) {
         return recordType(node, _typeProvider.boolType);
+      } else if (operator2 == sc.TokenType.MINUS || operator2 == sc.TokenType.PERCENT || operator2 == sc.TokenType.PLUS || operator2 == sc.TokenType.STAR || operator2 == sc.TokenType.TILDE_SLASH) {
+        Type2 intType2 = _typeProvider.intType;
+        if (identical(getType2(node.leftOperand), intType2) && identical(getType2(node.rightOperand), intType2)) {
+          return recordType(node, intType2);
+        }
+      } else if (operator2 == sc.TokenType.SLASH) {
+        Type2 doubleType2 = _typeProvider.doubleType;
+        if (identical(getType2(node.leftOperand), doubleType2) || identical(getType2(node.rightOperand), doubleType2)) {
+          return recordType(node, doubleType2);
+        }
       }
       break;
     }
-    return recordReturnType(node, node.element, null);
+    return recordReturnType(node, node.element);
   }
   /**
    * The Dart Language Specification, 12.4: <blockquote>The static type of a boolean literal is{@code bool}.</blockquote>
@@ -3243,7 +4404,7 @@
    * of the form <i>e..suffix</i> is equivalent to the expression <i>(t) {t.suffix; return
    * t;}(e)</i>.</blockquote>
    */
-  Object visitCascadeExpression(CascadeExpression node) => recordType(node, getType(node.target));
+  Object visitCascadeExpression(CascadeExpression node) => recordType(node, getType2(node.target));
   /**
    * The Dart Language Specification, 12.19: <blockquote> ... a conditional expression <i>c</i> of
    * the form <i>e<sub>1</sub> ? e<sub>2</sub> : e<sub>3</sub></i> ...
@@ -3254,8 +4415,8 @@
    * and the static type of <i>e<sub>3</sub></i>.</blockquote>
    */
   Object visitConditionalExpression(ConditionalExpression node) {
-    Type2 thenType = getType(node.thenExpression);
-    Type2 elseType = getType(node.elseExpression);
+    Type2 thenType = getType2(node.thenExpression);
+    Type2 elseType = getType2(node.elseExpression);
     if (thenType == null) {
       return recordType(node, _dynamicType);
     }
@@ -3322,22 +4483,17 @@
    * If <i>F</i> is not a function type, the static type of <i>i</i> is dynamic. Otherwise the
    * static type of <i>i</i> is the declared return type of <i>F</i>.</blockquote>
    */
-  Object visitFunctionExpressionInvocation(FunctionExpressionInvocation node) => recordReturnType(node, node.element, null);
+  Object visitFunctionExpressionInvocation(FunctionExpressionInvocation node) => recordReturnType(node, node.element);
   /**
    * The Dart Language Specification, 12.29: <blockquote>An assignable expression of the form
    * <i>e<sub>1</sub>[e<sub>2</sub>]</i> is evaluated as a method invocation of the operator method
    * <i>[]</i> on <i>e<sub>1</sub></i> with argument <i>e<sub>2</sub></i>.</blockquote>
    */
   Object visitIndexExpression(IndexExpression node) {
-    Type2 type = getType(node.realTarget);
-    List<Type2> typeArgs = null;
-    if (type is InterfaceType) {
-      typeArgs = ((type as InterfaceType)).typeArguments;
-    }
     if (node.inSetterContext()) {
-      return recordArgumentType(node, node.element, typeArgs);
+      return recordArgumentType(node, node.element);
     }
-    return recordReturnType(node, node.element, typeArgs);
+    return recordReturnType(node, node.element);
   }
   /**
    * The Dart Language Specification, 12.11.1: <blockquote>The static type of a new expression of
@@ -3348,7 +4504,21 @@
    * expression of either the form <i>const T.id(a<sub>1</sub>, &hellip;, a<sub>n</sub>)</i> or the
    * form <i>const T(a<sub>1</sub>, &hellip;, a<sub>n</sub>)</i> is <i>T</i>. </blockquote>
    */
-  Object visitInstanceCreationExpression(InstanceCreationExpression node) => recordType(node, node.constructorName.type.type);
+  Object visitInstanceCreationExpression(InstanceCreationExpression node) {
+    if (USE_TYPE_PROPAGATION) {
+      ConstructorElement element2 = node.element;
+      if (element2 != null && "Element" == element2.enclosingElement.name && "tag" == element2.name) {
+        LibraryElement library2 = element2.library;
+        if (isHtmlLibrary(library2)) {
+          Type2 returnType = getFirstArgumentAsType2(library2, node.argumentList, _HTML_ELEMENT_TO_CLASS_MAP);
+          if (returnType != null) {
+            return recordType(node, returnType);
+          }
+        }
+      }
+    }
+    return recordType(node, node.constructorName.type.type);
+  }
   /**
    * The Dart Language Specification, 12.3: <blockquote>The static type of an integer literal is{@code int}.</blockquote>
    */
@@ -3368,12 +4538,12 @@
    * the form <i>[e<sub>1</sub>, &hellip;, e<sub>n</sub>]</i> is {@code List&lt;dynamic&gt;}.</blockquote>
    */
   Object visitListLiteral(ListLiteral node) {
-    TypeArgumentList typeArguments8 = node.typeArguments;
-    if (typeArguments8 != null) {
-      NodeList<TypeName> arguments4 = typeArguments8.arguments;
-      if (arguments4 != null && arguments4.length == 1) {
-        TypeName argumentType = arguments4[0];
-        return recordType(node, _typeProvider.listType.substitute5(<Type2> [getType3(argumentType)]));
+    TypeArgumentList typeArguments2 = node.typeArguments;
+    if (typeArguments2 != null) {
+      NodeList<TypeName> arguments2 = typeArguments2.arguments;
+      if (arguments2 != null && arguments2.length == 1) {
+        TypeName argumentType = arguments2[0];
+        return recordType(node, _typeProvider.listType.substitute5(<Type2> [getType4(argumentType)]));
       }
     }
     return recordType(node, _typeProvider.listType.substitute5(<Type2> [_dynamicType]));
@@ -3391,15 +4561,15 @@
    * <i>String</i>.</blockquote>
    */
   Object visitMapLiteral(MapLiteral node) {
-    TypeArgumentList typeArguments9 = node.typeArguments;
-    if (typeArguments9 != null) {
-      NodeList<TypeName> arguments5 = typeArguments9.arguments;
-      if (arguments5 != null && arguments5.length == 2) {
-        TypeName keyType = arguments5[0];
+    TypeArgumentList typeArguments2 = node.typeArguments;
+    if (typeArguments2 != null) {
+      NodeList<TypeName> arguments2 = typeArguments2.arguments;
+      if (arguments2 != null && arguments2.length == 2) {
+        TypeName keyType = arguments2[0];
         if (keyType != _typeProvider.stringType) {
         }
-        TypeName valueType = arguments5[1];
-        return recordType(node, _typeProvider.mapType.substitute5(<Type2> [_typeProvider.stringType, getType3(valueType)]));
+        TypeName valueType = arguments2[1];
+        return recordType(node, _typeProvider.mapType.substitute5(<Type2> [_typeProvider.stringType, getType4(valueType)]));
       }
     }
     return recordType(node, _typeProvider.mapType.substitute5(<Type2> [_typeProvider.stringType, _dynamicType]));
@@ -3440,14 +4610,64 @@
    * <i>i</i> is dynamic. Otherwise the static type of <i>i</i> is the declared return type of
    * <i>F</i>.</blockquote>
    */
-  Object visitMethodInvocation(MethodInvocation node) => recordReturnType(node, node.methodName.element, null);
-  Object visitNamedExpression(NamedExpression node) => recordType(node, getType(node.expression));
+  Object visitMethodInvocation(MethodInvocation node) {
+    if (USE_TYPE_PROPAGATION) {
+      String methodName2 = node.methodName.name;
+      if (methodName2 == "\$dom_createEvent") {
+        Expression target = node.realTarget;
+        if (target != null) {
+          Type2 targetType = getType2(target);
+          if (targetType is InterfaceType && (targetType.name == "HtmlDocument" || targetType.name == "Document")) {
+            LibraryElement library2 = targetType.element.library;
+            if (isHtmlLibrary(library2)) {
+              Type2 returnType = getFirstArgumentAsType(library2, node.argumentList);
+              if (returnType != null) {
+                return recordType(node, returnType);
+              }
+            }
+          }
+        }
+      } else if (methodName2 == "query") {
+        Expression target = node.realTarget;
+        if (target == null) {
+          Element methodElement = node.methodName.element;
+          if (methodElement != null) {
+            LibraryElement library3 = methodElement.library;
+            if (isHtmlLibrary(library3)) {
+              Type2 returnType = getFirstArgumentAsQuery(library3, node.argumentList);
+              if (returnType != null) {
+                return recordType(node, returnType);
+              }
+            }
+          }
+        } else {
+          Type2 targetType = getType2(target);
+          if (targetType is InterfaceType && (targetType.name == "HtmlDocument" || targetType.name == "Document")) {
+            LibraryElement library4 = targetType.element.library;
+            if (isHtmlLibrary(library4)) {
+              Type2 returnType = getFirstArgumentAsQuery(library4, node.argumentList);
+              if (returnType != null) {
+                return recordType(node, returnType);
+              }
+            }
+          }
+        }
+      } else if (methodName2 == "JS") {
+        Type2 returnType = getFirstArgumentAsType(_typeProvider.objectType.element.library, node.argumentList);
+        if (returnType != null) {
+          return recordType(node, returnType);
+        }
+      }
+    }
+    return recordReturnType(node, node.methodName.element);
+  }
+  Object visitNamedExpression(NamedExpression node) => recordType(node, getType2(node.expression));
   /**
    * The Dart Language Specification, 12.2: <blockquote>The static type of {@code null} is bottom.
    * </blockquote>
    */
   Object visitNullLiteral(NullLiteral node) => recordType(node, _typeProvider.bottomType);
-  Object visitParenthesizedExpression(ParenthesizedExpression node) => recordType(node, getType(node.expression));
+  Object visitParenthesizedExpression(ParenthesizedExpression node) => recordType(node, getType2(node.expression));
   /**
    * The Dart Language Specification, 12.28: <blockquote>A postfix expression of the form
    * <i>v++</i>, where <i>v</i> is an identifier, is equivalent to <i>(){var r = v; v = r + 1;
@@ -3474,29 +4694,46 @@
    * A postfix expression of the form <i>e1[e2]--</i> is equivalent to <i>(a, i){var r = a[i]; a[i]
    * = r - 1; return r}(e1, e2)</i></blockquote>
    */
-  Object visitPostfixExpression(PostfixExpression node) => recordType(node, getType(node.operand));
+  Object visitPostfixExpression(PostfixExpression node) => recordType(node, getType2(node.operand));
   /**
    * See {@link #visitSimpleIdentifier(SimpleIdentifier)}.
    */
   Object visitPrefixedIdentifier(PrefixedIdentifier node) {
     SimpleIdentifier prefixedIdentifier = node.identifier;
-    Element element29 = prefixedIdentifier.element;
-    if (element29 is VariableElement) {
-      Type2 variableType = ((element29 as VariableElement)).type;
-      recordType(prefixedIdentifier, variableType);
-      return recordType(node, variableType);
-    } else if (element29 is PropertyAccessorElement) {
-      Type2 propertyType = getType2((element29 as PropertyAccessorElement));
-      recordType(prefixedIdentifier, propertyType);
-      return recordType(node, propertyType);
-    } else if (element29 is MethodElement) {
-      Type2 returnType = ((element29 as MethodElement)).type;
-      recordType(prefixedIdentifier, returnType);
-      return recordType(node, returnType);
-    } else {
+    Element element2 = prefixedIdentifier.element;
+    if (element2 == null) {
+      return recordType(node, _dynamicType);
     }
-    recordType(prefixedIdentifier, _dynamicType);
-    return recordType(node, _dynamicType);
+    if (USE_TYPE_PROPAGATION) {
+      Type2 type = _overrideManager.getType(element2);
+      if (type != null) {
+        return recordType(node, type);
+      }
+    }
+    Type2 type;
+    if (element2 is ClassElement) {
+      if (isNotTypeLiteral(node)) {
+        type = ((element2 as ClassElement)).type;
+      } else {
+        type = _typeProvider.typeType;
+      }
+    } else if (element2 is FunctionTypeAliasElement) {
+      type = ((element2 as FunctionTypeAliasElement)).type;
+    } else if (element2 is MethodElement) {
+      type = ((element2 as MethodElement)).type;
+    } else if (element2 is PropertyAccessorElement) {
+      type = getType3((element2 as PropertyAccessorElement), node.prefix.staticType);
+    } else if (element2 is ExecutableElement) {
+      type = ((element2 as ExecutableElement)).type;
+    } else if (element2 is TypeVariableElement) {
+      type = ((element2 as TypeVariableElement)).type;
+    } else if (element2 is VariableElement) {
+      type = ((element2 as VariableElement)).type;
+    } else {
+      type = _dynamicType;
+    }
+    recordType(prefixedIdentifier, type);
+    return recordType(node, type);
   }
   /**
    * The Dart Language Specification, 12.27: <blockquote>A unary expression <i>u</i> of the form
@@ -3504,11 +4741,11 @@
    * form <i>op super</i> is equivalent to the method invocation <i>super.op()<i>.</blockquote>
    */
   Object visitPrefixExpression(PrefixExpression node) {
-    sc.TokenType operator13 = node.operator.type;
-    if (identical(operator13, sc.TokenType.BANG)) {
+    sc.TokenType operator2 = node.operator.type;
+    if (identical(operator2, sc.TokenType.BANG)) {
       return recordType(node, _typeProvider.boolType);
     }
-    return recordReturnType(node, node.element, null);
+    return recordReturnType(node, node.element);
   }
   /**
    * The Dart Language Specification, 12.13: <blockquote> Property extraction allows for a member of
@@ -3555,13 +4792,19 @@
    */
   Object visitPropertyAccess(PropertyAccess node) {
     SimpleIdentifier propertyName2 = node.propertyName;
-    Element element30 = propertyName2.element;
-    if (element30 is MethodElement) {
-      FunctionType type15 = ((element30 as MethodElement)).type;
-      recordType(propertyName2, type15);
-      return recordType(node, type15);
-    } else if (element30 is PropertyAccessorElement) {
-      Type2 propertyType = getType2((element30 as PropertyAccessorElement));
+    Element element2 = propertyName2.element;
+    if (USE_TYPE_PROPAGATION) {
+      Type2 type = _overrideManager.getType(element2);
+      if (type != null) {
+        return recordType(node, type);
+      }
+    }
+    if (element2 is MethodElement) {
+      FunctionType type2 = ((element2 as MethodElement)).type;
+      recordType(propertyName2, type2);
+      return recordType(node, type2);
+    } else if (element2 is PropertyAccessorElement) {
+      Type2 propertyType = getType3((element2 as PropertyAccessorElement), node.target != null ? node.target.staticType : null);
       recordType(propertyName2, propertyType);
       return recordType(node, propertyType);
     } else {
@@ -3617,31 +4860,41 @@
    * </blockquote>
    */
   Object visitSimpleIdentifier(SimpleIdentifier node) {
-    Element element31 = node.element;
-    if (element31 == null) {
-      return recordType(node, _dynamicType);
-    } else if (element31 is ClassElement) {
-      if (isNotTypeLiteral(node)) {
-        return recordType(node, ((element31 as ClassElement)).type);
-      }
-      return recordType(node, _typeProvider.typeType);
-    } else if (element31 is TypeVariableElement) {
-      return recordType(node, ((element31 as TypeVariableElement)).type);
-    } else if (element31 is FunctionTypeAliasElement) {
-      return recordType(node, ((element31 as FunctionTypeAliasElement)).type);
-    } else if (element31 is VariableElement) {
-      return recordType(node, ((element31 as VariableElement)).type);
-    } else if (element31 is MethodElement) {
-      return recordType(node, ((element31 as MethodElement)).type);
-    } else if (element31 is PropertyAccessorElement) {
-      return recordType(node, getType2((element31 as PropertyAccessorElement)));
-    } else if (element31 is ExecutableElement) {
-      return recordType(node, ((element31 as ExecutableElement)).type);
-    } else if (element31 is PrefixElement) {
-      return null;
-    } else {
+    Element element2 = node.element;
+    if (element2 == null) {
       return recordType(node, _dynamicType);
     }
+    if (USE_TYPE_PROPAGATION) {
+      Type2 type = _overrideManager.getType(element2);
+      if (type != null) {
+        return recordType(node, type);
+      }
+    }
+    Type2 type;
+    if (element2 is ClassElement) {
+      if (isNotTypeLiteral(node)) {
+        type = ((element2 as ClassElement)).type;
+      } else {
+        type = _typeProvider.typeType;
+      }
+    } else if (element2 is FunctionTypeAliasElement) {
+      type = ((element2 as FunctionTypeAliasElement)).type;
+    } else if (element2 is MethodElement) {
+      type = ((element2 as MethodElement)).type;
+    } else if (element2 is PropertyAccessorElement) {
+      type = getType3((element2 as PropertyAccessorElement), null);
+    } else if (element2 is ExecutableElement) {
+      type = ((element2 as ExecutableElement)).type;
+    } else if (element2 is TypeVariableElement) {
+      type = ((element2 as TypeVariableElement)).type;
+    } else if (element2 is VariableElement) {
+      type = ((element2 as VariableElement)).type;
+    } else if (element2 is PrefixElement) {
+      return null;
+    } else {
+      type = _dynamicType;
+    }
+    return recordType(node, type);
   }
   /**
    * The Dart Language Specification, 12.5: <blockquote>The static type of a string literal is{@code String}.</blockquote>
@@ -3674,6 +4927,19 @@
    * bottom.</blockquote>
    */
   Object visitThrowExpression(ThrowExpression node) => recordType(node, _typeProvider.bottomType);
+  Object visitVariableDeclaration(VariableDeclaration node) {
+    if (USE_TYPE_PROPAGATION) {
+      Expression initializer2 = node.initializer;
+      if (initializer2 != null) {
+        Type2 rightType = getType2(initializer2);
+        VariableElement element2 = node.name.element as VariableElement;
+        if (element2 != null) {
+          override(element2, getType(element2), rightType);
+        }
+      }
+    }
+    return null;
+  }
   /**
    * Given a function declaration, compute the return type of the function. The return type of
    * functions with a block body is {@code dynamicType}, with an expression body it is the type of
@@ -3682,11 +4948,11 @@
    * @return the return type that was computed
    */
   Type2 computeReturnType(FunctionDeclaration node) {
-    TypeName returnType8 = node.returnType;
-    if (returnType8 == null) {
+    TypeName returnType2 = node.returnType;
+    if (returnType2 == null) {
       return computeReturnType2(node.functionExpression);
     }
-    return returnType8.type;
+    return returnType2.type;
   }
   /**
    * Given a function expression, compute the return type of the function. The return type of
@@ -3696,18 +4962,99 @@
    * @return the return type that was computed
    */
   Type2 computeReturnType2(FunctionExpression node) {
-    FunctionBody body4 = node.body;
-    if (body4 is ExpressionFunctionBody) {
-      return getType(((body4 as ExpressionFunctionBody)).expression);
+    FunctionBody body2 = node.body;
+    if (body2 is ExpressionFunctionBody) {
+      return getType2(((body2 as ExpressionFunctionBody)).expression);
     }
     return _dynamicType;
   }
   /**
+   * If the given argument list contains at least one argument, and if the argument is a simple
+   * string literal, then parse that argument as a query string and return the type specified by the
+   * argument.
+   * @param library the library in which the specified type would be defined
+   * @param argumentList the list of arguments from which a type is to be extracted
+   * @return the type specified by the first argument in the argument list
+   */
+  Type2 getFirstArgumentAsQuery(LibraryElement library, ArgumentList argumentList) {
+    String argumentValue = getFirstArgumentAsString(argumentList);
+    if (argumentValue != null) {
+      if (argumentValue.contains(" ")) {
+        return null;
+      }
+      String tag = argumentValue;
+      tag = StringUtilities.substringBefore(tag, ":");
+      tag = StringUtilities.substringBefore(tag, "[");
+      tag = StringUtilities.substringBefore(tag, ".");
+      tag = StringUtilities.substringBefore(tag, "#");
+      tag = _HTML_ELEMENT_TO_CLASS_MAP[tag.toLowerCase()];
+      ClassElement returnType = library.getType(tag);
+      if (returnType != null) {
+        return returnType.type;
+      }
+    }
+    return null;
+  }
+  /**
+   * If the given argument list contains at least one argument, and if the argument is a simple
+   * string literal, return the String value of the argument.
+   * @param argumentList the list of arguments from which a string value is to be extracted
+   * @return the string specified by the first argument in the argument list
+   */
+  String getFirstArgumentAsString(ArgumentList argumentList) {
+    NodeList<Expression> arguments2 = argumentList.arguments;
+    if (arguments2.length > 0) {
+      Expression argument = arguments2[0];
+      if (argument is SimpleStringLiteral) {
+        return ((argument as SimpleStringLiteral)).value;
+      }
+    }
+    return null;
+  }
+  /**
+   * If the given argument list contains at least one argument, and if the argument is a simple
+   * string literal, and if the value of the argument is the name of a class defined within the
+   * given library, return the type specified by the argument.
+   * @param library the library in which the specified type would be defined
+   * @param argumentList the list of arguments from which a type is to be extracted
+   * @return the type specified by the first argument in the argument list
+   */
+  Type2 getFirstArgumentAsType(LibraryElement library, ArgumentList argumentList) => getFirstArgumentAsType2(library, argumentList, null);
+  /**
+   * If the given argument list contains at least one argument, and if the argument is a simple
+   * string literal, and if the value of the argument is the name of a class defined within the
+   * given library, return the type specified by the argument.
+   * @param library the library in which the specified type would be defined
+   * @param argumentList the list of arguments from which a type is to be extracted
+   * @return the type specified by the first argument in the argument list
+   */
+  Type2 getFirstArgumentAsType2(LibraryElement library, ArgumentList argumentList, Map<String, String> nameMap) {
+    String argumentValue = getFirstArgumentAsString(argumentList);
+    if (argumentValue != null) {
+      if (nameMap != null) {
+        argumentValue = nameMap[argumentValue.toLowerCase()];
+      }
+      ClassElement returnType = library.getType(argumentValue);
+      if (returnType != null) {
+        return returnType.type;
+      }
+    }
+    return null;
+  }
+  Type2 getType(Element element) {
+    if (element is LocalVariableElement) {
+      return ((element as LocalVariableElement)).type;
+    } else if (element is ParameterElement) {
+      return ((element as ParameterElement)).type;
+    }
+    return null;
+  }
+  /**
    * Return the type of the given expression that is to be used for type analysis.
    * @param expression the expression whose type is to be returned
    * @return the type of the given expression
    */
-  Type2 getType(Expression expression) {
+  Type2 getType2(Expression expression) {
     Type2 type = expression.staticType;
     if (type == null) {
       return _dynamicType;
@@ -3717,9 +5064,12 @@
   /**
    * Return the type that should be recorded for a node that resolved to the given accessor.
    * @param accessor the accessor that the node resolved to
+   * @param context if the accessor element has context [by being the RHS of a{@link PrefixedIdentifier} or {@link PropertyAccess}], and the return type of the
+   * accessor is a parameter type, then the type of the LHS can be used to get more
+   * specific type information
    * @return the type that should be recorded for a node that resolved to the given accessor
    */
-  Type2 getType2(PropertyAccessorElement accessor) {
+  Type2 getType3(PropertyAccessorElement accessor, Type2 context) {
     FunctionType functionType = accessor.type;
     if (functionType == null) {
       return _dynamicType;
@@ -3729,57 +5079,89 @@
       if (parameterTypes != null && parameterTypes.length > 0) {
         return parameterTypes[0];
       }
-      PropertyAccessorElement getter4 = accessor.variable.getter;
-      if (getter4 != null) {
-        functionType = getter4.type;
+      PropertyAccessorElement getter2 = accessor.variable.getter;
+      if (getter2 != null) {
+        functionType = getter2.type;
         if (functionType != null) {
           return functionType.returnType;
         }
       }
       return _dynamicType;
     }
-    return functionType.returnType;
+    Type2 returnType2 = functionType.returnType;
+    if (returnType2 is TypeVariableType && context is InterfaceType) {
+      InterfaceType interfaceTypeContext = (context as InterfaceType);
+      List<TypeVariableElement> parameterElements = interfaceTypeContext.element != null ? interfaceTypeContext.element.typeVariables : null;
+      if (parameterElements != null) {
+        for (int i = 0; i < parameterElements.length; i++) {
+          TypeVariableElement varElt = parameterElements[i];
+          if (returnType2.name == varElt.name) {
+            return interfaceTypeContext.typeArguments[i];
+          }
+        }
+      }
+    }
+    return returnType2;
   }
   /**
    * Return the type represented by the given type name.
    * @param typeName the type name representing the type to be returned
    * @return the type represented by the type name
    */
-  Type2 getType3(TypeName typeName) {
-    Type2 type16 = typeName.type;
-    if (type16 == null) {
+  Type2 getType4(TypeName typeName) {
+    Type2 type2 = typeName.type;
+    if (type2 == null) {
       return _dynamicType;
     }
-    return type16;
+    return type2;
   }
   /**
+   * Return {@code true} if the given library is the 'dart:html' library.
+   * @param library the library being tested
+   * @return {@code true} if the library is 'dart:html'
+   */
+  bool isHtmlLibrary(LibraryElement library) => library.name == "dart.dom.html";
+  /**
    * Return {@code true} if the given node is not a type literal.
    * @param node the node being tested
    * @return {@code true} if the given node is not a type literal
    */
-  bool isNotTypeLiteral(SimpleIdentifier node) {
-    ASTNode parent15 = node.parent;
-    return parent15 is TypeName || (parent15 is PrefixedIdentifier && (parent15.parent is TypeName || identical(((parent15 as PrefixedIdentifier)).prefix, node))) || (parent15 is PropertyAccess && identical(((parent15 as PropertyAccess)).target, node)) || (parent15 is MethodInvocation && identical(node, ((parent15 as MethodInvocation)).target));
+  bool isNotTypeLiteral(Identifier node) {
+    ASTNode parent2 = node.parent;
+    return parent2 is TypeName || (parent2 is PrefixedIdentifier && (parent2.parent is TypeName || identical(((parent2 as PrefixedIdentifier)).prefix, node))) || (parent2 is PropertyAccess && identical(((parent2 as PropertyAccess)).target, node)) || (parent2 is MethodInvocation && identical(node, ((parent2 as MethodInvocation)).target));
+  }
+  /**
+   * If it is appropriate to do so, override the type of the given element. Use the static type and
+   * inferred type of the element to determine whether or not it is appropriate.
+   * @param element the element whose type might be overridden
+   * @param staticType the static type of the element
+   * @param inferredType the inferred type of the element
+   */
+  void override(VariableElement element, Type2 staticType, Type2 inferredType) {
+    if (identical(inferredType, BottomTypeImpl.instance) || element is! VariableElement) {
+      return;
+    }
+    if (element is PropertyInducingElement) {
+      PropertyInducingElement variable = element as PropertyInducingElement;
+      if (!variable.isConst() && !variable.isFinal()) {
+        return;
+      }
+    }
+    if (staticType == null || (inferredType != null && inferredType.isMoreSpecificThan(staticType))) {
+      _overrideManager.setType(element, inferredType);
+    }
   }
   /**
    * Record that the static type of the given node is the type of the second argument to the method
    * represented by the given element.
    * @param expression the node whose type is to be recorded
    * @param element the element representing the method invoked by the given node
-   * @param typeArguments the array of {@link Type}s to perform a substitution on the parameter
-   * types from the type in the passed {@link Element}, or <code>null</code>
    */
-  Object recordArgumentType(IndexExpression expression, MethodElement element, List<Type2> typeArguments10) {
+  Object recordArgumentType(IndexExpression expression, MethodElement element) {
     if (element != null) {
-      List<ParameterElement> parameters12 = element.parameters;
-      if (parameters12 != null && parameters12.length == 2) {
-        ClassElement classElement = parameters12[1].getAncestor(ClassElement);
-        List<Type2> typeParameters = classElement == null ? null : classElement.type.typeArguments;
-        if (typeArguments10 == null || typeParameters == null || typeArguments10.length != typeParameters.length) {
-          return recordType(expression, parameters12[1].type);
-        } else {
-          return recordType(expression, parameters12[1].type.substitute2(typeArguments10, typeParameters));
-        }
+      List<ParameterElement> parameters2 = element.parameters;
+      if (parameters2 != null && parameters2.length == 2) {
+        return recordType(expression, parameters2[1].type);
       }
     }
     return recordType(expression, _dynamicType);
@@ -3789,34 +5171,28 @@
    * represented by the given element.
    * @param expression the node whose type is to be recorded
    * @param element the element representing the method or function invoked by the given node
-   * @param typeArguments the array of {@link Type}s to perform a substitution on the parameter
-   * types from the type in the passed {@link Element}, or <code>null</code>
    */
-  Object recordReturnType(Expression expression, Element element, List<Type2> typeArguments11) {
+  Object recordReturnType(Expression expression, Element element) {
     if (element is PropertyAccessorElement) {
       FunctionType propertyType = ((element as PropertyAccessorElement)).type;
       if (propertyType != null) {
-        Type2 returnType9 = propertyType.returnType;
-        if (returnType9 is FunctionType) {
-          Type2 innerReturnType = ((returnType9 as FunctionType)).returnType;
+        Type2 returnType2 = propertyType.returnType;
+        if (returnType2 is FunctionType) {
+          Type2 innerReturnType = ((returnType2 as FunctionType)).returnType;
           if (innerReturnType != null) {
             return recordType(expression, innerReturnType);
           }
+        } else if (returnType2.isDartCoreFunction()) {
+          return recordType(expression, _dynamicType);
         }
-        if (returnType9 != null) {
-          return recordType(expression, returnType9);
+        if (returnType2 != null) {
+          return recordType(expression, returnType2);
         }
       }
     } else if (element is ExecutableElement) {
-      FunctionType type17 = ((element as ExecutableElement)).type;
-      if (type17 != null) {
-        ClassElement classElement = element.getAncestor(ClassElement);
-        List<Type2> typeParameters = classElement == null ? null : classElement.type.typeArguments;
-        if (typeArguments11 == null || typeParameters == null || typeArguments11.length != typeParameters.length) {
-          return recordType(expression, type17.returnType);
-        } else {
-          return recordType(expression, type17.returnType.substitute2(typeArguments11, typeParameters));
-        }
+      FunctionType type2 = ((element as ExecutableElement)).type;
+      if (type2 != null) {
+        return recordType(expression, type2.returnType);
       }
     } else if (element is VariableElement) {
       Type2 variableType = ((element as VariableElement)).type;
@@ -3846,7 +5222,7 @@
    * @param returnType the return type of the function, or {@code null} if no type was declared
    * @param parameters the elements representing the parameters to the function
    */
-  void setTypeInformation(FunctionTypeImpl functionType, Type2 returnType12, FormalParameterList parameterList) {
+  void setTypeInformation(FunctionTypeImpl functionType, Type2 returnType2, FormalParameterList parameterList) {
     List<Type2> normalParameterTypes = new List<Type2>();
     List<Type2> optionalParameterTypes = new List<Type2>();
     LinkedHashMap<String, Type2> namedParameterTypes = new LinkedHashMap<String, Type2>();
@@ -3867,12 +5243,112 @@
     functionType.normalParameterTypes = new List.from(normalParameterTypes);
     functionType.optionalParameterTypes = new List.from(optionalParameterTypes);
     functionType.namedParameterTypes = namedParameterTypes;
-    functionType.returnType = returnType12;
+    functionType.returnType = returnType2;
   }
   get thisType_J2DAccessor => _thisType;
   set thisType_J2DAccessor(__v) => _thisType = __v;
 }
 /**
+ * Instances of the class {@code TypeOverrideManager} manage the ability to override the type of an
+ * element within a given context.
+ */
+class TypeOverrideManager {
+  /**
+   * The current override scope, or {@code null} if no scope has been entered.
+   */
+  TypeOverrideManager_TypeOverrideScope _currentScope;
+  /**
+   * Initialize a newly created override manager to not be in any scope.
+   */
+  TypeOverrideManager() : super() {
+  }
+  /**
+   * Enter a new override scope.
+   */
+  void enterScope() {
+    _currentScope = new TypeOverrideManager_TypeOverrideScope(_currentScope);
+  }
+  /**
+   * Exit the current override scope.
+   */
+  void exitScope() {
+    if (_currentScope == null) {
+      throw new IllegalStateException("No scope to exit");
+    }
+    _currentScope = _currentScope._outerScope;
+  }
+  /**
+   * Return the overridden type of the given element, or {@code null} if the type of the element has
+   * not been overridden.
+   * @param element the element whose type might have been overridden
+   * @return the overridden type of the given element
+   */
+  Type2 getType(Element element) {
+    if (_currentScope == null) {
+      return null;
+    }
+    return _currentScope.getType(element);
+  }
+  /**
+   * Set the overridden type of the given element to the given type
+   * @param element the element whose type might have been overridden
+   * @param type the overridden type of the given element
+   */
+  void setType(Element element, Type2 type) {
+    if (_currentScope == null) {
+      throw new IllegalStateException("Cannot override without a scope");
+    }
+    _currentScope.setType(element, type);
+  }
+}
+/**
+ * Instances of the class {@code TypeOverrideScope} represent a scope in which the types of
+ * elements can be overridden.
+ */
+class TypeOverrideManager_TypeOverrideScope {
+  /**
+   * The outer scope in which types might be overridden.
+   */
+  TypeOverrideManager_TypeOverrideScope _outerScope;
+  /**
+   * A table mapping elements to the overridden type of that element.
+   */
+  Map<Element, Type2> _overridenTypes = new Map<Element, Type2>();
+  /**
+   * Initialize a newly created scope to be an empty child of the given scope.
+   * @param outerScope the outer scope in which types might be overridden
+   */
+  TypeOverrideManager_TypeOverrideScope(TypeOverrideManager_TypeOverrideScope outerScope) {
+    this._outerScope = outerScope;
+  }
+  /**
+   * Return the overridden type of the given element, or {@code null} if the type of the element
+   * has not been overridden.
+   * @param element the element whose type might have been overridden
+   * @return the overridden type of the given element
+   */
+  Type2 getType(Element element) {
+    Type2 type = _overridenTypes[element];
+    if (type == null && element is PropertyAccessorElement) {
+      type = _overridenTypes[((element as PropertyAccessorElement)).variable];
+    }
+    if (type != null) {
+      return type;
+    } else if (_outerScope != null) {
+      return _outerScope.getType(element);
+    }
+    return null;
+  }
+  /**
+   * Set the overridden type of the given element to the given type
+   * @param element the element whose type might have been overridden
+   * @param type the overridden type of the given element
+   */
+  void setType(Element element, Type2 type) {
+    _overridenTypes[element] = type;
+  }
+}
+/**
  * The interface {@code TypeProvider} defines the behavior of objects that provide access to types
  * defined by the language.
  * @coverage dart.engine.resolver
@@ -4076,7 +5552,25 @@
    * @param source the source representing the compilation unit being visited
    * @param typeProvider the object used to access the types from the core library
    */
-  TypeResolverVisitor(Library library, Source source, TypeProvider typeProvider) : super(library, source, typeProvider) {
+  TypeResolverVisitor.con1(Library library, Source source, TypeProvider typeProvider) : super.con1(library, source, typeProvider) {
+    _jtd_constructor_273_impl(library, source, typeProvider);
+  }
+  _jtd_constructor_273_impl(Library library, Source source, TypeProvider typeProvider) {
+    _dynamicType = typeProvider.dynamicType;
+  }
+  /**
+   * Initialize a newly created visitor to resolve the nodes in a compilation unit.
+   * @param definingLibrary the element for the library containing the compilation unit being
+   * visited
+   * @param source the source representing the compilation unit being visited
+   * @param typeProvider the object used to access the types from the core library
+   * @param errorListener the error listener that will be informed of any errors that are found
+   * during resolution
+   */
+  TypeResolverVisitor.con2(LibraryElement definingLibrary, Source source, TypeProvider typeProvider, AnalysisErrorListener errorListener) : super.con2(definingLibrary, source, typeProvider, errorListener) {
+    _jtd_constructor_274_impl(definingLibrary, source, typeProvider, errorListener);
+  }
+  _jtd_constructor_274_impl(LibraryElement definingLibrary, Source source, TypeProvider typeProvider, AnalysisErrorListener errorListener) {
     _dynamicType = typeProvider.dynamicType;
   }
   Object visitCatchClause(CatchClause node) {
@@ -4088,12 +5582,12 @@
       if (exceptionTypeName == null) {
         exceptionType = typeProvider.objectType;
       } else {
-        exceptionType = getType4(exceptionTypeName);
+        exceptionType = getType5(exceptionTypeName);
       }
       recordType(exception, exceptionType);
-      Element element32 = exception.element;
-      if (element32 is VariableElementImpl) {
-        ((element32 as VariableElementImpl)).type = exceptionType;
+      Element element2 = exception.element;
+      if (element2 is VariableElementImpl) {
+        ((element2 as VariableElementImpl)).type = exceptionType;
       } else {
       }
     }
@@ -4107,9 +5601,9 @@
     super.visitClassDeclaration(node);
     ClassElementImpl classElement = getClassElement(node.name);
     InterfaceType superclassType = null;
-    ExtendsClause extendsClause4 = node.extendsClause;
-    if (extendsClause4 != null) {
-      superclassType = resolveType(extendsClause4.superclass, CompileTimeErrorCode.EXTENDS_NON_CLASS, CompileTimeErrorCode.EXTENDS_NON_CLASS, null);
+    ExtendsClause extendsClause2 = node.extendsClause;
+    if (extendsClause2 != null) {
+      superclassType = resolveType(extendsClause2.superclass, CompileTimeErrorCode.EXTENDS_NON_CLASS);
       if (superclassType != typeProvider.objectType) {
         classElement.validMixin = false;
       }
@@ -4129,7 +5623,7 @@
   Object visitClassTypeAlias(ClassTypeAlias node) {
     super.visitClassTypeAlias(node);
     ClassElementImpl classElement = getClassElement(node.name);
-    InterfaceType superclassType = resolveType(node.superclass, CompileTimeErrorCode.EXTENDS_NON_CLASS, CompileTimeErrorCode.EXTENDS_NON_CLASS, null);
+    InterfaceType superclassType = resolveType(node.superclass, CompileTimeErrorCode.EXTENDS_NON_CLASS);
     if (superclassType == null) {
       superclassType = typeProvider.objectType;
     }
@@ -4141,11 +5635,11 @@
   }
   Object visitConstructorDeclaration(ConstructorDeclaration node) {
     super.visitConstructorDeclaration(node);
-    ExecutableElementImpl element33 = node.element as ExecutableElementImpl;
-    FunctionTypeImpl type = new FunctionTypeImpl.con1(element33);
-    setTypeInformation(type, null, element33.parameters);
-    type.returnType = ((element33.enclosingElement as ClassElement)).type;
-    element33.type = type;
+    ExecutableElementImpl element2 = node.element as ExecutableElementImpl;
+    FunctionTypeImpl type = new FunctionTypeImpl.con1(element2);
+    setTypeInformation(type, null, element2.parameters);
+    type.returnType = ((element2.enclosingElement as ClassElement)).type;
+    element2.type = type;
     return null;
   }
   Object visitDeclaredIdentifier(DeclaredIdentifier node) {
@@ -4155,10 +5649,10 @@
     if (typeName == null) {
       declaredType = _dynamicType;
     } else {
-      declaredType = getType4(typeName);
+      declaredType = getType5(typeName);
     }
-    LocalVariableElementImpl element34 = node.element as LocalVariableElementImpl;
-    element34.type = declaredType;
+    LocalVariableElementImpl element2 = node.element as LocalVariableElementImpl;
+    element2.type = declaredType;
     return null;
   }
   Object visitDefaultFormalParameter(DefaultFormalParameter node) {
@@ -4167,15 +5661,15 @@
   }
   Object visitFieldFormalParameter(FieldFormalParameter node) {
     super.visitFieldFormalParameter(node);
-    Element element35 = node.identifier.element;
-    if (element35 is ParameterElementImpl) {
-      ParameterElementImpl parameter = element35 as ParameterElementImpl;
+    Element element2 = node.identifier.element;
+    if (element2 is ParameterElementImpl) {
+      ParameterElementImpl parameter = element2 as ParameterElementImpl;
       Type2 type;
       TypeName typeName = node.type;
       if (typeName == null) {
         type = _dynamicType;
       } else {
-        type = getType4(typeName);
+        type = getType5(typeName);
       }
       parameter.type = type;
     } else {
@@ -4184,42 +5678,42 @@
   }
   Object visitFunctionDeclaration(FunctionDeclaration node) {
     super.visitFunctionDeclaration(node);
-    ExecutableElementImpl element36 = node.element as ExecutableElementImpl;
-    FunctionTypeImpl type = new FunctionTypeImpl.con1(element36);
-    setTypeInformation(type, node.returnType, element36.parameters);
-    element36.type = type;
+    ExecutableElementImpl element2 = node.element as ExecutableElementImpl;
+    FunctionTypeImpl type = new FunctionTypeImpl.con1(element2);
+    setTypeInformation(type, node.returnType, element2.parameters);
+    element2.type = type;
     return null;
   }
   Object visitFunctionTypeAlias(FunctionTypeAlias node) {
     super.visitFunctionTypeAlias(node);
-    FunctionTypeAliasElementImpl element37 = node.element as FunctionTypeAliasElementImpl;
-    FunctionTypeImpl type18 = element37.type as FunctionTypeImpl;
-    setTypeInformation(type18, node.returnType, element37.parameters);
+    FunctionTypeAliasElementImpl element2 = node.element as FunctionTypeAliasElementImpl;
+    FunctionTypeImpl type2 = element2.type as FunctionTypeImpl;
+    setTypeInformation(type2, node.returnType, element2.parameters);
     return null;
   }
   Object visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
     super.visitFunctionTypedFormalParameter(node);
-    ParameterElementImpl element38 = node.identifier.element as ParameterElementImpl;
+    ParameterElementImpl element2 = node.identifier.element as ParameterElementImpl;
     FunctionTypeImpl type = new FunctionTypeImpl.con1((null as ExecutableElement));
     setTypeInformation(type, node.returnType, getElements(node.parameters));
-    element38.type = type;
+    element2.type = type;
     return null;
   }
   Object visitMethodDeclaration(MethodDeclaration node) {
     super.visitMethodDeclaration(node);
-    ExecutableElementImpl element39 = node.element as ExecutableElementImpl;
-    FunctionTypeImpl type = new FunctionTypeImpl.con1(element39);
-    setTypeInformation(type, node.returnType, element39.parameters);
-    element39.type = type;
-    if (element39 is PropertyAccessorElementImpl) {
-      PropertyAccessorElementImpl accessor = element39 as PropertyAccessorElementImpl;
-      PropertyInducingElementImpl variable5 = accessor.variable as PropertyInducingElementImpl;
+    ExecutableElementImpl element2 = node.element as ExecutableElementImpl;
+    FunctionTypeImpl type = new FunctionTypeImpl.con1(element2);
+    setTypeInformation(type, node.returnType, element2.parameters);
+    element2.type = type;
+    if (element2 is PropertyAccessorElement) {
+      PropertyAccessorElement accessor = element2 as PropertyAccessorElement;
+      PropertyInducingElementImpl variable2 = accessor.variable as PropertyInducingElementImpl;
       if (accessor.isGetter()) {
-        variable5.type = type.returnType;
-      } else if (variable5.type == null) {
+        variable2.type = type.returnType;
+      } else if (variable2.type == null) {
         List<Type2> parameterTypes = type.normalParameterTypes;
         if (parameterTypes != null && parameterTypes.length > 0) {
-          variable5.type = parameterTypes[0];
+          variable2.type = parameterTypes[0];
         }
       }
     }
@@ -4232,11 +5726,11 @@
     if (typeName == null) {
       declaredType = _dynamicType;
     } else {
-      declaredType = getType4(typeName);
+      declaredType = getType5(typeName);
     }
-    Element element40 = node.identifier.element;
-    if (element40 is ParameterElement) {
-      ((element40 as ParameterElementImpl)).type = declaredType;
+    Element element2 = node.identifier.element;
+    if (element2 is ParameterElement) {
+      ((element2 as ParameterElementImpl)).type = declaredType;
     } else {
     }
     return null;
@@ -4263,24 +5757,31 @@
         node.type = voidType;
         return null;
       }
-      ASTNode parent16 = node.parent;
-      if (typeName is PrefixedIdentifier && parent16 is ConstructorName && argumentList == null) {
-        ConstructorName name = parent16 as ConstructorName;
+      ASTNode parent2 = node.parent;
+      if (typeName is PrefixedIdentifier && parent2 is ConstructorName && argumentList == null) {
+        ConstructorName name = parent2 as ConstructorName;
         if (name.name == null) {
-          SimpleIdentifier prefix8 = ((typeName as PrefixedIdentifier)).prefix;
-          element = nameScope.lookup(prefix8, definingLibrary);
+          SimpleIdentifier prefix2 = ((typeName as PrefixedIdentifier)).prefix;
+          element = nameScope.lookup(prefix2, definingLibrary);
           if (element is PrefixElement) {
             return null;
           } else if (element != null) {
             name.name = ((typeName as PrefixedIdentifier)).identifier;
             name.period = ((typeName as PrefixedIdentifier)).period;
-            node.name = prefix8;
-            typeName = prefix8;
+            node.name = prefix2;
+            typeName = prefix2;
           }
         }
       }
     }
     if (element == null) {
+      Identifier simpleIdentifier;
+      if (typeName is SimpleIdentifier) {
+        simpleIdentifier = typeName;
+      } else {
+        simpleIdentifier = ((typeName as PrefixedIdentifier)).prefix;
+      }
+      reportError(StaticWarningCode.UNDEFINED_CLASS, simpleIdentifier, [simpleIdentifier.name]);
       setElement(typeName, _dynamicType.element);
       typeName.staticType = _dynamicType;
       node.type = _dynamicType;
@@ -4298,6 +5799,12 @@
       type = ((element as TypeVariableElement)).type;
       if (argumentList != null) {
       }
+    } else if (element is MultiplyDefinedElement) {
+      List<Element> elements = ((element as MultiplyDefinedElement)).conflictingElements;
+      type = getType(elements);
+      if (type != null) {
+        node.type = type;
+      }
     } else {
       setElement(typeName, _dynamicType.element);
       typeName.staticType = _dynamicType;
@@ -4305,20 +5812,20 @@
       return null;
     }
     if (argumentList != null) {
-      NodeList<TypeName> arguments6 = argumentList.arguments;
-      int argumentCount = arguments6.length;
+      NodeList<TypeName> arguments2 = argumentList.arguments;
+      int argumentCount = arguments2.length;
       List<Type2> parameters = getTypeArguments(type);
       int parameterCount = parameters.length;
       int count = Math.min(argumentCount, parameterCount);
       List<Type2> typeArguments = new List<Type2>();
       for (int i = 0; i < count; i++) {
-        Type2 argumentType = getType4(arguments6[i]);
+        Type2 argumentType = getType5(arguments2[i]);
         if (argumentType != null) {
           typeArguments.add(argumentType);
         }
       }
       if (argumentCount != parameterCount) {
-        reportError(getInvalidTypeParametersErrorCode(node), node, [typeName.name, argumentCount, parameterCount]);
+        reportError(getInvalidTypeParametersErrorCode(node), node, [typeName.name, parameterCount, argumentCount]);
       }
       argumentCount = typeArguments.length;
       if (argumentCount < parameterCount) {
@@ -4357,23 +5864,23 @@
     if (typeName == null) {
       declaredType = _dynamicType;
     } else {
-      declaredType = getType4(typeName);
+      declaredType = getType5(typeName);
     }
-    Element element41 = node.name.element;
-    if (element41 is VariableElement) {
-      ((element41 as VariableElementImpl)).type = declaredType;
-      if (element41 is FieldElement) {
-        FieldElement field = element41 as FieldElement;
-        PropertyAccessorElementImpl getter5 = field.getter as PropertyAccessorElementImpl;
-        FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter5);
+    Element element2 = node.name.element;
+    if (element2 is VariableElement) {
+      ((element2 as VariableElementImpl)).type = declaredType;
+      if (element2 is PropertyInducingElement) {
+        PropertyInducingElement variableElement = element2 as PropertyInducingElement;
+        PropertyAccessorElementImpl getter2 = variableElement.getter as PropertyAccessorElementImpl;
+        FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter2);
         getterType.returnType = declaredType;
-        getter5.type = getterType;
-        PropertyAccessorElementImpl setter4 = field.setter as PropertyAccessorElementImpl;
-        if (setter4 != null) {
-          FunctionTypeImpl setterType = new FunctionTypeImpl.con1(setter4);
+        getter2.type = getterType;
+        PropertyAccessorElementImpl setter2 = variableElement.setter as PropertyAccessorElementImpl;
+        if (setter2 != null) {
+          FunctionTypeImpl setterType = new FunctionTypeImpl.con1(setter2);
           setterType.returnType = VoidTypeImpl.instance;
           setterType.normalParameterTypes = <Type2> [declaredType];
-          setter4.type = setterType;
+          setter2.type = setterType;
         }
       }
     } else {
@@ -4389,11 +5896,11 @@
     if (identifier == null) {
       return null;
     }
-    Element element42 = identifier.element;
-    if (element42 is! ClassElementImpl) {
+    Element element2 = identifier.element;
+    if (element2 is! ClassElementImpl) {
       return null;
     }
-    return element42 as ClassElementImpl;
+    return element2 as ClassElementImpl;
   }
   /**
    * Return an array containing all of the elements associated with the parameters in the given
@@ -4404,9 +5911,9 @@
   List<ParameterElement> getElements(FormalParameterList parameterList) {
     List<ParameterElement> elements = new List<ParameterElement>();
     for (FormalParameter parameter in parameterList.parameters) {
-      ParameterElement element43 = parameter.identifier.element as ParameterElement;
-      if (element43 != null) {
-        elements.add(element43);
+      ParameterElement element2 = parameter.identifier.element as ParameterElement;
+      if (element2 != null) {
+        elements.add(element2);
       }
     }
     return new List.from(elements);
@@ -4420,11 +5927,11 @@
    * were provided
    */
   ErrorCode getInvalidTypeParametersErrorCode(TypeName node) {
-    ASTNode parent17 = node.parent;
-    if (parent17 is ConstructorName) {
-      parent17 = parent17.parent;
-      if (parent17 is InstanceCreationExpression) {
-        if (((parent17 as InstanceCreationExpression)).isConst()) {
+    ASTNode parent2 = node.parent;
+    if (parent2 is ConstructorName) {
+      parent2 = parent2.parent;
+      if (parent2 is InstanceCreationExpression) {
+        if (((parent2 as InstanceCreationExpression)).isConst()) {
           return CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS;
         } else {
           return CompileTimeErrorCode.NEW_WITH_INVALID_TYPE_PARAMETERS;
@@ -4456,12 +5963,12 @@
    * @param typeName the type name representing the type to be returned
    * @return the type represented by the type name
    */
-  Type2 getType4(TypeName typeName) {
-    Type2 type19 = typeName.type;
-    if (type19 == null) {
+  Type2 getType5(TypeName typeName) {
+    Type2 type2 = typeName.type;
+    if (type2 == null) {
       return _dynamicType;
     }
-    return type19;
+    return type2;
   }
   /**
    * Return the type arguments associated with the given type.
@@ -4499,13 +6006,45 @@
    */
   void resolve(ClassElementImpl classElement, WithClause withClause, ImplementsClause implementsClause) {
     if (withClause != null) {
-      List<InterfaceType> mixinTypes2 = resolveTypes(withClause.mixinTypes, CompileTimeErrorCode.MIXIN_OF_NON_CLASS, CompileTimeErrorCode.MIXIN_OF_NON_CLASS, null);
+      List<InterfaceType> mixinTypes2 = resolveTypes(withClause.mixinTypes, CompileTimeErrorCode.MIXIN_OF_NON_CLASS);
       if (classElement != null) {
         classElement.mixins = mixinTypes2;
       }
     }
     if (implementsClause != null) {
-      List<InterfaceType> interfaceTypes = resolveTypes(implementsClause.interfaces, CompileTimeErrorCode.IMPLEMENTS_NON_CLASS, CompileTimeErrorCode.IMPLEMENTS_NON_CLASS, null);
+      NodeList<TypeName> interfaces2 = implementsClause.interfaces;
+      List<InterfaceType> interfaceTypes = resolveTypes(interfaces2, CompileTimeErrorCode.IMPLEMENTS_NON_CLASS);
+      List<TypeName> typeNames = new List.from(interfaces2);
+      String dynamicKeyword = sc.Keyword.DYNAMIC.syntax;
+      List<bool> detectedRepeatOnIndex = new List<bool>.filled(typeNames.length, false);
+      for (int i = 0; i < detectedRepeatOnIndex.length; i++) {
+        detectedRepeatOnIndex[i] = false;
+      }
+      for (int i = 0; i < typeNames.length; i++) {
+        TypeName typeName = typeNames[i];
+        String name3 = typeName.name.name;
+        if (name3 == dynamicKeyword) {
+          reportError(CompileTimeErrorCode.IMPLEMENTS_DYNAMIC, typeName, []);
+        } else {
+          Element element3 = typeName.name.element;
+          if (element3 != null && element3 == classElement) {
+            reportError(CompileTimeErrorCode.IMPLEMENTS_SELF, typeName, [name3]);
+          }
+        }
+        if (!detectedRepeatOnIndex[i]) {
+          for (int j = i + 1; j < typeNames.length; j++) {
+            Element element4 = typeName.name.element;
+            TypeName typeName2 = typeNames[j];
+            Identifier identifier2 = typeName2.name;
+            String name2 = identifier2.name;
+            Element element2 = identifier2.element;
+            if (element4 != null && element4 == element2) {
+              detectedRepeatOnIndex[j] = true;
+              reportError(CompileTimeErrorCode.IMPLEMENTS_REPEATED, typeName2, [name2]);
+            }
+          }
+        }
+      }
       if (classElement != null) {
         classElement.interfaces = interfaceTypes;
       }
@@ -4514,65 +6053,49 @@
   /**
    * Return the type specified by the given name.
    * @param typeName the type name specifying the type to be returned
-   * @param undefinedError the error to produce if the type name is not defined
    * @param nonTypeError the error to produce if the type name is defined to be something other than
    * a type
-   * @param nonInterfaceType the error to produce if the type is not an interface type
    * @return the type specified by the type name
    */
-  InterfaceType resolveType(TypeName typeName, ErrorCode undefinedError, ErrorCode nonTypeError, ErrorCode nonInterfaceType) {
-    Identifier name17 = typeName.name;
-    Element element = nameScope.lookup(name17, definingLibrary);
-    if (element == null) {
-      reportError(undefinedError, name17, [name17.name]);
-    } else if (element is ClassElement) {
-      Type2 classType = ((element as ClassElement)).type;
-      typeName.type = classType;
-      if (classType is InterfaceType) {
-        return classType as InterfaceType;
-      }
-      reportError(nonInterfaceType, name17, [name17.name]);
-    } else if (element is MultiplyDefinedElement) {
-      List<Element> elements = ((element as MultiplyDefinedElement)).conflictingElements;
-      InterfaceType type = getType(elements);
-      if (type != null) {
-        typeName.type = type;
-      }
-    } else {
-      reportError(nonTypeError, name17, [name17.name]);
+  InterfaceType resolveType(TypeName typeName, ErrorCode nonTypeError) {
+    Type2 type2 = typeName.type;
+    if (type2 is InterfaceType) {
+      return type2 as InterfaceType;
+    }
+    Identifier name2 = typeName.name;
+    if (name2.name != sc.Keyword.DYNAMIC.syntax) {
+      reportError(nonTypeError, name2, [name2.name]);
     }
     return null;
   }
   /**
    * Resolve the types in the given list of type names.
    * @param typeNames the type names to be resolved
-   * @param undefinedError the error to produce if the type name is not defined
    * @param nonTypeError the error to produce if the type name is defined to be something other than
    * a type
-   * @param nonInterfaceType the error to produce if the type is not an interface type
    * @return an array containing all of the types that were resolved.
    */
-  List<InterfaceType> resolveTypes(NodeList<TypeName> typeNames, ErrorCode undefinedError, ErrorCode nonTypeError, ErrorCode nonInterfaceType) {
+  List<InterfaceType> resolveTypes(NodeList<TypeName> typeNames, ErrorCode nonTypeError) {
     List<InterfaceType> types = new List<InterfaceType>();
     for (TypeName typeName in typeNames) {
-      InterfaceType type = resolveType(typeName, undefinedError, nonTypeError, nonInterfaceType);
+      InterfaceType type = resolveType(typeName, nonTypeError);
       if (type != null) {
         types.add(type);
       }
     }
     return new List.from(types);
   }
-  void setElement(Identifier typeName, Element element60) {
-    if (element60 != null) {
+  void setElement(Identifier typeName, Element element2) {
+    if (element2 != null) {
       if (typeName is SimpleIdentifier) {
-        ((typeName as SimpleIdentifier)).element = element60;
+        ((typeName as SimpleIdentifier)).element = element2;
       } else if (typeName is PrefixedIdentifier) {
         PrefixedIdentifier identifier = typeName as PrefixedIdentifier;
-        identifier.identifier.element = element60;
-        SimpleIdentifier prefix9 = identifier.prefix;
-        Element prefixElement = nameScope.lookup(prefix9, definingLibrary);
+        identifier.identifier.element = element2;
+        SimpleIdentifier prefix2 = identifier.prefix;
+        Element prefixElement = nameScope.lookup(prefix2, definingLibrary);
         if (prefixElement != null) {
-          prefix9.element = prefixElement;
+          prefix2.element = prefixElement;
         }
       }
     }
@@ -4584,7 +6107,7 @@
    * @param returnType the return type of the function, or {@code null} if no type was declared
    * @param parameters the elements representing the parameters to the function
    */
-  void setTypeInformation(FunctionTypeImpl functionType, TypeName returnType13, List<ParameterElement> parameters) {
+  void setTypeInformation(FunctionTypeImpl functionType, TypeName returnType2, List<ParameterElement> parameters) {
     List<Type2> normalParameterTypes = new List<Type2>();
     List<Type2> optionalParameterTypes = new List<Type2>();
     LinkedHashMap<String, Type2> namedParameterTypes = new LinkedHashMap<String, Type2>();
@@ -4609,10 +6132,10 @@
     if (!namedParameterTypes.isEmpty) {
       functionType.namedParameterTypes = namedParameterTypes;
     }
-    if (returnType13 == null) {
+    if (returnType2 == null) {
       functionType.returnType = _dynamicType;
     } else {
-      functionType.returnType = returnType13.type;
+      functionType.returnType = returnType2.type;
     }
   }
 }
@@ -4705,8 +6228,8 @@
   void defineParameters(ExecutableElement functionElement) {
     Scope parameterScope = enclosingScope;
     if (functionElement.enclosingElement is ExecutableElement) {
-      String name18 = functionElement.name;
-      if (name18 != null && !name18.isEmpty) {
+      String name2 = functionElement.name;
+      if (name2 != null && !name2.isEmpty) {
         parameterScope.define(functionElement);
       }
     }
@@ -4774,10 +6297,10 @@
    * @param onSwitchMember {@code true} if this label is associated with a {@code switch} member
    */
   LabelScope.con1(LabelScope outerScope, bool onSwitchStatement, bool onSwitchMember) {
-    _jtd_constructor_254_impl(outerScope, onSwitchStatement, onSwitchMember);
+    _jtd_constructor_279_impl(outerScope, onSwitchStatement, onSwitchMember);
   }
-  _jtd_constructor_254_impl(LabelScope outerScope, bool onSwitchStatement, bool onSwitchMember) {
-    _jtd_constructor_255_impl(outerScope, EMPTY_LABEL, new LabelElementImpl(_EMPTY_LABEL_IDENTIFIER, onSwitchStatement, onSwitchMember));
+  _jtd_constructor_279_impl(LabelScope outerScope, bool onSwitchStatement, bool onSwitchMember) {
+    _jtd_constructor_280_impl(outerScope, EMPTY_LABEL, new LabelElementImpl(_EMPTY_LABEL_IDENTIFIER, onSwitchStatement, onSwitchMember));
   }
   /**
    * Initialize a newly created scope to represent the given label.
@@ -4785,13 +6308,13 @@
    * @param label the label defined in this scope
    * @param element the element to which the label resolves
    */
-  LabelScope.con2(LabelScope outerScope2, String label4, LabelElement element21) {
-    _jtd_constructor_255_impl(outerScope2, label4, element21);
+  LabelScope.con2(LabelScope outerScope2, String label2, LabelElement element2) {
+    _jtd_constructor_280_impl(outerScope2, label2, element2);
   }
-  _jtd_constructor_255_impl(LabelScope outerScope2, String label4, LabelElement element21) {
+  _jtd_constructor_280_impl(LabelScope outerScope2, String label2, LabelElement element2) {
     this._outerScope = outerScope2;
-    this._label = label4;
-    this._element = element21;
+    this._label = label2;
+    this._element = element2;
   }
   /**
    * Return the label element corresponding to the given label, or {@code null} if the given label
@@ -4854,9 +6377,6 @@
   LibraryElement get definingLibrary => _definingLibrary;
   AnalysisErrorListener get errorListener => _errorListener;
   Element lookup3(String name, LibraryElement referencingLibrary) {
-    if (Scope.isPrivateName(name)) {
-      return null;
-    }
     Element foundElement = localLookup(name, referencingLibrary);
     if (foundElement != null) {
       return foundElement;
@@ -4999,11 +6519,11 @@
    * @return the import namespace that was created
    */
   Namespace createImportNamespace(ImportElement element) {
-    LibraryElement importedLibrary4 = element.importedLibrary;
-    if (importedLibrary4 == null) {
+    LibraryElement importedLibrary2 = element.importedLibrary;
+    if (importedLibrary2 == null) {
       return Namespace.EMPTY;
     }
-    Map<String, Element> definedNames = createExportMapping(importedLibrary4, new Set<LibraryElement>());
+    Map<String, Element> definedNames = createExportMapping(importedLibrary2, new Set<LibraryElement>());
     definedNames = apply(definedNames, element.combinators);
     definedNames = apply2(definedNames, element.prefix);
     return new Namespace(definedNames);
@@ -5047,9 +6567,9 @@
    * @param element the element to be added
    */
   void addIfPublic(Map<String, Element> definedNames, Element element) {
-    String name19 = element.name;
-    if (name19 != null && !Scope.isPrivateName(name19)) {
-      definedNames[name19] = element;
+    String name2 = element.name;
+    if (name2 != null && !Scope.isPrivateName(name2)) {
+      definedNames[name2] = element;
     }
   }
   /**
@@ -5123,14 +6643,14 @@
     try {
       Map<String, Element> definedNames = new Map<String, Element>();
       for (ExportElement element in library.exports) {
-        LibraryElement exportedLibrary3 = element.exportedLibrary;
-        if (exportedLibrary3 != null && !visitedElements.contains(exportedLibrary3)) {
-          Map<String, Element> exportedNames = createExportMapping(exportedLibrary3, visitedElements);
+        LibraryElement exportedLibrary2 = element.exportedLibrary;
+        if (exportedLibrary2 != null && !visitedElements.contains(exportedLibrary2)) {
+          Map<String, Element> exportedNames = createExportMapping(exportedLibrary2, visitedElements);
           exportedNames = apply(exportedNames, element.combinators);
           addAll(definedNames, exportedNames);
         }
       }
-      addAll2(definedNames, ((library.context as AnalysisContextImpl)).getPublicNamespace(library));
+      addAll2(definedNames, ((library.context as InternalAnalysisContext)).getPublicNamespace(library));
       return definedNames;
     } finally {
       visitedElements.remove(library);
@@ -5208,10 +6728,12 @@
    */
   void define(Element element) {
     String name = getName(element);
-    if (_definedNames.containsKey(name)) {
-      errorListener.onError(getErrorForDuplicate(_definedNames[name], element));
-    } else {
-      _definedNames[name] = element;
+    if (name != null && !name.isEmpty) {
+      if (_definedNames.containsKey(name)) {
+        errorListener.onError(getErrorForDuplicate(_definedNames[name], element));
+      } else {
+        _definedNames[name] = element;
+      }
     }
   }
   /**
@@ -5242,7 +6764,13 @@
    * @param duplicate another element declared with the conflicting name
    * @return the error code used to report duplicate names within a scope
    */
-  AnalysisError getErrorForDuplicate(Element existing, Element duplicate) => new AnalysisError.con2(source, duplicate.nameOffset, duplicate.name.length, CompileTimeErrorCode.DUPLICATE_DEFINITION, [existing.name]);
+  AnalysisError getErrorForDuplicate(Element existing, Element duplicate) {
+    Source source2 = duplicate.source;
+    if (source2 == null) {
+      source2 = source;
+    }
+    return new AnalysisError.con2(source2, duplicate.nameOffset, duplicate.name.length, CompileTimeErrorCode.DUPLICATE_DEFINITION, [existing.name]);
+  }
   /**
    * Return the listener that is to be informed when an error is encountered.
    * @return the listener that is to be informed when an error is encountered
@@ -5330,14 +6858,14 @@
     bool isConst = node.modifier != null;
     Set<String> keys = new Set<String>();
     for (MapLiteralEntry entry in node.entries) {
-      StringLiteral key4 = entry.key;
-      EvaluationResultImpl result = validate(key4, CompileTimeErrorCode.NON_CONSTANT_MAP_KEY);
+      StringLiteral key2 = entry.key;
+      EvaluationResultImpl result = validate(key2, CompileTimeErrorCode.NON_CONSTANT_MAP_KEY);
       if (result is ValidResult && ((result as ValidResult)).value is String) {
-        String value10 = ((result as ValidResult)).value as String;
-        if (keys.contains(value10)) {
-          _errorReporter.reportError(StaticWarningCode.EQUAL_KEYS_IN_MAP, key4, []);
+        String value2 = ((result as ValidResult)).value as String;
+        if (keys.contains(value2)) {
+          _errorReporter.reportError(StaticWarningCode.EQUAL_KEYS_IN_MAP, key2, []);
         } else {
-          javaSetAdd(keys, value10);
+          javaSetAdd(keys, value2);
         }
       }
       if (isConst) {
@@ -5358,32 +6886,42 @@
   }
   Object visitVariableDeclaration(VariableDeclaration node) {
     super.visitVariableDeclaration(node);
-    Expression initializer4 = node.initializer;
-    if (initializer4 != null && node.isConst()) {
-      EvaluationResultImpl result = validate(initializer4, CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE);
-      VariableElementImpl element49 = node.element as VariableElementImpl;
-      element49.evaluationResult = result;
+    Expression initializer2 = node.initializer;
+    if (initializer2 != null && node.isConst()) {
+      VariableElementImpl element2 = node.element as VariableElementImpl;
+      EvaluationResultImpl result = element2.evaluationResult;
+      if (result == null) {
+        result = validate(initializer2, CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE);
+        element2.evaluationResult = result;
+      } else if (result is ErrorResult) {
+        reportErrors(result, CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE);
+      }
     }
     return null;
   }
   /**
+   * If the given result represents one or more errors, report those errors. Except for special
+   * cases, use the given error code rather than the one reported in the error.
+   * @param result the result containing any errors that need to be reported
+   * @param errorCode the error code to be used if the result represents an error
+   */
+  void reportErrors(EvaluationResultImpl result, ErrorCode errorCode) {
+    if (result is ErrorResult) {
+      for (ErrorResult_ErrorData data in ((result as ErrorResult)).errorData) {
+        _errorReporter.reportError(errorCode, data.node, []);
+      }
+    }
+  }
+  /**
    * Validate that the given expression is a compile time constant. Return the value of the compile
    * time constant, or {@code null} if the expression is not a compile time constant.
    * @param expression the expression to be validated
    * @param errorCode the error code to be used if the expression is not a compile time constant
    * @return the value of the compile time constant
    */
-  EvaluationResultImpl validate(Expression expression, ErrorCode errorCode4) {
+  EvaluationResultImpl validate(Expression expression, ErrorCode errorCode) {
     EvaluationResultImpl result = expression.accept(new ConstantVisitor());
-    if (result is ErrorResult) {
-      for (ErrorResult_ErrorData data in ((result as ErrorResult)).errorData) {
-        if (identical(data.errorCode, CompileTimeErrorCode.COMPILE_TIME_CONSTANT_RAISES_EXCEPTION_DIVIDE_BY_ZERO)) {
-          _errorReporter.reportError(data.errorCode, data.node, []);
-        } else {
-          _errorReporter.reportError(errorCode4, data.node, []);
-        }
-      }
-    }
+    reportErrors(result, errorCode);
     return result;
   }
   /**
@@ -5391,19 +6929,19 @@
    * compile time constant.
    * @param parameters the list of parameters to be validated
    */
-  void validateDefaultValues(FormalParameterList parameters15) {
-    if (parameters15 == null) {
+  void validateDefaultValues(FormalParameterList parameters2) {
+    if (parameters2 == null) {
       return;
     }
-    for (FormalParameter parameter in parameters15.parameters) {
+    for (FormalParameter parameter in parameters2.parameters) {
       if (parameter is DefaultFormalParameter) {
         DefaultFormalParameter defaultParameter = parameter as DefaultFormalParameter;
         Expression defaultValue2 = defaultParameter.defaultValue;
         if (defaultValue2 != null) {
           EvaluationResultImpl result = validate(defaultValue2, CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE);
           if (defaultParameter.isConst()) {
-            VariableElementImpl element50 = parameter.element as VariableElementImpl;
-            element50.evaluationResult = result;
+            VariableElementImpl element2 = parameter.element as VariableElementImpl;
+            element2.evaluationResult = result;
           }
         }
       }
@@ -5433,20 +6971,36 @@
    */
   TypeProvider _typeProvider;
   /**
-   * This is set to <code>true</code> iff the visitor is currently visiting children nodes of a{@link ConstructorDeclaration} and the constructor is 'const'.
+   * This is set to {@code true} iff the visitor is currently visiting children nodes of a{@link ConstructorDeclaration} and the constructor is 'const'.
    * @see #visitConstructorDeclaration(ConstructorDeclaration)
    */
   bool _isEnclosingConstructorConst = false;
   /**
-   * This is set to <code>true</code> iff the visitor is currently visiting children nodes of a{@link CatchClause}.
+   * This is set to {@code true} iff the visitor is currently visiting children nodes of a{@link CatchClause}.
    * @see #visitCatchClause(CatchClause)
    */
   bool _isInCatchClause = false;
   /**
-   * The method or function that we are currently visiting, or <code>null</code> if we are not
-   * inside a method or function.
+   * This is set to {@code true} iff the visitor is currently visiting code in the SDK.
    */
-  ExecutableElement _currentFunction;
+  bool _isInSystemLibrary = false;
+  /**
+   * The method or function that we are currently visiting, or {@code null} if we are not inside a
+   * method or function.
+   */
+  ExecutableElement _enclosingFunction;
+  /**
+   * This map is initialized when visiting the contents of a class declaration. If the visitor is
+   * not in an enclosing class declaration, then the map is set to {@code null}.
+   * <p>
+   * When set the map maps the set of {@link FieldElement}s in the class to an{@link INIT_STATE#NOT_INIT} or {@link INIT_STATE#INIT_IN_DECLARATION}. <code>checkFor*</code>
+   * methods, specifically {@link #checkForAllFinalInitializedErrorCodes(ConstructorDeclaration)},
+   * can make a copy of the map to compute error code states. <code>checkFor*</code> methods should
+   * only ever make a copy, or read from this map after it has been set in{@link #visitClassDeclaration(ClassDeclaration)}.
+   * @see #visitClassDeclaration(ClassDeclaration)
+   * @see #checkForAllFinalInitializedErrorCodes(ConstructorDeclaration)
+   */
+  Map<FieldElement, INIT_STATE> _initialFieldElementsMap;
   /**
    * A list of types used by the {@link CompileTimeErrorCode#EXTENDS_DISALLOWED_CLASS} and{@link CompileTimeErrorCode#IMPLEMENTS_DISALLOWED_CLASS} error codes.
    */
@@ -5454,6 +7008,7 @@
   ErrorVerifier(ErrorReporter errorReporter, LibraryElement currentLibrary, TypeProvider typeProvider) {
     this._errorReporter = errorReporter;
     this._currentLibrary = currentLibrary;
+    this._isInSystemLibrary = currentLibrary.source.isInSystemLibrary();
     this._typeProvider = typeProvider;
     _isEnclosingConstructorConst = false;
     _isInCatchClause = false;
@@ -5482,8 +7037,23 @@
     }
   }
   Object visitClassDeclaration(ClassDeclaration node) {
-    checkForBuiltInIdentifierAsName(node.name, CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME);
-    return super.visitClassDeclaration(node);
+    try {
+      checkForBuiltInIdentifierAsName(node.name, CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME);
+      ClassElement classElement = node.element;
+      if (classElement != null) {
+        List<FieldElement> fieldElements = classElement.fields;
+        _initialFieldElementsMap = new Map<FieldElement, INIT_STATE>();
+        for (FieldElement fieldElement in fieldElements) {
+          if (!fieldElement.isSynthetic()) {
+            _initialFieldElementsMap[fieldElement] = fieldElement.initializer == null ? INIT_STATE.NOT_INIT : INIT_STATE.INIT_IN_DECLARATION;
+          }
+        }
+      }
+      checkForFinalNotInitialized(node);
+      return super.visitClassDeclaration(node);
+    } finally {
+      _initialFieldElementsMap = null;
+    }
   }
   Object visitClassTypeAlias(ClassTypeAlias node) {
     checkForBuiltInIdentifierAsName(node.name, CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME);
@@ -5494,23 +7064,19 @@
     return super.visitConditionalExpression(node);
   }
   Object visitConstructorDeclaration(ConstructorDeclaration node) {
-    ExecutableElement previousFunction = _currentFunction;
+    ExecutableElement outerFunction = _enclosingFunction;
     try {
-      _currentFunction = node.element;
+      _enclosingFunction = node.element;
       _isEnclosingConstructorConst = node.constKeyword != null;
       checkForConstConstructorWithNonFinalField(node);
       checkForConflictingConstructorNameAndMember(node);
+      checkForAllFinalInitializedErrorCodes(node);
       return super.visitConstructorDeclaration(node);
     } finally {
       _isEnclosingConstructorConst = false;
-      _currentFunction = previousFunction;
+      _enclosingFunction = outerFunction;
     }
   }
-  Object visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
-    checkForFieldInitializedInInitializerAndDeclaration(node);
-    checkForFieldInitializedInParameterAndInitializer(node);
-    return super.visitConstructorFieldInitializer(node);
-  }
   Object visitDoStatement(DoStatement node) {
     checkForNonBoolCondition(node.condition);
     return super.visitDoStatement(node);
@@ -5525,21 +7091,21 @@
     return super.visitFieldFormalParameter(node);
   }
   Object visitFunctionDeclaration(FunctionDeclaration node) {
-    ExecutableElement previousFunction = _currentFunction;
+    ExecutableElement outerFunction = _enclosingFunction;
     try {
-      _currentFunction = node.element;
+      _enclosingFunction = node.element;
       return super.visitFunctionDeclaration(node);
     } finally {
-      _currentFunction = previousFunction;
+      _enclosingFunction = outerFunction;
     }
   }
   Object visitFunctionExpression(FunctionExpression node) {
-    ExecutableElement previousFunction = _currentFunction;
+    ExecutableElement outerFunction = _enclosingFunction;
     try {
-      _currentFunction = node.element;
+      _enclosingFunction = node.element;
       return super.visitFunctionExpression(node);
     } finally {
-      _currentFunction = previousFunction;
+      _enclosingFunction = outerFunction;
     }
   }
   Object visitFunctionTypeAlias(FunctionTypeAlias node) {
@@ -5556,26 +7122,34 @@
     return super.visitImplementsClause(node);
   }
   Object visitInstanceCreationExpression(InstanceCreationExpression node) {
-    ConstructorName constructorName4 = node.constructorName;
-    TypeName typeName = constructorName4.type;
-    Type2 type20 = typeName.type;
-    if (type20 is InterfaceType) {
-      InterfaceType interfaceType = type20 as InterfaceType;
+    ConstructorName constructorName2 = node.constructorName;
+    TypeName typeName = constructorName2.type;
+    Type2 type2 = typeName.type;
+    if (type2 is InterfaceType) {
+      InterfaceType interfaceType = type2 as InterfaceType;
       checkForConstWithNonConst(node);
       checkForConstOrNewWithAbstractClass(node, typeName, interfaceType);
-      checkForTypeArgumentNotMatchingBounds(node, constructorName4.element, typeName);
+      checkForTypeArgumentNotMatchingBounds(node, constructorName2.element, typeName);
     }
     return super.visitInstanceCreationExpression(node);
   }
+  Object visitMapLiteral(MapLiteral node) {
+    checkForInvalidTypeArgumentForKey(node);
+    return super.visitMapLiteral(node);
+  }
   Object visitMethodDeclaration(MethodDeclaration node) {
-    ExecutableElement previousFunction = _currentFunction;
+    ExecutableElement previousFunction = _enclosingFunction;
     try {
-      _currentFunction = node.element;
+      _enclosingFunction = node.element;
       return super.visitMethodDeclaration(node);
     } finally {
-      _currentFunction = previousFunction;
+      _enclosingFunction = previousFunction;
     }
   }
+  Object visitNativeFunctionBody(NativeFunctionBody node) {
+    checkForNativeFunctionBodyInNonSDKCode(node);
+    return super.visitNativeFunctionBody(node);
+  }
   Object visitRethrowExpression(RethrowExpression node) {
     checkForRethrowOutsideCatch(node);
     return super.visitRethrowExpression(node);
@@ -5590,12 +7164,17 @@
   }
   Object visitSwitchStatement(SwitchStatement node) {
     checkForCaseExpressionTypeImplementsEquals(node);
+    checkForInconsistentCaseExpressionTypes(node);
     return super.visitSwitchStatement(node);
   }
   Object visitThrowExpression(ThrowExpression node) {
     checkForConstEvalThrowsException(node);
     return super.visitThrowExpression(node);
   }
+  Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
+    checkForFinalNotInitialized2(node.variables);
+    return super.visitTopLevelVariableDeclaration(node);
+  }
   Object visitTypeParameter(TypeParameter node) {
     checkForBuiltInIdentifierAsName(node.name, CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_VARIABLE_NAME);
     return super.visitTypeParameter(node);
@@ -5604,21 +7183,92 @@
     checkForBuiltInIdentifierAsName2(node);
     return super.visitVariableDeclarationList(node);
   }
+  Object visitVariableDeclarationStatement(VariableDeclarationStatement node) {
+    checkForFinalNotInitialized2(node.variables);
+    return super.visitVariableDeclarationStatement(node);
+  }
   Object visitWhileStatement(WhileStatement node) {
     checkForNonBoolCondition(node.condition);
     return super.visitWhileStatement(node);
   }
   /**
+   * This verifies that the passed constructor declaration does not violate any of the error codes
+   * relating to the initialization of fields in the enclosing class.
+   * @param node the {@link ConstructorDeclaration} to evaluate
+   * @return return {@code true} if and only if an error code is generated on the passed node
+   * @see #initialFieldElementsMap
+   * @see CompileTimeErrorCode#FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR
+   * @see CompileTimeErrorCode#FINAL_INITIALIZED_MULTIPLE_TIMES
+   */
+  bool checkForAllFinalInitializedErrorCodes(ConstructorDeclaration node) {
+    if (node.factoryKeyword != null || node.redirectedConstructor != null || node.externalKeyword != null) {
+      return false;
+    }
+    bool foundError = false;
+    Map<FieldElement, INIT_STATE> fieldElementsMap = new Map<FieldElement, INIT_STATE>.from(_initialFieldElementsMap);
+    NodeList<FormalParameter> formalParameters = node.parameters.parameters;
+    for (FormalParameter formalParameter in formalParameters) {
+      FormalParameter parameter = formalParameter;
+      if (parameter is DefaultFormalParameter) {
+        parameter = ((parameter as DefaultFormalParameter)).parameter;
+      }
+      if (parameter is FieldFormalParameter) {
+        FieldElement fieldElement = ((parameter.element as FieldFormalParameterElementImpl)).field;
+        INIT_STATE state = fieldElementsMap[fieldElement];
+        if (identical(state, INIT_STATE.NOT_INIT)) {
+          fieldElementsMap[fieldElement] = INIT_STATE.INIT_IN_FIELD_FORMAL;
+        } else if (identical(state, INIT_STATE.INIT_IN_DECLARATION)) {
+          if (fieldElement.isFinal() || fieldElement.isConst()) {
+            _errorReporter.reportError(CompileTimeErrorCode.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR, formalParameter.identifier, [fieldElement.name]);
+            foundError = true;
+          }
+        } else if (identical(state, INIT_STATE.INIT_IN_FIELD_FORMAL)) {
+          if (fieldElement.isFinal() || fieldElement.isConst()) {
+            _errorReporter.reportError(CompileTimeErrorCode.FINAL_INITIALIZED_MULTIPLE_TIMES, formalParameter.identifier, [fieldElement.name]);
+            foundError = true;
+          }
+        }
+      }
+    }
+    NodeList<ConstructorInitializer> initializers2 = node.initializers;
+    for (ConstructorInitializer constructorInitializer in initializers2) {
+      if (constructorInitializer is ConstructorFieldInitializer) {
+        ConstructorFieldInitializer constructorFieldInitializer = constructorInitializer as ConstructorFieldInitializer;
+        SimpleIdentifier fieldName2 = constructorFieldInitializer.fieldName;
+        Element element2 = fieldName2.element;
+        if (element2 is FieldElement) {
+          FieldElement fieldElement = element2 as FieldElement;
+          INIT_STATE state = fieldElementsMap[fieldElement];
+          if (identical(state, INIT_STATE.NOT_INIT)) {
+            fieldElementsMap[fieldElement] = INIT_STATE.INIT_IN_INITIALIZERS;
+          } else if (identical(state, INIT_STATE.INIT_IN_DECLARATION)) {
+            if (fieldElement.isFinal() || fieldElement.isConst()) {
+              _errorReporter.reportError(CompileTimeErrorCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION, fieldName2, []);
+              foundError = true;
+            }
+          } else if (identical(state, INIT_STATE.INIT_IN_FIELD_FORMAL)) {
+            _errorReporter.reportError(CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER, fieldName2, []);
+            foundError = true;
+          } else if (identical(state, INIT_STATE.INIT_IN_INITIALIZERS)) {
+            _errorReporter.reportError(CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS, fieldName2, [fieldElement.name]);
+            foundError = true;
+          }
+        }
+      }
+    }
+    return foundError;
+  }
+  /**
    * This verifies that the passed argument definition test identifier is a parameter.
    * @param node the {@link ArgumentDefinitionTest} to evaluate
-   * @return return <code>true</code> if and only if an error code is generated on the passed node
+   * @return return {@code true} if and only if an error code is generated on the passed node
    * @see CompileTimeErrorCode#ARGUMENT_DEFINITION_TEST_NON_PARAMETER
    */
   bool checkForArgumentDefinitionTestNonParameter(ArgumentDefinitionTest node) {
-    SimpleIdentifier identifier14 = node.identifier;
-    Element element51 = identifier14.element;
-    if (element51 != null && element51 is! ParameterElement) {
-      _errorReporter.reportError(CompileTimeErrorCode.ARGUMENT_DEFINITION_TEST_NON_PARAMETER, identifier14, [identifier14.name]);
+    SimpleIdentifier identifier2 = node.identifier;
+    Element element2 = identifier2.element;
+    if (element2 != null && element2 is! ParameterElement) {
+      _errorReporter.reportError(CompileTimeErrorCode.ARGUMENT_DEFINITION_TEST_NON_PARAMETER, identifier2, [identifier2.name]);
       return true;
     }
     return false;
@@ -5629,14 +7279,14 @@
    * @param identifier the identifier to check to ensure that it is not a keyword
    * @param errorCode if the passed identifier is a keyword then this error code is created on the
    * identifier, the error code will be one of{@link CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPE_NAME},{@link CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPE_VARIABLE_NAME} or{@link CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME}
-   * @return return <code>true</code> if and only if an error code is generated on the passed node
+   * @return return {@code true} if and only if an error code is generated on the passed node
    * @see CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPE_NAME
    * @see CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPE_VARIABLE_NAME
    * @see CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME
    */
   bool checkForBuiltInIdentifierAsName(SimpleIdentifier identifier, ErrorCode errorCode) {
-    sc.Token token13 = identifier.token;
-    if (identical(token13.type, sc.TokenType.KEYWORD)) {
+    sc.Token token2 = identifier.token;
+    if (identical(token2.type, sc.TokenType.KEYWORD)) {
       _errorReporter.reportError(errorCode, identifier, [identifier.name]);
       return true;
     }
@@ -5645,7 +7295,7 @@
   /**
    * This verifies that the passed variable declaration list does not have a built-in identifier.
    * @param node the variable declaration list to check
-   * @return return <code>true</code> if and only if an error code is generated on the passed node
+   * @return return {@code true} if and only if an error code is generated on the passed node
    * @see CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPE
    */
   bool checkForBuiltInIdentifierAsName2(VariableDeclarationList node) {
@@ -5654,9 +7304,9 @@
       Identifier identifier = typeName.name;
       if (identifier is SimpleIdentifier) {
         SimpleIdentifier simpleIdentifier = identifier as SimpleIdentifier;
-        sc.Token token14 = simpleIdentifier.token;
-        if (identical(token14.type, sc.TokenType.KEYWORD)) {
-          if (((token14 as sc.KeywordToken)).keyword != sc.Keyword.DYNAMIC) {
+        sc.Token token2 = simpleIdentifier.token;
+        if (identical(token2.type, sc.TokenType.KEYWORD)) {
+          if (((token2 as sc.KeywordToken)).keyword != sc.Keyword.DYNAMIC) {
             _errorReporter.reportError(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE, identifier, [identifier.name]);
             return true;
           }
@@ -5669,19 +7319,19 @@
    * This verifies that the passed switch statement does not have a case expression with the
    * operator '==' overridden.
    * @param node the switch statement to evaluate
-   * @return return <code>true</code> if and only if an error code is generated on the passed node
+   * @return return {@code true} if and only if an error code is generated on the passed node
    * @see CompileTimeErrorCode#CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS
    */
   bool checkForCaseExpressionTypeImplementsEquals(SwitchStatement node) {
-    Expression expression16 = node.expression;
-    Type2 type = expression16.staticType;
+    Expression expression2 = node.expression;
+    Type2 type = expression2.staticType;
     if (type != null && type != _typeProvider.intType && type != _typeProvider.stringType) {
-      Element element52 = type.element;
-      if (element52 is ClassElement) {
-        ClassElement classElement = element52 as ClassElement;
+      Element element2 = type.element;
+      if (element2 is ClassElement) {
+        ClassElement classElement = element2 as ClassElement;
         MethodElement method = classElement.lookUpMethod("==", _currentLibrary);
         if (method != null && method.enclosingElement.type != _typeProvider.objectType) {
-          _errorReporter.reportError(CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, expression16, [element52.name]);
+          _errorReporter.reportError(CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, expression2, [element2.name]);
           return true;
         }
       }
@@ -5692,19 +7342,19 @@
     ConstructorElement constructorElement = node.element;
     SimpleIdentifier constructorName = node.name;
     if (constructorName != null && constructorElement != null && !constructorName.isSynthetic()) {
-      String name21 = constructorName.name;
+      String name2 = constructorName.name;
       ClassElement classElement = constructorElement.enclosingElement;
-      List<FieldElement> fields3 = classElement.fields;
-      for (FieldElement field in fields3) {
-        if (field.name == name21) {
-          _errorReporter.reportError(CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD, node, [name21]);
+      List<FieldElement> fields2 = classElement.fields;
+      for (FieldElement field in fields2) {
+        if (field.name == name2) {
+          _errorReporter.reportError(CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD, node, [name2]);
           return true;
         }
       }
-      List<MethodElement> methods3 = classElement.methods;
-      for (MethodElement method in methods3) {
-        if (method.name == name21) {
-          _errorReporter.reportError(CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD, node, [name21]);
+      List<MethodElement> methods2 = classElement.methods;
+      for (MethodElement method in methods2) {
+        if (method.name == name2) {
+          _errorReporter.reportError(CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD, node, [name2]);
           return true;
         }
       }
@@ -5715,7 +7365,7 @@
    * This verifies that the passed constructor declaration is not 'const' if it has a non-final
    * instance variable.
    * @param node the instance creation expression to evaluate
-   * @return return <code>true</code> if and only if an error code is generated on the passed node
+   * @return return {@code true} if and only if an error code is generated on the passed node
    * @see CompileTimeErrorCode#CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD
    */
   bool checkForConstConstructorWithNonFinalField(ConstructorDeclaration node) {
@@ -5727,7 +7377,7 @@
       ClassElement classElement = constructorElement.enclosingElement;
       List<FieldElement> elements = classElement.fields;
       for (FieldElement field in elements) {
-        if (!field.isFinal() && !field.isConst() && !field.isSynthetic()) {
+        if (!field.isFinal() && !field.isConst() && !field.isStatic() && !field.isSynthetic()) {
           _errorReporter.reportError(CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD, node, []);
           return true;
         }
@@ -5739,7 +7389,7 @@
    * This verifies that the passed throw expression is not enclosed in a 'const' constructor
    * declaration.
    * @param node the throw expression expression to evaluate
-   * @return return <code>true</code> if and only if an error code is generated on the passed node
+   * @return return {@code true} if and only if an error code is generated on the passed node
    * @see CompileTimeErrorCode#CONST_EVAL_THROWS_EXCEPTION
    */
   bool checkForConstEvalThrowsException(ThrowExpression node) {
@@ -5752,7 +7402,7 @@
   /**
    * This verifies that the passed normal formal parameter is not 'const'.
    * @param node the normal formal parameter to evaluate
-   * @return return <code>true</code> if and only if an error code is generated on the passed node
+   * @return return {@code true} if and only if an error code is generated on the passed node
    * @see CompileTimeErrorCode#CONST_FORMAL_PARAMETER
    */
   bool checkForConstFormalParameter(NormalFormalParameter node) {
@@ -5768,14 +7418,14 @@
    * @param node the instance creation expression to evaluate
    * @param typeName the {@link TypeName} of the {@link ConstructorName} from the{@link InstanceCreationExpression}, this is the AST node that the error is attached to
    * @param type the type being constructed with this {@link InstanceCreationExpression}
-   * @return return <code>true</code> if and only if an error code is generated on the passed node
+   * @return return {@code true} if and only if an error code is generated on the passed node
    * @see StaticWarningCode#CONST_WITH_ABSTRACT_CLASS
    * @see StaticWarningCode#NEW_WITH_ABSTRACT_CLASS
    */
   bool checkForConstOrNewWithAbstractClass(InstanceCreationExpression node, TypeName typeName, InterfaceType type) {
     if (type.element.isAbstract()) {
-      ConstructorElement element53 = node.element;
-      if (element53 != null && !element53.isFactory()) {
+      ConstructorElement element2 = node.element;
+      if (element2 != null && !element2.isFactory()) {
         if (identical(((node.keyword as sc.KeywordToken)).keyword, sc.Keyword.CONST)) {
           _errorReporter.reportError(StaticWarningCode.CONST_WITH_ABSTRACT_CLASS, typeName, []);
         } else {
@@ -5790,7 +7440,7 @@
    * This verifies that if the passed instance creation expression is 'const', then it is not being
    * invoked on a constructor that is not 'const'.
    * @param node the instance creation expression to evaluate
-   * @return return <code>true</code> if and only if an error code is generated on the passed node
+   * @return return {@code true} if and only if an error code is generated on the passed node
    * @see CompileTimeErrorCode#CONST_WITH_NON_CONST
    */
   bool checkForConstWithNonConst(InstanceCreationExpression node) {
@@ -5804,14 +7454,14 @@
   /**
    * This verifies that there are no default parameters in the passed function type alias.
    * @param node the function type alias to evaluate
-   * @return return <code>true</code> if and only if an error code is generated on the passed node
+   * @return return {@code true} if and only if an error code is generated on the passed node
    * @see CompileTimeErrorCode#DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS
    */
   bool checkForDefaultValueInFunctionTypeAlias(FunctionTypeAlias node) {
     bool result = false;
     FormalParameterList formalParameterList = node.parameters;
-    NodeList<FormalParameter> parameters13 = formalParameterList.parameters;
-    for (FormalParameter formalParameter in parameters13) {
+    NodeList<FormalParameter> parameters2 = formalParameterList.parameters;
+    for (FormalParameter formalParameter in parameters2) {
       if (formalParameter is DefaultFormalParameter) {
         DefaultFormalParameter defaultFormalParameter = formalParameter as DefaultFormalParameter;
         if (defaultFormalParameter.defaultValue != null) {
@@ -5825,7 +7475,7 @@
   /**
    * This verifies that the passed extends clause does not extend classes such as num or String.
    * @param node the extends clause to test
-   * @return return <code>true</code> if and only if an error code is generated on the passed node
+   * @return return {@code true} if and only if an error code is generated on the passed node
    * @see CompileTimeErrorCode#EXTENDS_DISALLOWED_CLASS
    */
   bool checkForExtendsDisallowedClass(ExtendsClause extendsClause) => checkForExtendsOrImplementsDisallowedClass(extendsClause.superclass, CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS);
@@ -5833,7 +7483,7 @@
    * This verifies that the passed type name does not extend or implement classes such as 'num' or
    * 'String'.
    * @param node the type name to test
-   * @return return <code>true</code> if and only if an error code is generated on the passed node
+   * @return return {@code true} if and only if an error code is generated on the passed node
    * @see #checkForExtendsDisallowedClass(ExtendsClause)
    * @see #checkForImplementsDisallowedClass(ImplementsClause)
    * @see CompileTimeErrorCode#EXTENDS_DISALLOWED_CLASS
@@ -5845,7 +7495,7 @@
     }
     Type2 superType = typeName.type;
     for (InterfaceType disallowedType in _DISALLOWED_TYPES_TO_EXTEND_OR_IMPLEMENT) {
-      if (superType == disallowedType) {
+      if (superType != null && superType == disallowedType) {
         if (superType == _typeProvider.numType) {
           ASTNode grandParent = typeName.parent.parent;
           if (grandParent is ClassDeclaration) {
@@ -5863,61 +7513,15 @@
     return false;
   }
   /**
-   * This verifies that the passed constructor field initializer is not also a final variable that
-   * already included an initialization.
-   * @param node the constructor field initializer to test
-   * @return return <code>true</code> if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION
-   */
-  bool checkForFieldInitializedInInitializerAndDeclaration(ConstructorFieldInitializer node) {
-    SimpleIdentifier identifier = node.fieldName;
-    Element element54 = identifier.element;
-    if (element54 is PropertyAccessorElement) {
-      PropertyAccessorElement propertyAccessorElement = element54 as PropertyAccessorElement;
-      PropertyInducingElement propertyInducingElement = propertyAccessorElement.variable;
-      if (propertyInducingElement.initializer != null && (propertyInducingElement.isFinal() || propertyInducingElement.isConst())) {
-        _errorReporter.reportError(CompileTimeErrorCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION, node, []);
-        return true;
-      }
-    }
-    return false;
-  }
-  /**
-   * This verifies that the passed constructor field initializer is not also a field formal
-   * parameter in the constructor declaration.
-   * @param node the constructor field initializer to test
-   * @return return <code>true</code> if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER
-   */
-  bool checkForFieldInitializedInParameterAndInitializer(ConstructorFieldInitializer node) {
-    SimpleIdentifier identifier = node.fieldName;
-    Element element55 = identifier.element;
-    ASTNode parent18 = node.parent;
-    if (element55 != null && parent18 is ConstructorDeclaration) {
-      ConstructorDeclaration constructorDeclaration = parent18 as ConstructorDeclaration;
-      NodeList<FormalParameter> formalParameters = constructorDeclaration.parameters.parameters;
-      for (FormalParameter formalParameter in formalParameters) {
-        if (formalParameter is FieldFormalParameter) {
-          FieldFormalParameter fieldFormalParameter = formalParameter as FieldFormalParameter;
-          if (fieldFormalParameter.identifier.name == element55.name) {
-            _errorReporter.reportError(CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER, node, []);
-            return true;
-          }
-        }
-      }
-    }
-    return false;
-  }
-  /**
    * This verifies that the passed field formal parameter is in a constructor declaration.
    * @param node the field formal parameter to test
-   * @return return <code>true</code> if and only if an error code is generated on the passed node
+   * @return return {@code true} if and only if an error code is generated on the passed node
    * @see CompileTimeErrorCode#FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR
    */
   bool checkForFieldInitializerOutsideConstructor(FieldFormalParameter node) {
-    ASTNode parent19 = node.parent;
-    if (parent19 != null) {
-      ASTNode grandparent = parent19.parent;
+    ASTNode parent2 = node.parent;
+    if (parent2 != null) {
+      ASTNode grandparent = parent2.parent;
       if (grandparent != null && grandparent is! ConstructorDeclaration && grandparent.parent is! ConstructorDeclaration) {
         _errorReporter.reportError(CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, node, []);
         return true;
@@ -5926,33 +7530,140 @@
     return false;
   }
   /**
+   * This verifies that final fields that are declared, without any constructors in the enclosing
+   * class, are initialized. Cases in which there is at least one constructor are handled at the end
+   * of {@link #checkForAllFinalInitializedErrorCodes(ConstructorDeclaration)}.
+   * @param node the class declaration to test
+   * @return {@code true} if and only if an error code is generated on the passed node
+   * @see CompileTimeErrorCode#FINAL_NOT_INITIALIZED
+   */
+  bool checkForFinalNotInitialized(ClassDeclaration node) {
+    NodeList<ClassMember> classMembers = node.members;
+    for (ClassMember classMember in classMembers) {
+      if (classMember is ConstructorDeclaration) {
+        return false;
+      }
+    }
+    bool foundError = false;
+    for (ClassMember classMember in classMembers) {
+      if (classMember is FieldDeclaration) {
+        FieldDeclaration field = classMember as FieldDeclaration;
+        foundError = javaBooleanOr(foundError, checkForFinalNotInitialized2(field.fields));
+      }
+    }
+    return foundError;
+  }
+  /**
+   * This verifies that the passed variable declaration list has only initialized variables if the
+   * list is final or const. This method is called by{@link #checkForFinalNotInitialized(ClassDeclaration)},{@link #visitTopLevelVariableDeclaration(TopLevelVariableDeclaration)} and{@link #visitVariableDeclarationStatement(VariableDeclarationStatement)}.
+   * @param node the class declaration to test
+   * @return {@code true} if and only if an error code is generated on the passed node
+   * @see CompileTimeErrorCode#FINAL_NOT_INITIALIZED
+   */
+  bool checkForFinalNotInitialized2(VariableDeclarationList node) {
+    bool foundError = false;
+    if (!node.isSynthetic() && (node.isConst() || node.isFinal())) {
+      NodeList<VariableDeclaration> variables2 = node.variables;
+      for (VariableDeclaration variable in variables2) {
+        if (variable.initializer == null) {
+          _errorReporter.reportError(CompileTimeErrorCode.FINAL_NOT_INITIALIZED, variable, [variable.name.name]);
+          foundError = true;
+        }
+      }
+    }
+    return foundError;
+  }
+  /**
    * This verifies that the passed implements clause does not implement classes such as 'num' or
    * 'String'.
    * @param node the implements clause to test
-   * @return return <code>true</code> if and only if an error code is generated on the passed node
+   * @return return {@code true} if and only if an error code is generated on the passed node
    * @see CompileTimeErrorCode#IMPLEMENTS_DISALLOWED_CLASS
    */
   bool checkForImplementsDisallowedClass(ImplementsClause implementsClause) {
-    bool result = false;
+    bool foundError = false;
     for (TypeName type in implementsClause.interfaces) {
-      result = javaBooleanOr(result, checkForExtendsOrImplementsDisallowedClass(type, CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS));
-      ;
+      foundError = javaBooleanOr(foundError, checkForExtendsOrImplementsDisallowedClass(type, CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS));
     }
-    return result;
+    return foundError;
+  }
+  /**
+   * This verifies that the passed switch statement case expressions all have the same type.
+   * @param node the switch statement to evaluate
+   * @return return {@code true} if and only if an error code is generated on the passed node
+   * @see CompileTimeErrorCode#INCONSISTENT_CASE_EXPRESSION_TYPES
+   */
+  bool checkForInconsistentCaseExpressionTypes(SwitchStatement node) {
+    NodeList<SwitchMember> switchMembers = node.members;
+    bool foundError = false;
+    Type2 firstType = null;
+    for (SwitchMember switchMember in switchMembers) {
+      if (switchMember is SwitchCase) {
+        SwitchCase switchCase = switchMember as SwitchCase;
+        Expression expression2 = switchCase.expression;
+        if (firstType == null) {
+          firstType = expression2.staticType;
+        } else {
+          Type2 nType = expression2.staticType;
+          if (firstType != nType) {
+            _errorReporter.reportError(CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES, expression2, [expression2.toSource(), firstType.name]);
+            foundError = true;
+          }
+        }
+      }
+    }
+    return foundError;
   }
   /**
    * This verifies that the passed assignment expression represents a valid assignment.
    * @param node the assignment expression to evaluate
-   * @return return <code>true</code> if and only if an error code is generated on the passed node
+   * @return return {@code true} if and only if an error code is generated on the passed node
    * @see StaticTypeWarningCode#INVALID_ASSIGNMENT
    */
   bool checkForInvalidAssignment(AssignmentExpression node) {
     Expression lhs = node.leftHandSide;
     Expression rhs = node.rightHandSide;
-    Type2 leftType = getType(lhs);
+    VariableElement leftElement = getVariableElement(lhs);
+    Type2 leftType = (leftElement == null) ? getType(lhs) : leftElement.type;
     Type2 rightType = getType(rhs);
     if (!rightType.isAssignableTo(leftType)) {
-      _errorReporter.reportError(StaticTypeWarningCode.INVALID_ASSIGNMENT, rhs, [leftType.name, rightType.name]);
+      _errorReporter.reportError(StaticTypeWarningCode.INVALID_ASSIGNMENT, rhs, [rightType.name, leftType.name]);
+      return true;
+    }
+    return false;
+  }
+  /**
+   * Checks to ensure that native function bodies can only in SDK code.
+   * @param node the map literal to test
+   * @return return {@code true} if and only if an error code is generated on the passed node
+   * @see CompileTimeErrorCode#INVALID_TYPE_ARGUMENT_FOR_KEY
+   */
+  bool checkForInvalidTypeArgumentForKey(MapLiteral node) {
+    TypeArgumentList typeArgumentList = node.typeArguments;
+    if (typeArgumentList == null) {
+      return false;
+    }
+    NodeList<TypeName> arguments2 = typeArgumentList.arguments;
+    if (arguments2.length == 0) {
+      return false;
+    }
+    TypeName firstArgument = arguments2[0];
+    Type2 firstArgumentType = firstArgument.type;
+    if (firstArgumentType != null && firstArgumentType != _typeProvider.stringType) {
+      _errorReporter.reportError(CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_FOR_KEY, firstArgument, []);
+      return true;
+    }
+    return false;
+  }
+  /**
+   * Checks to ensure that native function bodies can only in SDK code.
+   * @param node the native function body to test
+   * @return return {@code true} if and only if an error code is generated on the passed node
+   * @see ParserErrorCode#NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE
+   */
+  bool checkForNativeFunctionBodyInNonSDKCode(NativeFunctionBody node) {
+    if (!_isInSystemLibrary) {
+      _errorReporter.reportError(ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE, node, []);
       return true;
     }
     return false;
@@ -5961,7 +7672,7 @@
    * Checks to ensure that the expressions that need to be of type bool, are. Otherwise an error is
    * reported on the expression.
    * @param condition the conditional expression to test
-   * @return return <code>true</code> if and only if an error code is generated on the passed node
+   * @return return {@code true} if and only if an error code is generated on the passed node
    * @see StaticTypeWarningCode#NON_BOOL_CONDITION
    */
   bool checkForNonBoolCondition(Expression condition) {
@@ -5975,7 +7686,7 @@
   /**
    * This verifies that the passed assert statement has either a 'bool' or '() -> bool' input.
    * @param node the assert statement to evaluate
-   * @return return <code>true</code> if and only if an error code is generated on the passed node
+   * @return return {@code true} if and only if an error code is generated on the passed node
    * @see StaticTypeWarningCode#NON_BOOL_EXPRESSION
    */
   bool checkForNonBoolExpression(AssertStatement node) {
@@ -5998,7 +7709,7 @@
   /**
    * This checks that the rethrow is inside of a catch clause.
    * @param node the rethrow expression to evaluate
-   * @return <code>true</code> if and only if an error code is generated on the passed node
+   * @return {@code true} if and only if an error code is generated on the passed node
    * @see CompileTimeErrorCode#RETHROW_OUTSIDE_CATCH
    */
   bool checkForRethrowOutsideCatch(RethrowExpression node) {
@@ -6012,17 +7723,17 @@
    * This checks that the return type matches the type of the declared return type in the enclosing
    * method or function.
    * @param node the return statement to evaluate
-   * @return return <code>true</code> if and only if an error code is generated on the passed node
+   * @return return {@code true} if and only if an error code is generated on the passed node
    * @see StaticTypeWarningCode#RETURN_OF_INVALID_TYPE
    */
   bool checkForReturnOfInvalidType(ReturnStatement node) {
-    FunctionType functionType = _currentFunction == null ? null : _currentFunction.type;
+    FunctionType functionType = _enclosingFunction == null ? null : _enclosingFunction.type;
     Type2 expectedReturnType = functionType == null ? null : functionType.returnType;
     Expression returnExpression = node.expression;
     if (expectedReturnType != null && !expectedReturnType.isVoid() && returnExpression != null) {
       Type2 actualReturnType = getType(returnExpression);
       if (!actualReturnType.isAssignableTo(expectedReturnType)) {
-        _errorReporter.reportError(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE, returnExpression, [actualReturnType.name, expectedReturnType.name]);
+        _errorReporter.reportError(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE, returnExpression, [actualReturnType.name, expectedReturnType.name, _enclosingFunction.name]);
         return true;
       }
     }
@@ -6035,7 +7746,7 @@
    * @param node the instance creation expression to evaluate
    * @param typeName the {@link TypeName} of the {@link ConstructorName} from the{@link InstanceCreationExpression}, this is the AST node that the error is attached to
    * @param constructorElement the {@link ConstructorElement} from the instance creation expression
-   * @return return <code>true</code> if and only if an error code is generated on the passed node
+   * @return return {@code true} if and only if an error code is generated on the passed node
    * @see StaticTypeWarningCode#TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
    */
   bool checkForTypeArgumentNotMatchingBounds(InstanceCreationExpression node, ConstructorElement constructorElement, TypeName typeName) {
@@ -6066,6 +7777,41 @@
     Type2 type = expression.staticType;
     return type == null ? _dynamicType : type;
   }
+  /**
+   * Return the variable element represented by the given expression, or {@code null} if there is no
+   * such element.
+   * @param expression the expression whose element is to be returned
+   * @return the variable element represented by the expression
+   */
+  VariableElement getVariableElement(Expression expression) {
+    if (expression is Identifier) {
+      Element element2 = ((expression as Identifier)).element;
+      if (element2 is VariableElement) {
+        return element2 as VariableElement;
+      }
+    }
+    return null;
+  }
+}
+/**
+ * This enum holds one of four states of a field initialization state through a constructor
+ * signature, not initialized, initialized in the field declaration, initialized in the field
+ * formal, and finally, initialized in the initializers list.
+ */
+class INIT_STATE implements Comparable<INIT_STATE> {
+  static final INIT_STATE NOT_INIT = new INIT_STATE('NOT_INIT', 0);
+  static final INIT_STATE INIT_IN_DECLARATION = new INIT_STATE('INIT_IN_DECLARATION', 1);
+  static final INIT_STATE INIT_IN_FIELD_FORMAL = new INIT_STATE('INIT_IN_FIELD_FORMAL', 2);
+  static final INIT_STATE INIT_IN_DEFAULT_VALUE = new INIT_STATE('INIT_IN_DEFAULT_VALUE', 3);
+  static final INIT_STATE INIT_IN_INITIALIZERS = new INIT_STATE('INIT_IN_INITIALIZERS', 4);
+  static final List<INIT_STATE> values = [NOT_INIT, INIT_IN_DECLARATION, INIT_IN_FIELD_FORMAL, INIT_IN_DEFAULT_VALUE, INIT_IN_INITIALIZERS];
+  final String __name;
+  final int __ordinal;
+  int get ordinal => __ordinal;
+  INIT_STATE(this.__name, this.__ordinal) {
+  }
+  int compareTo(INIT_STATE other) => __ordinal - other.__ordinal;
+  String toString() => __name;
 }
 /**
  * The enumeration {@code ResolverErrorCode} defines the error codes used for errors detected by the
@@ -6074,13 +7820,11 @@
  * when appropriate, how the problem can be corrected.
  * @coverage dart.engine.resolver
  */
-class ResolverErrorCode implements ErrorCode {
+class ResolverErrorCode implements Comparable<ResolverErrorCode>, ErrorCode {
   static final ResolverErrorCode BREAK_LABEL_ON_SWITCH_MEMBER = new ResolverErrorCode('BREAK_LABEL_ON_SWITCH_MEMBER', 0, ErrorType.COMPILE_TIME_ERROR, "Break label resolves to case or default statement");
-  static final ResolverErrorCode CANNOT_BE_RESOLVED = new ResolverErrorCode('CANNOT_BE_RESOLVED', 1, ErrorType.STATIC_WARNING, "Cannot resolve the name '%s'");
-  static final ResolverErrorCode CONTINUE_LABEL_ON_SWITCH = new ResolverErrorCode('CONTINUE_LABEL_ON_SWITCH', 2, ErrorType.COMPILE_TIME_ERROR, "A continue label resolves to switch, must be loop or switch member");
-  static final ResolverErrorCode MISSING_LIBRARY_DIRECTIVE_WITH_PART = new ResolverErrorCode('MISSING_LIBRARY_DIRECTIVE_WITH_PART', 3, ErrorType.COMPILE_TIME_ERROR, "Libraries that have parts must have a library directive");
-  static final ResolverErrorCode MISSING_PART_OF_DIRECTIVE = new ResolverErrorCode('MISSING_PART_OF_DIRECTIVE', 4, ErrorType.COMPILE_TIME_ERROR, "The included part must have a part-of directive");
-  static final List<ResolverErrorCode> values = [BREAK_LABEL_ON_SWITCH_MEMBER, CANNOT_BE_RESOLVED, CONTINUE_LABEL_ON_SWITCH, MISSING_LIBRARY_DIRECTIVE_WITH_PART, MISSING_PART_OF_DIRECTIVE];
+  static final ResolverErrorCode CONTINUE_LABEL_ON_SWITCH = new ResolverErrorCode('CONTINUE_LABEL_ON_SWITCH', 1, ErrorType.COMPILE_TIME_ERROR, "A continue label resolves to switch, must be loop or switch member");
+  static final ResolverErrorCode MISSING_LIBRARY_DIRECTIVE_WITH_PART = new ResolverErrorCode('MISSING_LIBRARY_DIRECTIVE_WITH_PART', 2, ErrorType.COMPILE_TIME_ERROR, "Libraries that have parts must have a library directive");
+  static final List<ResolverErrorCode> values = [BREAK_LABEL_ON_SWITCH_MEMBER, CONTINUE_LABEL_ON_SWITCH, MISSING_LIBRARY_DIRECTIVE_WITH_PART];
   final String __name;
   final int __ordinal;
   int get ordinal => __ordinal;
@@ -6105,5 +7849,6 @@
   String get message => _message;
   ErrorType get type => _type;
   bool needsRecompilation() => true;
+  int compareTo(ResolverErrorCode other) => __ordinal - other.__ordinal;
   String toString() => __name;
 }
\ No newline at end of file
diff --git a/pkg/analyzer_experimental/lib/src/generated/scanner.dart b/pkg/analyzer_experimental/lib/src/generated/scanner.dart
index 5ad4162..d98b898 100644
--- a/pkg/analyzer_experimental/lib/src/generated/scanner.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/scanner.dart
@@ -5,6 +5,7 @@
 
 import 'dart:collection';
 import 'java_core.dart';
+import 'java_engine.dart';
 import 'source.dart';
 import 'error.dart';
 import 'instrumentation.dart';
@@ -35,13 +36,13 @@
    * @param length the number of strings in the array that pass through the state being built
    * @return the state that was created
    */
-  static KeywordState computeKeywordStateTable(int start, List<String> strings, int offset, int length12) {
+  static KeywordState computeKeywordStateTable(int start, List<String> strings, int offset, int length2) {
     List<KeywordState> result = new List<KeywordState>(26);
-    assert(length12 != 0);
+    assert(length2 != 0);
     int chunk = 0x0;
     int chunkStart = -1;
     bool isLeaf = false;
-    for (int i = offset; i < offset + length12; i++) {
+    for (int i = offset; i < offset + length2; i++) {
       if (strings[i].length == start) {
         isLeaf = true;
       }
@@ -58,9 +59,9 @@
     }
     if (chunkStart != -1) {
       assert(result[chunk - 0x61] == null);
-      result[chunk - 0x61] = computeKeywordStateTable(start + 1, strings, chunkStart, offset + length12 - chunkStart);
+      result[chunk - 0x61] = computeKeywordStateTable(start + 1, strings, chunkStart, offset + length2 - chunkStart);
     } else {
-      assert(length12 == 1);
+      assert(length2 == 1);
       return new KeywordState(_EMPTY_TABLE, strings[offset]);
     }
     if (isLeaf) {
@@ -120,7 +121,7 @@
  * scanner.
  * @coverage dart.engine.parser
  */
-class ScannerErrorCode implements ErrorCode {
+class ScannerErrorCode implements Comparable<ScannerErrorCode>, ErrorCode {
   static final ScannerErrorCode ILLEGAL_CHARACTER = new ScannerErrorCode('ILLEGAL_CHARACTER', 0, "Illegal character %x");
   static final ScannerErrorCode MISSING_DIGIT = new ScannerErrorCode('MISSING_DIGIT', 1, "Decimal digit expected");
   static final ScannerErrorCode MISSING_HEX_DIGIT = new ScannerErrorCode('MISSING_HEX_DIGIT', 2, "Hexidecimal digit expected");
@@ -146,6 +147,7 @@
   String get message => _message;
   ErrorType get type => ErrorType.SYNTACTIC_ERROR;
   bool needsRecompilation() => true;
+  int compareTo(ScannerErrorCode other) => __ordinal - other.__ordinal;
   String toString() => __name;
 }
 /**
@@ -174,7 +176,7 @@
  * The enumeration {@code Keyword} defines the keywords in the Dart programming language.
  * @coverage dart.engine.parser
  */
-class Keyword {
+class Keyword implements Comparable<Keyword> {
   static final Keyword ASSERT = new Keyword.con1('ASSERT', 0, "assert");
   static final Keyword BREAK = new Keyword.con1('BREAK', 1, "break");
   static final Keyword CASE = new Keyword.con1('CASE', 2, "case");
@@ -257,10 +259,10 @@
    * @param syntax the lexeme for the keyword
    */
   Keyword.con1(String ___name, int ___ordinal, String syntax) {
-    _jtd_constructor_282_impl(___name, ___ordinal, syntax);
+    _jtd_constructor_308_impl(___name, ___ordinal, syntax);
   }
-  _jtd_constructor_282_impl(String ___name, int ___ordinal, String syntax) {
-    _jtd_constructor_283_impl(___name, ___ordinal, syntax, false);
+  _jtd_constructor_308_impl(String ___name, int ___ordinal, String syntax) {
+    _jtd_constructor_309_impl(___name, ___ordinal, syntax, false);
   }
   /**
    * Initialize a newly created keyword to have the given syntax. The keyword is a pseudo-keyword if
@@ -269,9 +271,9 @@
    * @param isPseudoKeyword {@code true} if this keyword is a pseudo-keyword
    */
   Keyword.con2(String ___name, int ___ordinal, String syntax2, bool isPseudoKeyword) {
-    _jtd_constructor_283_impl(___name, ___ordinal, syntax2, isPseudoKeyword);
+    _jtd_constructor_309_impl(___name, ___ordinal, syntax2, isPseudoKeyword);
   }
-  _jtd_constructor_283_impl(String ___name, int ___ordinal, String syntax2, bool isPseudoKeyword) {
+  _jtd_constructor_309_impl(String ___name, int ___ordinal, String syntax2, bool isPseudoKeyword) {
     __name = ___name;
     __ordinal = ___ordinal;
     this._syntax = syntax2;
@@ -288,6 +290,7 @@
    * @return {@code true} if this keyword is a pseudo-keyword
    */
   bool isPseudoKeyword() => _isPseudoKeyword2;
+  int compareTo(Keyword other) => __ordinal - other.__ordinal;
   String toString() => __name;
 }
 /**
@@ -383,12 +386,20 @@
    * @return the first token in the list of tokens that were produced
    */
   Token tokenize() {
-    int next = advance();
-    while (next != -1) {
-      next = bigSwitch(next);
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engine.AbstractScanner.tokenize");
+    int tokenCounter = 0;
+    try {
+      int next = advance();
+      while (next != -1) {
+        tokenCounter++;
+        next = bigSwitch(next);
+      }
+      appendEofToken();
+      instrumentation.metric2("tokensCount", tokenCounter);
+      return firstToken();
+    } finally {
+      instrumentation.log();
     }
-    appendEofToken();
-    return firstToken();
   }
   /**
    * Advance the current position and return the character at the new current position.
@@ -436,12 +447,12 @@
       _lastComment = _lastComment.setNext(new StringToken(type, value, _tokenStart));
     }
   }
-  void appendEndToken(TokenType type33, TokenType beginType) {
+  void appendEndToken(TokenType type2, TokenType beginType) {
     Token token;
     if (_firstComment == null) {
-      token = new Token(type33, _tokenStart);
+      token = new Token(type2, _tokenStart);
     } else {
-      token = new TokenWithComment(type33, _tokenStart, _firstComment);
+      token = new TokenWithComment(type2, _tokenStart, _firstComment);
       _firstComment = null;
       _lastComment = null;
     }
@@ -534,8 +545,8 @@
       return advance();
     }
     if (next == 0x72) {
-      int peek3 = peek();
-      if (peek3 == 0x22 || peek3 == 0x27) {
+      int peek2 = peek();
+      if (peek2 == 0x22 || peek2 == 0x27) {
         int start = offset;
         return tokenizeString(advance(), start, true);
       }
@@ -985,6 +996,15 @@
           next = advance();
           ++nesting;
         }
+      } else if (next == 0xD) {
+        next = advance();
+        if (next == 0xA) {
+          next = advance();
+        }
+        recordStartOfLine();
+      } else if (next == 0xA) {
+        recordStartOfLine();
+        next = advance();
       } else {
         next = advance();
       }
@@ -1219,7 +1239,7 @@
    * @param offset the offset from the beginning of the file to the first character in the token
    */
   StringToken(TokenType type, String value, int offset) : super(type, offset) {
-    this._value2 = value;
+    this._value2 = StringUtilities.intern(value);
   }
   String get lexeme => _value2;
   String value() => _value2;
@@ -1408,8 +1428,8 @@
    * offset.
    * @param offset the offset from the beginning of the file to the first character in the token
    */
-  void set offset(int offset4) {
-    this._offset = offset4;
+  void set offset(int offset2) {
+    this._offset = offset2;
   }
   String toString() => lexeme;
   /**
@@ -1422,8 +1442,8 @@
    * Set the previous token in the token stream to the given token.
    * @param previous the previous token in the token stream
    */
-  void set previous(Token previous3) {
-    this._previous = previous3;
+  void set previous(Token previous2) {
+    this._previous = previous2;
   }
 }
 /**
@@ -1581,7 +1601,7 @@
  * The enumeration {@code TokenClass} represents classes (or groups) of tokens with a similar use.
  * @coverage dart.engine.parser
  */
-class TokenClass {
+class TokenClass implements Comparable<TokenClass> {
   /**
    * A value used to indicate that the token type is not part of any specific class of token.
    */
@@ -1656,15 +1676,15 @@
    */
   int _precedence = 0;
   TokenClass.con1(String ___name, int ___ordinal) {
-    _jtd_constructor_292_impl(___name, ___ordinal);
+    _jtd_constructor_318_impl(___name, ___ordinal);
   }
-  _jtd_constructor_292_impl(String ___name, int ___ordinal) {
-    _jtd_constructor_293_impl(___name, ___ordinal, 0);
+  _jtd_constructor_318_impl(String ___name, int ___ordinal) {
+    _jtd_constructor_319_impl(___name, ___ordinal, 0);
   }
   TokenClass.con2(String ___name, int ___ordinal, int precedence2) {
-    _jtd_constructor_293_impl(___name, ___ordinal, precedence2);
+    _jtd_constructor_319_impl(___name, ___ordinal, precedence2);
   }
-  _jtd_constructor_293_impl(String ___name, int ___ordinal, int precedence2) {
+  _jtd_constructor_319_impl(String ___name, int ___ordinal, int precedence2) {
     __name = ___name;
     __ordinal = ___ordinal;
     this._precedence = precedence2;
@@ -1675,6 +1695,7 @@
    * @return the precedence of tokens of this class
    */
   int get precedence => _precedence;
+  int compareTo(TokenClass other) => __ordinal - other.__ordinal;
   String toString() => __name;
 }
 /**
@@ -1704,7 +1725,7 @@
  * scanner.
  * @coverage dart.engine.parser
  */
-class TokenType {
+class TokenType implements Comparable<TokenType> {
   /**
    * The type of the token that marks the end of the input.
    */
@@ -1790,15 +1811,15 @@
    */
   String _lexeme;
   TokenType.con1(String ___name, int ___ordinal) {
-    _jtd_constructor_294_impl(___name, ___ordinal);
+    _jtd_constructor_320_impl(___name, ___ordinal);
   }
-  _jtd_constructor_294_impl(String ___name, int ___ordinal) {
-    _jtd_constructor_295_impl(___name, ___ordinal, TokenClass.NO_CLASS, null);
+  _jtd_constructor_320_impl(String ___name, int ___ordinal) {
+    _jtd_constructor_321_impl(___name, ___ordinal, TokenClass.NO_CLASS, null);
   }
   TokenType.con2(String ___name, int ___ordinal, TokenClass tokenClass2, String lexeme2) {
-    _jtd_constructor_295_impl(___name, ___ordinal, tokenClass2, lexeme2);
+    _jtd_constructor_321_impl(___name, ___ordinal, tokenClass2, lexeme2);
   }
-  _jtd_constructor_295_impl(String ___name, int ___ordinal, TokenClass tokenClass2, String lexeme2) {
+  _jtd_constructor_321_impl(String ___name, int ___ordinal, TokenClass tokenClass2, String lexeme2) {
     __name = ___name;
     __ordinal = ___ordinal;
     this._tokenClass = tokenClass2 == null ? TokenClass.NO_CLASS : tokenClass2;
@@ -1881,6 +1902,7 @@
    * @return {@code true} if this token type represents an operator that can be defined by users
    */
   bool isUserDefinableOperator() => identical(_lexeme, "==") || identical(_lexeme, "~") || identical(_lexeme, "[]") || identical(_lexeme, "[]=") || identical(_lexeme, "*") || identical(_lexeme, "/") || identical(_lexeme, "%") || identical(_lexeme, "~/") || identical(_lexeme, "+") || identical(_lexeme, "-") || identical(_lexeme, "<<") || identical(_lexeme, ">>") || identical(_lexeme, ">=") || identical(_lexeme, ">") || identical(_lexeme, "<=") || identical(_lexeme, "<") || identical(_lexeme, "&") || identical(_lexeme, "^") || identical(_lexeme, "|");
+  int compareTo(TokenType other) => __ordinal - other.__ordinal;
   String toString() => __name;
 }
 class TokenType_EOF extends TokenType {
diff --git a/pkg/analyzer_experimental/lib/src/generated/sdk.dart b/pkg/analyzer_experimental/lib/src/generated/sdk.dart
index 758a694..9ff8716 100644
--- a/pkg/analyzer_experimental/lib/src/generated/sdk.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/sdk.dart
@@ -3,18 +3,11 @@
 
 library engine.sdk;
 
-import 'dart:io';
 import 'dart:uri';
 import 'java_core.dart';
-import 'java_io.dart';
 import 'java_engine.dart';
-import 'java_engine_io.dart';
-import 'source_io.dart';
-import 'error.dart';
-import 'scanner.dart';
-import 'parser.dart';
-import 'ast.dart';
-import 'package:analyzer_experimental/src/generated/engine.dart' show AnalysisEngine;
+import 'source.dart' show Source, ContentCache;
+import 'engine.dart' show AnalysisContext;
 
 /**
  * Represents a single library in the SDK
@@ -167,133 +160,6 @@
   }
 }
 /**
- * Instances of the class {@code SdkLibrariesReader} read and parse the libraries file
- * (dart-sdk/lib/_internal/libraries.dart) for information about the libraries in an SDK. The
- * library information is represented as a Dart file containing a single top-level variable whose
- * value is a const map. The keys of the map are the names of libraries defined in the SDK and the
- * values in the map are info objects defining the library. For example, a subset of a typical SDK
- * might have a libraries file that looks like the following:
- * <pre>
- * final Map&lt;String, LibraryInfo&gt; LIBRARIES = const &lt;LibraryInfo&gt; {
- * // Used by VM applications
- * "builtin" : const LibraryInfo(
- * "builtin/builtin_runtime.dart",
- * category: "Server",
- * platforms: VM_PLATFORM),
- * "compiler" : const LibraryInfo(
- * "compiler/compiler.dart",
- * category: "Tools",
- * platforms: 0),
- * };
- * </pre>
- * @coverage dart.engine.sdk
- */
-class SdkLibrariesReader {
-  /**
-   * Return the library map read from the given source.
-   * @return the library map read from the given source
-   */
-  LibraryMap readFrom(JavaFile librariesFile, String libraryFileContents) {
-    List<bool> foundError = [false];
-    AnalysisErrorListener errorListener = new AnalysisErrorListener_7(foundError);
-    Source source = new FileBasedSource.con2(null, librariesFile, false);
-    StringScanner scanner = new StringScanner(source, libraryFileContents, errorListener);
-    Parser parser = new Parser(source, errorListener);
-    CompilationUnit unit = parser.parseCompilationUnit(scanner.tokenize());
-    SdkLibrariesReader_LibraryBuilder libraryBuilder = new SdkLibrariesReader_LibraryBuilder();
-    if (!foundError[0]) {
-      unit.accept(libraryBuilder);
-    }
-    return libraryBuilder.librariesMap;
-  }
-}
-class SdkLibrariesReader_LibraryBuilder extends RecursiveASTVisitor<Object> {
-  /**
-   * The prefix added to the name of a library to form the URI used in code to reference the
-   * library.
-   */
-  static String _LIBRARY_PREFIX = "dart:";
-  /**
-   * The name of the optional parameter used to indicate whether the library is an implementation
-   * library.
-   */
-  static String _IMPLEMENTATION = "implementation";
-  /**
-   * The name of the optional parameter used to indicate whether the library is documented.
-   */
-  static String _DOCUMENTED = "documented";
-  /**
-   * The name of the optional parameter used to specify the category of the library.
-   */
-  static String _CATEGORY = "category";
-  /**
-   * The name of the optional parameter used to specify the platforms on which the library can be
-   * used.
-   */
-  static String _PLATFORMS = "platforms";
-  /**
-   * The value of the {@link #PLATFORMS platforms} parameter used to specify that the library can
-   * be used on the VM.
-   */
-  static String _VM_PLATFORM = "VM_PLATFORM";
-  /**
-   * The library map that is populated by visiting the AST structure parsed from the contents of
-   * the libraries file.
-   */
-  LibraryMap _librariesMap = new LibraryMap();
-  /**
-   * Return the library map that was populated by visiting the AST structure parsed from the
-   * contents of the libraries file.
-   * @return the library map describing the contents of the SDK
-   */
-  LibraryMap get librariesMap => _librariesMap;
-  Object visitMapLiteralEntry(MapLiteralEntry node) {
-    String libraryName = null;
-    Expression key3 = node.key;
-    if (key3 is SimpleStringLiteral) {
-      libraryName = "${_LIBRARY_PREFIX}${((key3 as SimpleStringLiteral)).value}";
-    }
-    Expression value9 = node.value;
-    if (value9 is InstanceCreationExpression) {
-      SdkLibraryImpl library = new SdkLibraryImpl(libraryName);
-      List<Expression> arguments7 = ((value9 as InstanceCreationExpression)).argumentList.arguments;
-      for (Expression argument in arguments7) {
-        if (argument is SimpleStringLiteral) {
-          library.path = ((argument as SimpleStringLiteral)).value;
-        } else if (argument is NamedExpression) {
-          String name20 = ((argument as NamedExpression)).name.label.name;
-          Expression expression15 = ((argument as NamedExpression)).expression;
-          if (name20 == _CATEGORY) {
-            library.category = ((expression15 as SimpleStringLiteral)).value;
-          } else if (name20 == _IMPLEMENTATION) {
-            library.implementation = ((expression15 as BooleanLiteral)).value;
-          } else if (name20 == _DOCUMENTED) {
-            library.documented = ((expression15 as BooleanLiteral)).value;
-          } else if (name20 == _PLATFORMS) {
-            if (expression15 is SimpleIdentifier) {
-              String identifier = ((expression15 as SimpleIdentifier)).name;
-              if (identifier == _VM_PLATFORM) {
-                library.setVmLibrary();
-              } else {
-                library.setDart2JsLibrary();
-              }
-            }
-          }
-        }
-      }
-      _librariesMap.setLibrary(libraryName, library);
-    }
-    return null;
-  }
-}
-class AnalysisErrorListener_7 implements AnalysisErrorListener {
-  List<bool> foundError;
-  AnalysisErrorListener_7(this.foundError);
-  void onError(AnalysisError error) {
-    foundError[0] = true;
-  }
-}
-/**
  * Instances of the class {@code LibraryMap} map Dart library URI's to the {@link SdkLibraryImpllibrary}.
  * @coverage dart.engine.sdk
  */
@@ -341,7 +207,7 @@
  * Instances of the class {@code DartSdk} represent a Dart SDK installed in a specified location.
  * @coverage dart.engine.sdk
  */
-class DartSdk {
+abstract class DartSdk {
   /**
    * The short name of the dart SDK core library.
    */
@@ -351,322 +217,32 @@
    */
   static String DART_HTML = "dart:html";
   /**
-   * The directory containing the SDK.
+   * Return the {@link AnalysisContext} used for all of the sources in this {@link DartSdk}.
+   * @return the {@link AnalysisContext} used for all of the sources in this {@link DartSdk}
    */
-  JavaFile _sdkDirectory;
-  /**
-   * The revision number of this SDK, or {@code "0"} if the revision number cannot be discovered.
-   */
-  String _sdkVersion;
-  /**
-   * The file containing the Dartium executable.
-   */
-  JavaFile _dartiumExecutable;
-  /**
-   * The file containing the VM executable.
-   */
-  JavaFile _vmExecutable;
-  /**
-   * A mapping from Dart library URI's to the library represented by that URI.
-   */
-  LibraryMap _libraryMap;
-  /**
-   * The name of the directory within the SDK directory that contains executables.
-   */
-  static String _BIN_DIRECTORY_NAME = "bin";
-  /**
-   * The name of the directory within the SDK directory that contains Chromium.
-   */
-  static String _CHROMIUM_DIRECTORY_NAME = "chromium";
-  /**
-   * The name of the environment variable whose value is the path to the default Dart SDK directory.
-   */
-  static String _DART_SDK_ENVIRONMENT_VARIABLE_NAME = "DART_SDK";
-  /**
-   * The name of the file containing the Dartium executable on Linux.
-   */
-  static String _DARTIUM_EXECUTABLE_NAME_LINUX = "chromium/chrome";
-  /**
-   * The name of the file containing the Dartium executable on Macintosh.
-   */
-  static String _DARTIUM_EXECUTABLE_NAME_MAC = "Chromium.app/Contents/MacOS/Chromium";
-  /**
-   * The name of the file containing the Dartium executable on Windows.
-   */
-  static String _DARTIUM_EXECUTABLE_NAME_WIN = "chromium/Chrome.exe";
-  /**
-   * The name of the {@link System} property whose value is the path to the default Dart SDK
-   * directory.
-   */
-  static String _DEFAULT_DIRECTORY_PROPERTY_NAME = "com.google.dart.sdk";
-  /**
-   * The version number that is returned when the real version number could not be determined.
-   */
-  static String _DEFAULT_VERSION = "0";
-  /**
-   * The name of the directory within the SDK directory that contains documentation for the
-   * libraries.
-   */
-  static String _DOCS_DIRECTORY_NAME = "docs";
-  /**
-   * The suffix added to the name of a library to derive the name of the file containing the
-   * documentation for that library.
-   */
-  static String _DOC_FILE_SUFFIX = "_api.json";
-  /**
-   * The name of the directory within the SDK directory that contains the libraries file.
-   */
-  static String _INTERNAL_DIR = "_internal";
-  /**
-   * The name of the directory within the SDK directory that contains the libraries.
-   */
-  static String _LIB_DIRECTORY_NAME = "lib";
-  /**
-   * The name of the libraries file.
-   */
-  static String _LIBRARIES_FILE = "libraries.dart";
-  /**
-   * The name of the directory within the SDK directory that contains the packages.
-   */
-  static String _PKG_DIRECTORY_NAME = "pkg";
-  /**
-   * The name of the file within the SDK directory that contains the revision number of the SDK.
-   */
-  static String _REVISION_FILE_NAME = "revision";
-  /**
-   * The name of the file containing the VM executable on the Windows operating system.
-   */
-  static String _VM_EXECUTABLE_NAME_WIN = "dart.exe";
-  /**
-   * The name of the file containing the VM executable on non-Windows operating systems.
-   */
-  static String _VM_EXECUTABLE_NAME = "dart";
-  /**
-   * Return the default Dart SDK, or {@code null} if the directory containing the default SDK cannot
-   * be determined (or does not exist).
-   * @return the default Dart SDK
-   */
-  static DartSdk get defaultSdk {
-    JavaFile sdkDirectory = defaultSdkDirectory;
-    if (sdkDirectory == null) {
-      return null;
-    }
-    return new DartSdk(sdkDirectory);
-  }
-  /**
-   * Return the default directory for the Dart SDK, or {@code null} if the directory cannot be
-   * determined (or does not exist). The default directory is provided by a {@link System} property
-   * named {@code com.google.dart.sdk}, or, if the property is not defined, an environment variable
-   * named {@code DART_SDK}.
-   * @return the default directory for the Dart SDK
-   */
-  static JavaFile get defaultSdkDirectory {
-    String sdkProperty = JavaSystemIO.getProperty(_DEFAULT_DIRECTORY_PROPERTY_NAME);
-    if (sdkProperty == null) {
-      sdkProperty = JavaSystemIO.getenv(_DART_SDK_ENVIRONMENT_VARIABLE_NAME);
-      if (sdkProperty == null) {
-        return null;
-      }
-    }
-    JavaFile sdkDirectory = new JavaFile(sdkProperty);
-    if (!sdkDirectory.exists()) {
-      return null;
-    }
-    return sdkDirectory;
-  }
-  /**
-   * Initialize a newly created SDK to represent the Dart SDK installed in the given directory.
-   * @param sdkDirectory the directory containing the SDK
-   */
-  DartSdk(JavaFile sdkDirectory) {
-    this._sdkDirectory = sdkDirectory.getAbsoluteFile();
-    initializeSdk();
-    initializeLibraryMap();
-  }
-  /**
-   * Return the file containing the Dartium executable, or {@code null} if it does not exist.
-   * @return the file containing the Dartium executable
-   */
-  JavaFile get dartiumExecutable {
-    {
-      if (_dartiumExecutable == null) {
-        JavaFile file = new JavaFile.relative(_sdkDirectory, dartiumBinaryName);
-        if (file.exists()) {
-          _dartiumExecutable = file;
-        }
-      }
-    }
-    return _dartiumExecutable;
-  }
-  /**
-   * Return the directory where dartium can be found in the Dart SDK (the directory that will be the
-   * working directory is Dartium is invoked without changing the default).
-   * @return the directory where dartium can be found
-   */
-  JavaFile get dartiumWorkingDirectory {
-    if (OSUtilities.isWindows() || OSUtilities.isMac()) {
-      return _sdkDirectory;
-    } else {
-      return new JavaFile.relative(_sdkDirectory, _CHROMIUM_DIRECTORY_NAME);
-    }
-  }
-  /**
-   * Return the directory containing the SDK.
-   * @return the directory containing the SDK
-   */
-  JavaFile get directory => _sdkDirectory;
-  /**
-   * Return the directory containing documentation for the SDK.
-   * @return the SDK's documentation directory
-   */
-  JavaFile get docDirectory => new JavaFile.relative(_sdkDirectory, _DOCS_DIRECTORY_NAME);
-  /**
-   * Return the auxiliary documentation file for the given library, or {@code null} if no such file
-   * exists.
-   * @param libraryName the name of the library associated with the documentation file to be
-   * returned
-   * @return the auxiliary documentation file for the library
-   */
-  JavaFile getDocFileFor(String libraryName) {
-    JavaFile dir = docDirectory;
-    if (!dir.exists()) {
-      return null;
-    }
-    JavaFile libDir = new JavaFile.relative(dir, libraryName);
-    JavaFile docFile = new JavaFile.relative(libDir, "${libraryName}${_DOC_FILE_SUFFIX}");
-    if (docFile.exists()) {
-      return docFile;
-    }
-    return null;
-  }
-  /**
-   * Return the directory within the SDK directory that contains the libraries.
-   * @return the directory that contains the libraries
-   */
-  JavaFile get libraryDirectory => new JavaFile.relative(_sdkDirectory, _LIB_DIRECTORY_NAME);
-  /**
-   * Return the directory within the SDK directory that contains the packages.
-   * @return the directory that contains the packages
-   */
-  JavaFile get packageDirectory => new JavaFile.relative(directory, _PKG_DIRECTORY_NAME);
+  AnalysisContext get context;
   /**
    * Return an array containing all of the libraries defined in this SDK.
    * @return the libraries defined in this SDK
    */
-  List<SdkLibrary> get sdkLibraries => _libraryMap.sdkLibraries;
+  List<SdkLibrary> get sdkLibraries;
   /**
    * Return the revision number of this SDK, or {@code "0"} if the revision number cannot be
    * discovered.
    * @return the revision number of this SDK
    */
-  String get sdkVersion {
-    {
-      if (_sdkVersion == null) {
-        _sdkVersion = _DEFAULT_VERSION;
-        JavaFile revisionFile = new JavaFile.relative(_sdkDirectory, _REVISION_FILE_NAME);
-        try {
-          String revision = revisionFile.readAsStringSync();
-          if (revision != null) {
-            _sdkVersion = revision;
-          }
-        } on IOException catch (exception) {
-        }
-      }
-    }
-    return _sdkVersion;
-  }
+  String get sdkVersion;
   /**
    * Return an array containing the library URI's for the libraries defined in this SDK.
    * @return the library URI's for the libraries defined in this SDK
    */
-  List<String> get uris => _libraryMap.uris;
+  List<String> get uris;
   /**
-   * Return the file containing the VM executable, or {@code null} if it does not exist.
-   * @return the file containing the VM executable
-   */
-  JavaFile get vmExecutable {
-    {
-      if (_vmExecutable == null) {
-        JavaFile file = new JavaFile.relative(new JavaFile.relative(_sdkDirectory, _BIN_DIRECTORY_NAME), binaryName);
-        if (file.exists()) {
-          _vmExecutable = file;
-        }
-      }
-    }
-    return _vmExecutable;
-  }
-  /**
-   * Return {@code true} if this SDK includes documentation.
-   * @return {@code true} if this installation of the SDK has documentation
-   */
-  bool hasDocumentation() => docDirectory.exists();
-  /**
-   * Return {@code true} if the Dartium binary is available.
-   * @return {@code true} if the Dartium binary is available
-   */
-  bool isDartiumInstalled() => dartiumExecutable != null;
-  /**
-   * Return the file representing the library with the given {@code dart:} URI, or {@code null} if
+   * Return the source representing the library with the given {@code dart:} URI, or {@code null} if
    * the given URI does not denote a library in this SDK.
+   * @param contentCache the content cache used to access the contents of the mapped source
    * @param dartUri the URI of the library to be returned
-   * @return the file representing the specified library
+   * @return the source representing the specified library
    */
-  JavaFile mapDartUri(String dartUri) {
-    SdkLibrary library = _libraryMap.getLibrary(dartUri);
-    if (library == null) {
-      return null;
-    }
-    return new JavaFile.relative(libraryDirectory, library.path);
-  }
-  /**
-   * Ensure that the dart VM is executable. If it is not, make it executable and log that it was
-   * necessary for us to do so.
-   */
-  void ensureVmIsExecutable() {
-  }
-  /**
-   * Return the name of the file containing the VM executable.
-   * @return the name of the file containing the VM executable
-   */
-  String get binaryName {
-    if (OSUtilities.isWindows()) {
-      return _VM_EXECUTABLE_NAME_WIN;
-    } else {
-      return _VM_EXECUTABLE_NAME;
-    }
-  }
-  /**
-   * Return the name of the file containing the Dartium executable.
-   * @return the name of the file containing the Dartium executable
-   */
-  String get dartiumBinaryName {
-    if (OSUtilities.isWindows()) {
-      return _DARTIUM_EXECUTABLE_NAME_WIN;
-    } else if (OSUtilities.isMac()) {
-      return _DARTIUM_EXECUTABLE_NAME_MAC;
-    } else {
-      return _DARTIUM_EXECUTABLE_NAME_LINUX;
-    }
-  }
-  /**
-   * Read all of the configuration files to initialize the library maps.
-   */
-  void initializeLibraryMap() {
-    try {
-      JavaFile librariesFile = new JavaFile.relative(new JavaFile.relative(libraryDirectory, _INTERNAL_DIR), _LIBRARIES_FILE);
-      String contents = librariesFile.readAsStringSync();
-      _libraryMap = new SdkLibrariesReader().readFrom(librariesFile, contents);
-    } catch (exception) {
-      AnalysisEngine.instance.logger.logError3(exception);
-      _libraryMap = new LibraryMap();
-    }
-  }
-  /**
-   * Initialize the state of the SDK.
-   */
-  void initializeSdk() {
-    if (!OSUtilities.isWindows()) {
-      ensureVmIsExecutable();
-    }
-  }
+  Source mapDartUri(ContentCache contentCache, String dartUri);
 }
\ No newline at end of file
diff --git a/pkg/analyzer_experimental/lib/src/generated/sdk_io.dart b/pkg/analyzer_experimental/lib/src/generated/sdk_io.dart
new file mode 100644
index 0000000..09ac253
--- /dev/null
+++ b/pkg/analyzer_experimental/lib/src/generated/sdk_io.dart
@@ -0,0 +1,460 @@
+// This code was auto-generated, is not intended to be edited, and is subject to
+// significant change. Please see the README file for more information.
+
+library engine.sdk;
+
+import 'dart:io';
+import 'dart:uri';
+import 'java_core.dart';
+import 'java_io.dart';
+import 'java_engine.dart';
+import 'java_engine_io.dart';
+import 'source_io.dart';
+import 'error.dart';
+import 'scanner.dart';
+import 'ast.dart';
+import 'parser.dart';
+import 'sdk.dart';
+import 'engine.dart';
+
+/**
+ * Instances of the class {@code DirectoryBasedDartSdk} represent a Dart SDK installed in a
+ * specified directory.
+ * @coverage dart.engine.sdk
+ */
+class DirectoryBasedDartSdk implements DartSdk {
+  /**
+   * The {@link AnalysisContext} which is used for all of the sources in this {@link DartSdk}.
+   */
+  InternalAnalysisContext _analysisContext;
+  /**
+   * The directory containing the SDK.
+   */
+  JavaFile _sdkDirectory;
+  /**
+   * The revision number of this SDK, or {@code "0"} if the revision number cannot be discovered.
+   */
+  String _sdkVersion;
+  /**
+   * The file containing the Dartium executable.
+   */
+  JavaFile _dartiumExecutable;
+  /**
+   * The file containing the VM executable.
+   */
+  JavaFile _vmExecutable;
+  /**
+   * A mapping from Dart library URI's to the library represented by that URI.
+   */
+  LibraryMap _libraryMap;
+  /**
+   * The name of the directory within the SDK directory that contains executables.
+   */
+  static String _BIN_DIRECTORY_NAME = "bin";
+  /**
+   * The name of the directory within the SDK directory that contains Chromium.
+   */
+  static String _CHROMIUM_DIRECTORY_NAME = "chromium";
+  /**
+   * The name of the environment variable whose value is the path to the default Dart SDK directory.
+   */
+  static String _DART_SDK_ENVIRONMENT_VARIABLE_NAME = "DART_SDK";
+  /**
+   * The name of the file containing the Dartium executable on Linux.
+   */
+  static String _DARTIUM_EXECUTABLE_NAME_LINUX = "chrome";
+  /**
+   * The name of the file containing the Dartium executable on Macintosh.
+   */
+  static String _DARTIUM_EXECUTABLE_NAME_MAC = "Chromium.app/Contents/MacOS/Chromium";
+  /**
+   * The name of the file containing the Dartium executable on Windows.
+   */
+  static String _DARTIUM_EXECUTABLE_NAME_WIN = "Chrome.exe";
+  /**
+   * The name of the {@link System} property whose value is the path to the default Dart SDK
+   * directory.
+   */
+  static String _DEFAULT_DIRECTORY_PROPERTY_NAME = "com.google.dart.sdk";
+  /**
+   * The version number that is returned when the real version number could not be determined.
+   */
+  static String _DEFAULT_VERSION = "0";
+  /**
+   * The name of the directory within the SDK directory that contains documentation for the
+   * libraries.
+   */
+  static String _DOCS_DIRECTORY_NAME = "docs";
+  /**
+   * The suffix added to the name of a library to derive the name of the file containing the
+   * documentation for that library.
+   */
+  static String _DOC_FILE_SUFFIX = "_api.json";
+  /**
+   * The name of the directory within the SDK directory that contains the libraries file.
+   */
+  static String _INTERNAL_DIR = "_internal";
+  /**
+   * The name of the directory within the SDK directory that contains the libraries.
+   */
+  static String _LIB_DIRECTORY_NAME = "lib";
+  /**
+   * The name of the libraries file.
+   */
+  static String _LIBRARIES_FILE = "libraries.dart";
+  /**
+   * The name of the file within the SDK directory that contains the revision number of the SDK.
+   */
+  static String _REVISION_FILE_NAME = "revision";
+  /**
+   * The name of the file containing the VM executable on the Windows operating system.
+   */
+  static String _VM_EXECUTABLE_NAME_WIN = "dart.exe";
+  /**
+   * The name of the file containing the VM executable on non-Windows operating systems.
+   */
+  static String _VM_EXECUTABLE_NAME = "dart";
+  /**
+   * Return the default Dart SDK, or {@code null} if the directory containing the default SDK cannot
+   * be determined (or does not exist).
+   * @return the default Dart SDK
+   */
+  static DirectoryBasedDartSdk get defaultSdk {
+    JavaFile sdkDirectory = defaultSdkDirectory;
+    if (sdkDirectory == null) {
+      return null;
+    }
+    return new DirectoryBasedDartSdk(sdkDirectory);
+  }
+  /**
+   * Return the default directory for the Dart SDK, or {@code null} if the directory cannot be
+   * determined (or does not exist). The default directory is provided by a {@link System} property
+   * named {@code com.google.dart.sdk}, or, if the property is not defined, an environment variable
+   * named {@code DART_SDK}.
+   * @return the default directory for the Dart SDK
+   */
+  static JavaFile get defaultSdkDirectory {
+    String sdkProperty = JavaSystemIO.getProperty(_DEFAULT_DIRECTORY_PROPERTY_NAME);
+    if (sdkProperty == null) {
+      sdkProperty = JavaSystemIO.getenv(_DART_SDK_ENVIRONMENT_VARIABLE_NAME);
+      if (sdkProperty == null) {
+        return null;
+      }
+    }
+    JavaFile sdkDirectory = new JavaFile(sdkProperty);
+    if (!sdkDirectory.exists()) {
+      return null;
+    }
+    return sdkDirectory;
+  }
+  /**
+   * Initialize a newly created SDK to represent the Dart SDK installed in the given directory.
+   * @param sdkDirectory the directory containing the SDK
+   */
+  DirectoryBasedDartSdk(JavaFile sdkDirectory) {
+    this._sdkDirectory = sdkDirectory.getAbsoluteFile();
+    initializeSdk();
+    initializeLibraryMap();
+    _analysisContext = new AnalysisContextImpl();
+    _analysisContext.sourceFactory = new SourceFactory.con2([new DartUriResolver(this)]);
+    List<String> uris2 = uris;
+    ChangeSet changeSet = new ChangeSet();
+    for (String uri in uris2) {
+      changeSet.added(_analysisContext.sourceFactory.forUri(uri));
+    }
+    _analysisContext.applyChanges(changeSet);
+  }
+  AnalysisContext get context => _analysisContext;
+  /**
+   * Return the file containing the Dartium executable, or {@code null} if it does not exist.
+   * @return the file containing the Dartium executable
+   */
+  JavaFile get dartiumExecutable {
+    {
+      if (_dartiumExecutable == null) {
+        JavaFile file = new JavaFile.relative(dartiumWorkingDirectory, dartiumBinaryName);
+        if (file.exists()) {
+          _dartiumExecutable = file;
+        }
+      }
+    }
+    return _dartiumExecutable;
+  }
+  /**
+   * Return the directory where dartium can be found in the Dart SDK (the directory that will be the
+   * working directory is Dartium is invoked without changing the default).
+   * @return the directory where dartium can be found
+   */
+  JavaFile get dartiumWorkingDirectory => new JavaFile.relative(_sdkDirectory.getParentFile(), _CHROMIUM_DIRECTORY_NAME);
+  /**
+   * Return the directory containing the SDK.
+   * @return the directory containing the SDK
+   */
+  JavaFile get directory => _sdkDirectory;
+  /**
+   * Return the directory containing documentation for the SDK.
+   * @return the SDK's documentation directory
+   */
+  JavaFile get docDirectory => new JavaFile.relative(_sdkDirectory, _DOCS_DIRECTORY_NAME);
+  /**
+   * Return the auxiliary documentation file for the given library, or {@code null} if no such file
+   * exists.
+   * @param libraryName the name of the library associated with the documentation file to be
+   * returned
+   * @return the auxiliary documentation file for the library
+   */
+  JavaFile getDocFileFor(String libraryName) {
+    JavaFile dir = docDirectory;
+    if (!dir.exists()) {
+      return null;
+    }
+    JavaFile libDir = new JavaFile.relative(dir, libraryName);
+    JavaFile docFile = new JavaFile.relative(libDir, "${libraryName}${_DOC_FILE_SUFFIX}");
+    if (docFile.exists()) {
+      return docFile;
+    }
+    return null;
+  }
+  /**
+   * Return the directory within the SDK directory that contains the libraries.
+   * @return the directory that contains the libraries
+   */
+  JavaFile get libraryDirectory => new JavaFile.relative(_sdkDirectory, _LIB_DIRECTORY_NAME);
+  List<SdkLibrary> get sdkLibraries => _libraryMap.sdkLibraries;
+  /**
+   * Return the revision number of this SDK, or {@code "0"} if the revision number cannot be
+   * discovered.
+   * @return the revision number of this SDK
+   */
+  String get sdkVersion {
+    {
+      if (_sdkVersion == null) {
+        _sdkVersion = _DEFAULT_VERSION;
+        JavaFile revisionFile = new JavaFile.relative(_sdkDirectory, _REVISION_FILE_NAME);
+        try {
+          String revision = revisionFile.readAsStringSync();
+          if (revision != null) {
+            _sdkVersion = revision;
+          }
+        } on IOException catch (exception) {
+        }
+      }
+    }
+    return _sdkVersion;
+  }
+  /**
+   * Return an array containing the library URI's for the libraries defined in this SDK.
+   * @return the library URI's for the libraries defined in this SDK
+   */
+  List<String> get uris => _libraryMap.uris;
+  /**
+   * Return the file containing the VM executable, or {@code null} if it does not exist.
+   * @return the file containing the VM executable
+   */
+  JavaFile get vmExecutable {
+    {
+      if (_vmExecutable == null) {
+        JavaFile file = new JavaFile.relative(new JavaFile.relative(_sdkDirectory, _BIN_DIRECTORY_NAME), binaryName);
+        if (file.exists()) {
+          _vmExecutable = file;
+        }
+      }
+    }
+    return _vmExecutable;
+  }
+  /**
+   * Return {@code true} if this SDK includes documentation.
+   * @return {@code true} if this installation of the SDK has documentation
+   */
+  bool hasDocumentation() => docDirectory.exists();
+  /**
+   * Return {@code true} if the Dartium binary is available.
+   * @return {@code true} if the Dartium binary is available
+   */
+  bool isDartiumInstalled() => dartiumExecutable != null;
+  Source mapDartUri(ContentCache contentCache, String dartUri) {
+    SdkLibrary library = _libraryMap.getLibrary(dartUri);
+    if (library == null) {
+      return null;
+    }
+    return new FileBasedSource.con2(contentCache, new JavaFile.relative(libraryDirectory, library.path), true);
+  }
+  /**
+   * Ensure that the dart VM is executable. If it is not, make it executable and log that it was
+   * necessary for us to do so.
+   */
+  void ensureVmIsExecutable() {
+  }
+  /**
+   * Return the name of the file containing the VM executable.
+   * @return the name of the file containing the VM executable
+   */
+  String get binaryName {
+    if (OSUtilities.isWindows()) {
+      return _VM_EXECUTABLE_NAME_WIN;
+    } else {
+      return _VM_EXECUTABLE_NAME;
+    }
+  }
+  /**
+   * Return the name of the file containing the Dartium executable.
+   * @return the name of the file containing the Dartium executable
+   */
+  String get dartiumBinaryName {
+    if (OSUtilities.isWindows()) {
+      return _DARTIUM_EXECUTABLE_NAME_WIN;
+    } else if (OSUtilities.isMac()) {
+      return _DARTIUM_EXECUTABLE_NAME_MAC;
+    } else {
+      return _DARTIUM_EXECUTABLE_NAME_LINUX;
+    }
+  }
+  /**
+   * Read all of the configuration files to initialize the library maps.
+   */
+  void initializeLibraryMap() {
+    try {
+      JavaFile librariesFile = new JavaFile.relative(new JavaFile.relative(libraryDirectory, _INTERNAL_DIR), _LIBRARIES_FILE);
+      String contents = librariesFile.readAsStringSync();
+      _libraryMap = new SdkLibrariesReader().readFrom(librariesFile, contents);
+    } catch (exception) {
+      AnalysisEngine.instance.logger.logError3(exception);
+      _libraryMap = new LibraryMap();
+    }
+  }
+  /**
+   * Initialize the state of the SDK.
+   */
+  void initializeSdk() {
+    if (!OSUtilities.isWindows()) {
+      ensureVmIsExecutable();
+    }
+  }
+}
+/**
+ * Instances of the class {@code SdkLibrariesReader} read and parse the libraries file
+ * (dart-sdk/lib/_internal/libraries.dart) for information about the libraries in an SDK. The
+ * library information is represented as a Dart file containing a single top-level variable whose
+ * value is a const map. The keys of the map are the names of libraries defined in the SDK and the
+ * values in the map are info objects defining the library. For example, a subset of a typical SDK
+ * might have a libraries file that looks like the following:
+ * <pre>
+ * final Map&lt;String, LibraryInfo&gt; LIBRARIES = const &lt;LibraryInfo&gt; {
+ * // Used by VM applications
+ * "builtin" : const LibraryInfo(
+ * "builtin/builtin_runtime.dart",
+ * category: "Server",
+ * platforms: VM_PLATFORM),
+ * "compiler" : const LibraryInfo(
+ * "compiler/compiler.dart",
+ * category: "Tools",
+ * platforms: 0),
+ * };
+ * </pre>
+ * @coverage dart.engine.sdk
+ */
+class SdkLibrariesReader {
+  /**
+   * Return the library map read from the given source.
+   * @return the library map read from the given source
+   */
+  LibraryMap readFrom(JavaFile librariesFile, String libraryFileContents) {
+    List<bool> foundError = [false];
+    AnalysisErrorListener errorListener = new AnalysisErrorListener_10(foundError);
+    Source source = new FileBasedSource.con2(null, librariesFile, false);
+    StringScanner scanner = new StringScanner(source, libraryFileContents, errorListener);
+    Parser parser = new Parser(source, errorListener);
+    CompilationUnit unit = parser.parseCompilationUnit(scanner.tokenize());
+    SdkLibrariesReader_LibraryBuilder libraryBuilder = new SdkLibrariesReader_LibraryBuilder();
+    if (!foundError[0]) {
+      unit.accept(libraryBuilder);
+    }
+    return libraryBuilder.librariesMap;
+  }
+}
+class SdkLibrariesReader_LibraryBuilder extends RecursiveASTVisitor<Object> {
+  /**
+   * The prefix added to the name of a library to form the URI used in code to reference the
+   * library.
+   */
+  static String _LIBRARY_PREFIX = "dart:";
+  /**
+   * The name of the optional parameter used to indicate whether the library is an implementation
+   * library.
+   */
+  static String _IMPLEMENTATION = "implementation";
+  /**
+   * The name of the optional parameter used to indicate whether the library is documented.
+   */
+  static String _DOCUMENTED = "documented";
+  /**
+   * The name of the optional parameter used to specify the category of the library.
+   */
+  static String _CATEGORY = "category";
+  /**
+   * The name of the optional parameter used to specify the platforms on which the library can be
+   * used.
+   */
+  static String _PLATFORMS = "platforms";
+  /**
+   * The value of the {@link #PLATFORMS platforms} parameter used to specify that the library can
+   * be used on the VM.
+   */
+  static String _VM_PLATFORM = "VM_PLATFORM";
+  /**
+   * The library map that is populated by visiting the AST structure parsed from the contents of
+   * the libraries file.
+   */
+  LibraryMap _librariesMap = new LibraryMap();
+  /**
+   * Return the library map that was populated by visiting the AST structure parsed from the
+   * contents of the libraries file.
+   * @return the library map describing the contents of the SDK
+   */
+  LibraryMap get librariesMap => _librariesMap;
+  Object visitMapLiteralEntry(MapLiteralEntry node) {
+    String libraryName = null;
+    Expression key2 = node.key;
+    if (key2 is SimpleStringLiteral) {
+      libraryName = "${_LIBRARY_PREFIX}${((key2 as SimpleStringLiteral)).value}";
+    }
+    Expression value2 = node.value;
+    if (value2 is InstanceCreationExpression) {
+      SdkLibraryImpl library = new SdkLibraryImpl(libraryName);
+      List<Expression> arguments2 = ((value2 as InstanceCreationExpression)).argumentList.arguments;
+      for (Expression argument in arguments2) {
+        if (argument is SimpleStringLiteral) {
+          library.path = ((argument as SimpleStringLiteral)).value;
+        } else if (argument is NamedExpression) {
+          String name2 = ((argument as NamedExpression)).name.label.name;
+          Expression expression2 = ((argument as NamedExpression)).expression;
+          if (name2 == _CATEGORY) {
+            library.category = ((expression2 as SimpleStringLiteral)).value;
+          } else if (name2 == _IMPLEMENTATION) {
+            library.implementation = ((expression2 as BooleanLiteral)).value;
+          } else if (name2 == _DOCUMENTED) {
+            library.documented = ((expression2 as BooleanLiteral)).value;
+          } else if (name2 == _PLATFORMS) {
+            if (expression2 is SimpleIdentifier) {
+              String identifier = ((expression2 as SimpleIdentifier)).name;
+              if (identifier == _VM_PLATFORM) {
+                library.setVmLibrary();
+              } else {
+                library.setDart2JsLibrary();
+              }
+            }
+          }
+        }
+      }
+      _librariesMap.setLibrary(libraryName, library);
+    }
+    return null;
+  }
+}
+class AnalysisErrorListener_10 implements AnalysisErrorListener {
+  List<bool> foundError;
+  AnalysisErrorListener_10(this.foundError);
+  void onError(AnalysisError error) {
+    foundError[0] = true;
+  }
+}
\ No newline at end of file
diff --git a/pkg/analyzer_experimental/lib/src/generated/source.dart b/pkg/analyzer_experimental/lib/src/generated/source.dart
index c7db991..f5f63be 100644
--- a/pkg/analyzer_experimental/lib/src/generated/source.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/source.dart
@@ -5,6 +5,7 @@
 
 import 'dart:uri';
 import 'java_core.dart';
+import 'sdk.dart' show DartSdk;
 import 'engine.dart' show AnalysisContext;
 
 /**
@@ -26,13 +27,13 @@
   ContentCache _contentCache;
   /**
    * Initialize a newly created source factory.
-   * @param contentCache the cache holding content used to override the default content of a source.
+   * @param contentCache the cache holding content used to override the default content of a source
    * @param resolvers the resolvers used to resolve absolute URI's
    */
   SourceFactory.con1(ContentCache contentCache2, List<UriResolver> resolvers2) {
-    _jtd_constructor_306_impl(contentCache2, resolvers2);
+    _jtd_constructor_332_impl(contentCache2, resolvers2);
   }
-  _jtd_constructor_306_impl(ContentCache contentCache2, List<UriResolver> resolvers2) {
+  _jtd_constructor_332_impl(ContentCache contentCache2, List<UriResolver> resolvers2) {
     this._contentCache = contentCache2;
     this._resolvers = resolvers2;
   }
@@ -41,10 +42,10 @@
    * @param resolvers the resolvers used to resolve absolute URI's
    */
   SourceFactory.con2(List<UriResolver> resolvers) {
-    _jtd_constructor_307_impl(resolvers);
+    _jtd_constructor_333_impl(resolvers);
   }
-  _jtd_constructor_307_impl(List<UriResolver> resolvers) {
-    _jtd_constructor_306_impl(new ContentCache(), resolvers);
+  _jtd_constructor_333_impl(List<UriResolver> resolvers) {
+    _jtd_constructor_332_impl(new ContentCache(), resolvers);
   }
   /**
    * Return a source object representing the given absolute URI, or {@code null} if the URI is not a
@@ -70,11 +71,31 @@
    */
   Source fromEncoding(String encoding) => forUri(encoding);
   /**
+   * Return a cache of content used to override the default content of a source.
+   * @return a cache of content used to override the default content of a source
+   */
+  ContentCache get contentCache => _contentCache;
+  /**
    * Return the analysis context that this source factory is associated with.
    * @return the analysis context that this source factory is associated with
    */
   AnalysisContext get context => _context;
   /**
+   * Return the {@link DartSdk} associated with this {@link SourceFactory}, or {@code null} if there
+   * is no such SDK.
+   * @return the {@link DartSdk} associated with this {@link SourceFactory}, or {@code null} if
+   * there is no such SDK
+   */
+  DartSdk get dartSdk {
+    for (UriResolver resolver in _resolvers) {
+      if (resolver is DartUriResolver) {
+        DartUriResolver dartUriResolver = resolver as DartUriResolver;
+        return dartUriResolver.dartSdk;
+      }
+    }
+    return null;
+  }
+  /**
    * Return a source object representing the URI that results from resolving the given (possibly
    * relative) contained URI against the URI associated with an existing source object, or{@code null} if either the contained URI is invalid or if it cannot be resolved against the
    * source object's URI.
@@ -138,7 +159,7 @@
   Source resolveUri2(Source containingSource, Uri containedUri) {
     if (containedUri.isAbsolute) {
       for (UriResolver resolver in _resolvers) {
-        Source result = resolver.resolveAbsolute(this, containedUri);
+        Source result = resolver.resolveAbsolute(_contentCache, containedUri);
         if (result != null) {
           return result;
         }
@@ -164,10 +185,11 @@
   /**
    * Resolve the given absolute URI. Return a {@link Source source} representing the file to which
    * it was resolved, or {@code null} if it could not be resolved.
+   * @param contentCache the content cache used to access the contents of the returned source
    * @param uri the URI to be resolved
    * @return a {@link Source source} representing the URI to which given URI was resolved
    */
-  Source resolveAbsolute(SourceFactory factory, Uri uri);
+  Source resolveAbsolute(ContentCache contentCache, Uri uri);
 }
 /**
  * The interface {@code Source} defines the behavior of objects representing source code that can be
@@ -194,11 +216,6 @@
    */
   bool exists();
   /**
-   * Return the analysis context in which this source is defined.
-   * @return the analysis context in which this source is defined
-   */
-  AnalysisContext get context;
-  /**
    * Get the contents of this source and pass it to the given receiver. Exactly one of the methods
    * defined on the receiver will be invoked unless an exception is thrown. The method that will be
    * invoked depends on which of the possible representations of the contents is the most efficient.
@@ -248,12 +265,6 @@
    */
   bool isInSystemLibrary();
   /**
-   * Resolve the given URI relative to the location of this source.
-   * @param uri the URI to be resolved against this source
-   * @return a source representing the resolved URI
-   */
-  Source resolve(String uri);
-  /**
    * Resolve the relative URI against the URI associated with this source object. Return a{@link Source source} representing the URI to which it was resolved, or {@code null} if it
    * could not be resolved.
    * <p>
@@ -275,20 +286,22 @@
   /**
    * Accept the contents of a source represented as a character buffer.
    * @param contents the contents of the source
+   * @param modificationTime the time at which the contents were last set
    */
-  accept(CharBuffer contents);
+  void accept(CharBuffer contents, int modificationTime);
   /**
    * Accept the contents of a source represented as a string.
    * @param contents the contents of the source
+   * @param modificationTime the time at which the contents were last set
    */
-  void accept2(String contents);
+  void accept2(String contents, int modificationTime);
 }
 /**
  * The enumeration {@code SourceKind} defines the different kinds of sources that are known to the
  * analysis engine.
  * @coverage dart.engine.source
  */
-class SourceKind {
+class SourceKind implements Comparable<SourceKind> {
   /**
    * A source containing HTML. The HTML might or might not contain Dart scripts.
    */
@@ -314,6 +327,7 @@
   int get ordinal => __ordinal;
   SourceKind(this.__name, this.__ordinal) {
   }
+  int compareTo(SourceKind other) => __ordinal - other.__ordinal;
   String toString() => __name;
 }
 /**
@@ -341,23 +355,23 @@
     this._length = length;
   }
   /**
-   * @return <code>true</code> if <code>x</code> is in [offset, offset + length) interval.
+   * @return {@code true} if <code>x</code> is in [offset, offset + length) interval.
    */
   bool contains(int x) => _offset <= x && x < _offset + _length;
   /**
-   * @return <code>true</code> if <code>x</code> is in (offset, offset + length) interval.
+   * @return {@code true} if <code>x</code> is in (offset, offset + length) interval.
    */
   bool containsExclusive(int x) => _offset < x && x < _offset + _length;
   /**
-   * @return <code>true</code> if <code>otherRange</code> covers this {@link SourceRange}.
+   * @return {@code true} if <code>otherRange</code> covers this {@link SourceRange}.
    */
   bool coveredBy(SourceRange otherRange) => otherRange.covers(this);
   /**
-   * @return <code>true</code> if this {@link SourceRange} covers <code>otherRange</code>.
+   * @return {@code true} if this {@link SourceRange} covers <code>otherRange</code>.
    */
   bool covers(SourceRange otherRange) => offset <= otherRange.offset && otherRange.end <= end;
   /**
-   * @return <code>true</code> if this {@link SourceRange} ends in <code>otherRange</code>.
+   * @return {@code true} if this {@link SourceRange} ends in <code>otherRange</code>.
    */
   bool endsIn(SourceRange otherRange) {
     int thisEnd = end;
@@ -399,7 +413,7 @@
   int get offset => _offset;
   int get hashCode => 31 * _offset + _length;
   /**
-   * @return <code>true</code> if this {@link SourceRange} intersects with given.
+   * @return {@code true} if this {@link SourceRange} intersects with given.
    */
   bool intersects(SourceRange other) {
     if (other == null) {
@@ -414,7 +428,7 @@
     return true;
   }
   /**
-   * @return <code>true</code> if this {@link SourceRange} starts in <code>otherRange</code>.
+   * @return {@code true} if this {@link SourceRange} starts in <code>otherRange</code>.
    */
   bool startsIn(SourceRange otherRange) => otherRange.contains(_offset);
   String toString() {
@@ -445,6 +459,45 @@
   bool contains(Source source);
 }
 /**
+ * Instances of the class {@code DartUriResolver} resolve {@code dart} URI's.
+ * @coverage dart.engine.source
+ */
+class DartUriResolver extends UriResolver {
+  /**
+   * The Dart SDK against which URI's are to be resolved.
+   */
+  DartSdk _sdk;
+  /**
+   * The name of the {@code dart} scheme.
+   */
+  static String _DART_SCHEME = "dart";
+  /**
+   * Return {@code true} if the given URI is a {@code dart:} URI.
+   * @param uri the URI being tested
+   * @return {@code true} if the given URI is a {@code dart:} URI
+   */
+  static bool isDartUri(Uri uri) => uri.scheme == _DART_SCHEME;
+  /**
+   * Initialize a newly created resolver to resolve Dart URI's against the given platform within the
+   * given Dart SDK.
+   * @param sdk the Dart SDK against which URI's are to be resolved
+   */
+  DartUriResolver(DartSdk sdk) {
+    this._sdk = sdk;
+  }
+  /**
+   * Return the {@link DartSdk} against which URIs are to be resolved.
+   * @return the {@link DartSdk} against which URIs are to be resolved.
+   */
+  DartSdk get dartSdk => _sdk;
+  Source resolveAbsolute(ContentCache contentCache, Uri uri) {
+    if (!isDartUri(uri)) {
+      return null;
+    }
+    return _sdk.mapDartUri(contentCache, uri.toString());
+  }
+}
+/**
  * Instances of the class {@code LineInfo} encapsulate information about line and column information
  * within a source file.
  * @coverage dart.engine.utilities
diff --git a/pkg/analyzer_experimental/lib/src/generated/source_io.dart b/pkg/analyzer_experimental/lib/src/generated/source_io.dart
index a31152a..28991a4 100644
--- a/pkg/analyzer_experimental/lib/src/generated/source_io.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/source_io.dart
@@ -9,7 +9,7 @@
 import 'java_core.dart';
 import 'java_io.dart';
 import 'sdk.dart' show DartSdk;
-import 'engine.dart' show AnalysisContext;
+import 'engine.dart' show AnalysisContext, AnalysisEngine;
 export 'source.dart';
 
 /**
@@ -18,61 +18,65 @@
  */
 class FileBasedSource implements Source {
   /**
-   * The source factory that created this source and that should be used to resolve URI's against
-   * this source.
+   * The content cache used to access the contents of this source if they have been overridden from
+   * what is on disk or cached.
    */
-  SourceFactory _factory;
+  ContentCache _contentCache;
   /**
    * The file represented by this source.
    */
   JavaFile _file;
   /**
+   * The cached URI of the {@link #file}.
+   */
+  String _fileUriString;
+  /**
    * A flag indicating whether this source is in one of the system libraries.
    */
   bool _inSystemLibrary = false;
   /**
    * Initialize a newly created source object. The source object is assumed to not be in a system
    * library.
-   * @param factory the source factory that created this source
+   * @param contentCache the content cache used to access the contents of this source
    * @param file the file represented by this source
    */
-  FileBasedSource.con1(SourceFactory factory, JavaFile file) {
-    _jtd_constructor_302_impl(factory, file);
+  FileBasedSource.con1(ContentCache contentCache, JavaFile file) {
+    _jtd_constructor_328_impl(contentCache, file);
   }
-  _jtd_constructor_302_impl(SourceFactory factory, JavaFile file) {
-    _jtd_constructor_303_impl(factory, file, false);
+  _jtd_constructor_328_impl(ContentCache contentCache, JavaFile file) {
+    _jtd_constructor_329_impl(contentCache, file, false);
   }
   /**
    * Initialize a newly created source object.
-   * @param factory the source factory that created this source
+   * @param contentCache the content cache used to access the contents of this source
    * @param file the file represented by this source
    * @param inSystemLibrary {@code true} if this source is in one of the system libraries
    */
-  FileBasedSource.con2(SourceFactory factory2, JavaFile file3, bool inSystemLibrary2) {
-    _jtd_constructor_303_impl(factory2, file3, inSystemLibrary2);
+  FileBasedSource.con2(ContentCache contentCache2, JavaFile file2, bool inSystemLibrary2) {
+    _jtd_constructor_329_impl(contentCache2, file2, inSystemLibrary2);
   }
-  _jtd_constructor_303_impl(SourceFactory factory2, JavaFile file3, bool inSystemLibrary2) {
-    this._factory = factory2;
-    this._file = file3;
+  _jtd_constructor_329_impl(ContentCache contentCache2, JavaFile file2, bool inSystemLibrary2) {
+    this._contentCache = contentCache2;
+    this._file = file2;
     this._inSystemLibrary = inSystemLibrary2;
+    this._fileUriString = file2.toURI().toString();
   }
-  bool operator ==(Object object) => object != null && identical(this.runtimeType, object.runtimeType) && _file == ((object as FileBasedSource))._file;
-  bool exists() => _factory.getContents(this) != null || (_file.exists() && !_file.isDirectory());
+  bool operator ==(Object object) => object != null && this.runtimeType == object.runtimeType && _file == ((object as FileBasedSource))._file;
+  bool exists() => _contentCache.getContents(this) != null || (_file.exists() && !_file.isDirectory());
   void getContents(Source_ContentReceiver receiver) {
     {
-      String contents = _factory.getContents(this);
+      String contents = _contentCache.getContents(this);
       if (contents != null) {
-        receiver.accept2(contents);
+        receiver.accept2(contents, _contentCache.getModificationStamp(this));
         return;
       }
     }
-    receiver.accept2(_file.readAsStringSync());
+    receiver.accept2(_file.readAsStringSync(), _file.lastModified());
   }
-  AnalysisContext get context => _factory.context;
-  String get encoding => _file.toURI().toString();
+  String get encoding => _fileUriString;
   String get fullName => _file.getAbsolutePath();
   int get modificationStamp {
-    int stamp = _factory.getModificationStamp(this);
+    int stamp = _contentCache.getModificationStamp(this);
     if (stamp != null) {
       return stamp;
     }
@@ -81,11 +85,10 @@
   String get shortName => _file.getName();
   int get hashCode => _file.hashCode;
   bool isInSystemLibrary() => _inSystemLibrary;
-  Source resolve(String uri) => _factory.resolveUri(this, uri);
   Source resolveRelative(Uri containedUri) {
     try {
       Uri resolvedUri = file.toURI().resolveUri(containedUri);
-      return new FileBasedSource.con1(_factory, new JavaFile.fromUri(resolvedUri));
+      return new FileBasedSource.con2(_contentCache, new JavaFile.fromUri(resolvedUri), isInSystemLibrary());
     } catch (exception) {
     }
     return null;
@@ -104,46 +107,12 @@
   JavaFile get file => _file;
 }
 /**
- * Instances of the class {@code DartUriResolver} resolve {@code dart} URI's.
- * @coverage dart.engine.source
- */
-class DartUriResolver extends UriResolver {
-  /**
-   * The Dart SDK against which URI's are to be resolved.
-   */
-  DartSdk _sdk;
-  /**
-   * The name of the {@code dart} scheme.
-   */
-  static String _DART_SCHEME = "dart";
-  /**
-   * Return {@code true} if the given URI is a {@code dart:} URI.
-   * @param uri the URI being tested
-   * @return {@code true} if the given URI is a {@code dart:} URI
-   */
-  static bool isDartUri(Uri uri) => uri.scheme == _DART_SCHEME;
-  /**
-   * Initialize a newly created resolver to resolve Dart URI's against the given platform within the
-   * given Dart SDK.
-   * @param sdk the Dart SDK against which URI's are to be resolved
-   */
-  DartUriResolver(DartSdk sdk) {
-    this._sdk = sdk;
-  }
-  Source resolveAbsolute(SourceFactory factory, Uri uri) {
-    if (!isDartUri(uri)) {
-      return null;
-    }
-    JavaFile resolvedFile = _sdk.mapDartUri(uri.toString());
-    if (resolvedFile == null) {
-      return null;
-    }
-    return new FileBasedSource.con2(factory, resolvedFile, true);
-  }
-}
-/**
  * Instances of the class {@code PackageUriResolver} resolve {@code package} URI's in the context of
  * an application.
+ * <p>
+ * For the purposes of sharing analysis, the path to each package under the "packages" directory
+ * should be canonicalized, but to preserve relative links within a package, the remainder of the
+ * path from the package directory to the leaf should not.
  * @coverage dart.engine.source
  */
 class PackageUriResolver extends UriResolver {
@@ -173,24 +142,53 @@
     }
     this._packagesDirectories = packagesDirectories;
   }
-  Source resolveAbsolute(SourceFactory factory, Uri uri) {
+  Source resolveAbsolute(ContentCache contentCache, Uri uri) {
     if (!isPackageUri(uri)) {
       return null;
     }
-    String path4 = uri.path;
-    if (path4 == null) {
-      path4 = uri.path;
-      if (path4 == null) {
+    String path2 = uri.path;
+    if (path2 == null) {
+      path2 = uri.path;
+      if (path2 == null) {
         return null;
       }
     }
+    String pkgName;
+    String relPath;
+    int index = path2.indexOf('/');
+    if (index == -1) {
+      pkgName = path2;
+      relPath = "";
+    } else if (index == 0) {
+      return null;
+    } else {
+      pkgName = path2.substring(0, index);
+      relPath = path2.substring(index + 1);
+    }
     for (JavaFile packagesDirectory in _packagesDirectories) {
-      JavaFile resolvedFile = new JavaFile.relative(packagesDirectory, path4);
+      JavaFile resolvedFile = new JavaFile.relative(packagesDirectory, path2);
       if (resolvedFile.exists()) {
-        return new FileBasedSource.con1(factory, resolvedFile);
+        return new FileBasedSource.con1(contentCache, getCanonicalFile(packagesDirectory, pkgName, relPath));
       }
     }
-    return new FileBasedSource.con1(factory, new JavaFile.relative(_packagesDirectories[0], path4));
+    return new FileBasedSource.con1(contentCache, getCanonicalFile(_packagesDirectories[0], pkgName, relPath));
+  }
+  /**
+   * Answer the canonical file for the specified package.
+   * @param packagesDirectory the "packages" directory (not {@code null})
+   * @param pkgName the package name (not {@code null}, not empty)
+   * @param relPath the path relative to the package directory (not {@code null}, no leading slash,
+   * but may be empty string)
+   * @return the file (not {@code null})
+   */
+  JavaFile getCanonicalFile(JavaFile packagesDirectory, String pkgName, String relPath) {
+    JavaFile pkgDir = new JavaFile.relative(packagesDirectory, pkgName);
+    try {
+      pkgDir = pkgDir.getCanonicalFile();
+    } on IOException catch (e) {
+      AnalysisEngine.instance.logger.logError2("Canonical failed: ${pkgDir}", e);
+    }
+    return new JavaFile.relative(pkgDir, relPath.replaceAll(0x2F, JavaFile.separatorChar));
   }
 }
 /**
@@ -221,20 +219,20 @@
    * @param directory the directory (not {@code null})
    */
   DirectoryBasedSourceContainer.con1(JavaFile directory) {
-    _jtd_constructor_300_impl(directory);
+    _jtd_constructor_326_impl(directory);
   }
-  _jtd_constructor_300_impl(JavaFile directory) {
-    _jtd_constructor_301_impl(directory.getPath());
+  _jtd_constructor_326_impl(JavaFile directory) {
+    _jtd_constructor_327_impl(directory.getPath());
   }
   /**
    * Construct a container representing the specified path and containing any sources whose{@link Source#getFullName()} starts with the specified path.
    * @param path the path (not {@code null} and not empty)
    */
-  DirectoryBasedSourceContainer.con2(String path3) {
-    _jtd_constructor_301_impl(path3);
+  DirectoryBasedSourceContainer.con2(String path2) {
+    _jtd_constructor_327_impl(path2);
   }
-  _jtd_constructor_301_impl(String path3) {
-    this._path = appendFileSeparator(path3);
+  _jtd_constructor_327_impl(String path2) {
+    this._path = appendFileSeparator(path2);
   }
   bool contains(Source source) => source.fullName.startsWith(_path);
   bool operator ==(Object obj) => (obj is DirectoryBasedSourceContainer) && ((obj as DirectoryBasedSourceContainer)).path == path;
@@ -266,10 +264,10 @@
    */
   FileUriResolver() : super() {
   }
-  Source resolveAbsolute(SourceFactory factory, Uri uri) {
+  Source resolveAbsolute(ContentCache contentCache, Uri uri) {
     if (!isFileUri(uri)) {
       return null;
     }
-    return new FileBasedSource.con1(factory, new JavaFile.fromUri(uri));
+    return new FileBasedSource.con1(contentCache, new JavaFile.fromUri(uri));
   }
 }
\ No newline at end of file
diff --git a/pkg/analyzer_experimental/lib/src/generated/utilities_dart.dart b/pkg/analyzer_experimental/lib/src/generated/utilities_dart.dart
index 185d559..a2ff948 100644
--- a/pkg/analyzer_experimental/lib/src/generated/utilities_dart.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/utilities_dart.dart
@@ -10,7 +10,7 @@
  * two kinds: positional optional and named optional.
  * @coverage dart.engine.utilities
  */
-class ParameterKind {
+class ParameterKind implements Comparable<ParameterKind> {
   static final ParameterKind REQUIRED = new ParameterKind('REQUIRED', 0, false);
   static final ParameterKind POSITIONAL = new ParameterKind('POSITIONAL', 1, true);
   static final ParameterKind NAMED = new ParameterKind('NAMED', 2, true);
@@ -34,5 +34,6 @@
    * @return {@code true} if this is an optional parameter
    */
   bool isOptional() => _isOptional2;
+  int compareTo(ParameterKind other) => __ordinal - other.__ordinal;
   String toString() => __name;
 }
\ No newline at end of file
diff --git a/pkg/analyzer_experimental/test/generated/ast_test.dart b/pkg/analyzer_experimental/test/generated/ast_test.dart
index c927106..7a8031d 100644
--- a/pkg/analyzer_experimental/test/generated/ast_test.dart
+++ b/pkg/analyzer_experimental/test/generated/ast_test.dart
@@ -23,6 +23,18 @@
     CompilationUnit unit = ParserTestCase.parseCompilationUnit("library myLib;", []);
     assertLocate(unit, 10, SimpleIdentifier);
   }
+  void test_offsetAfterNode() {
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(EngineTestCase.createSource(["class A {}", "class B {}"]), []);
+    NodeLocator locator = new NodeLocator.con2(1024, 1024);
+    ASTNode node = locator.searchWithin(unit.declarations[0]);
+    JUnitTestCase.assertNull(node);
+  }
+  void test_offsetBeforeNode() {
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(EngineTestCase.createSource(["class A {}", "class B {}"]), []);
+    NodeLocator locator = new NodeLocator.con2(0, 0);
+    ASTNode node = locator.searchWithin(unit.declarations[1]);
+    JUnitTestCase.assertNull(node);
+  }
   void test_range() {
     CompilationUnit unit = ParserTestCase.parseCompilationUnit("library myLib;", []);
     assertLocate2(unit, 4, 10, LibraryDirective);
@@ -44,6 +56,14 @@
         final __test = new NodeLocatorTest();
         runJUnitTest(__test, __test.test_offset);
       });
+      _ut.test('test_offsetAfterNode', () {
+        final __test = new NodeLocatorTest();
+        runJUnitTest(__test, __test.test_offsetAfterNode);
+      });
+      _ut.test('test_offsetBeforeNode', () {
+        final __test = new NodeLocatorTest();
+        runJUnitTest(__test, __test.test_offsetBeforeNode);
+      });
       _ut.test('test_range', () {
         final __test = new NodeLocatorTest();
         runJUnitTest(__test, __test.test_range);
@@ -53,62 +73,62 @@
 }
 class IndexExpressionTest extends EngineTestCase {
   void test_inGetterContext_assignment_compound_left() {
-    IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier2("a"), ASTFactory.identifier2("b"));
+    IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"));
     ASTFactory.assignmentExpression(expression, TokenType.PLUS_EQ, null);
     JUnitTestCase.assertTrue(expression.inGetterContext());
   }
   void test_inGetterContext_assignment_simple_left() {
-    IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier2("a"), ASTFactory.identifier2("b"));
+    IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"));
     ASTFactory.assignmentExpression(expression, TokenType.EQ, null);
     JUnitTestCase.assertFalse(expression.inGetterContext());
   }
   void test_inGetterContext_nonAssignment() {
-    IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier2("a"), ASTFactory.identifier2("b"));
+    IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"));
     ASTFactory.binaryExpression(expression, TokenType.PLUS, null);
     JUnitTestCase.assertTrue(expression.inGetterContext());
   }
   void test_inSetterContext_assignment_compound_left() {
-    IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier2("a"), ASTFactory.identifier2("b"));
+    IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"));
     ASTFactory.assignmentExpression(expression, TokenType.PLUS_EQ, null);
     JUnitTestCase.assertTrue(expression.inSetterContext());
   }
   void test_inSetterContext_assignment_compound_right() {
-    IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier2("a"), ASTFactory.identifier2("b"));
+    IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"));
     ASTFactory.assignmentExpression(null, TokenType.PLUS_EQ, expression);
     JUnitTestCase.assertFalse(expression.inSetterContext());
   }
   void test_inSetterContext_assignment_simple_left() {
-    IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier2("a"), ASTFactory.identifier2("b"));
+    IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"));
     ASTFactory.assignmentExpression(expression, TokenType.EQ, null);
     JUnitTestCase.assertTrue(expression.inSetterContext());
   }
   void test_inSetterContext_assignment_simple_right() {
-    IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier2("a"), ASTFactory.identifier2("b"));
+    IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"));
     ASTFactory.assignmentExpression(null, TokenType.EQ, expression);
     JUnitTestCase.assertFalse(expression.inSetterContext());
   }
   void test_inSetterContext_nonAssignment() {
-    IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier2("a"), ASTFactory.identifier2("b"));
+    IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"));
     ASTFactory.binaryExpression(expression, TokenType.PLUS, null);
     JUnitTestCase.assertFalse(expression.inSetterContext());
   }
   void test_inSetterContext_postfix() {
-    IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier2("a"), ASTFactory.identifier2("b"));
+    IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"));
     ASTFactory.postfixExpression(expression, TokenType.PLUS_PLUS);
     JUnitTestCase.assertTrue(expression.inSetterContext());
   }
   void test_inSetterContext_prefix_bang() {
-    IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier2("a"), ASTFactory.identifier2("b"));
+    IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"));
     ASTFactory.prefixExpression(TokenType.BANG, expression);
     JUnitTestCase.assertFalse(expression.inSetterContext());
   }
   void test_inSetterContext_prefix_minusMinus() {
-    IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier2("a"), ASTFactory.identifier2("b"));
+    IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"));
     ASTFactory.prefixExpression(TokenType.MINUS_MINUS, expression);
     JUnitTestCase.assertTrue(expression.inSetterContext());
   }
   void test_inSetterContext_prefix_plusPlus() {
-    IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier2("a"), ASTFactory.identifier2("b"));
+    IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"));
     ASTFactory.prefixExpression(TokenType.PLUS_PLUS, expression);
     JUnitTestCase.assertTrue(expression.inSetterContext());
   }
@@ -181,7 +201,7 @@
   static AdjacentStrings adjacentStrings(List<StringLiteral> strings) => new AdjacentStrings.full(list(strings));
   static Annotation annotation(Identifier name) => new Annotation.full(TokenFactory.token3(TokenType.AT), name, null, null, null);
   static Annotation annotation2(Identifier name, SimpleIdentifier constructorName, ArgumentList arguments) => new Annotation.full(TokenFactory.token3(TokenType.AT), name, TokenFactory.token3(TokenType.PERIOD), constructorName, arguments);
-  static ArgumentDefinitionTest argumentDefinitionTest(String identifier) => new ArgumentDefinitionTest.full(TokenFactory.token3(TokenType.QUESTION), identifier2(identifier));
+  static ArgumentDefinitionTest argumentDefinitionTest(String identifier) => new ArgumentDefinitionTest.full(TokenFactory.token3(TokenType.QUESTION), identifier3(identifier));
   static ArgumentList argumentList(List<Expression> arguments) => new ArgumentList.full(TokenFactory.token3(TokenType.OPEN_PAREN), list(arguments), TokenFactory.token3(TokenType.CLOSE_PAREN));
   static AsExpression asExpression(Expression expression, TypeName type) => new AsExpression.full(expression, TokenFactory.token(Keyword.AS), type);
   static AssertStatement assertStatement(Expression condition) => new AssertStatement.full(TokenFactory.token(Keyword.ASSERT), TokenFactory.token3(TokenType.OPEN_PAREN), condition, TokenFactory.token3(TokenType.CLOSE_PAREN), TokenFactory.token3(TokenType.SEMICOLON));
@@ -191,18 +211,18 @@
   static BlockFunctionBody blockFunctionBody(List<Statement> statements) => new BlockFunctionBody.full(block(statements));
   static BooleanLiteral booleanLiteral(bool value) => new BooleanLiteral.full(value ? TokenFactory.token(Keyword.TRUE) : TokenFactory.token(Keyword.FALSE), value);
   static BreakStatement breakStatement() => new BreakStatement.full(TokenFactory.token(Keyword.BREAK), null, TokenFactory.token3(TokenType.SEMICOLON));
-  static BreakStatement breakStatement2(String label) => new BreakStatement.full(TokenFactory.token(Keyword.BREAK), identifier2(label), TokenFactory.token3(TokenType.SEMICOLON));
+  static BreakStatement breakStatement2(String label) => new BreakStatement.full(TokenFactory.token(Keyword.BREAK), identifier3(label), TokenFactory.token3(TokenType.SEMICOLON));
   static IndexExpression cascadedIndexExpression(Expression index) => new IndexExpression.forCascade_full(TokenFactory.token3(TokenType.PERIOD_PERIOD), TokenFactory.token3(TokenType.OPEN_SQUARE_BRACKET), index, TokenFactory.token3(TokenType.CLOSE_SQUARE_BRACKET));
-  static MethodInvocation cascadedMethodInvocation(String methodName, List<Expression> arguments) => new MethodInvocation.full(null, TokenFactory.token3(TokenType.PERIOD_PERIOD), identifier2(methodName), argumentList(arguments));
-  static PropertyAccess cascadedPropertyAccess(String propertyName) => new PropertyAccess.full(null, TokenFactory.token3(TokenType.PERIOD_PERIOD), identifier2(propertyName));
+  static MethodInvocation cascadedMethodInvocation(String methodName, List<Expression> arguments) => new MethodInvocation.full(null, TokenFactory.token3(TokenType.PERIOD_PERIOD), identifier3(methodName), argumentList(arguments));
+  static PropertyAccess cascadedPropertyAccess(String propertyName) => new PropertyAccess.full(null, TokenFactory.token3(TokenType.PERIOD_PERIOD), identifier3(propertyName));
   static CascadeExpression cascadeExpression(Expression target, List<Expression> cascadeSections) => new CascadeExpression.full(target, list(cascadeSections));
   static CatchClause catchClause(String exceptionParameter, List<Statement> statements) => catchClause5(null, exceptionParameter, null, statements);
   static CatchClause catchClause2(String exceptionParameter, String stackTraceParameter, List<Statement> statements) => catchClause5(null, exceptionParameter, stackTraceParameter, statements);
   static CatchClause catchClause3(TypeName exceptionType, List<Statement> statements) => catchClause5(exceptionType, null, null, statements);
   static CatchClause catchClause4(TypeName exceptionType, String exceptionParameter, List<Statement> statements) => catchClause5(exceptionType, exceptionParameter, null, statements);
-  static CatchClause catchClause5(TypeName exceptionType, String exceptionParameter, String stackTraceParameter, List<Statement> statements) => new CatchClause.full(exceptionType == null ? null : TokenFactory.token4(TokenType.IDENTIFIER, "on"), exceptionType, exceptionParameter == null ? null : TokenFactory.token(Keyword.CATCH), exceptionParameter == null ? null : TokenFactory.token3(TokenType.OPEN_PAREN), identifier2(exceptionParameter), stackTraceParameter == null ? null : TokenFactory.token3(TokenType.COMMA), stackTraceParameter == null ? null : identifier2(stackTraceParameter), exceptionParameter == null ? null : TokenFactory.token3(TokenType.CLOSE_PAREN), block(statements));
-  static ClassDeclaration classDeclaration(Keyword abstractKeyword, String name, TypeParameterList typeParameters, ExtendsClause extendsClause, WithClause withClause, ImplementsClause implementsClause, List<ClassMember> members) => new ClassDeclaration.full(null, null, abstractKeyword == null ? null : TokenFactory.token(abstractKeyword), TokenFactory.token(Keyword.CLASS), identifier2(name), typeParameters, extendsClause, withClause, implementsClause, TokenFactory.token3(TokenType.OPEN_CURLY_BRACKET), list(members), TokenFactory.token3(TokenType.CLOSE_CURLY_BRACKET));
-  static ClassTypeAlias classTypeAlias(String name, TypeParameterList typeParameters, Keyword abstractKeyword, TypeName superclass, WithClause withClause, ImplementsClause implementsClause) => new ClassTypeAlias.full(null, null, TokenFactory.token(Keyword.TYPEDEF), identifier2(name), typeParameters, TokenFactory.token3(TokenType.EQ), abstractKeyword == null ? null : TokenFactory.token(abstractKeyword), superclass, withClause, implementsClause, TokenFactory.token3(TokenType.SEMICOLON));
+  static CatchClause catchClause5(TypeName exceptionType, String exceptionParameter, String stackTraceParameter, List<Statement> statements) => new CatchClause.full(exceptionType == null ? null : TokenFactory.token4(TokenType.IDENTIFIER, "on"), exceptionType, exceptionParameter == null ? null : TokenFactory.token(Keyword.CATCH), exceptionParameter == null ? null : TokenFactory.token3(TokenType.OPEN_PAREN), identifier3(exceptionParameter), stackTraceParameter == null ? null : TokenFactory.token3(TokenType.COMMA), stackTraceParameter == null ? null : identifier3(stackTraceParameter), exceptionParameter == null ? null : TokenFactory.token3(TokenType.CLOSE_PAREN), block(statements));
+  static ClassDeclaration classDeclaration(Keyword abstractKeyword, String name, TypeParameterList typeParameters, ExtendsClause extendsClause, WithClause withClause, ImplementsClause implementsClause, List<ClassMember> members) => new ClassDeclaration.full(null, null, abstractKeyword == null ? null : TokenFactory.token(abstractKeyword), TokenFactory.token(Keyword.CLASS), identifier3(name), typeParameters, extendsClause, withClause, implementsClause, TokenFactory.token3(TokenType.OPEN_CURLY_BRACKET), list(members), TokenFactory.token3(TokenType.CLOSE_CURLY_BRACKET));
+  static ClassTypeAlias classTypeAlias(String name, TypeParameterList typeParameters, Keyword abstractKeyword, TypeName superclass, WithClause withClause, ImplementsClause implementsClause) => new ClassTypeAlias.full(null, null, TokenFactory.token(Keyword.TYPEDEF), identifier3(name), typeParameters, TokenFactory.token3(TokenType.EQ), abstractKeyword == null ? null : TokenFactory.token(abstractKeyword), superclass, withClause, implementsClause, TokenFactory.token3(TokenType.SEMICOLON));
   static CompilationUnit compilationUnit() => compilationUnit8(null, null, null);
   static CompilationUnit compilationUnit2(List<CompilationUnitMember> declarations) => compilationUnit8(null, null, list(declarations));
   static CompilationUnit compilationUnit3(List<Directive> directives) => compilationUnit8(null, list(directives), null);
@@ -210,16 +230,16 @@
   static CompilationUnit compilationUnit5(String scriptTag) => compilationUnit8(scriptTag, null, null);
   static CompilationUnit compilationUnit6(String scriptTag, List<CompilationUnitMember> declarations) => compilationUnit8(scriptTag, null, list(declarations));
   static CompilationUnit compilationUnit7(String scriptTag, List<Directive> directives) => compilationUnit8(scriptTag, list(directives), null);
-  static CompilationUnit compilationUnit8(String scriptTag4, List<Directive> directives, List<CompilationUnitMember> declarations) => new CompilationUnit.full(TokenFactory.token3(TokenType.EOF), scriptTag4 == null ? null : scriptTag(scriptTag4), directives == null ? new List<Directive>() : directives, declarations == null ? new List<CompilationUnitMember>() : declarations, TokenFactory.token3(TokenType.EOF));
+  static CompilationUnit compilationUnit8(String scriptTag2, List<Directive> directives, List<CompilationUnitMember> declarations) => new CompilationUnit.full(TokenFactory.token3(TokenType.EOF), scriptTag2 == null ? null : scriptTag(scriptTag2), directives == null ? new List<Directive>() : directives, declarations == null ? new List<CompilationUnitMember>() : declarations, TokenFactory.token3(TokenType.EOF));
   static ConditionalExpression conditionalExpression(Expression condition, Expression thenExpression, Expression elseExpression) => new ConditionalExpression.full(condition, TokenFactory.token3(TokenType.QUESTION), thenExpression, TokenFactory.token3(TokenType.COLON), elseExpression);
-  static ConstructorDeclaration constructorDeclaration(Identifier returnType, String name, FormalParameterList parameters, List<ConstructorInitializer> initializers) => new ConstructorDeclaration.full(null, null, TokenFactory.token(Keyword.EXTERNAL), null, null, returnType, name == null ? null : TokenFactory.token3(TokenType.PERIOD), name == null ? null : identifier2(name), parameters, initializers == null || initializers.isEmpty ? null : TokenFactory.token3(TokenType.PERIOD), initializers == null ? new List<ConstructorInitializer>() : initializers, null, emptyFunctionBody());
-  static ConstructorDeclaration constructorDeclaration2(Keyword constKeyword, Keyword factoryKeyword, Identifier returnType, String name, FormalParameterList parameters, List<ConstructorInitializer> initializers, FunctionBody body) => new ConstructorDeclaration.full(null, null, null, constKeyword == null ? null : TokenFactory.token(constKeyword), factoryKeyword == null ? null : TokenFactory.token(factoryKeyword), returnType, name == null ? null : TokenFactory.token3(TokenType.PERIOD), name == null ? null : identifier2(name), parameters, initializers == null || initializers.isEmpty ? null : TokenFactory.token3(TokenType.PERIOD), initializers == null ? new List<ConstructorInitializer>() : initializers, null, body);
-  static ConstructorFieldInitializer constructorFieldInitializer(bool prefixedWithThis, String fieldName, Expression expression) => new ConstructorFieldInitializer.full(prefixedWithThis ? TokenFactory.token(Keyword.THIS) : null, prefixedWithThis ? TokenFactory.token3(TokenType.PERIOD) : null, identifier2(fieldName), TokenFactory.token3(TokenType.EQ), expression);
-  static ConstructorName constructorName(TypeName type, String name) => new ConstructorName.full(type, name == null ? null : TokenFactory.token3(TokenType.PERIOD), name == null ? null : identifier2(name));
+  static ConstructorDeclaration constructorDeclaration(Identifier returnType, String name, FormalParameterList parameters, List<ConstructorInitializer> initializers) => new ConstructorDeclaration.full(null, null, TokenFactory.token(Keyword.EXTERNAL), null, null, returnType, name == null ? null : TokenFactory.token3(TokenType.PERIOD), name == null ? null : identifier3(name), parameters, initializers == null || initializers.isEmpty ? null : TokenFactory.token3(TokenType.PERIOD), initializers == null ? new List<ConstructorInitializer>() : initializers, null, emptyFunctionBody());
+  static ConstructorDeclaration constructorDeclaration2(Keyword constKeyword, Keyword factoryKeyword, Identifier returnType, String name, FormalParameterList parameters, List<ConstructorInitializer> initializers, FunctionBody body) => new ConstructorDeclaration.full(null, null, null, constKeyword == null ? null : TokenFactory.token(constKeyword), factoryKeyword == null ? null : TokenFactory.token(factoryKeyword), returnType, name == null ? null : TokenFactory.token3(TokenType.PERIOD), name == null ? null : identifier3(name), parameters, initializers == null || initializers.isEmpty ? null : TokenFactory.token3(TokenType.PERIOD), initializers == null ? new List<ConstructorInitializer>() : initializers, null, body);
+  static ConstructorFieldInitializer constructorFieldInitializer(bool prefixedWithThis, String fieldName, Expression expression) => new ConstructorFieldInitializer.full(prefixedWithThis ? TokenFactory.token(Keyword.THIS) : null, prefixedWithThis ? TokenFactory.token3(TokenType.PERIOD) : null, identifier3(fieldName), TokenFactory.token3(TokenType.EQ), expression);
+  static ConstructorName constructorName(TypeName type, String name) => new ConstructorName.full(type, name == null ? null : TokenFactory.token3(TokenType.PERIOD), name == null ? null : identifier3(name));
   static ContinueStatement continueStatement() => new ContinueStatement.full(TokenFactory.token(Keyword.CONTINUE), null, TokenFactory.token3(TokenType.SEMICOLON));
-  static ContinueStatement continueStatement2(String label) => new ContinueStatement.full(TokenFactory.token(Keyword.CONTINUE), identifier2(label), TokenFactory.token3(TokenType.SEMICOLON));
+  static ContinueStatement continueStatement2(String label) => new ContinueStatement.full(TokenFactory.token(Keyword.CONTINUE), identifier3(label), TokenFactory.token3(TokenType.SEMICOLON));
   static DeclaredIdentifier declaredIdentifier(Keyword keyword, String identifier) => declaredIdentifier2(keyword, null, identifier);
-  static DeclaredIdentifier declaredIdentifier2(Keyword keyword, TypeName type, String identifier) => new DeclaredIdentifier.full(null, null, keyword == null ? null : TokenFactory.token(keyword), type, identifier2(identifier));
+  static DeclaredIdentifier declaredIdentifier2(Keyword keyword, TypeName type, String identifier) => new DeclaredIdentifier.full(null, null, keyword == null ? null : TokenFactory.token(keyword), type, identifier3(identifier));
   static DeclaredIdentifier declaredIdentifier3(String identifier) => declaredIdentifier2(null, null, identifier);
   static DeclaredIdentifier declaredIdentifier4(TypeName type, String identifier) => declaredIdentifier2(null, type, identifier);
   static DoStatement doStatement(Statement body, Expression condition) => new DoStatement.full(TokenFactory.token(Keyword.DO), body, TokenFactory.token(Keyword.WHILE), TokenFactory.token3(TokenType.OPEN_PAREN), condition, TokenFactory.token3(TokenType.CLOSE_PAREN), TokenFactory.token3(TokenType.SEMICOLON));
@@ -233,44 +253,46 @@
   static ExtendsClause extendsClause(TypeName type) => new ExtendsClause.full(TokenFactory.token(Keyword.EXTENDS), type);
   static FieldDeclaration fieldDeclaration(bool isStatic, Keyword keyword, TypeName type, List<VariableDeclaration> variables) => new FieldDeclaration.full(null, null, isStatic ? TokenFactory.token(Keyword.STATIC) : null, variableDeclarationList(keyword, type, variables), TokenFactory.token3(TokenType.SEMICOLON));
   static FieldDeclaration fieldDeclaration2(bool isStatic, Keyword keyword, List<VariableDeclaration> variables) => fieldDeclaration(isStatic, keyword, null, variables);
-  static FieldFormalParameter fieldFormalParameter(Keyword keyword, TypeName type, String identifier) => new FieldFormalParameter.full(null, null, keyword == null ? null : TokenFactory.token(keyword), type, TokenFactory.token(Keyword.THIS), TokenFactory.token3(TokenType.PERIOD), identifier2(identifier));
+  static FieldFormalParameter fieldFormalParameter(Keyword keyword, TypeName type, String identifier) => new FieldFormalParameter.full(null, null, keyword == null ? null : TokenFactory.token(keyword), type, TokenFactory.token(Keyword.THIS), TokenFactory.token3(TokenType.PERIOD), identifier3(identifier));
+  static FieldFormalParameter fieldFormalParameter2(String identifier) => fieldFormalParameter(null, null, identifier);
   static ForEachStatement forEachStatement(DeclaredIdentifier loopVariable, Expression iterator, Statement body) => new ForEachStatement.full(TokenFactory.token(Keyword.FOR), TokenFactory.token3(TokenType.OPEN_PAREN), loopVariable, TokenFactory.token(Keyword.IN), iterator, TokenFactory.token3(TokenType.CLOSE_PAREN), body);
   static FormalParameterList formalParameterList(List<FormalParameter> parameters) => new FormalParameterList.full(TokenFactory.token3(TokenType.OPEN_PAREN), list(parameters), null, null, TokenFactory.token3(TokenType.CLOSE_PAREN));
   static ForStatement forStatement(Expression initialization, Expression condition, List<Expression> updaters, Statement body) => new ForStatement.full(TokenFactory.token(Keyword.FOR), TokenFactory.token3(TokenType.OPEN_PAREN), null, initialization, TokenFactory.token3(TokenType.SEMICOLON), condition, TokenFactory.token3(TokenType.SEMICOLON), updaters, TokenFactory.token3(TokenType.CLOSE_PAREN), body);
   static ForStatement forStatement2(VariableDeclarationList variableList, Expression condition, List<Expression> updaters, Statement body) => new ForStatement.full(TokenFactory.token(Keyword.FOR), TokenFactory.token3(TokenType.OPEN_PAREN), variableList, null, TokenFactory.token3(TokenType.SEMICOLON), condition, TokenFactory.token3(TokenType.SEMICOLON), updaters, TokenFactory.token3(TokenType.CLOSE_PAREN), body);
-  static FunctionDeclaration functionDeclaration(TypeName type, Keyword keyword, String name, FunctionExpression functionExpression) => new FunctionDeclaration.full(null, null, null, type, keyword == null ? null : TokenFactory.token(keyword), identifier2(name), functionExpression);
+  static FunctionDeclaration functionDeclaration(TypeName type, Keyword keyword, String name, FunctionExpression functionExpression) => new FunctionDeclaration.full(null, null, null, type, keyword == null ? null : TokenFactory.token(keyword), identifier3(name), functionExpression);
   static FunctionDeclarationStatement functionDeclarationStatement(TypeName type, Keyword keyword, String name, FunctionExpression functionExpression) => new FunctionDeclarationStatement.full(functionDeclaration(type, keyword, name, functionExpression));
   static FunctionExpression functionExpression() => new FunctionExpression.full(formalParameterList([]), blockFunctionBody([]));
   static FunctionExpression functionExpression2(FormalParameterList parameters, FunctionBody body) => new FunctionExpression.full(parameters, body);
   static FunctionExpressionInvocation functionExpressionInvocation(Expression function, List<Expression> arguments) => new FunctionExpressionInvocation.full(function, argumentList(arguments));
-  static FunctionTypedFormalParameter functionTypedFormalParameter(TypeName returnType, String identifier, List<FormalParameter> parameters) => new FunctionTypedFormalParameter.full(null, null, returnType, identifier2(identifier), formalParameterList(parameters));
+  static FunctionTypedFormalParameter functionTypedFormalParameter(TypeName returnType, String identifier, List<FormalParameter> parameters) => new FunctionTypedFormalParameter.full(null, null, returnType, identifier3(identifier), formalParameterList(parameters));
   static HideCombinator hideCombinator(List<SimpleIdentifier> identifiers) => new HideCombinator.full(TokenFactory.token2("hide"), list(identifiers));
   static HideCombinator hideCombinator2(List<String> identifiers) {
     List<SimpleIdentifier> identifierList = new List<SimpleIdentifier>();
     for (String identifier in identifiers) {
-      identifierList.add(identifier2(identifier));
+      identifierList.add(identifier3(identifier));
     }
     return new HideCombinator.full(TokenFactory.token2("hide"), identifierList);
   }
-  static PrefixedIdentifier identifier(SimpleIdentifier prefix, SimpleIdentifier identifier10) => new PrefixedIdentifier.full(prefix, TokenFactory.token3(TokenType.PERIOD), identifier10);
-  static SimpleIdentifier identifier2(String lexeme) => new SimpleIdentifier.full(TokenFactory.token4(TokenType.IDENTIFIER, lexeme));
-  static PrefixedIdentifier identifier3(String prefix, SimpleIdentifier identifier) => new PrefixedIdentifier.full(identifier2(prefix), TokenFactory.token3(TokenType.PERIOD), identifier);
-  static PrefixedIdentifier identifier4(String prefix, String identifier) => new PrefixedIdentifier.full(identifier2(prefix), TokenFactory.token3(TokenType.PERIOD), identifier2(identifier));
+  static PrefixedIdentifier identifier(SimpleIdentifier prefix, SimpleIdentifier identifier2) => new PrefixedIdentifier.full(prefix, TokenFactory.token3(TokenType.PERIOD), identifier2);
+  static SimpleIdentifier identifier3(String lexeme) => new SimpleIdentifier.full(TokenFactory.token4(TokenType.IDENTIFIER, lexeme));
+  static PrefixedIdentifier identifier4(String prefix, SimpleIdentifier identifier) => new PrefixedIdentifier.full(identifier3(prefix), TokenFactory.token3(TokenType.PERIOD), identifier);
+  static PrefixedIdentifier identifier5(String prefix, String identifier) => new PrefixedIdentifier.full(identifier3(prefix), TokenFactory.token3(TokenType.PERIOD), identifier3(identifier));
   static IfStatement ifStatement(Expression condition, Statement thenStatement) => ifStatement2(condition, thenStatement, null);
   static IfStatement ifStatement2(Expression condition, Statement thenStatement, Statement elseStatement) => new IfStatement.full(TokenFactory.token(Keyword.IF), TokenFactory.token3(TokenType.OPEN_PAREN), condition, TokenFactory.token3(TokenType.CLOSE_PAREN), thenStatement, elseStatement == null ? null : TokenFactory.token(Keyword.ELSE), elseStatement);
   static ImplementsClause implementsClause(List<TypeName> types) => new ImplementsClause.full(TokenFactory.token(Keyword.IMPLEMENTS), list(types));
-  static ImportDirective importDirective(List<Annotation> metadata, String uri, String prefix, List<Combinator> combinators) => new ImportDirective.full(null, metadata, TokenFactory.token(Keyword.IMPORT), string2(uri), prefix == null ? null : TokenFactory.token(Keyword.AS), prefix == null ? null : identifier2(prefix), list(combinators), TokenFactory.token3(TokenType.SEMICOLON));
+  static ImportDirective importDirective(List<Annotation> metadata, String uri, String prefix, List<Combinator> combinators) => new ImportDirective.full(null, metadata, TokenFactory.token(Keyword.IMPORT), string2(uri), prefix == null ? null : TokenFactory.token(Keyword.AS), prefix == null ? null : identifier3(prefix), list(combinators), TokenFactory.token3(TokenType.SEMICOLON));
   static ImportDirective importDirective2(String uri, String prefix, List<Combinator> combinators) => importDirective(new List<Annotation>(), uri, prefix, combinators);
   static IndexExpression indexExpression(Expression array, Expression index) => new IndexExpression.forTarget_full(array, TokenFactory.token3(TokenType.OPEN_SQUARE_BRACKET), index, TokenFactory.token3(TokenType.CLOSE_SQUARE_BRACKET));
   static InstanceCreationExpression instanceCreationExpression(Keyword keyword, ConstructorName name, List<Expression> arguments) => new InstanceCreationExpression.full(keyword == null ? null : TokenFactory.token(keyword), name, argumentList(arguments));
   static InstanceCreationExpression instanceCreationExpression2(Keyword keyword, TypeName type, List<Expression> arguments) => instanceCreationExpression3(keyword, type, null, arguments);
-  static InstanceCreationExpression instanceCreationExpression3(Keyword keyword, TypeName type, String identifier, List<Expression> arguments) => instanceCreationExpression(keyword, new ConstructorName.full(type, identifier == null ? null : TokenFactory.token3(TokenType.PERIOD), identifier == null ? null : identifier2(identifier)), arguments);
+  static InstanceCreationExpression instanceCreationExpression3(Keyword keyword, TypeName type, String identifier, List<Expression> arguments) => instanceCreationExpression(keyword, new ConstructorName.full(type, identifier == null ? null : TokenFactory.token3(TokenType.PERIOD), identifier == null ? null : identifier3(identifier)), arguments);
   static IntegerLiteral integer(int value) => new IntegerLiteral.full(TokenFactory.token4(TokenType.INT, value.toString()), value);
   static InterpolationExpression interpolationExpression(Expression expression) => new InterpolationExpression.full(TokenFactory.token3(TokenType.STRING_INTERPOLATION_EXPRESSION), expression, TokenFactory.token3(TokenType.CLOSE_CURLY_BRACKET));
-  static InterpolationExpression interpolationExpression2(String identifier) => new InterpolationExpression.full(TokenFactory.token3(TokenType.STRING_INTERPOLATION_IDENTIFIER), identifier2(identifier), null);
+  static InterpolationExpression interpolationExpression2(String identifier) => new InterpolationExpression.full(TokenFactory.token3(TokenType.STRING_INTERPOLATION_IDENTIFIER), identifier3(identifier), null);
   static InterpolationString interpolationString(String contents, String value) => new InterpolationString.full(TokenFactory.token2(contents), value);
   static IsExpression isExpression(Expression expression, bool negated, TypeName type) => new IsExpression.full(expression, TokenFactory.token(Keyword.IS), negated ? TokenFactory.token3(TokenType.BANG) : null, type);
-  static Label label(String label5) => new Label.full(identifier2(label5), TokenFactory.token3(TokenType.COLON));
+  static Label label(SimpleIdentifier label2) => new Label.full(label2, TokenFactory.token3(TokenType.COLON));
+  static Label label2(String label22) => label(identifier3(label22));
   static LabeledStatement labeledStatement(List<Label> labels, Statement statement) => new LabeledStatement.full(labels, statement);
   static LibraryDirective libraryDirective(List<Annotation> metadata, LibraryIdentifier libraryName) => new LibraryDirective.full(null, metadata, TokenFactory.token(Keyword.LIBRARY), libraryName, TokenFactory.token3(TokenType.SEMICOLON));
   static LibraryDirective libraryDirective2(String libraryName) => libraryDirective(new List<Annotation>(), libraryIdentifier2([libraryName]));
@@ -278,12 +300,12 @@
   static LibraryIdentifier libraryIdentifier2(List<String> components) {
     List<SimpleIdentifier> componentList = new List<SimpleIdentifier>();
     for (String component in components) {
-      componentList.add(identifier2(component));
+      componentList.add(identifier3(component));
     }
     return new LibraryIdentifier.full(componentList);
   }
-  static List<Object> list(List<Object> elements) {
-    List<Object> elementList = new List();
+  static List list(List<Object> elements) {
+    List elementList = new List();
     for (Object element in elements) {
       elementList.add(element);
     }
@@ -296,10 +318,12 @@
   static MapLiteralEntry mapLiteralEntry(String key, Expression value) => new MapLiteralEntry.full(string2(key), TokenFactory.token3(TokenType.COLON), value);
   static MethodDeclaration methodDeclaration(Keyword modifier, TypeName returnType, Keyword property, Keyword operator, SimpleIdentifier name, FormalParameterList parameters) => new MethodDeclaration.full(null, null, TokenFactory.token(Keyword.EXTERNAL), modifier == null ? null : TokenFactory.token(modifier), returnType, property == null ? null : TokenFactory.token(property), operator == null ? null : TokenFactory.token(operator), name, parameters, emptyFunctionBody());
   static MethodDeclaration methodDeclaration2(Keyword modifier, TypeName returnType, Keyword property, Keyword operator, SimpleIdentifier name, FormalParameterList parameters, FunctionBody body) => new MethodDeclaration.full(null, null, null, modifier == null ? null : TokenFactory.token(modifier), returnType, property == null ? null : TokenFactory.token(property), operator == null ? null : TokenFactory.token(operator), name, parameters, body);
-  static MethodInvocation methodInvocation(Expression target, String methodName, List<Expression> arguments) => new MethodInvocation.full(target, target == null ? null : TokenFactory.token3(TokenType.PERIOD), identifier2(methodName), argumentList(arguments));
+  static MethodInvocation methodInvocation(Expression target, String methodName, List<Expression> arguments) => new MethodInvocation.full(target, target == null ? null : TokenFactory.token3(TokenType.PERIOD), identifier3(methodName), argumentList(arguments));
   static MethodInvocation methodInvocation2(String methodName, List<Expression> arguments) => methodInvocation(null, methodName, arguments);
-  static NamedExpression namedExpression(String label6, Expression expression) => new NamedExpression.full(label(label6), expression);
+  static NamedExpression namedExpression(Label label, Expression expression) => new NamedExpression.full(label, expression);
+  static NamedExpression namedExpression2(String label, Expression expression) => namedExpression(label2(label), expression);
   static DefaultFormalParameter namedFormalParameter(NormalFormalParameter parameter, Expression expression) => new DefaultFormalParameter.full(parameter, ParameterKind.NAMED, expression == null ? null : TokenFactory.token3(TokenType.COLON), expression);
+  static NativeFunctionBody nativeFunctionBody(String nativeMethodName) => new NativeFunctionBody.full(TokenFactory.token2("native"), string2(nativeMethodName), TokenFactory.token3(TokenType.SEMICOLON));
   static NullLiteral nullLiteral() => new NullLiteral.full(TokenFactory.token(Keyword.NULL));
   static ParenthesizedExpression parenthesizedExpression(Expression expression) => new ParenthesizedExpression.full(TokenFactory.token3(TokenType.OPEN_PAREN), expression, TokenFactory.token3(TokenType.CLOSE_PAREN));
   static PartDirective partDirective(List<Annotation> metadata, String url) => new PartDirective.full(null, metadata, TokenFactory.token(Keyword.PART), string2(url), TokenFactory.token3(TokenType.SEMICOLON));
@@ -310,28 +334,28 @@
   static PostfixExpression postfixExpression(Expression expression, TokenType operator) => new PostfixExpression.full(expression, TokenFactory.token3(operator));
   static PrefixExpression prefixExpression(TokenType operator, Expression expression) => new PrefixExpression.full(TokenFactory.token3(operator), expression);
   static PropertyAccess propertyAccess(Expression target, SimpleIdentifier propertyName) => new PropertyAccess.full(target, TokenFactory.token3(TokenType.PERIOD), propertyName);
-  static PropertyAccess propertyAccess2(Expression target, String propertyName) => new PropertyAccess.full(target, TokenFactory.token3(TokenType.PERIOD), identifier2(propertyName));
+  static PropertyAccess propertyAccess2(Expression target, String propertyName) => new PropertyAccess.full(target, TokenFactory.token3(TokenType.PERIOD), identifier3(propertyName));
   static RedirectingConstructorInvocation redirectingConstructorInvocation(List<Expression> arguments) => redirectingConstructorInvocation2(null, arguments);
-  static RedirectingConstructorInvocation redirectingConstructorInvocation2(String constructorName, List<Expression> arguments) => new RedirectingConstructorInvocation.full(TokenFactory.token(Keyword.THIS), constructorName == null ? null : TokenFactory.token3(TokenType.PERIOD), constructorName == null ? null : identifier2(constructorName), argumentList(arguments));
+  static RedirectingConstructorInvocation redirectingConstructorInvocation2(String constructorName, List<Expression> arguments) => new RedirectingConstructorInvocation.full(TokenFactory.token(Keyword.THIS), constructorName == null ? null : TokenFactory.token3(TokenType.PERIOD), constructorName == null ? null : identifier3(constructorName), argumentList(arguments));
   static ReturnStatement returnStatement() => returnStatement2(null);
   static ReturnStatement returnStatement2(Expression expression) => new ReturnStatement.full(TokenFactory.token(Keyword.RETURN), expression, TokenFactory.token3(TokenType.SEMICOLON));
-  static ScriptTag scriptTag(String scriptTag5) => new ScriptTag.full(TokenFactory.token2(scriptTag5));
+  static ScriptTag scriptTag(String scriptTag2) => new ScriptTag.full(TokenFactory.token2(scriptTag2));
   static ShowCombinator showCombinator(List<SimpleIdentifier> identifiers) => new ShowCombinator.full(TokenFactory.token2("show"), list(identifiers));
   static ShowCombinator showCombinator2(List<String> identifiers) {
     List<SimpleIdentifier> identifierList = new List<SimpleIdentifier>();
     for (String identifier in identifiers) {
-      identifierList.add(identifier2(identifier));
+      identifierList.add(identifier3(identifier));
     }
     return new ShowCombinator.full(TokenFactory.token2("show"), identifierList);
   }
   static SimpleFormalParameter simpleFormalParameter(Keyword keyword, String parameterName) => simpleFormalParameter2(keyword, null, parameterName);
-  static SimpleFormalParameter simpleFormalParameter2(Keyword keyword, TypeName type, String parameterName) => new SimpleFormalParameter.full(null, null, keyword == null ? null : TokenFactory.token(keyword), type, identifier2(parameterName));
+  static SimpleFormalParameter simpleFormalParameter2(Keyword keyword, TypeName type, String parameterName) => new SimpleFormalParameter.full(null, null, keyword == null ? null : TokenFactory.token(keyword), type, identifier3(parameterName));
   static SimpleFormalParameter simpleFormalParameter3(String parameterName) => simpleFormalParameter2(null, null, parameterName);
   static SimpleFormalParameter simpleFormalParameter4(TypeName type, String parameterName) => simpleFormalParameter2(null, type, parameterName);
   static StringInterpolation string(List<InterpolationElement> elements) => new StringInterpolation.full(list(elements));
   static SimpleStringLiteral string2(String content) => new SimpleStringLiteral.full(TokenFactory.token2("'${content}'"), content);
   static SuperConstructorInvocation superConstructorInvocation(List<Expression> arguments) => superConstructorInvocation2(null, arguments);
-  static SuperConstructorInvocation superConstructorInvocation2(String name, List<Expression> arguments) => new SuperConstructorInvocation.full(TokenFactory.token(Keyword.SUPER), name == null ? null : TokenFactory.token3(TokenType.PERIOD), name == null ? null : identifier2(name), argumentList(arguments));
+  static SuperConstructorInvocation superConstructorInvocation2(String name, List<Expression> arguments) => new SuperConstructorInvocation.full(TokenFactory.token(Keyword.SUPER), name == null ? null : TokenFactory.token3(TokenType.PERIOD), name == null ? null : identifier3(name), argumentList(arguments));
   static SuperExpression superExpression() => new SuperExpression.full(TokenFactory.token(Keyword.SUPER));
   static SwitchCase switchCase(Expression expression, List<Statement> statements) => switchCase2(new List<Label>(), expression, statements);
   static SwitchCase switchCase2(List<Label> labels, Expression expression, List<Statement> statements) => new SwitchCase.full(labels, TokenFactory.token(Keyword.CASE), expression, TokenFactory.token3(TokenType.COLON), list(statements));
@@ -346,7 +370,7 @@
   static TryStatement tryStatement(Block body, Block finallyClause) => tryStatement3(body, new List<CatchClause>(), finallyClause);
   static TryStatement tryStatement2(Block body, List<CatchClause> catchClauses) => tryStatement3(body, list(catchClauses), null);
   static TryStatement tryStatement3(Block body, List<CatchClause> catchClauses, Block finallyClause) => new TryStatement.full(TokenFactory.token(Keyword.TRY), body, catchClauses, finallyClause == null ? null : TokenFactory.token(Keyword.FINALLY), finallyClause);
-  static FunctionTypeAlias typeAlias(TypeName returnType, String name, TypeParameterList typeParameters, FormalParameterList parameters) => new FunctionTypeAlias.full(null, null, TokenFactory.token(Keyword.TYPEDEF), returnType, identifier2(name), typeParameters, parameters, TokenFactory.token3(TokenType.SEMICOLON));
+  static FunctionTypeAlias typeAlias(TypeName returnType, String name, TypeParameterList typeParameters, FormalParameterList parameters) => new FunctionTypeAlias.full(null, null, TokenFactory.token(Keyword.TYPEDEF), returnType, identifier3(name), typeParameters, parameters, TokenFactory.token3(TokenType.SEMICOLON));
   static TypeArgumentList typeArgumentList(List<TypeName> typeNames) => new TypeArgumentList.full(TokenFactory.token3(TokenType.LT), list(typeNames), TokenFactory.token3(TokenType.GT));
   /**
    * Create a type name whose name has been resolved to the given element and whose type has been
@@ -356,27 +380,27 @@
    * @param element the element defining the type represented by the type name
    * @return the type name that was created
    */
-  static TypeName typeName(ClassElement element61, List<TypeName> arguments) {
-    SimpleIdentifier name22 = identifier2(element61.name);
-    name22.element = element61;
-    TypeName typeName = typeName2(name22, arguments);
-    typeName.type = element61.type;
+  static TypeName typeName(ClassElement element2, List<TypeName> arguments) {
+    SimpleIdentifier name2 = identifier3(element2.name);
+    name2.element = element2;
+    TypeName typeName = typeName3(name2, arguments);
+    typeName.type = element2.type;
     return typeName;
   }
-  static TypeName typeName2(Identifier name, List<TypeName> arguments) {
+  static TypeName typeName3(Identifier name, List<TypeName> arguments) {
     if (arguments.length == 0) {
       return new TypeName.full(name, null);
     }
     return new TypeName.full(name, typeArgumentList(arguments));
   }
-  static TypeName typeName3(String name, List<TypeName> arguments) {
+  static TypeName typeName4(String name, List<TypeName> arguments) {
     if (arguments.length == 0) {
-      return new TypeName.full(identifier2(name), null);
+      return new TypeName.full(identifier3(name), null);
     }
-    return new TypeName.full(identifier2(name), typeArgumentList(arguments));
+    return new TypeName.full(identifier3(name), typeArgumentList(arguments));
   }
-  static TypeParameter typeParameter(String name) => new TypeParameter.full(null, null, identifier2(name), null, null);
-  static TypeParameter typeParameter2(String name, TypeName bound) => new TypeParameter.full(null, null, identifier2(name), TokenFactory.token(Keyword.EXTENDS), bound);
+  static TypeParameter typeParameter(String name) => new TypeParameter.full(null, null, identifier3(name), null, null);
+  static TypeParameter typeParameter2(String name, TypeName bound) => new TypeParameter.full(null, null, identifier3(name), TokenFactory.token(Keyword.EXTENDS), bound);
   static TypeParameterList typeParameterList(List<String> typeNames) {
     List<TypeParameter> typeParameters = new List<TypeParameter>();
     for (String typeName in typeNames) {
@@ -384,8 +408,8 @@
     }
     return new TypeParameterList.full(TokenFactory.token3(TokenType.LT), typeParameters, TokenFactory.token3(TokenType.GT));
   }
-  static VariableDeclaration variableDeclaration(String name) => new VariableDeclaration.full(null, null, identifier2(name), null, null);
-  static VariableDeclaration variableDeclaration2(String name, Expression initializer) => new VariableDeclaration.full(null, null, identifier2(name), TokenFactory.token3(TokenType.EQ), initializer);
+  static VariableDeclaration variableDeclaration(String name) => new VariableDeclaration.full(null, null, identifier3(name), null, null);
+  static VariableDeclaration variableDeclaration2(String name, Expression initializer) => new VariableDeclaration.full(null, null, identifier3(name), TokenFactory.token3(TokenType.EQ), initializer);
   static VariableDeclarationList variableDeclarationList(Keyword keyword, TypeName type, List<VariableDeclaration> variables) => new VariableDeclarationList.full(null, null, keyword == null ? null : TokenFactory.token(keyword), type, list(variables));
   static VariableDeclarationList variableDeclarationList2(Keyword keyword, List<VariableDeclaration> variables) => variableDeclarationList(keyword, null, variables);
   static VariableDeclarationStatement variableDeclarationStatement(Keyword keyword, TypeName type, List<VariableDeclaration> variables) => new VariableDeclarationStatement.full(variableDeclarationList(keyword, type, variables), TokenFactory.token3(TokenType.SEMICOLON));
@@ -400,8 +424,8 @@
 }
 class SimpleIdentifierTest extends ParserTestCase {
   void test_inDeclarationContext_argumentDefinition() {
-    SimpleIdentifier identifier15 = ASTFactory.argumentDefinitionTest("p").identifier;
-    JUnitTestCase.assertFalse(identifier15.inDeclarationContext());
+    SimpleIdentifier identifier2 = ASTFactory.argumentDefinitionTest("p").identifier;
+    JUnitTestCase.assertFalse(identifier2.inDeclarationContext());
   }
   void test_inDeclarationContext_catch_exception() {
     SimpleIdentifier identifier = ASTFactory.catchClause("e", []).exceptionParameter;
@@ -420,9 +444,13 @@
     JUnitTestCase.assertTrue(identifier.inDeclarationContext());
   }
   void test_inDeclarationContext_constructorDeclaration() {
-    SimpleIdentifier identifier = ASTFactory.constructorDeclaration(ASTFactory.identifier2("C"), "c", null, null).name;
+    SimpleIdentifier identifier = ASTFactory.constructorDeclaration(ASTFactory.identifier3("C"), "c", null, null).name;
     JUnitTestCase.assertTrue(identifier.inDeclarationContext());
   }
+  void test_inDeclarationContext_fieldFormalParameter() {
+    SimpleIdentifier identifier2 = ASTFactory.fieldFormalParameter2("p").identifier;
+    JUnitTestCase.assertFalse(identifier2.inDeclarationContext());
+  }
   void test_inDeclarationContext_functionDeclaration() {
     SimpleIdentifier identifier = ASTFactory.functionDeclaration(null, null, "f", null).name;
     JUnitTestCase.assertTrue(identifier.inDeclarationContext());
@@ -432,26 +460,26 @@
     JUnitTestCase.assertTrue(identifier.inDeclarationContext());
   }
   void test_inDeclarationContext_label_false() {
-    SimpleIdentifier identifier = ASTFactory.namedExpression("l", ASTFactory.integer(0)).name.label;
+    SimpleIdentifier identifier = ASTFactory.namedExpression2("l", ASTFactory.integer(0)).name.label;
     JUnitTestCase.assertFalse(identifier.inDeclarationContext());
   }
   void test_inDeclarationContext_label_true() {
-    Label label2 = ASTFactory.label("l");
-    SimpleIdentifier identifier = label2.label;
-    ASTFactory.labeledStatement(ASTFactory.list([label2]), ASTFactory.emptyStatement());
+    Label label = ASTFactory.label2("l");
+    SimpleIdentifier identifier = label.label;
+    ASTFactory.labeledStatement(ASTFactory.list([label]), ASTFactory.emptyStatement());
     JUnitTestCase.assertTrue(identifier.inDeclarationContext());
   }
   void test_inDeclarationContext_methodDeclaration() {
-    SimpleIdentifier identifier = ASTFactory.identifier2("m");
+    SimpleIdentifier identifier = ASTFactory.identifier3("m");
     ASTFactory.methodDeclaration2(null, null, null, null, identifier, null, null);
     JUnitTestCase.assertTrue(identifier.inDeclarationContext());
   }
-  void test_inDeclarationContext_normalFormalParameter() {
-    SimpleIdentifier identifier16 = ASTFactory.simpleFormalParameter3("p").identifier;
-    JUnitTestCase.assertTrue(identifier16.inDeclarationContext());
+  void test_inDeclarationContext_simpleFormalParameter() {
+    SimpleIdentifier identifier2 = ASTFactory.simpleFormalParameter3("p").identifier;
+    JUnitTestCase.assertTrue(identifier2.inDeclarationContext());
   }
   void test_inDeclarationContext_typeParameter_bound() {
-    TypeName bound = ASTFactory.typeName3("A", []);
+    TypeName bound = ASTFactory.typeName4("A", []);
     SimpleIdentifier identifier = bound.name as SimpleIdentifier;
     ASTFactory.typeParameter2("E", bound);
     JUnitTestCase.assertFalse(identifier.inDeclarationContext());
@@ -480,6 +508,12 @@
       }
     }
   }
+  void test_inReferenceContext() {
+    SimpleIdentifier identifier = ASTFactory.identifier3("id");
+    ASTFactory.namedExpression(ASTFactory.label(identifier), ASTFactory.identifier3("_"));
+    JUnitTestCase.assertFalse(identifier.inGetterContext());
+    JUnitTestCase.assertFalse(identifier.inSetterContext());
+  }
   void test_inSetterContext() {
     for (WrapperKind wrapper in WrapperKind.values) {
       for (AssignmentKind assignment in AssignmentKind.values) {
@@ -497,27 +531,27 @@
     }
   }
   SimpleIdentifier createIdentifier(WrapperKind wrapper, AssignmentKind assignment) {
-    SimpleIdentifier identifier = ASTFactory.identifier2("a");
+    SimpleIdentifier identifier = ASTFactory.identifier3("a");
     Expression expression = identifier;
     while (true) {
       if (wrapper == WrapperKind.PREFIXED_LEFT) {
-        expression = ASTFactory.identifier(identifier, ASTFactory.identifier2("_"));
+        expression = ASTFactory.identifier(identifier, ASTFactory.identifier3("_"));
       } else if (wrapper == WrapperKind.PREFIXED_RIGHT) {
-        expression = ASTFactory.identifier(ASTFactory.identifier2("_"), identifier);
+        expression = ASTFactory.identifier(ASTFactory.identifier3("_"), identifier);
       } else if (wrapper == WrapperKind.PROPERTY_LEFT) {
         expression = ASTFactory.propertyAccess2(expression, "_");
       } else if (wrapper == WrapperKind.PROPERTY_RIGHT) {
-        expression = ASTFactory.propertyAccess(ASTFactory.identifier2("_"), identifier);
+        expression = ASTFactory.propertyAccess(ASTFactory.identifier3("_"), identifier);
       }
       break;
     }
     while (true) {
       if (assignment == AssignmentKind.BINARY) {
-        ASTFactory.binaryExpression(expression, TokenType.PLUS, ASTFactory.identifier2("_"));
+        ASTFactory.binaryExpression(expression, TokenType.PLUS, ASTFactory.identifier3("_"));
       } else if (assignment == AssignmentKind.COMPOUND_LEFT) {
-        ASTFactory.assignmentExpression(expression, TokenType.PLUS_EQ, ASTFactory.identifier2("_"));
+        ASTFactory.assignmentExpression(expression, TokenType.PLUS_EQ, ASTFactory.identifier3("_"));
       } else if (assignment == AssignmentKind.COMPOUND_RIGHT) {
-        ASTFactory.assignmentExpression(ASTFactory.identifier2("_"), TokenType.PLUS_EQ, expression);
+        ASTFactory.assignmentExpression(ASTFactory.identifier3("_"), TokenType.PLUS_EQ, expression);
       } else if (assignment == AssignmentKind.POSTFIX_INC) {
         ASTFactory.postfixExpression(expression, TokenType.PLUS_PLUS);
       } else if (assignment == AssignmentKind.PREFIX_DEC) {
@@ -527,9 +561,9 @@
       } else if (assignment == AssignmentKind.PREFIX_NOT) {
         ASTFactory.prefixExpression(TokenType.BANG, expression);
       } else if (assignment == AssignmentKind.SIMPLE_LEFT) {
-        ASTFactory.assignmentExpression(expression, TokenType.EQ, ASTFactory.identifier2("_"));
+        ASTFactory.assignmentExpression(expression, TokenType.EQ, ASTFactory.identifier3("_"));
       } else if (assignment == AssignmentKind.SIMPLE_RIGHT) {
-        ASTFactory.assignmentExpression(ASTFactory.identifier2("_"), TokenType.EQ, expression);
+        ASTFactory.assignmentExpression(ASTFactory.identifier3("_"), TokenType.EQ, expression);
       }
       break;
     }
@@ -542,10 +576,10 @@
    */
   ASTNode topMostNode(SimpleIdentifier identifier) {
     ASTNode child = identifier;
-    ASTNode parent20 = identifier.parent;
-    while (parent20 != null) {
-      child = parent20;
-      parent20 = parent20.parent;
+    ASTNode parent2 = identifier.parent;
+    while (parent2 != null) {
+      child = parent2;
+      parent2 = parent2.parent;
     }
     return child;
   }
@@ -575,6 +609,10 @@
         final __test = new SimpleIdentifierTest();
         runJUnitTest(__test, __test.test_inDeclarationContext_constructorDeclaration);
       });
+      _ut.test('test_inDeclarationContext_fieldFormalParameter', () {
+        final __test = new SimpleIdentifierTest();
+        runJUnitTest(__test, __test.test_inDeclarationContext_fieldFormalParameter);
+      });
       _ut.test('test_inDeclarationContext_functionDeclaration', () {
         final __test = new SimpleIdentifierTest();
         runJUnitTest(__test, __test.test_inDeclarationContext_functionDeclaration);
@@ -595,9 +633,9 @@
         final __test = new SimpleIdentifierTest();
         runJUnitTest(__test, __test.test_inDeclarationContext_methodDeclaration);
       });
-      _ut.test('test_inDeclarationContext_normalFormalParameter', () {
+      _ut.test('test_inDeclarationContext_simpleFormalParameter', () {
         final __test = new SimpleIdentifierTest();
-        runJUnitTest(__test, __test.test_inDeclarationContext_normalFormalParameter);
+        runJUnitTest(__test, __test.test_inDeclarationContext_simpleFormalParameter);
       });
       _ut.test('test_inDeclarationContext_typeParameter_bound', () {
         final __test = new SimpleIdentifierTest();
@@ -615,6 +653,10 @@
         final __test = new SimpleIdentifierTest();
         runJUnitTest(__test, __test.test_inGetterContext);
       });
+      _ut.test('test_inReferenceContext', () {
+        final __test = new SimpleIdentifierTest();
+        runJUnitTest(__test, __test.test_inReferenceContext);
+      });
       _ut.test('test_inSetterContext', () {
         final __test = new SimpleIdentifierTest();
         runJUnitTest(__test, __test.test_inSetterContext);
@@ -622,7 +664,7 @@
     });
   }
 }
-class AssignmentKind {
+class AssignmentKind implements Comparable<AssignmentKind> {
   static final AssignmentKind BINARY = new AssignmentKind('BINARY', 0);
   static final AssignmentKind COMPOUND_LEFT = new AssignmentKind('COMPOUND_LEFT', 1);
   static final AssignmentKind COMPOUND_RIGHT = new AssignmentKind('COMPOUND_RIGHT', 2);
@@ -639,9 +681,10 @@
   int get ordinal => __ordinal;
   AssignmentKind(this.__name, this.__ordinal) {
   }
+  int compareTo(AssignmentKind other) => __ordinal - other.__ordinal;
   String toString() => __name;
 }
-class WrapperKind {
+class WrapperKind implements Comparable<WrapperKind> {
   static final WrapperKind PREFIXED_LEFT = new WrapperKind('PREFIXED_LEFT', 0);
   static final WrapperKind PREFIXED_RIGHT = new WrapperKind('PREFIXED_RIGHT', 1);
   static final WrapperKind PROPERTY_LEFT = new WrapperKind('PROPERTY_LEFT', 2);
@@ -653,6 +696,7 @@
   int get ordinal => __ordinal;
   WrapperKind(this.__name, this.__ordinal) {
   }
+  int compareTo(WrapperKind other) => __ordinal - other.__ordinal;
   String toString() => __name;
 }
 class ConstantEvaluatorTest extends ParserTestCase {
@@ -912,7 +956,7 @@
     EngineTestCase.assertInstanceOf(int, value);
     JUnitTestCase.assertEquals(-42, ((value as int)));
   }
-  Object getConstantValue(String source) => ParserTestCase.parseExpression(source, []).accept(new ConstantEvaluator(null));
+  Object getConstantValue(String source) => ParserTestCase.parseExpression(source, []).accept(new ConstantEvaluator());
   static dartSuite() {
     _ut.group('ConstantEvaluatorTest', () {
       _ut.test('test_binary_bitAnd', () {
@@ -1119,28 +1163,28 @@
     assertSource("'a' 'b'", ASTFactory.adjacentStrings([ASTFactory.string2("a"), ASTFactory.string2("b")]));
   }
   void test_visitAnnotation_constant() {
-    assertSource("@A", ASTFactory.annotation(ASTFactory.identifier2("A")));
+    assertSource("@A", ASTFactory.annotation(ASTFactory.identifier3("A")));
   }
   void test_visitAnnotation_constructor() {
-    assertSource("@A.c()", ASTFactory.annotation2(ASTFactory.identifier2("A"), ASTFactory.identifier2("c"), ASTFactory.argumentList([])));
+    assertSource("@A.c()", ASTFactory.annotation2(ASTFactory.identifier3("A"), ASTFactory.identifier3("c"), ASTFactory.argumentList([])));
   }
   void test_visitArgumentDefinitionTest() {
     assertSource("?a", ASTFactory.argumentDefinitionTest("a"));
   }
   void test_visitArgumentList() {
-    assertSource("(a, b)", ASTFactory.argumentList([ASTFactory.identifier2("a"), ASTFactory.identifier2("b")]));
+    assertSource("(a, b)", ASTFactory.argumentList([ASTFactory.identifier3("a"), ASTFactory.identifier3("b")]));
   }
   void test_visitAsExpression() {
-    assertSource("e as T", ASTFactory.asExpression(ASTFactory.identifier2("e"), ASTFactory.typeName3("T", [])));
+    assertSource("e as T", ASTFactory.asExpression(ASTFactory.identifier3("e"), ASTFactory.typeName4("T", [])));
   }
   void test_visitAssertStatement() {
-    assertSource("assert (a);", ASTFactory.assertStatement(ASTFactory.identifier2("a")));
+    assertSource("assert (a);", ASTFactory.assertStatement(ASTFactory.identifier3("a")));
   }
   void test_visitAssignmentExpression() {
-    assertSource("a = b", ASTFactory.assignmentExpression(ASTFactory.identifier2("a"), TokenType.EQ, ASTFactory.identifier2("b")));
+    assertSource("a = b", ASTFactory.assignmentExpression(ASTFactory.identifier3("a"), TokenType.EQ, ASTFactory.identifier3("b")));
   }
   void test_visitBinaryExpression() {
-    assertSource("a + b", ASTFactory.binaryExpression(ASTFactory.identifier2("a"), TokenType.PLUS, ASTFactory.identifier2("b")));
+    assertSource("a + b", ASTFactory.binaryExpression(ASTFactory.identifier3("a"), TokenType.PLUS, ASTFactory.identifier3("b")));
   }
   void test_visitBlock_empty() {
     assertSource("{}", ASTFactory.block([]));
@@ -1164,13 +1208,13 @@
     assertSource("break;", ASTFactory.breakStatement());
   }
   void test_visitCascadeExpression_field() {
-    assertSource("a..b..c", ASTFactory.cascadeExpression(ASTFactory.identifier2("a"), [ASTFactory.cascadedPropertyAccess("b"), ASTFactory.cascadedPropertyAccess("c")]));
+    assertSource("a..b..c", ASTFactory.cascadeExpression(ASTFactory.identifier3("a"), [ASTFactory.cascadedPropertyAccess("b"), ASTFactory.cascadedPropertyAccess("c")]));
   }
   void test_visitCascadeExpression_index() {
-    assertSource("a..[0]..[1]", ASTFactory.cascadeExpression(ASTFactory.identifier2("a"), [ASTFactory.cascadedIndexExpression(ASTFactory.integer(0)), ASTFactory.cascadedIndexExpression(ASTFactory.integer(1))]));
+    assertSource("a..[0]..[1]", ASTFactory.cascadeExpression(ASTFactory.identifier3("a"), [ASTFactory.cascadedIndexExpression(ASTFactory.integer(0)), ASTFactory.cascadedIndexExpression(ASTFactory.integer(1))]));
   }
   void test_visitCascadeExpression_method() {
-    assertSource("a..b()..c()", ASTFactory.cascadeExpression(ASTFactory.identifier2("a"), [ASTFactory.cascadedMethodInvocation("b", []), ASTFactory.cascadedMethodInvocation("c", [])]));
+    assertSource("a..b()..c()", ASTFactory.cascadeExpression(ASTFactory.identifier3("a"), [ASTFactory.cascadedMethodInvocation("b", []), ASTFactory.cascadedMethodInvocation("c", [])]));
   }
   void test_visitCatchClause_catch_noStack() {
     assertSource("catch (e) {}", ASTFactory.catchClause("e", []));
@@ -1179,10 +1223,10 @@
     assertSource("catch (e, s) {}", ASTFactory.catchClause2("e", "s", []));
   }
   void test_visitCatchClause_on() {
-    assertSource("on E {}", ASTFactory.catchClause3(ASTFactory.typeName3("E", []), []));
+    assertSource("on E {}", ASTFactory.catchClause3(ASTFactory.typeName4("E", []), []));
   }
   void test_visitCatchClause_on_catch() {
-    assertSource("on E catch (e) {}", ASTFactory.catchClause4(ASTFactory.typeName3("E", []), "e", []));
+    assertSource("on E catch (e) {}", ASTFactory.catchClause4(ASTFactory.typeName4("E", []), "e", []));
   }
   void test_visitClassDeclaration_abstract() {
     assertSource("abstract class C {}", ASTFactory.classDeclaration(Keyword.ABSTRACT, "C", null, null, null, null, []));
@@ -1191,19 +1235,19 @@
     assertSource("class C {}", ASTFactory.classDeclaration(null, "C", null, null, null, null, []));
   }
   void test_visitClassDeclaration_extends() {
-    assertSource("class C extends A {}", ASTFactory.classDeclaration(null, "C", null, ASTFactory.extendsClause(ASTFactory.typeName3("A", [])), null, null, []));
+    assertSource("class C extends A {}", ASTFactory.classDeclaration(null, "C", null, ASTFactory.extendsClause(ASTFactory.typeName4("A", [])), null, null, []));
   }
   void test_visitClassDeclaration_extends_implements() {
-    assertSource("class C extends A implements B {}", ASTFactory.classDeclaration(null, "C", null, ASTFactory.extendsClause(ASTFactory.typeName3("A", [])), null, ASTFactory.implementsClause([ASTFactory.typeName3("B", [])]), []));
+    assertSource("class C extends A implements B {}", ASTFactory.classDeclaration(null, "C", null, ASTFactory.extendsClause(ASTFactory.typeName4("A", [])), null, ASTFactory.implementsClause([ASTFactory.typeName4("B", [])]), []));
   }
   void test_visitClassDeclaration_extends_with() {
-    assertSource("class C extends A with M {}", ASTFactory.classDeclaration(null, "C", null, ASTFactory.extendsClause(ASTFactory.typeName3("A", [])), ASTFactory.withClause([ASTFactory.typeName3("M", [])]), null, []));
+    assertSource("class C extends A with M {}", ASTFactory.classDeclaration(null, "C", null, ASTFactory.extendsClause(ASTFactory.typeName4("A", [])), ASTFactory.withClause([ASTFactory.typeName4("M", [])]), null, []));
   }
   void test_visitClassDeclaration_extends_with_implements() {
-    assertSource("class C extends A with M implements B {}", ASTFactory.classDeclaration(null, "C", null, ASTFactory.extendsClause(ASTFactory.typeName3("A", [])), ASTFactory.withClause([ASTFactory.typeName3("M", [])]), ASTFactory.implementsClause([ASTFactory.typeName3("B", [])]), []));
+    assertSource("class C extends A with M implements B {}", ASTFactory.classDeclaration(null, "C", null, ASTFactory.extendsClause(ASTFactory.typeName4("A", [])), ASTFactory.withClause([ASTFactory.typeName4("M", [])]), ASTFactory.implementsClause([ASTFactory.typeName4("B", [])]), []));
   }
   void test_visitClassDeclaration_implements() {
-    assertSource("class C implements B {}", ASTFactory.classDeclaration(null, "C", null, null, null, ASTFactory.implementsClause([ASTFactory.typeName3("B", [])]), []));
+    assertSource("class C implements B {}", ASTFactory.classDeclaration(null, "C", null, null, null, ASTFactory.implementsClause([ASTFactory.typeName4("B", [])]), []));
   }
   void test_visitClassDeclaration_multipleMember() {
     assertSource("class C {var a; var b;}", ASTFactory.classDeclaration(null, "C", null, null, null, null, [ASTFactory.fieldDeclaration2(false, Keyword.VAR, [ASTFactory.variableDeclaration("a")]), ASTFactory.fieldDeclaration2(false, Keyword.VAR, [ASTFactory.variableDeclaration("b")])]));
@@ -1212,52 +1256,52 @@
     assertSource("class C<E> {}", ASTFactory.classDeclaration(null, "C", ASTFactory.typeParameterList(["E"]), null, null, null, []));
   }
   void test_visitClassDeclaration_parameters_extends() {
-    assertSource("class C<E> extends A {}", ASTFactory.classDeclaration(null, "C", ASTFactory.typeParameterList(["E"]), ASTFactory.extendsClause(ASTFactory.typeName3("A", [])), null, null, []));
+    assertSource("class C<E> extends A {}", ASTFactory.classDeclaration(null, "C", ASTFactory.typeParameterList(["E"]), ASTFactory.extendsClause(ASTFactory.typeName4("A", [])), null, null, []));
   }
   void test_visitClassDeclaration_parameters_extends_implements() {
-    assertSource("class C<E> extends A implements B {}", ASTFactory.classDeclaration(null, "C", ASTFactory.typeParameterList(["E"]), ASTFactory.extendsClause(ASTFactory.typeName3("A", [])), null, ASTFactory.implementsClause([ASTFactory.typeName3("B", [])]), []));
+    assertSource("class C<E> extends A implements B {}", ASTFactory.classDeclaration(null, "C", ASTFactory.typeParameterList(["E"]), ASTFactory.extendsClause(ASTFactory.typeName4("A", [])), null, ASTFactory.implementsClause([ASTFactory.typeName4("B", [])]), []));
   }
   void test_visitClassDeclaration_parameters_extends_with() {
-    assertSource("class C<E> extends A with M {}", ASTFactory.classDeclaration(null, "C", ASTFactory.typeParameterList(["E"]), ASTFactory.extendsClause(ASTFactory.typeName3("A", [])), ASTFactory.withClause([ASTFactory.typeName3("M", [])]), null, []));
+    assertSource("class C<E> extends A with M {}", ASTFactory.classDeclaration(null, "C", ASTFactory.typeParameterList(["E"]), ASTFactory.extendsClause(ASTFactory.typeName4("A", [])), ASTFactory.withClause([ASTFactory.typeName4("M", [])]), null, []));
   }
   void test_visitClassDeclaration_parameters_extends_with_implements() {
-    assertSource("class C<E> extends A with M implements B {}", ASTFactory.classDeclaration(null, "C", ASTFactory.typeParameterList(["E"]), ASTFactory.extendsClause(ASTFactory.typeName3("A", [])), ASTFactory.withClause([ASTFactory.typeName3("M", [])]), ASTFactory.implementsClause([ASTFactory.typeName3("B", [])]), []));
+    assertSource("class C<E> extends A with M implements B {}", ASTFactory.classDeclaration(null, "C", ASTFactory.typeParameterList(["E"]), ASTFactory.extendsClause(ASTFactory.typeName4("A", [])), ASTFactory.withClause([ASTFactory.typeName4("M", [])]), ASTFactory.implementsClause([ASTFactory.typeName4("B", [])]), []));
   }
   void test_visitClassDeclaration_parameters_implements() {
-    assertSource("class C<E> implements B {}", ASTFactory.classDeclaration(null, "C", ASTFactory.typeParameterList(["E"]), null, null, ASTFactory.implementsClause([ASTFactory.typeName3("B", [])]), []));
+    assertSource("class C<E> implements B {}", ASTFactory.classDeclaration(null, "C", ASTFactory.typeParameterList(["E"]), null, null, ASTFactory.implementsClause([ASTFactory.typeName4("B", [])]), []));
   }
   void test_visitClassDeclaration_singleMember() {
     assertSource("class C {var a;}", ASTFactory.classDeclaration(null, "C", null, null, null, null, [ASTFactory.fieldDeclaration2(false, Keyword.VAR, [ASTFactory.variableDeclaration("a")])]));
   }
   void test_visitClassTypeAlias_abstract() {
-    assertSource("typedef C = abstract S with M1;", ASTFactory.classTypeAlias("C", null, Keyword.ABSTRACT, ASTFactory.typeName3("S", []), ASTFactory.withClause([ASTFactory.typeName3("M1", [])]), null));
+    assertSource("typedef C = abstract S with M1;", ASTFactory.classTypeAlias("C", null, Keyword.ABSTRACT, ASTFactory.typeName4("S", []), ASTFactory.withClause([ASTFactory.typeName4("M1", [])]), null));
   }
   void test_visitClassTypeAlias_abstract_implements() {
-    assertSource("typedef C = abstract S with M1 implements I;", ASTFactory.classTypeAlias("C", null, Keyword.ABSTRACT, ASTFactory.typeName3("S", []), ASTFactory.withClause([ASTFactory.typeName3("M1", [])]), ASTFactory.implementsClause([ASTFactory.typeName3("I", [])])));
+    assertSource("typedef C = abstract S with M1 implements I;", ASTFactory.classTypeAlias("C", null, Keyword.ABSTRACT, ASTFactory.typeName4("S", []), ASTFactory.withClause([ASTFactory.typeName4("M1", [])]), ASTFactory.implementsClause([ASTFactory.typeName4("I", [])])));
   }
   void test_visitClassTypeAlias_generic() {
-    assertSource("typedef C<E> = S<E> with M1<E>;", ASTFactory.classTypeAlias("C", ASTFactory.typeParameterList(["E"]), null, ASTFactory.typeName3("S", [ASTFactory.typeName3("E", [])]), ASTFactory.withClause([ASTFactory.typeName3("M1", [ASTFactory.typeName3("E", [])])]), null));
+    assertSource("typedef C<E> = S<E> with M1<E>;", ASTFactory.classTypeAlias("C", ASTFactory.typeParameterList(["E"]), null, ASTFactory.typeName4("S", [ASTFactory.typeName4("E", [])]), ASTFactory.withClause([ASTFactory.typeName4("M1", [ASTFactory.typeName4("E", [])])]), null));
   }
   void test_visitClassTypeAlias_implements() {
-    assertSource("typedef C = S with M1 implements I;", ASTFactory.classTypeAlias("C", null, null, ASTFactory.typeName3("S", []), ASTFactory.withClause([ASTFactory.typeName3("M1", [])]), ASTFactory.implementsClause([ASTFactory.typeName3("I", [])])));
+    assertSource("typedef C = S with M1 implements I;", ASTFactory.classTypeAlias("C", null, null, ASTFactory.typeName4("S", []), ASTFactory.withClause([ASTFactory.typeName4("M1", [])]), ASTFactory.implementsClause([ASTFactory.typeName4("I", [])])));
   }
   void test_visitClassTypeAlias_minimal() {
-    assertSource("typedef C = S with M1;", ASTFactory.classTypeAlias("C", null, null, ASTFactory.typeName3("S", []), ASTFactory.withClause([ASTFactory.typeName3("M1", [])]), null));
+    assertSource("typedef C = S with M1;", ASTFactory.classTypeAlias("C", null, null, ASTFactory.typeName4("S", []), ASTFactory.withClause([ASTFactory.typeName4("M1", [])]), null));
   }
   void test_visitClassTypeAlias_parameters_abstract() {
-    assertSource("typedef C<E> = abstract S with M1;", ASTFactory.classTypeAlias("C", ASTFactory.typeParameterList(["E"]), Keyword.ABSTRACT, ASTFactory.typeName3("S", []), ASTFactory.withClause([ASTFactory.typeName3("M1", [])]), null));
+    assertSource("typedef C<E> = abstract S with M1;", ASTFactory.classTypeAlias("C", ASTFactory.typeParameterList(["E"]), Keyword.ABSTRACT, ASTFactory.typeName4("S", []), ASTFactory.withClause([ASTFactory.typeName4("M1", [])]), null));
   }
   void test_visitClassTypeAlias_parameters_abstract_implements() {
-    assertSource("typedef C<E> = abstract S with M1 implements I;", ASTFactory.classTypeAlias("C", ASTFactory.typeParameterList(["E"]), Keyword.ABSTRACT, ASTFactory.typeName3("S", []), ASTFactory.withClause([ASTFactory.typeName3("M1", [])]), ASTFactory.implementsClause([ASTFactory.typeName3("I", [])])));
+    assertSource("typedef C<E> = abstract S with M1 implements I;", ASTFactory.classTypeAlias("C", ASTFactory.typeParameterList(["E"]), Keyword.ABSTRACT, ASTFactory.typeName4("S", []), ASTFactory.withClause([ASTFactory.typeName4("M1", [])]), ASTFactory.implementsClause([ASTFactory.typeName4("I", [])])));
   }
   void test_visitClassTypeAlias_parameters_implements() {
-    assertSource("typedef C<E> = S with M1 implements I;", ASTFactory.classTypeAlias("C", ASTFactory.typeParameterList(["E"]), null, ASTFactory.typeName3("S", []), ASTFactory.withClause([ASTFactory.typeName3("M1", [])]), ASTFactory.implementsClause([ASTFactory.typeName3("I", [])])));
+    assertSource("typedef C<E> = S with M1 implements I;", ASTFactory.classTypeAlias("C", ASTFactory.typeParameterList(["E"]), null, ASTFactory.typeName4("S", []), ASTFactory.withClause([ASTFactory.typeName4("M1", [])]), ASTFactory.implementsClause([ASTFactory.typeName4("I", [])])));
   }
   void test_visitComment() {
     assertSource("", Comment.createBlockComment(<Token> [TokenFactory.token2("/* comment */")]));
   }
   void test_visitCommentReference() {
-    assertSource("", new CommentReference.full(null, ASTFactory.identifier2("a")));
+    assertSource("", new CommentReference.full(null, ASTFactory.identifier3("a")));
   }
   void test_visitCompilationUnit_declaration() {
     assertSource("var a;", ASTFactory.compilationUnit2([ASTFactory.topLevelVariableDeclaration2(Keyword.VAR, [ASTFactory.variableDeclaration("a")])]));
@@ -1284,43 +1328,43 @@
     assertSource("!#/bin/dartvm library l; var a;", ASTFactory.compilationUnit8("!#/bin/dartvm", ASTFactory.list([(ASTFactory.libraryDirective2("l") as Directive)]), ASTFactory.list([(ASTFactory.topLevelVariableDeclaration2(Keyword.VAR, [ASTFactory.variableDeclaration("a")]) as CompilationUnitMember)])));
   }
   void test_visitConditionalExpression() {
-    assertSource("a ? b : c", ASTFactory.conditionalExpression(ASTFactory.identifier2("a"), ASTFactory.identifier2("b"), ASTFactory.identifier2("c")));
+    assertSource("a ? b : c", ASTFactory.conditionalExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"), ASTFactory.identifier3("c")));
   }
   void test_visitConstructorDeclaration_const() {
-    assertSource("const C() {}", ASTFactory.constructorDeclaration2(Keyword.CONST, null, ASTFactory.identifier2("C"), null, ASTFactory.formalParameterList([]), null, ASTFactory.blockFunctionBody([])));
+    assertSource("const C() {}", ASTFactory.constructorDeclaration2(Keyword.CONST, null, ASTFactory.identifier3("C"), null, ASTFactory.formalParameterList([]), null, ASTFactory.blockFunctionBody([])));
   }
   void test_visitConstructorDeclaration_external() {
-    assertSource("external C();", ASTFactory.constructorDeclaration(ASTFactory.identifier2("C"), null, ASTFactory.formalParameterList([]), null));
+    assertSource("external C();", ASTFactory.constructorDeclaration(ASTFactory.identifier3("C"), null, ASTFactory.formalParameterList([]), null));
   }
   void test_visitConstructorDeclaration_minimal() {
-    assertSource("C() {}", ASTFactory.constructorDeclaration2(null, null, ASTFactory.identifier2("C"), null, ASTFactory.formalParameterList([]), null, ASTFactory.blockFunctionBody([])));
+    assertSource("C() {}", ASTFactory.constructorDeclaration2(null, null, ASTFactory.identifier3("C"), null, ASTFactory.formalParameterList([]), null, ASTFactory.blockFunctionBody([])));
   }
   void test_visitConstructorDeclaration_multipleInitializers() {
-    assertSource("C() : a = b, c = d {}", ASTFactory.constructorDeclaration2(null, null, ASTFactory.identifier2("C"), null, ASTFactory.formalParameterList([]), ASTFactory.list([(ASTFactory.constructorFieldInitializer(false, "a", ASTFactory.identifier2("b")) as ConstructorInitializer), ASTFactory.constructorFieldInitializer(false, "c", ASTFactory.identifier2("d"))]), ASTFactory.blockFunctionBody([])));
+    assertSource("C() : a = b, c = d {}", ASTFactory.constructorDeclaration2(null, null, ASTFactory.identifier3("C"), null, ASTFactory.formalParameterList([]), ASTFactory.list([(ASTFactory.constructorFieldInitializer(false, "a", ASTFactory.identifier3("b")) as ConstructorInitializer), ASTFactory.constructorFieldInitializer(false, "c", ASTFactory.identifier3("d"))]), ASTFactory.blockFunctionBody([])));
   }
   void test_visitConstructorDeclaration_multipleParameters() {
-    assertSource("C(var a, var b) {}", ASTFactory.constructorDeclaration2(null, null, ASTFactory.identifier2("C"), null, ASTFactory.formalParameterList([ASTFactory.simpleFormalParameter(Keyword.VAR, "a"), ASTFactory.simpleFormalParameter(Keyword.VAR, "b")]), null, ASTFactory.blockFunctionBody([])));
+    assertSource("C(var a, var b) {}", ASTFactory.constructorDeclaration2(null, null, ASTFactory.identifier3("C"), null, ASTFactory.formalParameterList([ASTFactory.simpleFormalParameter(Keyword.VAR, "a"), ASTFactory.simpleFormalParameter(Keyword.VAR, "b")]), null, ASTFactory.blockFunctionBody([])));
   }
   void test_visitConstructorDeclaration_named() {
-    assertSource("C.m() {}", ASTFactory.constructorDeclaration2(null, null, ASTFactory.identifier2("C"), "m", ASTFactory.formalParameterList([]), null, ASTFactory.blockFunctionBody([])));
+    assertSource("C.m() {}", ASTFactory.constructorDeclaration2(null, null, ASTFactory.identifier3("C"), "m", ASTFactory.formalParameterList([]), null, ASTFactory.blockFunctionBody([])));
   }
   void test_visitConstructorDeclaration_singleInitializer() {
-    assertSource("C() : a = b {}", ASTFactory.constructorDeclaration2(null, null, ASTFactory.identifier2("C"), null, ASTFactory.formalParameterList([]), ASTFactory.list([(ASTFactory.constructorFieldInitializer(false, "a", ASTFactory.identifier2("b")) as ConstructorInitializer)]), ASTFactory.blockFunctionBody([])));
+    assertSource("C() : a = b {}", ASTFactory.constructorDeclaration2(null, null, ASTFactory.identifier3("C"), null, ASTFactory.formalParameterList([]), ASTFactory.list([(ASTFactory.constructorFieldInitializer(false, "a", ASTFactory.identifier3("b")) as ConstructorInitializer)]), ASTFactory.blockFunctionBody([])));
   }
   void test_visitConstructorFieldInitializer_withoutThis() {
-    assertSource("a = b", ASTFactory.constructorFieldInitializer(false, "a", ASTFactory.identifier2("b")));
+    assertSource("a = b", ASTFactory.constructorFieldInitializer(false, "a", ASTFactory.identifier3("b")));
   }
   void test_visitConstructorFieldInitializer_withThis() {
-    assertSource("this.a = b", ASTFactory.constructorFieldInitializer(true, "a", ASTFactory.identifier2("b")));
+    assertSource("this.a = b", ASTFactory.constructorFieldInitializer(true, "a", ASTFactory.identifier3("b")));
   }
   void test_visitConstructorName_named_prefix() {
-    assertSource("p.C.n", ASTFactory.constructorName(ASTFactory.typeName3("p.C.n", []), null));
+    assertSource("p.C.n", ASTFactory.constructorName(ASTFactory.typeName4("p.C.n", []), null));
   }
   void test_visitConstructorName_unnamed_noPrefix() {
-    assertSource("C", ASTFactory.constructorName(ASTFactory.typeName3("C", []), null));
+    assertSource("C", ASTFactory.constructorName(ASTFactory.typeName4("C", []), null));
   }
   void test_visitConstructorName_unnamed_prefix() {
-    assertSource("p.C", ASTFactory.constructorName(ASTFactory.typeName2(ASTFactory.identifier4("p", "C"), []), null));
+    assertSource("p.C", ASTFactory.constructorName(ASTFactory.typeName3(ASTFactory.identifier5("p", "C"), []), null));
   }
   void test_visitContinueStatement_label() {
     assertSource("continue l;", ASTFactory.continueStatement2("l"));
@@ -1341,7 +1385,7 @@
     assertSource("p = 0", ASTFactory.positionalFormalParameter(ASTFactory.simpleFormalParameter3("p"), ASTFactory.integer(0)));
   }
   void test_visitDoStatement() {
-    assertSource("do {} while (c);", ASTFactory.doStatement(ASTFactory.block([]), ASTFactory.identifier2("c")));
+    assertSource("do {} while (c);", ASTFactory.doStatement(ASTFactory.block([]), ASTFactory.identifier3("c")));
   }
   void test_visitDoubleLiteral() {
     assertSource("4.2", ASTFactory.doubleLiteral(4.2));
@@ -1353,22 +1397,22 @@
     assertSource(";", ASTFactory.emptyStatement());
   }
   void test_visitExportDirective_combinator() {
-    assertSource("export 'a.dart' show A;", ASTFactory.exportDirective2("a.dart", [(ASTFactory.showCombinator([ASTFactory.identifier2("A")]) as Combinator)]));
+    assertSource("export 'a.dart' show A;", ASTFactory.exportDirective2("a.dart", [(ASTFactory.showCombinator([ASTFactory.identifier3("A")]) as Combinator)]));
   }
   void test_visitExportDirective_combinators() {
-    assertSource("export 'a.dart' show A hide B;", ASTFactory.exportDirective2("a.dart", [ASTFactory.showCombinator([ASTFactory.identifier2("A")]), ASTFactory.hideCombinator([ASTFactory.identifier2("B")])]));
+    assertSource("export 'a.dart' show A hide B;", ASTFactory.exportDirective2("a.dart", [ASTFactory.showCombinator([ASTFactory.identifier3("A")]), ASTFactory.hideCombinator([ASTFactory.identifier3("B")])]));
   }
   void test_visitExportDirective_minimal() {
     assertSource("export 'a.dart';", ASTFactory.exportDirective2("a.dart", []));
   }
   void test_visitExpressionFunctionBody() {
-    assertSource("=> a;", ASTFactory.expressionFunctionBody(ASTFactory.identifier2("a")));
+    assertSource("=> a;", ASTFactory.expressionFunctionBody(ASTFactory.identifier3("a")));
   }
   void test_visitExpressionStatement() {
-    assertSource("a;", ASTFactory.expressionStatement(ASTFactory.identifier2("a")));
+    assertSource("a;", ASTFactory.expressionStatement(ASTFactory.identifier3("a")));
   }
   void test_visitExtendsClause() {
-    assertSource("extends C", ASTFactory.extendsClause(ASTFactory.typeName3("C", [])));
+    assertSource("extends C", ASTFactory.extendsClause(ASTFactory.typeName4("C", [])));
   }
   void test_visitFieldDeclaration_instance() {
     assertSource("var a;", ASTFactory.fieldDeclaration2(false, Keyword.VAR, [ASTFactory.variableDeclaration("a")]));
@@ -1380,13 +1424,13 @@
     assertSource("var this.a", ASTFactory.fieldFormalParameter(Keyword.VAR, null, "a"));
   }
   void test_visitFieldFormalParameter_keywordAndType() {
-    assertSource("final A this.a", ASTFactory.fieldFormalParameter(Keyword.FINAL, ASTFactory.typeName3("A", []), "a"));
+    assertSource("final A this.a", ASTFactory.fieldFormalParameter(Keyword.FINAL, ASTFactory.typeName4("A", []), "a"));
   }
   void test_visitFieldFormalParameter_type() {
-    assertSource("A this.a", ASTFactory.fieldFormalParameter(null, ASTFactory.typeName3("A", []), "a"));
+    assertSource("A this.a", ASTFactory.fieldFormalParameter(null, ASTFactory.typeName4("A", []), "a"));
   }
   void test_visitForEachStatement() {
-    assertSource("for (a in b) {}", ASTFactory.forEachStatement(ASTFactory.declaredIdentifier3("a"), ASTFactory.identifier2("b"), ASTFactory.block([])));
+    assertSource("for (a in b) {}", ASTFactory.forEachStatement(ASTFactory.declaredIdentifier3("a"), ASTFactory.identifier3("b"), ASTFactory.block([])));
   }
   void test_visitFormalParameterList_empty() {
     assertSource("()", ASTFactory.formalParameterList([]));
@@ -1434,37 +1478,37 @@
     assertSource("(a, b, [c = 3, d = 4])", ASTFactory.formalParameterList([ASTFactory.simpleFormalParameter3("a"), ASTFactory.simpleFormalParameter3("b"), ASTFactory.positionalFormalParameter(ASTFactory.simpleFormalParameter3("c"), ASTFactory.integer(3)), ASTFactory.positionalFormalParameter(ASTFactory.simpleFormalParameter3("d"), ASTFactory.integer(4))]));
   }
   void test_visitForStatement_c() {
-    assertSource("for (; c;) {}", ASTFactory.forStatement((null as Expression), ASTFactory.identifier2("c"), null, ASTFactory.block([])));
+    assertSource("for (; c;) {}", ASTFactory.forStatement((null as Expression), ASTFactory.identifier3("c"), null, ASTFactory.block([])));
   }
   void test_visitForStatement_cu() {
-    assertSource("for (; c; u) {}", ASTFactory.forStatement((null as Expression), ASTFactory.identifier2("c"), ASTFactory.list([(ASTFactory.identifier2("u") as Expression)]), ASTFactory.block([])));
+    assertSource("for (; c; u) {}", ASTFactory.forStatement((null as Expression), ASTFactory.identifier3("c"), ASTFactory.list([(ASTFactory.identifier3("u") as Expression)]), ASTFactory.block([])));
   }
   void test_visitForStatement_e() {
-    assertSource("for (e;;) {}", ASTFactory.forStatement(ASTFactory.identifier2("e"), null, null, ASTFactory.block([])));
+    assertSource("for (e;;) {}", ASTFactory.forStatement(ASTFactory.identifier3("e"), null, null, ASTFactory.block([])));
   }
   void test_visitForStatement_ec() {
-    assertSource("for (e; c;) {}", ASTFactory.forStatement(ASTFactory.identifier2("e"), ASTFactory.identifier2("c"), null, ASTFactory.block([])));
+    assertSource("for (e; c;) {}", ASTFactory.forStatement(ASTFactory.identifier3("e"), ASTFactory.identifier3("c"), null, ASTFactory.block([])));
   }
   void test_visitForStatement_ecu() {
-    assertSource("for (e; c; u) {}", ASTFactory.forStatement(ASTFactory.identifier2("e"), ASTFactory.identifier2("c"), ASTFactory.list([(ASTFactory.identifier2("u") as Expression)]), ASTFactory.block([])));
+    assertSource("for (e; c; u) {}", ASTFactory.forStatement(ASTFactory.identifier3("e"), ASTFactory.identifier3("c"), ASTFactory.list([(ASTFactory.identifier3("u") as Expression)]), ASTFactory.block([])));
   }
   void test_visitForStatement_eu() {
-    assertSource("for (e;; u) {}", ASTFactory.forStatement(ASTFactory.identifier2("e"), null, ASTFactory.list([(ASTFactory.identifier2("u") as Expression)]), ASTFactory.block([])));
+    assertSource("for (e;; u) {}", ASTFactory.forStatement(ASTFactory.identifier3("e"), null, ASTFactory.list([(ASTFactory.identifier3("u") as Expression)]), ASTFactory.block([])));
   }
   void test_visitForStatement_i() {
     assertSource("for (var i;;) {}", ASTFactory.forStatement2(ASTFactory.variableDeclarationList2(Keyword.VAR, [ASTFactory.variableDeclaration("i")]), null, null, ASTFactory.block([])));
   }
   void test_visitForStatement_ic() {
-    assertSource("for (var i; c;) {}", ASTFactory.forStatement2(ASTFactory.variableDeclarationList2(Keyword.VAR, [ASTFactory.variableDeclaration("i")]), ASTFactory.identifier2("c"), null, ASTFactory.block([])));
+    assertSource("for (var i; c;) {}", ASTFactory.forStatement2(ASTFactory.variableDeclarationList2(Keyword.VAR, [ASTFactory.variableDeclaration("i")]), ASTFactory.identifier3("c"), null, ASTFactory.block([])));
   }
   void test_visitForStatement_icu() {
-    assertSource("for (var i; c; u) {}", ASTFactory.forStatement2(ASTFactory.variableDeclarationList2(Keyword.VAR, [ASTFactory.variableDeclaration("i")]), ASTFactory.identifier2("c"), ASTFactory.list([(ASTFactory.identifier2("u") as Expression)]), ASTFactory.block([])));
+    assertSource("for (var i; c; u) {}", ASTFactory.forStatement2(ASTFactory.variableDeclarationList2(Keyword.VAR, [ASTFactory.variableDeclaration("i")]), ASTFactory.identifier3("c"), ASTFactory.list([(ASTFactory.identifier3("u") as Expression)]), ASTFactory.block([])));
   }
   void test_visitForStatement_iu() {
-    assertSource("for (var i;; u) {}", ASTFactory.forStatement2(ASTFactory.variableDeclarationList2(Keyword.VAR, [ASTFactory.variableDeclaration("i")]), null, ASTFactory.list([(ASTFactory.identifier2("u") as Expression)]), ASTFactory.block([])));
+    assertSource("for (var i;; u) {}", ASTFactory.forStatement2(ASTFactory.variableDeclarationList2(Keyword.VAR, [ASTFactory.variableDeclaration("i")]), null, ASTFactory.list([(ASTFactory.identifier3("u") as Expression)]), ASTFactory.block([])));
   }
   void test_visitForStatement_u() {
-    assertSource("for (;; u) {}", ASTFactory.forStatement((null as Expression), null, ASTFactory.list([(ASTFactory.identifier2("u") as Expression)]), ASTFactory.block([])));
+    assertSource("for (;; u) {}", ASTFactory.forStatement((null as Expression), null, ASTFactory.list([(ASTFactory.identifier3("u") as Expression)]), ASTFactory.block([])));
   }
   void test_visitFunctionDeclaration_getter() {
     assertSource("get f() {}", ASTFactory.functionDeclaration(null, Keyword.GET, "f", ASTFactory.functionExpression()));
@@ -1482,31 +1526,31 @@
     assertSource("() {}", ASTFactory.functionExpression());
   }
   void test_visitFunctionExpressionInvocation() {
-    assertSource("f()", ASTFactory.functionExpressionInvocation(ASTFactory.identifier2("f"), []));
+    assertSource("f()", ASTFactory.functionExpressionInvocation(ASTFactory.identifier3("f"), []));
   }
   void test_visitFunctionTypedFormalParameter_noType() {
     assertSource("f()", ASTFactory.functionTypedFormalParameter(null, "f", []));
   }
   void test_visitFunctionTypedFormalParameter_type() {
-    assertSource("T f()", ASTFactory.functionTypedFormalParameter(ASTFactory.typeName3("T", []), "f", []));
+    assertSource("T f()", ASTFactory.functionTypedFormalParameter(ASTFactory.typeName4("T", []), "f", []));
   }
   void test_visitIfStatement_withElse() {
-    assertSource("if (c) {} else {}", ASTFactory.ifStatement2(ASTFactory.identifier2("c"), ASTFactory.block([]), ASTFactory.block([])));
+    assertSource("if (c) {} else {}", ASTFactory.ifStatement2(ASTFactory.identifier3("c"), ASTFactory.block([]), ASTFactory.block([])));
   }
   void test_visitIfStatement_withoutElse() {
-    assertSource("if (c) {}", ASTFactory.ifStatement(ASTFactory.identifier2("c"), ASTFactory.block([])));
+    assertSource("if (c) {}", ASTFactory.ifStatement(ASTFactory.identifier3("c"), ASTFactory.block([])));
   }
   void test_visitImplementsClause_multiple() {
-    assertSource("implements A, B", ASTFactory.implementsClause([ASTFactory.typeName3("A", []), ASTFactory.typeName3("B", [])]));
+    assertSource("implements A, B", ASTFactory.implementsClause([ASTFactory.typeName4("A", []), ASTFactory.typeName4("B", [])]));
   }
   void test_visitImplementsClause_single() {
-    assertSource("implements A", ASTFactory.implementsClause([ASTFactory.typeName3("A", [])]));
+    assertSource("implements A", ASTFactory.implementsClause([ASTFactory.typeName4("A", [])]));
   }
   void test_visitImportDirective_combinator() {
-    assertSource("import 'a.dart' show A;", ASTFactory.importDirective2("a.dart", null, [ASTFactory.showCombinator([ASTFactory.identifier2("A")])]));
+    assertSource("import 'a.dart' show A;", ASTFactory.importDirective2("a.dart", null, [ASTFactory.showCombinator([ASTFactory.identifier3("A")])]));
   }
   void test_visitImportDirective_combinators() {
-    assertSource("import 'a.dart' show A hide B;", ASTFactory.importDirective2("a.dart", null, [ASTFactory.showCombinator([ASTFactory.identifier2("A")]), ASTFactory.hideCombinator([ASTFactory.identifier2("B")])]));
+    assertSource("import 'a.dart' show A hide B;", ASTFactory.importDirective2("a.dart", null, [ASTFactory.showCombinator([ASTFactory.identifier3("A")]), ASTFactory.hideCombinator([ASTFactory.identifier3("B")])]));
   }
   void test_visitImportDirective_minimal() {
     assertSource("import 'a.dart';", ASTFactory.importDirective2("a.dart", null, []));
@@ -1515,40 +1559,40 @@
     assertSource("import 'a.dart' as p;", ASTFactory.importDirective2("a.dart", "p", []));
   }
   void test_visitImportDirective_prefix_combinator() {
-    assertSource("import 'a.dart' as p show A;", ASTFactory.importDirective2("a.dart", "p", [ASTFactory.showCombinator([ASTFactory.identifier2("A")])]));
+    assertSource("import 'a.dart' as p show A;", ASTFactory.importDirective2("a.dart", "p", [ASTFactory.showCombinator([ASTFactory.identifier3("A")])]));
   }
   void test_visitImportDirective_prefix_combinators() {
-    assertSource("import 'a.dart' as p show A hide B;", ASTFactory.importDirective2("a.dart", "p", [ASTFactory.showCombinator([ASTFactory.identifier2("A")]), ASTFactory.hideCombinator([ASTFactory.identifier2("B")])]));
+    assertSource("import 'a.dart' as p show A hide B;", ASTFactory.importDirective2("a.dart", "p", [ASTFactory.showCombinator([ASTFactory.identifier3("A")]), ASTFactory.hideCombinator([ASTFactory.identifier3("B")])]));
   }
   void test_visitImportHideCombinator_multiple() {
-    assertSource("hide a, b", ASTFactory.hideCombinator([ASTFactory.identifier2("a"), ASTFactory.identifier2("b")]));
+    assertSource("hide a, b", ASTFactory.hideCombinator([ASTFactory.identifier3("a"), ASTFactory.identifier3("b")]));
   }
   void test_visitImportHideCombinator_single() {
-    assertSource("hide a", ASTFactory.hideCombinator([ASTFactory.identifier2("a")]));
+    assertSource("hide a", ASTFactory.hideCombinator([ASTFactory.identifier3("a")]));
   }
   void test_visitImportShowCombinator_multiple() {
-    assertSource("show a, b", ASTFactory.showCombinator([ASTFactory.identifier2("a"), ASTFactory.identifier2("b")]));
+    assertSource("show a, b", ASTFactory.showCombinator([ASTFactory.identifier3("a"), ASTFactory.identifier3("b")]));
   }
   void test_visitImportShowCombinator_single() {
-    assertSource("show a", ASTFactory.showCombinator([ASTFactory.identifier2("a")]));
+    assertSource("show a", ASTFactory.showCombinator([ASTFactory.identifier3("a")]));
   }
   void test_visitIndexExpression() {
-    assertSource("a[i]", ASTFactory.indexExpression(ASTFactory.identifier2("a"), ASTFactory.identifier2("i")));
+    assertSource("a[i]", ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("i")));
   }
   void test_visitInstanceCreationExpression_const() {
-    assertSource("const C()", ASTFactory.instanceCreationExpression2(Keyword.CONST, ASTFactory.typeName3("C", []), []));
+    assertSource("const C()", ASTFactory.instanceCreationExpression2(Keyword.CONST, ASTFactory.typeName4("C", []), []));
   }
   void test_visitInstanceCreationExpression_named() {
-    assertSource("new C.c()", ASTFactory.instanceCreationExpression3(Keyword.NEW, ASTFactory.typeName3("C", []), "c", []));
+    assertSource("new C.c()", ASTFactory.instanceCreationExpression3(Keyword.NEW, ASTFactory.typeName4("C", []), "c", []));
   }
   void test_visitInstanceCreationExpression_unnamed() {
-    assertSource("new C()", ASTFactory.instanceCreationExpression2(Keyword.NEW, ASTFactory.typeName3("C", []), []));
+    assertSource("new C()", ASTFactory.instanceCreationExpression2(Keyword.NEW, ASTFactory.typeName4("C", []), []));
   }
   void test_visitIntegerLiteral() {
     assertSource("42", ASTFactory.integer(42));
   }
   void test_visitInterpolationExpression_expression() {
-    assertSource("\${a}", ASTFactory.interpolationExpression(ASTFactory.identifier2("a")));
+    assertSource("\${a}", ASTFactory.interpolationExpression(ASTFactory.identifier3("a")));
   }
   void test_visitInterpolationExpression_identifier() {
     assertSource("\$a", ASTFactory.interpolationExpression2("a"));
@@ -1557,28 +1601,28 @@
     assertSource("'x", ASTFactory.interpolationString("'x", "x"));
   }
   void test_visitIsExpression_negated() {
-    assertSource("a is! C", ASTFactory.isExpression(ASTFactory.identifier2("a"), true, ASTFactory.typeName3("C", [])));
+    assertSource("a is! C", ASTFactory.isExpression(ASTFactory.identifier3("a"), true, ASTFactory.typeName4("C", [])));
   }
   void test_visitIsExpression_normal() {
-    assertSource("a is C", ASTFactory.isExpression(ASTFactory.identifier2("a"), false, ASTFactory.typeName3("C", [])));
+    assertSource("a is C", ASTFactory.isExpression(ASTFactory.identifier3("a"), false, ASTFactory.typeName4("C", [])));
   }
   void test_visitLabel() {
-    assertSource("a:", ASTFactory.label("a"));
+    assertSource("a:", ASTFactory.label2("a"));
   }
   void test_visitLabeledStatement_multiple() {
-    assertSource("a: b: return;", ASTFactory.labeledStatement(ASTFactory.list([ASTFactory.label("a"), ASTFactory.label("b")]), ASTFactory.returnStatement()));
+    assertSource("a: b: return;", ASTFactory.labeledStatement(ASTFactory.list([ASTFactory.label2("a"), ASTFactory.label2("b")]), ASTFactory.returnStatement()));
   }
   void test_visitLabeledStatement_single() {
-    assertSource("a: return;", ASTFactory.labeledStatement(ASTFactory.list([ASTFactory.label("a")]), ASTFactory.returnStatement()));
+    assertSource("a: return;", ASTFactory.labeledStatement(ASTFactory.list([ASTFactory.label2("a")]), ASTFactory.returnStatement()));
   }
   void test_visitLibraryDirective() {
     assertSource("library l;", ASTFactory.libraryDirective2("l"));
   }
   void test_visitLibraryIdentifier_multiple() {
-    assertSource("a.b.c", ASTFactory.libraryIdentifier([ASTFactory.identifier2("a"), ASTFactory.identifier2("b"), ASTFactory.identifier2("c")]));
+    assertSource("a.b.c", ASTFactory.libraryIdentifier([ASTFactory.identifier3("a"), ASTFactory.identifier3("b"), ASTFactory.identifier3("c")]));
   }
   void test_visitLibraryIdentifier_single() {
-    assertSource("a", ASTFactory.libraryIdentifier([ASTFactory.identifier2("a")]));
+    assertSource("a", ASTFactory.libraryIdentifier([ASTFactory.identifier3("a")]));
   }
   void test_visitListLiteral_const() {
     assertSource("const []", ASTFactory.listLiteral2(Keyword.CONST, null, []));
@@ -1587,7 +1631,7 @@
     assertSource("[]", ASTFactory.listLiteral([]));
   }
   void test_visitListLiteral_nonEmpty() {
-    assertSource("[a, b, c]", ASTFactory.listLiteral([ASTFactory.identifier2("a"), ASTFactory.identifier2("b"), ASTFactory.identifier2("c")]));
+    assertSource("[a, b, c]", ASTFactory.listLiteral([ASTFactory.identifier3("a"), ASTFactory.identifier3("b"), ASTFactory.identifier3("c")]));
   }
   void test_visitMapLiteral_const() {
     assertSource("const {}", ASTFactory.mapLiteral(Keyword.CONST, null, []));
@@ -1596,67 +1640,70 @@
     assertSource("{}", ASTFactory.mapLiteral2([]));
   }
   void test_visitMapLiteral_nonEmpty() {
-    assertSource("{'a' : a, 'b' : b, 'c' : c}", ASTFactory.mapLiteral2([ASTFactory.mapLiteralEntry("a", ASTFactory.identifier2("a")), ASTFactory.mapLiteralEntry("b", ASTFactory.identifier2("b")), ASTFactory.mapLiteralEntry("c", ASTFactory.identifier2("c"))]));
+    assertSource("{'a' : a, 'b' : b, 'c' : c}", ASTFactory.mapLiteral2([ASTFactory.mapLiteralEntry("a", ASTFactory.identifier3("a")), ASTFactory.mapLiteralEntry("b", ASTFactory.identifier3("b")), ASTFactory.mapLiteralEntry("c", ASTFactory.identifier3("c"))]));
   }
   void test_visitMapLiteralEntry() {
-    assertSource("'a' : b", ASTFactory.mapLiteralEntry("a", ASTFactory.identifier2("b")));
+    assertSource("'a' : b", ASTFactory.mapLiteralEntry("a", ASTFactory.identifier3("b")));
   }
   void test_visitMethodDeclaration_external() {
-    assertSource("external m();", ASTFactory.methodDeclaration(null, null, null, null, ASTFactory.identifier2("m"), ASTFactory.formalParameterList([])));
+    assertSource("external m();", ASTFactory.methodDeclaration(null, null, null, null, ASTFactory.identifier3("m"), ASTFactory.formalParameterList([])));
   }
   void test_visitMethodDeclaration_external_returnType() {
-    assertSource("external T m();", ASTFactory.methodDeclaration(null, ASTFactory.typeName3("T", []), null, null, ASTFactory.identifier2("m"), ASTFactory.formalParameterList([])));
+    assertSource("external T m();", ASTFactory.methodDeclaration(null, ASTFactory.typeName4("T", []), null, null, ASTFactory.identifier3("m"), ASTFactory.formalParameterList([])));
   }
   void test_visitMethodDeclaration_getter() {
-    assertSource("get m {}", ASTFactory.methodDeclaration2(null, null, Keyword.GET, null, ASTFactory.identifier2("m"), null, ASTFactory.blockFunctionBody([])));
+    assertSource("get m {}", ASTFactory.methodDeclaration2(null, null, Keyword.GET, null, ASTFactory.identifier3("m"), null, ASTFactory.blockFunctionBody([])));
   }
   void test_visitMethodDeclaration_getter_returnType() {
-    assertSource("T get m {}", ASTFactory.methodDeclaration2(null, ASTFactory.typeName3("T", []), Keyword.GET, null, ASTFactory.identifier2("m"), null, ASTFactory.blockFunctionBody([])));
+    assertSource("T get m {}", ASTFactory.methodDeclaration2(null, ASTFactory.typeName4("T", []), Keyword.GET, null, ASTFactory.identifier3("m"), null, ASTFactory.blockFunctionBody([])));
   }
   void test_visitMethodDeclaration_getter_seturnType() {
-    assertSource("T set m(var v) {}", ASTFactory.methodDeclaration2(null, ASTFactory.typeName3("T", []), Keyword.SET, null, ASTFactory.identifier2("m"), ASTFactory.formalParameterList([ASTFactory.simpleFormalParameter(Keyword.VAR, "v")]), ASTFactory.blockFunctionBody([])));
+    assertSource("T set m(var v) {}", ASTFactory.methodDeclaration2(null, ASTFactory.typeName4("T", []), Keyword.SET, null, ASTFactory.identifier3("m"), ASTFactory.formalParameterList([ASTFactory.simpleFormalParameter(Keyword.VAR, "v")]), ASTFactory.blockFunctionBody([])));
   }
   void test_visitMethodDeclaration_minimal() {
-    assertSource("m() {}", ASTFactory.methodDeclaration2(null, null, null, null, ASTFactory.identifier2("m"), ASTFactory.formalParameterList([]), ASTFactory.blockFunctionBody([])));
+    assertSource("m() {}", ASTFactory.methodDeclaration2(null, null, null, null, ASTFactory.identifier3("m"), ASTFactory.formalParameterList([]), ASTFactory.blockFunctionBody([])));
   }
   void test_visitMethodDeclaration_multipleParameters() {
-    assertSource("m(var a, var b) {}", ASTFactory.methodDeclaration2(null, null, null, null, ASTFactory.identifier2("m"), ASTFactory.formalParameterList([ASTFactory.simpleFormalParameter(Keyword.VAR, "a"), ASTFactory.simpleFormalParameter(Keyword.VAR, "b")]), ASTFactory.blockFunctionBody([])));
+    assertSource("m(var a, var b) {}", ASTFactory.methodDeclaration2(null, null, null, null, ASTFactory.identifier3("m"), ASTFactory.formalParameterList([ASTFactory.simpleFormalParameter(Keyword.VAR, "a"), ASTFactory.simpleFormalParameter(Keyword.VAR, "b")]), ASTFactory.blockFunctionBody([])));
   }
   void test_visitMethodDeclaration_operator() {
-    assertSource("operator +() {}", ASTFactory.methodDeclaration2(null, null, null, Keyword.OPERATOR, ASTFactory.identifier2("+"), ASTFactory.formalParameterList([]), ASTFactory.blockFunctionBody([])));
+    assertSource("operator +() {}", ASTFactory.methodDeclaration2(null, null, null, Keyword.OPERATOR, ASTFactory.identifier3("+"), ASTFactory.formalParameterList([]), ASTFactory.blockFunctionBody([])));
   }
   void test_visitMethodDeclaration_operator_returnType() {
-    assertSource("T operator +() {}", ASTFactory.methodDeclaration2(null, ASTFactory.typeName3("T", []), null, Keyword.OPERATOR, ASTFactory.identifier2("+"), ASTFactory.formalParameterList([]), ASTFactory.blockFunctionBody([])));
+    assertSource("T operator +() {}", ASTFactory.methodDeclaration2(null, ASTFactory.typeName4("T", []), null, Keyword.OPERATOR, ASTFactory.identifier3("+"), ASTFactory.formalParameterList([]), ASTFactory.blockFunctionBody([])));
   }
   void test_visitMethodDeclaration_returnType() {
-    assertSource("T m() {}", ASTFactory.methodDeclaration2(null, ASTFactory.typeName3("T", []), null, null, ASTFactory.identifier2("m"), ASTFactory.formalParameterList([]), ASTFactory.blockFunctionBody([])));
+    assertSource("T m() {}", ASTFactory.methodDeclaration2(null, ASTFactory.typeName4("T", []), null, null, ASTFactory.identifier3("m"), ASTFactory.formalParameterList([]), ASTFactory.blockFunctionBody([])));
   }
   void test_visitMethodDeclaration_setter() {
-    assertSource("set m(var v) {}", ASTFactory.methodDeclaration2(null, null, Keyword.SET, null, ASTFactory.identifier2("m"), ASTFactory.formalParameterList([ASTFactory.simpleFormalParameter(Keyword.VAR, "v")]), ASTFactory.blockFunctionBody([])));
+    assertSource("set m(var v) {}", ASTFactory.methodDeclaration2(null, null, Keyword.SET, null, ASTFactory.identifier3("m"), ASTFactory.formalParameterList([ASTFactory.simpleFormalParameter(Keyword.VAR, "v")]), ASTFactory.blockFunctionBody([])));
   }
   void test_visitMethodDeclaration_static() {
-    assertSource("static m() {}", ASTFactory.methodDeclaration2(Keyword.STATIC, null, null, null, ASTFactory.identifier2("m"), ASTFactory.formalParameterList([]), ASTFactory.blockFunctionBody([])));
+    assertSource("static m() {}", ASTFactory.methodDeclaration2(Keyword.STATIC, null, null, null, ASTFactory.identifier3("m"), ASTFactory.formalParameterList([]), ASTFactory.blockFunctionBody([])));
   }
   void test_visitMethodDeclaration_static_returnType() {
-    assertSource("static T m() {}", ASTFactory.methodDeclaration2(Keyword.STATIC, ASTFactory.typeName3("T", []), null, null, ASTFactory.identifier2("m"), ASTFactory.formalParameterList([]), ASTFactory.blockFunctionBody([])));
+    assertSource("static T m() {}", ASTFactory.methodDeclaration2(Keyword.STATIC, ASTFactory.typeName4("T", []), null, null, ASTFactory.identifier3("m"), ASTFactory.formalParameterList([]), ASTFactory.blockFunctionBody([])));
   }
   void test_visitMethodInvocation_noTarget() {
     assertSource("m()", ASTFactory.methodInvocation2("m", []));
   }
   void test_visitMethodInvocation_target() {
-    assertSource("t.m()", ASTFactory.methodInvocation(ASTFactory.identifier2("t"), "m", []));
+    assertSource("t.m()", ASTFactory.methodInvocation(ASTFactory.identifier3("t"), "m", []));
   }
   void test_visitNamedExpression() {
-    assertSource("a: b", ASTFactory.namedExpression("a", ASTFactory.identifier2("b")));
+    assertSource("a: b", ASTFactory.namedExpression2("a", ASTFactory.identifier3("b")));
   }
   void test_visitNamedFormalParameter() {
     assertSource("var a : 0", ASTFactory.namedFormalParameter(ASTFactory.simpleFormalParameter(Keyword.VAR, "a"), ASTFactory.integer(0)));
   }
+  void test_visitNativeFunctionBody() {
+    assertSource("native 'str';", ASTFactory.nativeFunctionBody("str"));
+  }
   void test_visitNullLiteral() {
     assertSource("null", ASTFactory.nullLiteral());
   }
   void test_visitParenthesizedExpression() {
-    assertSource("(a)", ASTFactory.parenthesizedExpression(ASTFactory.identifier2("a")));
+    assertSource("(a)", ASTFactory.parenthesizedExpression(ASTFactory.identifier3("a")));
   }
   void test_visitPartDirective() {
     assertSource("part 'a.dart';", ASTFactory.partDirective2("a.dart"));
@@ -1668,16 +1715,16 @@
     assertSource("var a = 0", ASTFactory.positionalFormalParameter(ASTFactory.simpleFormalParameter(Keyword.VAR, "a"), ASTFactory.integer(0)));
   }
   void test_visitPostfixExpression() {
-    assertSource("a++", ASTFactory.postfixExpression(ASTFactory.identifier2("a"), TokenType.PLUS_PLUS));
+    assertSource("a++", ASTFactory.postfixExpression(ASTFactory.identifier3("a"), TokenType.PLUS_PLUS));
   }
   void test_visitPrefixedIdentifier() {
-    assertSource("a.b", ASTFactory.identifier4("a", "b"));
+    assertSource("a.b", ASTFactory.identifier5("a", "b"));
   }
   void test_visitPrefixExpression() {
-    assertSource("-a", ASTFactory.prefixExpression(TokenType.MINUS, ASTFactory.identifier2("a")));
+    assertSource("-a", ASTFactory.prefixExpression(TokenType.MINUS, ASTFactory.identifier3("a")));
   }
   void test_visitPropertyAccess() {
-    assertSource("a.b", ASTFactory.propertyAccess2(ASTFactory.identifier2("a"), "b"));
+    assertSource("a.b", ASTFactory.propertyAccess2(ASTFactory.identifier3("a"), "b"));
   }
   void test_visitRedirectingConstructorInvocation_named() {
     assertSource("this.c()", ASTFactory.redirectingConstructorInvocation2("c", []));
@@ -1686,7 +1733,7 @@
     assertSource("this()", ASTFactory.redirectingConstructorInvocation([]));
   }
   void test_visitReturnStatement_expression() {
-    assertSource("return a;", ASTFactory.returnStatement2(ASTFactory.identifier2("a")));
+    assertSource("return a;", ASTFactory.returnStatement2(ASTFactory.identifier3("a")));
   }
   void test_visitReturnStatement_noExpression() {
     assertSource("return;", ASTFactory.returnStatement());
@@ -1699,19 +1746,19 @@
     assertSource("var a", ASTFactory.simpleFormalParameter(Keyword.VAR, "a"));
   }
   void test_visitSimpleFormalParameter_keyword_type() {
-    assertSource("final A a", ASTFactory.simpleFormalParameter2(Keyword.FINAL, ASTFactory.typeName3("A", []), "a"));
+    assertSource("final A a", ASTFactory.simpleFormalParameter2(Keyword.FINAL, ASTFactory.typeName4("A", []), "a"));
   }
   void test_visitSimpleFormalParameter_type() {
-    assertSource("A a", ASTFactory.simpleFormalParameter4(ASTFactory.typeName3("A", []), "a"));
+    assertSource("A a", ASTFactory.simpleFormalParameter4(ASTFactory.typeName4("A", []), "a"));
   }
   void test_visitSimpleIdentifier() {
-    assertSource("a", ASTFactory.identifier2("a"));
+    assertSource("a", ASTFactory.identifier3("a"));
   }
   void test_visitSimpleStringLiteral() {
     assertSource("'a'", ASTFactory.string2("a"));
   }
   void test_visitStringInterpolation() {
-    assertSource("'a\${e}b'", ASTFactory.string([ASTFactory.interpolationString("'a", "a"), ASTFactory.interpolationExpression(ASTFactory.identifier2("e")), ASTFactory.interpolationString("b'", "b")]));
+    assertSource("'a\${e}b'", ASTFactory.string([ASTFactory.interpolationString("'a", "a"), ASTFactory.interpolationExpression(ASTFactory.identifier3("e")), ASTFactory.interpolationString("b'", "b")]));
   }
   void test_visitSuperConstructorInvocation() {
     assertSource("super()", ASTFactory.superConstructorInvocation([]));
@@ -1723,19 +1770,19 @@
     assertSource("super", ASTFactory.superExpression());
   }
   void test_visitSwitchCase_multipleLabels() {
-    assertSource("l1: l2: case a: {}", ASTFactory.switchCase2(ASTFactory.list([ASTFactory.label("l1"), ASTFactory.label("l2")]), ASTFactory.identifier2("a"), [ASTFactory.block([])]));
+    assertSource("l1: l2: case a: {}", ASTFactory.switchCase2(ASTFactory.list([ASTFactory.label2("l1"), ASTFactory.label2("l2")]), ASTFactory.identifier3("a"), [ASTFactory.block([])]));
   }
   void test_visitSwitchCase_multipleStatements() {
-    assertSource("case a: {} {}", ASTFactory.switchCase(ASTFactory.identifier2("a"), [ASTFactory.block([]), ASTFactory.block([])]));
+    assertSource("case a: {} {}", ASTFactory.switchCase(ASTFactory.identifier3("a"), [ASTFactory.block([]), ASTFactory.block([])]));
   }
   void test_visitSwitchCase_noLabels() {
-    assertSource("case a: {}", ASTFactory.switchCase(ASTFactory.identifier2("a"), [ASTFactory.block([])]));
+    assertSource("case a: {}", ASTFactory.switchCase(ASTFactory.identifier3("a"), [ASTFactory.block([])]));
   }
   void test_visitSwitchCase_singleLabel() {
-    assertSource("l1: case a: {}", ASTFactory.switchCase2(ASTFactory.list([ASTFactory.label("l1")]), ASTFactory.identifier2("a"), [ASTFactory.block([])]));
+    assertSource("l1: case a: {}", ASTFactory.switchCase2(ASTFactory.list([ASTFactory.label2("l1")]), ASTFactory.identifier3("a"), [ASTFactory.block([])]));
   }
   void test_visitSwitchDefault_multipleLabels() {
-    assertSource("l1: l2: default: {}", ASTFactory.switchDefault(ASTFactory.list([ASTFactory.label("l1"), ASTFactory.label("l2")]), [ASTFactory.block([])]));
+    assertSource("l1: l2: default: {}", ASTFactory.switchDefault(ASTFactory.list([ASTFactory.label2("l1"), ASTFactory.label2("l2")]), [ASTFactory.block([])]));
   }
   void test_visitSwitchDefault_multipleStatements() {
     assertSource("default: {} {}", ASTFactory.switchDefault2([ASTFactory.block([]), ASTFactory.block([])]));
@@ -1744,16 +1791,16 @@
     assertSource("default: {}", ASTFactory.switchDefault2([ASTFactory.block([])]));
   }
   void test_visitSwitchDefault_singleLabel() {
-    assertSource("l1: default: {}", ASTFactory.switchDefault(ASTFactory.list([ASTFactory.label("l1")]), [ASTFactory.block([])]));
+    assertSource("l1: default: {}", ASTFactory.switchDefault(ASTFactory.list([ASTFactory.label2("l1")]), [ASTFactory.block([])]));
   }
   void test_visitSwitchStatement() {
-    assertSource("switch (a) {case 'b': {} default: {}}", ASTFactory.switchStatement(ASTFactory.identifier2("a"), [ASTFactory.switchCase(ASTFactory.string2("b"), [ASTFactory.block([])]), ASTFactory.switchDefault2([ASTFactory.block([])])]));
+    assertSource("switch (a) {case 'b': {} default: {}}", ASTFactory.switchStatement(ASTFactory.identifier3("a"), [ASTFactory.switchCase(ASTFactory.string2("b"), [ASTFactory.block([])]), ASTFactory.switchDefault2([ASTFactory.block([])])]));
   }
   void test_visitThisExpression() {
     assertSource("this", ASTFactory.thisExpression());
   }
   void test_visitThrowStatement() {
-    assertSource("throw e", ASTFactory.throwExpression2(ASTFactory.identifier2("e")));
+    assertSource("throw e", ASTFactory.throwExpression2(ASTFactory.identifier3("e")));
   }
   void test_visitTopLevelVariableDeclaration_multiple() {
     assertSource("var a;", ASTFactory.topLevelVariableDeclaration2(Keyword.VAR, [ASTFactory.variableDeclaration("a")]));
@@ -1762,43 +1809,43 @@
     assertSource("var a, b;", ASTFactory.topLevelVariableDeclaration2(Keyword.VAR, [ASTFactory.variableDeclaration("a"), ASTFactory.variableDeclaration("b")]));
   }
   void test_visitTryStatement_catch() {
-    assertSource("try {} on E {}", ASTFactory.tryStatement2(ASTFactory.block([]), [ASTFactory.catchClause3(ASTFactory.typeName3("E", []), [])]));
+    assertSource("try {} on E {}", ASTFactory.tryStatement2(ASTFactory.block([]), [ASTFactory.catchClause3(ASTFactory.typeName4("E", []), [])]));
   }
   void test_visitTryStatement_catches() {
-    assertSource("try {} on E {} on F {}", ASTFactory.tryStatement2(ASTFactory.block([]), [ASTFactory.catchClause3(ASTFactory.typeName3("E", []), []), ASTFactory.catchClause3(ASTFactory.typeName3("F", []), [])]));
+    assertSource("try {} on E {} on F {}", ASTFactory.tryStatement2(ASTFactory.block([]), [ASTFactory.catchClause3(ASTFactory.typeName4("E", []), []), ASTFactory.catchClause3(ASTFactory.typeName4("F", []), [])]));
   }
   void test_visitTryStatement_catchFinally() {
-    assertSource("try {} on E {} finally {}", ASTFactory.tryStatement3(ASTFactory.block([]), ASTFactory.list([ASTFactory.catchClause3(ASTFactory.typeName3("E", []), [])]), ASTFactory.block([])));
+    assertSource("try {} on E {} finally {}", ASTFactory.tryStatement3(ASTFactory.block([]), ASTFactory.list([ASTFactory.catchClause3(ASTFactory.typeName4("E", []), [])]), ASTFactory.block([])));
   }
   void test_visitTryStatement_finally() {
     assertSource("try {} finally {}", ASTFactory.tryStatement(ASTFactory.block([]), ASTFactory.block([])));
   }
   void test_visitTypeAlias_generic() {
-    assertSource("typedef A F<B>();", ASTFactory.typeAlias(ASTFactory.typeName3("A", []), "F", ASTFactory.typeParameterList(["B"]), ASTFactory.formalParameterList([])));
+    assertSource("typedef A F<B>();", ASTFactory.typeAlias(ASTFactory.typeName4("A", []), "F", ASTFactory.typeParameterList(["B"]), ASTFactory.formalParameterList([])));
   }
   void test_visitTypeAlias_nonGeneric() {
-    assertSource("typedef A F();", ASTFactory.typeAlias(ASTFactory.typeName3("A", []), "F", null, ASTFactory.formalParameterList([])));
+    assertSource("typedef A F();", ASTFactory.typeAlias(ASTFactory.typeName4("A", []), "F", null, ASTFactory.formalParameterList([])));
   }
   void test_visitTypeArgumentList_multiple() {
-    assertSource("<E, F>", ASTFactory.typeArgumentList([ASTFactory.typeName3("E", []), ASTFactory.typeName3("F", [])]));
+    assertSource("<E, F>", ASTFactory.typeArgumentList([ASTFactory.typeName4("E", []), ASTFactory.typeName4("F", [])]));
   }
   void test_visitTypeArgumentList_single() {
-    assertSource("<E>", ASTFactory.typeArgumentList([ASTFactory.typeName3("E", [])]));
+    assertSource("<E>", ASTFactory.typeArgumentList([ASTFactory.typeName4("E", [])]));
   }
   void test_visitTypeName_multipleArgs() {
-    assertSource("C<D, E>", ASTFactory.typeName3("C", [ASTFactory.typeName3("D", []), ASTFactory.typeName3("E", [])]));
+    assertSource("C<D, E>", ASTFactory.typeName4("C", [ASTFactory.typeName4("D", []), ASTFactory.typeName4("E", [])]));
   }
   void test_visitTypeName_nestedArg() {
-    assertSource("C<D<E>>", ASTFactory.typeName3("C", [ASTFactory.typeName3("D", [ASTFactory.typeName3("E", [])])]));
+    assertSource("C<D<E>>", ASTFactory.typeName4("C", [ASTFactory.typeName4("D", [ASTFactory.typeName4("E", [])])]));
   }
   void test_visitTypeName_noArgs() {
-    assertSource("C", ASTFactory.typeName3("C", []));
+    assertSource("C", ASTFactory.typeName4("C", []));
   }
   void test_visitTypeName_singleArg() {
-    assertSource("C<D>", ASTFactory.typeName3("C", [ASTFactory.typeName3("D", [])]));
+    assertSource("C<D>", ASTFactory.typeName4("C", [ASTFactory.typeName4("D", [])]));
   }
   void test_visitTypeParameter_withExtends() {
-    assertSource("E extends C", ASTFactory.typeParameter2("E", ASTFactory.typeName3("C", [])));
+    assertSource("E extends C", ASTFactory.typeParameter2("E", ASTFactory.typeName4("C", [])));
   }
   void test_visitTypeParameter_withoutExtends() {
     assertSource("E", ASTFactory.typeParameter("E"));
@@ -1810,34 +1857,34 @@
     assertSource("<E>", ASTFactory.typeParameterList(["E"]));
   }
   void test_visitVariableDeclaration_initialized() {
-    assertSource("a = b", ASTFactory.variableDeclaration2("a", ASTFactory.identifier2("b")));
+    assertSource("a = b", ASTFactory.variableDeclaration2("a", ASTFactory.identifier3("b")));
   }
   void test_visitVariableDeclaration_uninitialized() {
     assertSource("a", ASTFactory.variableDeclaration("a"));
   }
   void test_visitVariableDeclarationList_const_type() {
-    assertSource("const C a, b", ASTFactory.variableDeclarationList(Keyword.CONST, ASTFactory.typeName3("C", []), [ASTFactory.variableDeclaration("a"), ASTFactory.variableDeclaration("b")]));
+    assertSource("const C a, b", ASTFactory.variableDeclarationList(Keyword.CONST, ASTFactory.typeName4("C", []), [ASTFactory.variableDeclaration("a"), ASTFactory.variableDeclaration("b")]));
   }
   void test_visitVariableDeclarationList_final_noType() {
     assertSource("final a, b", ASTFactory.variableDeclarationList2(Keyword.FINAL, [ASTFactory.variableDeclaration("a"), ASTFactory.variableDeclaration("b")]));
   }
   void test_visitVariableDeclarationList_type() {
-    assertSource("C a, b", ASTFactory.variableDeclarationList(null, ASTFactory.typeName3("C", []), [ASTFactory.variableDeclaration("a"), ASTFactory.variableDeclaration("b")]));
+    assertSource("C a, b", ASTFactory.variableDeclarationList(null, ASTFactory.typeName4("C", []), [ASTFactory.variableDeclaration("a"), ASTFactory.variableDeclaration("b")]));
   }
   void test_visitVariableDeclarationList_var() {
     assertSource("var a, b", ASTFactory.variableDeclarationList2(Keyword.VAR, [ASTFactory.variableDeclaration("a"), ASTFactory.variableDeclaration("b")]));
   }
   void test_visitVariableDeclarationStatement() {
-    assertSource("C c;", ASTFactory.variableDeclarationStatement(null, ASTFactory.typeName3("C", []), [ASTFactory.variableDeclaration("c")]));
+    assertSource("C c;", ASTFactory.variableDeclarationStatement(null, ASTFactory.typeName4("C", []), [ASTFactory.variableDeclaration("c")]));
   }
   void test_visitWhileStatement() {
-    assertSource("while (c) {}", ASTFactory.whileStatement(ASTFactory.identifier2("c"), ASTFactory.block([])));
+    assertSource("while (c) {}", ASTFactory.whileStatement(ASTFactory.identifier3("c"), ASTFactory.block([])));
   }
   void test_visitWithClause_multiple() {
-    assertSource("with A, B, C", ASTFactory.withClause([ASTFactory.typeName3("A", []), ASTFactory.typeName3("B", []), ASTFactory.typeName3("C", [])]));
+    assertSource("with A, B, C", ASTFactory.withClause([ASTFactory.typeName4("A", []), ASTFactory.typeName4("B", []), ASTFactory.typeName4("C", [])]));
   }
   void test_visitWithClause_single() {
-    assertSource("with A", ASTFactory.withClause([ASTFactory.typeName3("A", [])]));
+    assertSource("with A", ASTFactory.withClause([ASTFactory.typeName4("A", [])]));
   }
   /**
    * Assert that a {@code ToSourceVisitor} will produce the expected source when visiting the given
@@ -2569,6 +2616,10 @@
         final __test = new ToSourceVisitorTest();
         runJUnitTest(__test, __test.test_visitNamedFormalParameter);
       });
+      _ut.test('test_visitNativeFunctionBody', () {
+        final __test = new ToSourceVisitorTest();
+        runJUnitTest(__test, __test.test_visitNativeFunctionBody);
+      });
       _ut.test('test_visitNullLiteral', () {
         final __test = new ToSourceVisitorTest();
         runJUnitTest(__test, __test.test_visitNullLiteral);
diff --git a/pkg/analyzer_experimental/test/generated/element_test.dart b/pkg/analyzer_experimental/test/generated/element_test.dart
index edfa3a3..834b925 100644
--- a/pkg/analyzer_experimental/test/generated/element_test.dart
+++ b/pkg/analyzer_experimental/test/generated/element_test.dart
@@ -20,6 +20,7 @@
 import 'test_support.dart';
 import 'scanner_test.dart' show TokenFactory;
 import 'ast_test.dart' show ASTFactory;
+import 'resolver_test.dart' show TestTypeProvider;
 
 class ElementLocationImplTest extends EngineTestCase {
   void test_create_encoding() {
@@ -50,11 +51,11 @@
   void test_getComponents() {
     String encoding = "a;b;c";
     ElementLocationImpl location = new ElementLocationImpl.con2(encoding);
-    List<String> components3 = location.components;
-    EngineTestCase.assertLength(3, components3);
-    JUnitTestCase.assertEquals("a", components3[0]);
-    JUnitTestCase.assertEquals("b", components3[1]);
-    JUnitTestCase.assertEquals("c", components3[2]);
+    List<String> components2 = location.components;
+    EngineTestCase.assertLength(3, components2);
+    JUnitTestCase.assertEquals("a", components2[0]);
+    JUnitTestCase.assertEquals("b", components2[1]);
+    JUnitTestCase.assertEquals("c", components2[2]);
   }
   void test_getEncoding() {
     String encoding = "a;b;c;;d";
@@ -96,29 +97,29 @@
 }
 class LibraryElementImplTest extends EngineTestCase {
   void test_creation() {
-    JUnitTestCase.assertNotNull(new LibraryElementImpl(new AnalysisContextImpl(), ASTFactory.libraryIdentifier2(["l"])));
+    JUnitTestCase.assertNotNull(new LibraryElementImpl(createAnalysisContext(), ASTFactory.libraryIdentifier2(["l"])));
   }
   void test_getImportedLibraries() {
-    AnalysisContext context = new AnalysisContextImpl();
+    AnalysisContext context = createAnalysisContext();
     LibraryElementImpl library1 = ElementFactory.library(context, "l1");
     LibraryElementImpl library2 = ElementFactory.library(context, "l2");
     LibraryElementImpl library3 = ElementFactory.library(context, "l3");
     LibraryElementImpl library4 = ElementFactory.library(context, "l4");
-    PrefixElement prefixA = new PrefixElementImpl(ASTFactory.identifier2("a"));
-    PrefixElement prefixB = new PrefixElementImpl(ASTFactory.identifier2("b"));
+    PrefixElement prefixA = new PrefixElementImpl(ASTFactory.identifier3("a"));
+    PrefixElement prefixB = new PrefixElementImpl(ASTFactory.identifier3("b"));
     List<ImportElementImpl> imports = [ElementFactory.importFor(library2, null, []), ElementFactory.importFor(library2, prefixB, []), ElementFactory.importFor(library3, null, []), ElementFactory.importFor(library3, prefixA, []), ElementFactory.importFor(library3, prefixB, []), ElementFactory.importFor(library4, prefixA, [])];
     library1.imports = imports;
     List<LibraryElement> libraries = library1.importedLibraries;
     EngineTestCase.assertEqualsIgnoreOrder(<LibraryElement> [library2, library3, library4], libraries);
   }
   void test_getPrefixes() {
-    AnalysisContext context = new AnalysisContextImpl();
-    LibraryElementImpl library18 = ElementFactory.library(context, "l1");
-    PrefixElement prefixA = new PrefixElementImpl(ASTFactory.identifier2("a"));
-    PrefixElement prefixB = new PrefixElementImpl(ASTFactory.identifier2("b"));
+    AnalysisContext context = createAnalysisContext();
+    LibraryElementImpl library2 = ElementFactory.library(context, "l1");
+    PrefixElement prefixA = new PrefixElementImpl(ASTFactory.identifier3("a"));
+    PrefixElement prefixB = new PrefixElementImpl(ASTFactory.identifier3("b"));
     List<ImportElementImpl> imports = [ElementFactory.importFor(ElementFactory.library(context, "l2"), null, []), ElementFactory.importFor(ElementFactory.library(context, "l3"), null, []), ElementFactory.importFor(ElementFactory.library(context, "l4"), prefixA, []), ElementFactory.importFor(ElementFactory.library(context, "l5"), prefixA, []), ElementFactory.importFor(ElementFactory.library(context, "l6"), prefixB, [])];
-    library18.imports = imports;
-    List<PrefixElement> prefixes2 = library18.prefixes;
+    library2.imports = imports;
+    List<PrefixElement> prefixes2 = library2.prefixes;
     EngineTestCase.assertLength(2, prefixes2);
     if (identical(prefixA, prefixes2[0])) {
       JUnitTestCase.assertSame(prefixB, prefixes2[1]);
@@ -128,15 +129,15 @@
     }
   }
   void test_isUpToDate() {
-    AnalysisContext context = new AnalysisContextImpl();
+    AnalysisContext context = createAnalysisContext();
     context.sourceFactory = new SourceFactory.con2([]);
-    LibraryElement library19 = ElementFactory.library(context, "foo");
-    context.sourceFactory.setContents(library19.definingCompilationUnit.source, "sdfsdff");
-    JUnitTestCase.assertFalse(library19.isUpToDate2(0));
-    JUnitTestCase.assertTrue(library19.isUpToDate2(JavaSystem.currentTimeMillis() + 1000));
+    LibraryElement library2 = ElementFactory.library(context, "foo");
+    context.sourceFactory.setContents(library2.definingCompilationUnit.source, "sdfsdff");
+    JUnitTestCase.assertFalse(library2.isUpToDate2(0));
+    JUnitTestCase.assertTrue(library2.isUpToDate2(JavaSystem.currentTimeMillis() + 1000));
   }
   void test_setImports() {
-    AnalysisContext context = new AnalysisContextImpl();
+    AnalysisContext context = createAnalysisContext();
     LibraryElementImpl library = new LibraryElementImpl(context, ASTFactory.libraryIdentifier2(["l1"]));
     List<ImportElementImpl> expectedImports = [ElementFactory.importFor(ElementFactory.library(context, "l2"), null, []), ElementFactory.importFor(ElementFactory.library(context, "l3"), null, [])];
     library.imports = expectedImports;
@@ -172,184 +173,258 @@
   }
 }
 class InterfaceTypeImplTest extends EngineTestCase {
+  /**
+   * The type provider used to access the types.
+   */
+  TestTypeProvider _typeProvider;
+  void setUp() {
+    _typeProvider = new TestTypeProvider();
+  }
   void test_computeLongestInheritancePathToObject_multipleInterfacePaths() {
-    ClassElementImpl elementA = ElementFactory.classElement2("A", []);
-    ClassElementImpl elementB = ElementFactory.classElement2("B", []);
-    ClassElementImpl elementC = ElementFactory.classElement2("C", []);
-    ClassElementImpl elementD = ElementFactory.classElement2("D", []);
-    ClassElementImpl elementE = ElementFactory.classElement2("E", []);
-    elementB.interfaces = <InterfaceType> [elementA.type];
-    elementC.interfaces = <InterfaceType> [elementA.type];
-    elementD.interfaces = <InterfaceType> [elementC.type];
-    elementE.interfaces = <InterfaceType> [elementB.type, elementD.type];
-    JUnitTestCase.assertEquals(2, InterfaceTypeImpl.computeLongestInheritancePathToObject(elementB.type));
-    JUnitTestCase.assertEquals(4, InterfaceTypeImpl.computeLongestInheritancePathToObject(elementE.type));
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    ClassElementImpl classD = ElementFactory.classElement2("D", []);
+    ClassElementImpl classE = ElementFactory.classElement2("E", []);
+    classB.interfaces = <InterfaceType> [classA.type];
+    classC.interfaces = <InterfaceType> [classA.type];
+    classD.interfaces = <InterfaceType> [classC.type];
+    classE.interfaces = <InterfaceType> [classB.type, classD.type];
+    JUnitTestCase.assertEquals(2, InterfaceTypeImpl.computeLongestInheritancePathToObject(classB.type));
+    JUnitTestCase.assertEquals(4, InterfaceTypeImpl.computeLongestInheritancePathToObject(classE.type));
   }
   void test_computeLongestInheritancePathToObject_multipleSuperclassPaths() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    ClassElement elementB = ElementFactory.classElement("B", elementA.type, []);
-    ClassElement elementC = ElementFactory.classElement("C", elementA.type, []);
-    ClassElement elementD = ElementFactory.classElement("D", elementC.type, []);
-    ClassElementImpl elementE = ElementFactory.classElement("E", elementB.type, []);
-    elementE.interfaces = <InterfaceType> [elementD.type];
-    JUnitTestCase.assertEquals(2, InterfaceTypeImpl.computeLongestInheritancePathToObject(elementB.type));
-    JUnitTestCase.assertEquals(4, InterfaceTypeImpl.computeLongestInheritancePathToObject(elementE.type));
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElement classC = ElementFactory.classElement("C", classA.type, []);
+    ClassElement classD = ElementFactory.classElement("D", classC.type, []);
+    ClassElementImpl classE = ElementFactory.classElement("E", classB.type, []);
+    classE.interfaces = <InterfaceType> [classD.type];
+    JUnitTestCase.assertEquals(2, InterfaceTypeImpl.computeLongestInheritancePathToObject(classB.type));
+    JUnitTestCase.assertEquals(4, InterfaceTypeImpl.computeLongestInheritancePathToObject(classE.type));
   }
   void test_computeLongestInheritancePathToObject_object() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    InterfaceType object = elementA.supertype;
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    InterfaceType object = classA.supertype;
     JUnitTestCase.assertEquals(0, InterfaceTypeImpl.computeLongestInheritancePathToObject(object));
   }
   void test_computeLongestInheritancePathToObject_singleInterfacePath() {
-    ClassElementImpl elementA = ElementFactory.classElement2("A", []);
-    ClassElementImpl elementB = ElementFactory.classElement2("B", []);
-    ClassElementImpl elementC = ElementFactory.classElement2("C", []);
-    elementB.interfaces = <InterfaceType> [elementA.type];
-    elementC.interfaces = <InterfaceType> [elementB.type];
-    JUnitTestCase.assertEquals(1, InterfaceTypeImpl.computeLongestInheritancePathToObject(elementA.type));
-    JUnitTestCase.assertEquals(2, InterfaceTypeImpl.computeLongestInheritancePathToObject(elementB.type));
-    JUnitTestCase.assertEquals(3, InterfaceTypeImpl.computeLongestInheritancePathToObject(elementC.type));
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    classB.interfaces = <InterfaceType> [classA.type];
+    classC.interfaces = <InterfaceType> [classB.type];
+    JUnitTestCase.assertEquals(1, InterfaceTypeImpl.computeLongestInheritancePathToObject(classA.type));
+    JUnitTestCase.assertEquals(2, InterfaceTypeImpl.computeLongestInheritancePathToObject(classB.type));
+    JUnitTestCase.assertEquals(3, InterfaceTypeImpl.computeLongestInheritancePathToObject(classC.type));
   }
   void test_computeLongestInheritancePathToObject_singleSuperclassPath() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    ClassElement elementB = ElementFactory.classElement("B", elementA.type, []);
-    ClassElement elementC = ElementFactory.classElement("C", elementB.type, []);
-    JUnitTestCase.assertEquals(1, InterfaceTypeImpl.computeLongestInheritancePathToObject(elementA.type));
-    JUnitTestCase.assertEquals(2, InterfaceTypeImpl.computeLongestInheritancePathToObject(elementB.type));
-    JUnitTestCase.assertEquals(3, InterfaceTypeImpl.computeLongestInheritancePathToObject(elementC.type));
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElement classC = ElementFactory.classElement("C", classB.type, []);
+    JUnitTestCase.assertEquals(1, InterfaceTypeImpl.computeLongestInheritancePathToObject(classA.type));
+    JUnitTestCase.assertEquals(2, InterfaceTypeImpl.computeLongestInheritancePathToObject(classB.type));
+    JUnitTestCase.assertEquals(3, InterfaceTypeImpl.computeLongestInheritancePathToObject(classC.type));
   }
   void test_computeSuperinterfaceSet_multipleInterfacePaths() {
-    ClassElementImpl elementA = ElementFactory.classElement2("A", []);
-    ClassElementImpl elementB = ElementFactory.classElement2("B", []);
-    ClassElementImpl elementC = ElementFactory.classElement2("C", []);
-    ClassElementImpl elementD = ElementFactory.classElement2("D", []);
-    ClassElementImpl elementE = ElementFactory.classElement2("E", []);
-    elementB.interfaces = <InterfaceType> [elementA.type];
-    elementC.interfaces = <InterfaceType> [elementA.type];
-    elementD.interfaces = <InterfaceType> [elementC.type];
-    elementE.interfaces = <InterfaceType> [elementB.type, elementD.type];
-    Set<InterfaceType> superinterfacesOfD = InterfaceTypeImpl.computeSuperinterfaceSet(elementD.type);
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    ClassElementImpl classD = ElementFactory.classElement2("D", []);
+    ClassElementImpl classE = ElementFactory.classElement2("E", []);
+    classB.interfaces = <InterfaceType> [classA.type];
+    classC.interfaces = <InterfaceType> [classA.type];
+    classD.interfaces = <InterfaceType> [classC.type];
+    classE.interfaces = <InterfaceType> [classB.type, classD.type];
+    Set<InterfaceType> superinterfacesOfD = InterfaceTypeImpl.computeSuperinterfaceSet(classD.type);
     JUnitTestCase.assertNotNull(superinterfacesOfD);
     JUnitTestCase.assertTrue(superinterfacesOfD.contains(ElementFactory.object.type));
-    JUnitTestCase.assertTrue(superinterfacesOfD.contains(elementA.type));
-    JUnitTestCase.assertTrue(superinterfacesOfD.contains(elementC.type));
+    JUnitTestCase.assertTrue(superinterfacesOfD.contains(classA.type));
+    JUnitTestCase.assertTrue(superinterfacesOfD.contains(classC.type));
     JUnitTestCase.assertEquals(3, superinterfacesOfD.length);
-    Set<InterfaceType> superinterfacesOfE = InterfaceTypeImpl.computeSuperinterfaceSet(elementE.type);
+    Set<InterfaceType> superinterfacesOfE = InterfaceTypeImpl.computeSuperinterfaceSet(classE.type);
     JUnitTestCase.assertNotNull(superinterfacesOfE);
     JUnitTestCase.assertTrue(superinterfacesOfE.contains(ElementFactory.object.type));
-    JUnitTestCase.assertTrue(superinterfacesOfE.contains(elementA.type));
-    JUnitTestCase.assertTrue(superinterfacesOfE.contains(elementB.type));
-    JUnitTestCase.assertTrue(superinterfacesOfE.contains(elementC.type));
-    JUnitTestCase.assertTrue(superinterfacesOfE.contains(elementD.type));
+    JUnitTestCase.assertTrue(superinterfacesOfE.contains(classA.type));
+    JUnitTestCase.assertTrue(superinterfacesOfE.contains(classB.type));
+    JUnitTestCase.assertTrue(superinterfacesOfE.contains(classC.type));
+    JUnitTestCase.assertTrue(superinterfacesOfE.contains(classD.type));
     JUnitTestCase.assertEquals(5, superinterfacesOfE.length);
   }
   void test_computeSuperinterfaceSet_multipleSuperclassPaths() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    ClassElement elementB = ElementFactory.classElement("B", elementA.type, []);
-    ClassElement elementC = ElementFactory.classElement("C", elementA.type, []);
-    ClassElement elementD = ElementFactory.classElement("D", elementC.type, []);
-    ClassElementImpl elementE = ElementFactory.classElement("E", elementB.type, []);
-    elementE.interfaces = <InterfaceType> [elementD.type];
-    Set<InterfaceType> superinterfacesOfD = InterfaceTypeImpl.computeSuperinterfaceSet(elementD.type);
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElement classC = ElementFactory.classElement("C", classA.type, []);
+    ClassElement classD = ElementFactory.classElement("D", classC.type, []);
+    ClassElementImpl classE = ElementFactory.classElement("E", classB.type, []);
+    classE.interfaces = <InterfaceType> [classD.type];
+    Set<InterfaceType> superinterfacesOfD = InterfaceTypeImpl.computeSuperinterfaceSet(classD.type);
     JUnitTestCase.assertNotNull(superinterfacesOfD);
     JUnitTestCase.assertTrue(superinterfacesOfD.contains(ElementFactory.object.type));
-    JUnitTestCase.assertTrue(superinterfacesOfD.contains(elementA.type));
-    JUnitTestCase.assertTrue(superinterfacesOfD.contains(elementC.type));
+    JUnitTestCase.assertTrue(superinterfacesOfD.contains(classA.type));
+    JUnitTestCase.assertTrue(superinterfacesOfD.contains(classC.type));
     JUnitTestCase.assertEquals(3, superinterfacesOfD.length);
-    Set<InterfaceType> superinterfacesOfE = InterfaceTypeImpl.computeSuperinterfaceSet(elementE.type);
+    Set<InterfaceType> superinterfacesOfE = InterfaceTypeImpl.computeSuperinterfaceSet(classE.type);
     JUnitTestCase.assertNotNull(superinterfacesOfE);
     JUnitTestCase.assertTrue(superinterfacesOfE.contains(ElementFactory.object.type));
-    JUnitTestCase.assertTrue(superinterfacesOfE.contains(elementA.type));
-    JUnitTestCase.assertTrue(superinterfacesOfE.contains(elementB.type));
-    JUnitTestCase.assertTrue(superinterfacesOfE.contains(elementC.type));
-    JUnitTestCase.assertTrue(superinterfacesOfE.contains(elementD.type));
+    JUnitTestCase.assertTrue(superinterfacesOfE.contains(classA.type));
+    JUnitTestCase.assertTrue(superinterfacesOfE.contains(classB.type));
+    JUnitTestCase.assertTrue(superinterfacesOfE.contains(classC.type));
+    JUnitTestCase.assertTrue(superinterfacesOfE.contains(classD.type));
     JUnitTestCase.assertEquals(5, superinterfacesOfE.length);
   }
   void test_computeSuperinterfaceSet_singleInterfacePath() {
-    ClassElementImpl elementA = ElementFactory.classElement2("A", []);
-    ClassElementImpl elementB = ElementFactory.classElement2("B", []);
-    ClassElementImpl elementC = ElementFactory.classElement2("C", []);
-    elementB.interfaces = <InterfaceType> [elementA.type];
-    elementC.interfaces = <InterfaceType> [elementB.type];
-    Set<InterfaceType> superinterfacesOfA = InterfaceTypeImpl.computeSuperinterfaceSet(elementA.type);
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    classB.interfaces = <InterfaceType> [classA.type];
+    classC.interfaces = <InterfaceType> [classB.type];
+    Set<InterfaceType> superinterfacesOfA = InterfaceTypeImpl.computeSuperinterfaceSet(classA.type);
     JUnitTestCase.assertNotNull(superinterfacesOfA);
     JUnitTestCase.assertTrue(superinterfacesOfA.contains(ElementFactory.object.type));
     JUnitTestCase.assertEquals(1, superinterfacesOfA.length);
-    Set<InterfaceType> superinterfacesOfB = InterfaceTypeImpl.computeSuperinterfaceSet(elementB.type);
+    Set<InterfaceType> superinterfacesOfB = InterfaceTypeImpl.computeSuperinterfaceSet(classB.type);
     JUnitTestCase.assertNotNull(superinterfacesOfB);
     JUnitTestCase.assertTrue(superinterfacesOfB.contains(ElementFactory.object.type));
-    JUnitTestCase.assertTrue(superinterfacesOfB.contains(elementA.type));
+    JUnitTestCase.assertTrue(superinterfacesOfB.contains(classA.type));
     JUnitTestCase.assertEquals(2, superinterfacesOfB.length);
-    Set<InterfaceType> superinterfacesOfC = InterfaceTypeImpl.computeSuperinterfaceSet(elementC.type);
+    Set<InterfaceType> superinterfacesOfC = InterfaceTypeImpl.computeSuperinterfaceSet(classC.type);
     JUnitTestCase.assertNotNull(superinterfacesOfC);
     JUnitTestCase.assertTrue(superinterfacesOfC.contains(ElementFactory.object.type));
-    JUnitTestCase.assertTrue(superinterfacesOfC.contains(elementA.type));
-    JUnitTestCase.assertTrue(superinterfacesOfC.contains(elementB.type));
+    JUnitTestCase.assertTrue(superinterfacesOfC.contains(classA.type));
+    JUnitTestCase.assertTrue(superinterfacesOfC.contains(classB.type));
     JUnitTestCase.assertEquals(3, superinterfacesOfC.length);
   }
   void test_computeSuperinterfaceSet_singleSuperclassPath() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    ClassElement elementB = ElementFactory.classElement("B", elementA.type, []);
-    ClassElement elementC = ElementFactory.classElement("C", elementB.type, []);
-    Set<InterfaceType> superinterfacesOfA = InterfaceTypeImpl.computeSuperinterfaceSet(elementA.type);
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElement classC = ElementFactory.classElement("C", classB.type, []);
+    Set<InterfaceType> superinterfacesOfA = InterfaceTypeImpl.computeSuperinterfaceSet(classA.type);
     JUnitTestCase.assertNotNull(superinterfacesOfA);
     JUnitTestCase.assertTrue(superinterfacesOfA.contains(ElementFactory.object.type));
     JUnitTestCase.assertEquals(1, superinterfacesOfA.length);
-    Set<InterfaceType> superinterfacesOfB = InterfaceTypeImpl.computeSuperinterfaceSet(elementB.type);
+    Set<InterfaceType> superinterfacesOfB = InterfaceTypeImpl.computeSuperinterfaceSet(classB.type);
     JUnitTestCase.assertNotNull(superinterfacesOfB);
     JUnitTestCase.assertTrue(superinterfacesOfB.contains(ElementFactory.object.type));
-    JUnitTestCase.assertTrue(superinterfacesOfB.contains(elementA.type));
+    JUnitTestCase.assertTrue(superinterfacesOfB.contains(classA.type));
     JUnitTestCase.assertEquals(2, superinterfacesOfB.length);
-    Set<InterfaceType> superinterfacesOfC = InterfaceTypeImpl.computeSuperinterfaceSet(elementC.type);
+    Set<InterfaceType> superinterfacesOfC = InterfaceTypeImpl.computeSuperinterfaceSet(classC.type);
     JUnitTestCase.assertNotNull(superinterfacesOfC);
     JUnitTestCase.assertTrue(superinterfacesOfC.contains(ElementFactory.object.type));
-    JUnitTestCase.assertTrue(superinterfacesOfC.contains(elementA.type));
-    JUnitTestCase.assertTrue(superinterfacesOfC.contains(elementB.type));
+    JUnitTestCase.assertTrue(superinterfacesOfC.contains(classA.type));
+    JUnitTestCase.assertTrue(superinterfacesOfC.contains(classB.type));
     JUnitTestCase.assertEquals(3, superinterfacesOfC.length);
   }
   void test_creation() {
-    JUnitTestCase.assertNotNull(new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier2("A"))));
+    JUnitTestCase.assertNotNull(new InterfaceTypeImpl.con1(ElementFactory.classElement2("A", [])));
   }
   void test_getElement() {
-    ClassElementImpl typeElement = new ClassElementImpl(ASTFactory.identifier2("A"));
+    ClassElementImpl typeElement = ElementFactory.classElement2("A", []);
     InterfaceTypeImpl type = new InterfaceTypeImpl.con1(typeElement);
     JUnitTestCase.assertEquals(typeElement, type.element);
   }
+  void test_getGetter_implemented() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    String getterName = "g";
+    PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, null);
+    classA.accessors = <PropertyAccessorElement> [getterG];
+    InterfaceType typeA = classA.type;
+    JUnitTestCase.assertSame(getterG, typeA.getGetter(getterName));
+  }
+  void test_getGetter_parameterized() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", ["E"]);
+    Type2 typeE = classA.type.typeArguments[0];
+    String getterName = "g";
+    PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, typeE);
+    classA.accessors = <PropertyAccessorElement> [getterG];
+    InterfaceType typeI = ElementFactory.classElement2("I", []).type;
+    InterfaceTypeImpl typeAI = new InterfaceTypeImpl.con1(classA);
+    typeAI.typeArguments = <Type2> [typeI];
+    PropertyAccessorElement getter = typeAI.getGetter(getterName);
+    JUnitTestCase.assertNotNull(getter);
+    FunctionType getterType = getter.type;
+    JUnitTestCase.assertSame(typeI, getterType.returnType);
+  }
+  void test_getGetter_unimplemented() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    InterfaceType typeA = classA.type;
+    JUnitTestCase.assertNull(typeA.getGetter("g"));
+  }
+  void test_getInterfaces_nonParameterized() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    InterfaceType typeA = classA.type;
+    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    InterfaceType typeB = classB.type;
+    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    classC.interfaces = <InterfaceType> [typeA, typeB];
+    List<InterfaceType> interfaces2 = classC.type.interfaces;
+    EngineTestCase.assertLength(2, interfaces2);
+    if (identical(interfaces2[0], typeA)) {
+      JUnitTestCase.assertSame(typeB, interfaces2[1]);
+    } else {
+      JUnitTestCase.assertSame(typeB, interfaces2[0]);
+      JUnitTestCase.assertSame(typeA, interfaces2[1]);
+    }
+  }
+  void test_getInterfaces_parameterized() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", ["E"]);
+    ClassElementImpl classB = ElementFactory.classElement2("B", ["F"]);
+    InterfaceType typeB = classB.type;
+    InterfaceTypeImpl typeAF = new InterfaceTypeImpl.con1(classA);
+    typeAF.typeArguments = <Type2> [typeB.typeArguments[0]];
+    classB.interfaces = <InterfaceType> [typeAF];
+    InterfaceType typeI = ElementFactory.classElement2("I", []).type;
+    InterfaceTypeImpl typeBI = new InterfaceTypeImpl.con1(classB);
+    typeBI.typeArguments = <Type2> [typeI];
+    List<InterfaceType> interfaces2 = typeBI.interfaces;
+    EngineTestCase.assertLength(1, interfaces2);
+    InterfaceType result = interfaces2[0];
+    JUnitTestCase.assertSame(classA, result.element);
+    JUnitTestCase.assertSame(typeI, result.typeArguments[0]);
+  }
   void test_getLeastUpperBound_directInterfaceCase() {
-    ClassElementImpl elementA = ElementFactory.classElement2("A", []);
-    ClassElementImpl elementB = ElementFactory.classElement2("B", []);
-    ClassElementImpl elementC = ElementFactory.classElement2("C", []);
-    InterfaceType typeA = elementA.type;
-    InterfaceType typeB = elementB.type;
-    InterfaceType typeC = elementC.type;
-    elementB.interfaces = <InterfaceType> [typeA];
-    elementC.interfaces = <InterfaceType> [typeB];
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    InterfaceType typeA = classA.type;
+    InterfaceType typeB = classB.type;
+    InterfaceType typeC = classC.type;
+    classB.interfaces = <InterfaceType> [typeA];
+    classC.interfaces = <InterfaceType> [typeB];
     JUnitTestCase.assertEquals(typeB, typeB.getLeastUpperBound(typeC));
     JUnitTestCase.assertEquals(typeB, typeC.getLeastUpperBound(typeB));
   }
   void test_getLeastUpperBound_directSubclassCase() {
-    ClassElementImpl elementA = ElementFactory.classElement2("A", []);
-    ClassElementImpl elementB = ElementFactory.classElement("B", elementA.type, []);
-    ClassElementImpl elementC = ElementFactory.classElement("C", elementB.type, []);
-    InterfaceType typeB = elementB.type;
-    InterfaceType typeC = elementC.type;
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classC = ElementFactory.classElement("C", classB.type, []);
+    InterfaceType typeB = classB.type;
+    InterfaceType typeC = classC.type;
     JUnitTestCase.assertEquals(typeB, typeB.getLeastUpperBound(typeC));
     JUnitTestCase.assertEquals(typeB, typeC.getLeastUpperBound(typeB));
   }
   void test_getLeastUpperBound_functionType() {
     Type2 interfaceType = ElementFactory.classElement2("A", []).type;
-    FunctionTypeImpl functionType = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier2("f")));
+    FunctionTypeImpl functionType = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier3("f")));
     JUnitTestCase.assertNull(interfaceType.getLeastUpperBound(functionType));
   }
+  void test_getLeastUpperBound_ignoreTypeParameters() {
+    InterfaceType listType2 = _typeProvider.listType;
+    InterfaceType intType2 = _typeProvider.intType;
+    InterfaceType doubleType2 = _typeProvider.doubleType;
+    InterfaceType listOfIntType = listType2.substitute5(<Type2> [intType2]);
+    InterfaceType listOfDoubleType = listType2.substitute5(<Type2> [doubleType2]);
+    JUnitTestCase.assertEquals(listType2, listOfIntType.getLeastUpperBound(listOfDoubleType));
+  }
   void test_getLeastUpperBound_mixinCase() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    ClassElement elementB = ElementFactory.classElement("B", elementA.type, []);
-    ClassElement elementC = ElementFactory.classElement("C", elementA.type, []);
-    ClassElementImpl elementD = ElementFactory.classElement("D", elementB.type, []);
-    InterfaceType typeA = elementA.type;
-    InterfaceType typeC = elementC.type;
-    InterfaceType typeD = elementD.type;
-    elementD.mixins = <InterfaceType> [ElementFactory.classElement2("M", []).type, ElementFactory.classElement2("N", []).type, ElementFactory.classElement2("O", []).type, ElementFactory.classElement2("P", []).type];
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElement classC = ElementFactory.classElement("C", classA.type, []);
+    ClassElementImpl classD = ElementFactory.classElement("D", classB.type, []);
+    InterfaceType typeA = classA.type;
+    InterfaceType typeC = classC.type;
+    InterfaceType typeD = classD.type;
+    classD.mixins = <InterfaceType> [ElementFactory.classElement2("M", []).type, ElementFactory.classElement2("N", []).type, ElementFactory.classElement2("O", []).type, ElementFactory.classElement2("P", []).type];
     JUnitTestCase.assertEquals(typeA, typeD.getLeastUpperBound(typeC));
     JUnitTestCase.assertEquals(typeA, typeC.getLeastUpperBound(typeD));
   }
@@ -358,276 +433,388 @@
     JUnitTestCase.assertNull(interfaceType.getLeastUpperBound(null));
   }
   void test_getLeastUpperBound_object() {
-    ClassElementImpl elementA = ElementFactory.classElement2("A", []);
-    ClassElementImpl elementB = ElementFactory.classElement2("B", []);
-    InterfaceType typeA = elementA.type;
-    InterfaceType typeB = elementB.type;
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    InterfaceType typeA = classA.type;
+    InterfaceType typeB = classB.type;
     Type2 typeObject = typeA.element.supertype;
     JUnitTestCase.assertNull(((typeObject.element as ClassElement)).supertype);
     JUnitTestCase.assertEquals(typeObject, typeB.element.supertype);
     JUnitTestCase.assertEquals(typeObject, typeA.getLeastUpperBound(typeB));
   }
   void test_getLeastUpperBound_self() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    InterfaceType typeA = elementA.type;
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    InterfaceType typeA = classA.type;
     JUnitTestCase.assertEquals(typeA, typeA.getLeastUpperBound(typeA));
   }
   void test_getLeastUpperBound_sharedSuperclass1() {
-    ClassElementImpl elementA = ElementFactory.classElement2("A", []);
-    ClassElementImpl elementB = ElementFactory.classElement("B", elementA.type, []);
-    ClassElementImpl elementC = ElementFactory.classElement("C", elementA.type, []);
-    InterfaceType typeA = elementA.type;
-    InterfaceType typeB = elementB.type;
-    InterfaceType typeC = elementC.type;
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classC = ElementFactory.classElement("C", classA.type, []);
+    InterfaceType typeA = classA.type;
+    InterfaceType typeB = classB.type;
+    InterfaceType typeC = classC.type;
     JUnitTestCase.assertEquals(typeA, typeB.getLeastUpperBound(typeC));
     JUnitTestCase.assertEquals(typeA, typeC.getLeastUpperBound(typeB));
   }
   void test_getLeastUpperBound_sharedSuperclass2() {
-    ClassElementImpl elementA = ElementFactory.classElement2("A", []);
-    ClassElementImpl elementB = ElementFactory.classElement("B", elementA.type, []);
-    ClassElementImpl elementC = ElementFactory.classElement("C", elementA.type, []);
-    ClassElementImpl elementD = ElementFactory.classElement("D", elementC.type, []);
-    InterfaceType typeA = elementA.type;
-    InterfaceType typeB = elementB.type;
-    InterfaceType typeD = elementD.type;
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classC = ElementFactory.classElement("C", classA.type, []);
+    ClassElementImpl classD = ElementFactory.classElement("D", classC.type, []);
+    InterfaceType typeA = classA.type;
+    InterfaceType typeB = classB.type;
+    InterfaceType typeD = classD.type;
     JUnitTestCase.assertEquals(typeA, typeB.getLeastUpperBound(typeD));
     JUnitTestCase.assertEquals(typeA, typeD.getLeastUpperBound(typeB));
   }
   void test_getLeastUpperBound_sharedSuperclass3() {
-    ClassElementImpl elementA = ElementFactory.classElement2("A", []);
-    ClassElementImpl elementB = ElementFactory.classElement("B", elementA.type, []);
-    ClassElementImpl elementC = ElementFactory.classElement("C", elementB.type, []);
-    ClassElementImpl elementD = ElementFactory.classElement("D", elementB.type, []);
-    InterfaceType typeB = elementB.type;
-    InterfaceType typeC = elementC.type;
-    InterfaceType typeD = elementD.type;
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classC = ElementFactory.classElement("C", classB.type, []);
+    ClassElementImpl classD = ElementFactory.classElement("D", classB.type, []);
+    InterfaceType typeB = classB.type;
+    InterfaceType typeC = classC.type;
+    InterfaceType typeD = classD.type;
     JUnitTestCase.assertEquals(typeB, typeC.getLeastUpperBound(typeD));
     JUnitTestCase.assertEquals(typeB, typeD.getLeastUpperBound(typeC));
   }
   void test_getLeastUpperBound_sharedSuperclass4() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    ClassElement elementA2 = ElementFactory.classElement2("A2", []);
-    ClassElement elementA3 = ElementFactory.classElement2("A3", []);
-    ClassElementImpl elementB = ElementFactory.classElement("B", elementA.type, []);
-    ClassElementImpl elementC = ElementFactory.classElement("C", elementA.type, []);
-    InterfaceType typeA = elementA.type;
-    InterfaceType typeA2 = elementA2.type;
-    InterfaceType typeA3 = elementA3.type;
-    InterfaceType typeB = elementB.type;
-    InterfaceType typeC = elementC.type;
-    elementB.interfaces = <InterfaceType> [typeA2];
-    elementC.interfaces = <InterfaceType> [typeA3];
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classA2 = ElementFactory.classElement2("A2", []);
+    ClassElement classA3 = ElementFactory.classElement2("A3", []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classC = ElementFactory.classElement("C", classA.type, []);
+    InterfaceType typeA = classA.type;
+    InterfaceType typeA2 = classA2.type;
+    InterfaceType typeA3 = classA3.type;
+    InterfaceType typeB = classB.type;
+    InterfaceType typeC = classC.type;
+    classB.interfaces = <InterfaceType> [typeA2];
+    classC.interfaces = <InterfaceType> [typeA3];
     JUnitTestCase.assertEquals(typeA, typeB.getLeastUpperBound(typeC));
     JUnitTestCase.assertEquals(typeA, typeC.getLeastUpperBound(typeB));
   }
   void test_getLeastUpperBound_sharedSuperinterface1() {
-    ClassElementImpl elementA = ElementFactory.classElement2("A", []);
-    ClassElementImpl elementB = ElementFactory.classElement2("B", []);
-    ClassElementImpl elementC = ElementFactory.classElement2("C", []);
-    InterfaceType typeA = elementA.type;
-    InterfaceType typeB = elementB.type;
-    InterfaceType typeC = elementC.type;
-    elementB.interfaces = <InterfaceType> [typeA];
-    elementC.interfaces = <InterfaceType> [typeA];
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    InterfaceType typeA = classA.type;
+    InterfaceType typeB = classB.type;
+    InterfaceType typeC = classC.type;
+    classB.interfaces = <InterfaceType> [typeA];
+    classC.interfaces = <InterfaceType> [typeA];
     JUnitTestCase.assertEquals(typeA, typeB.getLeastUpperBound(typeC));
     JUnitTestCase.assertEquals(typeA, typeC.getLeastUpperBound(typeB));
   }
   void test_getLeastUpperBound_sharedSuperinterface2() {
-    ClassElementImpl elementA = ElementFactory.classElement2("A", []);
-    ClassElementImpl elementB = ElementFactory.classElement2("B", []);
-    ClassElementImpl elementC = ElementFactory.classElement2("C", []);
-    ClassElementImpl elementD = ElementFactory.classElement2("D", []);
-    InterfaceType typeA = elementA.type;
-    InterfaceType typeB = elementB.type;
-    InterfaceType typeC = elementC.type;
-    InterfaceType typeD = elementD.type;
-    elementB.interfaces = <InterfaceType> [typeA];
-    elementC.interfaces = <InterfaceType> [typeA];
-    elementD.interfaces = <InterfaceType> [typeC];
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    ClassElementImpl classD = ElementFactory.classElement2("D", []);
+    InterfaceType typeA = classA.type;
+    InterfaceType typeB = classB.type;
+    InterfaceType typeC = classC.type;
+    InterfaceType typeD = classD.type;
+    classB.interfaces = <InterfaceType> [typeA];
+    classC.interfaces = <InterfaceType> [typeA];
+    classD.interfaces = <InterfaceType> [typeC];
     JUnitTestCase.assertEquals(typeA, typeB.getLeastUpperBound(typeD));
     JUnitTestCase.assertEquals(typeA, typeD.getLeastUpperBound(typeB));
   }
   void test_getLeastUpperBound_sharedSuperinterface3() {
-    ClassElementImpl elementA = ElementFactory.classElement2("A", []);
-    ClassElementImpl elementB = ElementFactory.classElement2("B", []);
-    ClassElementImpl elementC = ElementFactory.classElement2("C", []);
-    ClassElementImpl elementD = ElementFactory.classElement2("D", []);
-    InterfaceType typeA = elementA.type;
-    InterfaceType typeB = elementB.type;
-    InterfaceType typeC = elementC.type;
-    InterfaceType typeD = elementD.type;
-    elementB.interfaces = <InterfaceType> [typeA];
-    elementC.interfaces = <InterfaceType> [typeB];
-    elementD.interfaces = <InterfaceType> [typeB];
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    ClassElementImpl classD = ElementFactory.classElement2("D", []);
+    InterfaceType typeA = classA.type;
+    InterfaceType typeB = classB.type;
+    InterfaceType typeC = classC.type;
+    InterfaceType typeD = classD.type;
+    classB.interfaces = <InterfaceType> [typeA];
+    classC.interfaces = <InterfaceType> [typeB];
+    classD.interfaces = <InterfaceType> [typeB];
     JUnitTestCase.assertEquals(typeB, typeC.getLeastUpperBound(typeD));
     JUnitTestCase.assertEquals(typeB, typeD.getLeastUpperBound(typeC));
   }
   void test_getLeastUpperBound_sharedSuperinterface4() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    ClassElement elementA2 = ElementFactory.classElement2("A2", []);
-    ClassElement elementA3 = ElementFactory.classElement2("A3", []);
-    ClassElementImpl elementB = ElementFactory.classElement2("B", []);
-    ClassElementImpl elementC = ElementFactory.classElement2("C", []);
-    InterfaceType typeA = elementA.type;
-    InterfaceType typeA2 = elementA2.type;
-    InterfaceType typeA3 = elementA3.type;
-    InterfaceType typeB = elementB.type;
-    InterfaceType typeC = elementC.type;
-    elementB.interfaces = <InterfaceType> [typeA, typeA2];
-    elementC.interfaces = <InterfaceType> [typeA, typeA3];
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classA2 = ElementFactory.classElement2("A2", []);
+    ClassElement classA3 = ElementFactory.classElement2("A3", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    InterfaceType typeA = classA.type;
+    InterfaceType typeA2 = classA2.type;
+    InterfaceType typeA3 = classA3.type;
+    InterfaceType typeB = classB.type;
+    InterfaceType typeC = classC.type;
+    classB.interfaces = <InterfaceType> [typeA, typeA2];
+    classC.interfaces = <InterfaceType> [typeA, typeA3];
     JUnitTestCase.assertEquals(typeA, typeB.getLeastUpperBound(typeC));
     JUnitTestCase.assertEquals(typeA, typeC.getLeastUpperBound(typeB));
   }
-  void test_getTypeArguments() {
-    InterfaceTypeImpl type = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier2("A")));
-    EngineTestCase.assertLength(0, type.typeArguments);
+  void test_getMethod_implemented() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    String methodName = "m";
+    MethodElementImpl methodM = ElementFactory.methodElement(methodName, null, []);
+    classA.methods = <MethodElement> [methodM];
+    InterfaceType typeA = classA.type;
+    JUnitTestCase.assertSame(methodM, typeA.getMethod(methodName));
+  }
+  void test_getMethod_parameterized() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", ["E"]);
+    Type2 typeE = classA.type.typeArguments[0];
+    String methodName = "m";
+    MethodElementImpl methodM = ElementFactory.methodElement(methodName, typeE, [typeE]);
+    classA.methods = <MethodElement> [methodM];
+    InterfaceType typeI = ElementFactory.classElement2("I", []).type;
+    InterfaceTypeImpl typeAI = new InterfaceTypeImpl.con1(classA);
+    typeAI.typeArguments = <Type2> [typeI];
+    MethodElement method = typeAI.getMethod(methodName);
+    JUnitTestCase.assertNotNull(method);
+    FunctionType methodType = method.type;
+    JUnitTestCase.assertSame(typeI, methodType.returnType);
+    List<Type2> parameterTypes = methodType.normalParameterTypes;
+    EngineTestCase.assertLength(1, parameterTypes);
+    JUnitTestCase.assertSame(typeI, parameterTypes[0]);
+  }
+  void test_getMethod_unimplemented() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    InterfaceType typeA = classA.type;
+    JUnitTestCase.assertNull(typeA.getMethod("m"));
+  }
+  void test_getMixins_nonParameterized() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    InterfaceType typeA = classA.type;
+    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    InterfaceType typeB = classB.type;
+    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    classC.mixins = <InterfaceType> [typeA, typeB];
+    List<InterfaceType> interfaces = classC.type.mixins;
+    EngineTestCase.assertLength(2, interfaces);
+    if (identical(interfaces[0], typeA)) {
+      JUnitTestCase.assertSame(typeB, interfaces[1]);
+    } else {
+      JUnitTestCase.assertSame(typeB, interfaces[0]);
+      JUnitTestCase.assertSame(typeA, interfaces[1]);
+    }
+  }
+  void test_getMixins_parameterized() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", ["E"]);
+    ClassElementImpl classB = ElementFactory.classElement2("B", ["F"]);
+    InterfaceType typeB = classB.type;
+    InterfaceTypeImpl typeAF = new InterfaceTypeImpl.con1(classA);
+    typeAF.typeArguments = <Type2> [typeB.typeArguments[0]];
+    classB.mixins = <InterfaceType> [typeAF];
+    InterfaceType typeI = ElementFactory.classElement2("I", []).type;
+    InterfaceTypeImpl typeBI = new InterfaceTypeImpl.con1(classB);
+    typeBI.typeArguments = <Type2> [typeI];
+    List<InterfaceType> interfaces = typeBI.mixins;
+    EngineTestCase.assertLength(1, interfaces);
+    InterfaceType result = interfaces[0];
+    JUnitTestCase.assertSame(classA, result.element);
+    JUnitTestCase.assertSame(typeI, result.typeArguments[0]);
+  }
+  void test_getSetter_implemented() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    String setterName = "s";
+    PropertyAccessorElement setterS = ElementFactory.setterElement(setterName, false, null);
+    classA.accessors = <PropertyAccessorElement> [setterS];
+    InterfaceType typeA = classA.type;
+    JUnitTestCase.assertSame(setterS, typeA.getSetter(setterName));
+  }
+  void test_getSetter_parameterized() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", ["E"]);
+    Type2 typeE = classA.type.typeArguments[0];
+    String setterName = "s";
+    PropertyAccessorElement setterS = ElementFactory.setterElement(setterName, false, typeE);
+    classA.accessors = <PropertyAccessorElement> [setterS];
+    InterfaceType typeI = ElementFactory.classElement2("I", []).type;
+    InterfaceTypeImpl typeAI = new InterfaceTypeImpl.con1(classA);
+    typeAI.typeArguments = <Type2> [typeI];
+    PropertyAccessorElement setter = typeAI.getSetter(setterName);
+    JUnitTestCase.assertNotNull(setter);
+    FunctionType setterType = setter.type;
+    List<Type2> parameterTypes = setterType.normalParameterTypes;
+    EngineTestCase.assertLength(1, parameterTypes);
+    JUnitTestCase.assertSame(typeI, parameterTypes[0]);
+  }
+  void test_getSetter_unimplemented() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    InterfaceType typeA = classA.type;
+    JUnitTestCase.assertNull(typeA.getSetter("s"));
+  }
+  void test_getSuperclass_nonParameterized() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    InterfaceType typeA = classA.type;
+    ClassElementImpl classB = ElementFactory.classElement("B", typeA, []);
+    InterfaceType typeB = classB.type;
+    JUnitTestCase.assertSame(typeA, typeB.superclass);
+  }
+  void test_getSuperclass_parameterized() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", ["E"]);
+    ClassElementImpl classB = ElementFactory.classElement2("B", ["F"]);
+    InterfaceType typeB = classB.type;
+    InterfaceTypeImpl typeAF = new InterfaceTypeImpl.con1(classA);
+    typeAF.typeArguments = <Type2> [typeB.typeArguments[0]];
+    classB.supertype = typeAF;
+    InterfaceType typeI = ElementFactory.classElement2("I", []).type;
+    InterfaceTypeImpl typeBI = new InterfaceTypeImpl.con1(classB);
+    typeBI.typeArguments = <Type2> [typeI];
+    InterfaceType superclass2 = typeBI.superclass;
+    JUnitTestCase.assertSame(classA, superclass2.element);
+    JUnitTestCase.assertSame(typeI, superclass2.typeArguments[0]);
+  }
+  void test_getTypeArguments_empty() {
+    InterfaceType type2 = ElementFactory.classElement2("A", []).type;
+    EngineTestCase.assertLength(0, type2.typeArguments);
   }
   void test_isDirectSupertypeOf_extends() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    ClassElement elementB = ElementFactory.classElement("B", elementA.type, []);
-    InterfaceTypeImpl typeA = new InterfaceTypeImpl.con1(elementA);
-    InterfaceTypeImpl typeB = new InterfaceTypeImpl.con1(elementB);
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
+    InterfaceType typeA = classA.type;
+    InterfaceType typeB = classB.type;
     JUnitTestCase.assertTrue(typeA.isDirectSupertypeOf(typeB));
   }
   void test_isDirectSupertypeOf_false() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    ClassElement elementB = ElementFactory.classElement2("B", []);
-    ClassElement elementC = ElementFactory.classElement("C", elementB.type, []);
-    InterfaceTypeImpl typeA = new InterfaceTypeImpl.con1(elementA);
-    InterfaceTypeImpl typeC = new InterfaceTypeImpl.con1(elementC);
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classB = ElementFactory.classElement2("B", []);
+    ClassElement classC = ElementFactory.classElement("C", classB.type, []);
+    InterfaceType typeA = classA.type;
+    InterfaceType typeC = classC.type;
     JUnitTestCase.assertFalse(typeA.isDirectSupertypeOf(typeC));
   }
   void test_isDirectSupertypeOf_implements() {
-    ClassElementImpl elementA = ElementFactory.classElement2("A", []);
-    ClassElementImpl elementB = ElementFactory.classElement2("B", []);
-    elementB.interfaces = <InterfaceType> [elementA.type];
-    InterfaceTypeImpl typeA = new InterfaceTypeImpl.con1(elementA);
-    InterfaceTypeImpl typeB = new InterfaceTypeImpl.con1(elementB);
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    InterfaceType typeA = classA.type;
+    InterfaceType typeB = classB.type;
+    classB.interfaces = <InterfaceType> [typeA];
     JUnitTestCase.assertTrue(typeA.isDirectSupertypeOf(typeB));
   }
   void test_isDirectSupertypeOf_with() {
-    ClassElementImpl elementA = ElementFactory.classElement2("A", []);
-    ClassElementImpl elementB = ElementFactory.classElement2("B", []);
-    elementB.mixins = <InterfaceType> [elementA.type];
-    InterfaceTypeImpl typeA = new InterfaceTypeImpl.con1(elementA);
-    InterfaceTypeImpl typeB = new InterfaceTypeImpl.con1(elementB);
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    InterfaceType typeA = classA.type;
+    InterfaceType typeB = classB.type;
+    classB.mixins = <InterfaceType> [typeA];
     JUnitTestCase.assertTrue(typeA.isDirectSupertypeOf(typeB));
   }
   void test_isMoreSpecificThan_bottom() {
-    Type2 type25 = ElementFactory.classElement2("A", []).type;
-    JUnitTestCase.assertTrue(BottomTypeImpl.instance.isMoreSpecificThan(type25));
+    Type2 type2 = ElementFactory.classElement2("A", []).type;
+    JUnitTestCase.assertTrue(BottomTypeImpl.instance.isMoreSpecificThan(type2));
   }
   void test_isMoreSpecificThan_covariance() {
-    ClassElement elementA = ElementFactory.classElement2("A", ["E"]);
-    ClassElement elementI = ElementFactory.classElement2("I", []);
-    ClassElement elementJ = ElementFactory.classElement("J", elementI.type, []);
-    InterfaceTypeImpl typeAI = new InterfaceTypeImpl.con1(elementA);
-    InterfaceTypeImpl typeAJ = new InterfaceTypeImpl.con1(elementA);
-    typeAI.typeArguments = <Type2> [elementI.type];
-    typeAJ.typeArguments = <Type2> [elementJ.type];
+    ClassElement classA = ElementFactory.classElement2("A", ["E"]);
+    ClassElement classI = ElementFactory.classElement2("I", []);
+    ClassElement classJ = ElementFactory.classElement("J", classI.type, []);
+    InterfaceTypeImpl typeAI = new InterfaceTypeImpl.con1(classA);
+    InterfaceTypeImpl typeAJ = new InterfaceTypeImpl.con1(classA);
+    typeAI.typeArguments = <Type2> [classI.type];
+    typeAJ.typeArguments = <Type2> [classJ.type];
     JUnitTestCase.assertTrue(typeAJ.isMoreSpecificThan(typeAI));
     JUnitTestCase.assertFalse(typeAI.isMoreSpecificThan(typeAJ));
   }
   void test_isMoreSpecificThan_directSupertype() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    ClassElement elementB = ElementFactory.classElement("B", elementA.type, []);
-    InterfaceType typeA = elementA.type;
-    InterfaceType typeB = elementB.type;
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
+    InterfaceType typeA = classA.type;
+    InterfaceType typeB = classB.type;
     JUnitTestCase.assertTrue(typeB.isMoreSpecificThan(typeA));
     JUnitTestCase.assertFalse(typeA.isMoreSpecificThan(typeB));
   }
   void test_isMoreSpecificThan_dynamic() {
-    InterfaceType type26 = ElementFactory.classElement2("A", []).type;
-    JUnitTestCase.assertTrue(type26.isMoreSpecificThan(DynamicTypeImpl.instance));
+    InterfaceType type2 = ElementFactory.classElement2("A", []).type;
+    JUnitTestCase.assertTrue(type2.isMoreSpecificThan(DynamicTypeImpl.instance));
   }
   void test_isMoreSpecificThan_indirectSupertype() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    ClassElement elementB = ElementFactory.classElement("B", elementA.type, []);
-    ClassElement elementC = ElementFactory.classElement("C", elementB.type, []);
-    InterfaceType typeA = elementA.type;
-    InterfaceType typeC = elementC.type;
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElement classC = ElementFactory.classElement("C", classB.type, []);
+    InterfaceType typeA = classA.type;
+    InterfaceType typeC = classC.type;
     JUnitTestCase.assertTrue(typeC.isMoreSpecificThan(typeA));
   }
   void test_isMoreSpecificThan_self() {
-    InterfaceType type27 = ElementFactory.classElement2("A", []).type;
-    JUnitTestCase.assertTrue(type27.isMoreSpecificThan(type27));
+    InterfaceType type2 = ElementFactory.classElement2("A", []).type;
+    JUnitTestCase.assertTrue(type2.isMoreSpecificThan(type2));
   }
   void test_isSubtypeOf_directSubtype() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    ClassElement elementB = ElementFactory.classElement("B", elementA.type, []);
-    InterfaceType typeA = elementA.type;
-    InterfaceType typeB = elementB.type;
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
+    InterfaceType typeA = classA.type;
+    InterfaceType typeB = classB.type;
     JUnitTestCase.assertTrue(typeB.isSubtypeOf(typeA));
     JUnitTestCase.assertFalse(typeA.isSubtypeOf(typeB));
   }
   void test_isSubtypeOf_dynamic() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    InterfaceType typeA = elementA.type;
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    InterfaceType typeA = classA.type;
     Type2 dynamicType = DynamicTypeImpl.instance;
     JUnitTestCase.assertFalse(dynamicType.isSubtypeOf(typeA));
     JUnitTestCase.assertTrue(typeA.isSubtypeOf(dynamicType));
   }
   void test_isSubtypeOf_indirectSubtype() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    ClassElement elementB = ElementFactory.classElement("B", elementA.type, []);
-    ClassElement elementC = ElementFactory.classElement("C", elementB.type, []);
-    InterfaceType typeA = elementA.type;
-    InterfaceType typeC = elementC.type;
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElement classC = ElementFactory.classElement("C", classB.type, []);
+    InterfaceType typeA = classA.type;
+    InterfaceType typeC = classC.type;
     JUnitTestCase.assertTrue(typeC.isSubtypeOf(typeA));
     JUnitTestCase.assertFalse(typeA.isSubtypeOf(typeC));
   }
   void test_isSubtypeOf_interface() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    ClassElement elementB = ElementFactory.classElement("B", elementA.type, []);
-    ClassElementImpl elementC = ElementFactory.classElement2("C", []);
-    InterfaceType typeObject = elementA.supertype;
-    InterfaceType typeA = elementA.type;
-    InterfaceType typeB = elementB.type;
-    InterfaceType typeC = elementC.type;
-    elementC.interfaces = <InterfaceType> [typeB];
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    InterfaceType typeObject = classA.supertype;
+    InterfaceType typeA = classA.type;
+    InterfaceType typeB = classB.type;
+    InterfaceType typeC = classC.type;
+    classC.interfaces = <InterfaceType> [typeB];
     JUnitTestCase.assertTrue(typeC.isSubtypeOf(typeB));
     JUnitTestCase.assertTrue(typeC.isSubtypeOf(typeObject));
     JUnitTestCase.assertTrue(typeC.isSubtypeOf(typeA));
     JUnitTestCase.assertFalse(typeA.isSubtypeOf(typeC));
   }
   void test_isSubtypeOf_mixins() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    ClassElement elementB = ElementFactory.classElement("B", elementA.type, []);
-    ClassElementImpl elementC = ElementFactory.classElement2("C", []);
-    InterfaceType typeObject = elementA.supertype;
-    InterfaceType typeA = elementA.type;
-    InterfaceType typeB = elementB.type;
-    InterfaceType typeC = elementC.type;
-    elementC.mixins = <InterfaceType> [typeB];
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    InterfaceType typeObject = classA.supertype;
+    InterfaceType typeA = classA.type;
+    InterfaceType typeB = classB.type;
+    InterfaceType typeC = classC.type;
+    classC.mixins = <InterfaceType> [typeB];
     JUnitTestCase.assertTrue(typeC.isSubtypeOf(typeB));
     JUnitTestCase.assertTrue(typeC.isSubtypeOf(typeObject));
     JUnitTestCase.assertFalse(typeC.isSubtypeOf(typeA));
     JUnitTestCase.assertFalse(typeA.isSubtypeOf(typeC));
   }
   void test_isSubtypeOf_object() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    InterfaceType typeA = elementA.type;
-    InterfaceType typeObject = elementA.supertype;
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    InterfaceType typeA = classA.type;
+    InterfaceType typeObject = classA.supertype;
     JUnitTestCase.assertTrue(typeA.isSubtypeOf(typeObject));
     JUnitTestCase.assertFalse(typeObject.isSubtypeOf(typeA));
   }
   void test_isSubtypeOf_self() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    InterfaceType typeA = elementA.type;
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    InterfaceType typeA = classA.type;
     JUnitTestCase.assertTrue(typeA.isSubtypeOf(typeA));
   }
   void test_isSubtypeOf_typeArguments() {
-    ClassElement elementA = ElementFactory.classElement2("A", ["E"]);
-    ClassElement elementI = ElementFactory.classElement2("I", []);
-    ClassElement elementJ = ElementFactory.classElement("J", elementI.type, []);
-    ClassElement elementK = ElementFactory.classElement2("K", []);
-    InterfaceType typeA = elementA.type;
-    InterfaceTypeImpl typeAI = new InterfaceTypeImpl.con1(elementA);
-    InterfaceTypeImpl typeAJ = new InterfaceTypeImpl.con1(elementA);
-    InterfaceTypeImpl typeAK = new InterfaceTypeImpl.con1(elementA);
-    typeAI.typeArguments = <Type2> [elementI.type];
-    typeAJ.typeArguments = <Type2> [elementJ.type];
-    typeAK.typeArguments = <Type2> [elementK.type];
+    ClassElement classA = ElementFactory.classElement2("A", ["E"]);
+    ClassElement classI = ElementFactory.classElement2("I", []);
+    ClassElement classJ = ElementFactory.classElement("J", classI.type, []);
+    ClassElement classK = ElementFactory.classElement2("K", []);
+    InterfaceType typeA = classA.type;
+    InterfaceTypeImpl typeAI = new InterfaceTypeImpl.con1(classA);
+    InterfaceTypeImpl typeAJ = new InterfaceTypeImpl.con1(classA);
+    InterfaceTypeImpl typeAK = new InterfaceTypeImpl.con1(classA);
+    typeAI.typeArguments = <Type2> [classI.type];
+    typeAJ.typeArguments = <Type2> [classJ.type];
+    typeAK.typeArguments = <Type2> [classK.type];
     JUnitTestCase.assertTrue(typeAJ.isSubtypeOf(typeAI));
     JUnitTestCase.assertFalse(typeAI.isSubtypeOf(typeAJ));
     JUnitTestCase.assertTrue(typeAI.isSubtypeOf(typeAI));
@@ -639,98 +826,216 @@
     JUnitTestCase.assertFalse(typeAK.isSubtypeOf(typeAI));
   }
   void test_isSupertypeOf_directSupertype() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    ClassElement elementB = ElementFactory.classElement("B", elementA.type, []);
-    InterfaceType typeA = elementA.type;
-    InterfaceType typeB = elementB.type;
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
+    InterfaceType typeA = classA.type;
+    InterfaceType typeB = classB.type;
     JUnitTestCase.assertFalse(typeB.isSupertypeOf(typeA));
     JUnitTestCase.assertTrue(typeA.isSupertypeOf(typeB));
   }
   void test_isSupertypeOf_dynamic() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    InterfaceType typeA = elementA.type;
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    InterfaceType typeA = classA.type;
     Type2 dynamicType = DynamicTypeImpl.instance;
     JUnitTestCase.assertTrue(dynamicType.isSupertypeOf(typeA));
     JUnitTestCase.assertFalse(typeA.isSupertypeOf(dynamicType));
   }
   void test_isSupertypeOf_indirectSupertype() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    ClassElement elementB = ElementFactory.classElement("B", elementA.type, []);
-    ClassElement elementC = ElementFactory.classElement("C", elementB.type, []);
-    InterfaceType typeA = elementA.type;
-    InterfaceType typeC = elementC.type;
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElement classC = ElementFactory.classElement("C", classB.type, []);
+    InterfaceType typeA = classA.type;
+    InterfaceType typeC = classC.type;
     JUnitTestCase.assertFalse(typeC.isSupertypeOf(typeA));
     JUnitTestCase.assertTrue(typeA.isSupertypeOf(typeC));
   }
   void test_isSupertypeOf_interface() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    ClassElement elementB = ElementFactory.classElement("B", elementA.type, []);
-    ClassElementImpl elementC = ElementFactory.classElement2("C", []);
-    InterfaceType typeObject = elementA.supertype;
-    InterfaceType typeA = elementA.type;
-    InterfaceType typeB = elementB.type;
-    InterfaceType typeC = elementC.type;
-    elementC.interfaces = <InterfaceType> [typeB];
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    InterfaceType typeObject = classA.supertype;
+    InterfaceType typeA = classA.type;
+    InterfaceType typeB = classB.type;
+    InterfaceType typeC = classC.type;
+    classC.interfaces = <InterfaceType> [typeB];
     JUnitTestCase.assertTrue(typeB.isSupertypeOf(typeC));
     JUnitTestCase.assertTrue(typeObject.isSupertypeOf(typeC));
     JUnitTestCase.assertTrue(typeA.isSupertypeOf(typeC));
     JUnitTestCase.assertFalse(typeC.isSupertypeOf(typeA));
   }
   void test_isSupertypeOf_mixins() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    ClassElement elementB = ElementFactory.classElement("B", elementA.type, []);
-    ClassElementImpl elementC = ElementFactory.classElement2("C", []);
-    InterfaceType typeObject = elementA.supertype;
-    InterfaceType typeA = elementA.type;
-    InterfaceType typeB = elementB.type;
-    InterfaceType typeC = elementC.type;
-    elementC.mixins = <InterfaceType> [typeB];
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    InterfaceType typeObject = classA.supertype;
+    InterfaceType typeA = classA.type;
+    InterfaceType typeB = classB.type;
+    InterfaceType typeC = classC.type;
+    classC.mixins = <InterfaceType> [typeB];
     JUnitTestCase.assertTrue(typeB.isSupertypeOf(typeC));
     JUnitTestCase.assertTrue(typeObject.isSupertypeOf(typeC));
     JUnitTestCase.assertFalse(typeA.isSupertypeOf(typeC));
     JUnitTestCase.assertFalse(typeC.isSupertypeOf(typeA));
   }
   void test_isSupertypeOf_object() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    InterfaceType typeA = elementA.type;
-    InterfaceType typeObject = elementA.supertype;
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    InterfaceType typeA = classA.type;
+    InterfaceType typeObject = classA.supertype;
     JUnitTestCase.assertFalse(typeA.isSupertypeOf(typeObject));
     JUnitTestCase.assertTrue(typeObject.isSupertypeOf(typeA));
   }
   void test_isSupertypeOf_self() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    InterfaceType typeA = elementA.type;
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    InterfaceType typeA = classA.type;
     JUnitTestCase.assertTrue(typeA.isSupertypeOf(typeA));
   }
+  void test_lookUpGetter_implemented() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    String getterName = "g";
+    PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, null);
+    classA.accessors = <PropertyAccessorElement> [getterG];
+    InterfaceType typeA = classA.type;
+    LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
+    CompilationUnitElement unit = library2.definingCompilationUnit;
+    ((unit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
+    JUnitTestCase.assertSame(getterG, typeA.lookUpGetter(getterName, library2));
+  }
+  void test_lookUpGetter_inherited() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    String getterName = "g";
+    PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, null);
+    classA.accessors = <PropertyAccessorElement> [getterG];
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    InterfaceType typeB = classB.type;
+    LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
+    CompilationUnitElement unit = library2.definingCompilationUnit;
+    ((unit as CompilationUnitElementImpl)).types = <ClassElement> [classA, classB];
+    JUnitTestCase.assertSame(getterG, typeB.lookUpGetter(getterName, library2));
+  }
+  void test_lookUpGetter_unimplemented() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    InterfaceType typeA = classA.type;
+    LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
+    CompilationUnitElement unit = library2.definingCompilationUnit;
+    ((unit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
+    JUnitTestCase.assertNull(typeA.lookUpGetter("g", library2));
+  }
+  void test_lookUpMethod_implemented() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    String methodName = "m";
+    MethodElementImpl methodM = ElementFactory.methodElement(methodName, null, []);
+    classA.methods = <MethodElement> [methodM];
+    InterfaceType typeA = classA.type;
+    LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
+    CompilationUnitElement unit = library2.definingCompilationUnit;
+    ((unit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
+    JUnitTestCase.assertSame(methodM, typeA.lookUpMethod(methodName, library2));
+  }
+  void test_lookUpMethod_inherited() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    String methodName = "m";
+    MethodElementImpl methodM = ElementFactory.methodElement(methodName, null, []);
+    classA.methods = <MethodElement> [methodM];
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    InterfaceType typeB = classB.type;
+    LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
+    CompilationUnitElement unit = library2.definingCompilationUnit;
+    ((unit as CompilationUnitElementImpl)).types = <ClassElement> [classA, classB];
+    JUnitTestCase.assertSame(methodM, typeB.lookUpMethod(methodName, library2));
+  }
+  void test_lookUpMethod_parameterized() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", ["E"]);
+    Type2 typeE = classA.type.typeArguments[0];
+    String methodName = "m";
+    MethodElementImpl methodM = ElementFactory.methodElement(methodName, typeE, [typeE]);
+    classA.methods = <MethodElement> [methodM];
+    ClassElementImpl classB = ElementFactory.classElement2("B", ["F"]);
+    InterfaceType typeB = classB.type;
+    InterfaceTypeImpl typeAF = new InterfaceTypeImpl.con1(classA);
+    typeAF.typeArguments = <Type2> [typeB.typeArguments[0]];
+    classB.supertype = typeAF;
+    LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
+    CompilationUnitElement unit = library2.definingCompilationUnit;
+    ((unit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
+    InterfaceType typeI = ElementFactory.classElement2("I", []).type;
+    InterfaceTypeImpl typeBI = new InterfaceTypeImpl.con1(classB);
+    typeBI.typeArguments = <Type2> [typeI];
+    MethodElement method = typeBI.lookUpMethod(methodName, library2);
+    JUnitTestCase.assertNotNull(method);
+    FunctionType methodType = method.type;
+    JUnitTestCase.assertSame(typeI, methodType.returnType);
+    List<Type2> parameterTypes = methodType.normalParameterTypes;
+    EngineTestCase.assertLength(1, parameterTypes);
+    JUnitTestCase.assertSame(typeI, parameterTypes[0]);
+  }
+  void test_lookUpMethod_unimplemented() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    InterfaceType typeA = classA.type;
+    LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
+    CompilationUnitElement unit = library2.definingCompilationUnit;
+    ((unit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
+    JUnitTestCase.assertNull(typeA.lookUpMethod("m", library2));
+  }
+  void test_lookUpSetter_implemented() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    String setterName = "s";
+    PropertyAccessorElement setterS = ElementFactory.setterElement(setterName, false, null);
+    classA.accessors = <PropertyAccessorElement> [setterS];
+    InterfaceType typeA = classA.type;
+    LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
+    CompilationUnitElement unit = library2.definingCompilationUnit;
+    ((unit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
+    JUnitTestCase.assertSame(setterS, typeA.lookUpSetter(setterName, library2));
+  }
+  void test_lookUpSetter_inherited() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    String setterName = "g";
+    PropertyAccessorElement setterS = ElementFactory.setterElement(setterName, false, null);
+    classA.accessors = <PropertyAccessorElement> [setterS];
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    InterfaceType typeB = classB.type;
+    LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
+    CompilationUnitElement unit = library2.definingCompilationUnit;
+    ((unit as CompilationUnitElementImpl)).types = <ClassElement> [classA, classB];
+    JUnitTestCase.assertSame(setterS, typeB.lookUpSetter(setterName, library2));
+  }
+  void test_lookUpSetter_unimplemented() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    InterfaceType typeA = classA.type;
+    LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
+    CompilationUnitElement unit = library2.definingCompilationUnit;
+    ((unit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
+    JUnitTestCase.assertNull(typeA.lookUpSetter("s", library2));
+  }
   void test_setTypeArguments() {
-    InterfaceTypeImpl type28 = ElementFactory.classElement2("A", []).type as InterfaceTypeImpl;
-    List<Type2> typeArguments = <Type2> [new InterfaceTypeImpl.con1(ElementFactory.classElement2("B", [])), new InterfaceTypeImpl.con1(ElementFactory.classElement2("C", []))];
-    type28.typeArguments = typeArguments;
-    JUnitTestCase.assertEquals(typeArguments, type28.typeArguments);
+    InterfaceTypeImpl type2 = ElementFactory.classElement2("A", []).type as InterfaceTypeImpl;
+    List<Type2> typeArguments = <Type2> [ElementFactory.classElement2("B", []).type, ElementFactory.classElement2("C", []).type];
+    type2.typeArguments = typeArguments;
+    JUnitTestCase.assertEquals(typeArguments, type2.typeArguments);
   }
   void test_substitute_equal() {
-    ClassElementImpl classElement = new ClassElementImpl(ASTFactory.identifier2("A"));
-    TypeVariableElementImpl parameterElement = new TypeVariableElementImpl(ASTFactory.identifier2("E"));
-    InterfaceTypeImpl type = new InterfaceTypeImpl.con1(classElement);
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    TypeVariableElementImpl parameterElement = new TypeVariableElementImpl(ASTFactory.identifier3("E"));
+    InterfaceTypeImpl type = new InterfaceTypeImpl.con1(classA);
     TypeVariableTypeImpl parameter = new TypeVariableTypeImpl(parameterElement);
     type.typeArguments = <Type2> [parameter];
-    InterfaceTypeImpl argumentType = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier2("B")));
+    InterfaceType argumentType = ElementFactory.classElement2("B", []).type;
     InterfaceType result = type.substitute2(<Type2> [argumentType], <Type2> [parameter]);
-    JUnitTestCase.assertEquals(classElement, result.element);
+    JUnitTestCase.assertEquals(classA, result.element);
     List<Type2> resultArguments = result.typeArguments;
     EngineTestCase.assertLength(1, resultArguments);
     JUnitTestCase.assertEquals(argumentType, resultArguments[0]);
   }
   void test_substitute_notEqual() {
-    ClassElementImpl classElement = new ClassElementImpl(ASTFactory.identifier2("A"));
-    TypeVariableElementImpl parameterElement = new TypeVariableElementImpl(ASTFactory.identifier2("E"));
-    InterfaceTypeImpl type = new InterfaceTypeImpl.con1(classElement);
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    TypeVariableElementImpl parameterElement = new TypeVariableElementImpl(ASTFactory.identifier3("E"));
+    InterfaceTypeImpl type = new InterfaceTypeImpl.con1(classA);
     TypeVariableTypeImpl parameter = new TypeVariableTypeImpl(parameterElement);
     type.typeArguments = <Type2> [parameter];
-    InterfaceTypeImpl argumentType = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier2("B")));
-    TypeVariableTypeImpl parameterType = new TypeVariableTypeImpl(new TypeVariableElementImpl(ASTFactory.identifier2("F")));
+    InterfaceType argumentType = ElementFactory.classElement2("B", []).type;
+    TypeVariableTypeImpl parameterType = new TypeVariableTypeImpl(new TypeVariableElementImpl(ASTFactory.identifier3("F")));
     InterfaceType result = type.substitute2(<Type2> [argumentType], <Type2> [parameterType]);
-    JUnitTestCase.assertEquals(classElement, result.element);
+    JUnitTestCase.assertEquals(classA, result.element);
     List<Type2> resultArguments = result.typeArguments;
     EngineTestCase.assertLength(1, resultArguments);
     JUnitTestCase.assertEquals(parameter, resultArguments[0]);
@@ -781,6 +1086,26 @@
         final __test = new InterfaceTypeImplTest();
         runJUnitTest(__test, __test.test_getElement);
       });
+      _ut.test('test_getGetter_implemented', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_getGetter_implemented);
+      });
+      _ut.test('test_getGetter_parameterized', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_getGetter_parameterized);
+      });
+      _ut.test('test_getGetter_unimplemented', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_getGetter_unimplemented);
+      });
+      _ut.test('test_getInterfaces_nonParameterized', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_getInterfaces_nonParameterized);
+      });
+      _ut.test('test_getInterfaces_parameterized', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_getInterfaces_parameterized);
+      });
       _ut.test('test_getLeastUpperBound_directInterfaceCase', () {
         final __test = new InterfaceTypeImplTest();
         runJUnitTest(__test, __test.test_getLeastUpperBound_directInterfaceCase);
@@ -793,6 +1118,10 @@
         final __test = new InterfaceTypeImplTest();
         runJUnitTest(__test, __test.test_getLeastUpperBound_functionType);
       });
+      _ut.test('test_getLeastUpperBound_ignoreTypeParameters', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_getLeastUpperBound_ignoreTypeParameters);
+      });
       _ut.test('test_getLeastUpperBound_mixinCase', () {
         final __test = new InterfaceTypeImplTest();
         runJUnitTest(__test, __test.test_getLeastUpperBound_mixinCase);
@@ -841,9 +1170,49 @@
         final __test = new InterfaceTypeImplTest();
         runJUnitTest(__test, __test.test_getLeastUpperBound_sharedSuperinterface4);
       });
-      _ut.test('test_getTypeArguments', () {
+      _ut.test('test_getMethod_implemented', () {
         final __test = new InterfaceTypeImplTest();
-        runJUnitTest(__test, __test.test_getTypeArguments);
+        runJUnitTest(__test, __test.test_getMethod_implemented);
+      });
+      _ut.test('test_getMethod_parameterized', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_getMethod_parameterized);
+      });
+      _ut.test('test_getMethod_unimplemented', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_getMethod_unimplemented);
+      });
+      _ut.test('test_getMixins_nonParameterized', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_getMixins_nonParameterized);
+      });
+      _ut.test('test_getMixins_parameterized', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_getMixins_parameterized);
+      });
+      _ut.test('test_getSetter_implemented', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_getSetter_implemented);
+      });
+      _ut.test('test_getSetter_parameterized', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_getSetter_parameterized);
+      });
+      _ut.test('test_getSetter_unimplemented', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_getSetter_unimplemented);
+      });
+      _ut.test('test_getSuperclass_nonParameterized', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_getSuperclass_nonParameterized);
+      });
+      _ut.test('test_getSuperclass_parameterized', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_getSuperclass_parameterized);
+      });
+      _ut.test('test_getTypeArguments_empty', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_getTypeArguments_empty);
       });
       _ut.test('test_isDirectSupertypeOf_extends', () {
         final __test = new InterfaceTypeImplTest();
@@ -945,6 +1314,46 @@
         final __test = new InterfaceTypeImplTest();
         runJUnitTest(__test, __test.test_isSupertypeOf_self);
       });
+      _ut.test('test_lookUpGetter_implemented', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_lookUpGetter_implemented);
+      });
+      _ut.test('test_lookUpGetter_inherited', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_lookUpGetter_inherited);
+      });
+      _ut.test('test_lookUpGetter_unimplemented', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_lookUpGetter_unimplemented);
+      });
+      _ut.test('test_lookUpMethod_implemented', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_lookUpMethod_implemented);
+      });
+      _ut.test('test_lookUpMethod_inherited', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_lookUpMethod_inherited);
+      });
+      _ut.test('test_lookUpMethod_parameterized', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_lookUpMethod_parameterized);
+      });
+      _ut.test('test_lookUpMethod_unimplemented', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_lookUpMethod_unimplemented);
+      });
+      _ut.test('test_lookUpSetter_implemented', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_lookUpSetter_implemented);
+      });
+      _ut.test('test_lookUpSetter_inherited', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_lookUpSetter_inherited);
+      });
+      _ut.test('test_lookUpSetter_unimplemented', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_lookUpSetter_unimplemented);
+      });
       _ut.test('test_setTypeArguments', () {
         final __test = new InterfaceTypeImplTest();
         runJUnitTest(__test, __test.test_setTypeArguments);
@@ -962,24 +1371,24 @@
 }
 class TypeVariableTypeImplTest extends EngineTestCase {
   void test_creation() {
-    JUnitTestCase.assertNotNull(new TypeVariableTypeImpl(new TypeVariableElementImpl(ASTFactory.identifier2("E"))));
+    JUnitTestCase.assertNotNull(new TypeVariableTypeImpl(new TypeVariableElementImpl(ASTFactory.identifier3("E"))));
   }
   void test_getElement() {
-    TypeVariableElementImpl element = new TypeVariableElementImpl(ASTFactory.identifier2("E"));
+    TypeVariableElementImpl element = new TypeVariableElementImpl(ASTFactory.identifier3("E"));
     TypeVariableTypeImpl type = new TypeVariableTypeImpl(element);
     JUnitTestCase.assertEquals(element, type.element);
   }
   void test_substitute_equal() {
-    TypeVariableElementImpl element = new TypeVariableElementImpl(ASTFactory.identifier2("E"));
+    TypeVariableElementImpl element = new TypeVariableElementImpl(ASTFactory.identifier3("E"));
     TypeVariableTypeImpl type = new TypeVariableTypeImpl(element);
-    InterfaceTypeImpl argument = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier2("A")));
+    InterfaceTypeImpl argument = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier3("A")));
     TypeVariableTypeImpl parameter = new TypeVariableTypeImpl(element);
     JUnitTestCase.assertSame(argument, type.substitute2(<Type2> [argument], <Type2> [parameter]));
   }
   void test_substitute_notEqual() {
-    TypeVariableTypeImpl type = new TypeVariableTypeImpl(new TypeVariableElementImpl(ASTFactory.identifier2("E")));
-    InterfaceTypeImpl argument = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier2("A")));
-    TypeVariableTypeImpl parameter = new TypeVariableTypeImpl(new TypeVariableElementImpl(ASTFactory.identifier2("F")));
+    TypeVariableTypeImpl type = new TypeVariableTypeImpl(new TypeVariableElementImpl(ASTFactory.identifier3("E")));
+    InterfaceTypeImpl argument = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier3("A")));
+    TypeVariableTypeImpl parameter = new TypeVariableTypeImpl(new TypeVariableElementImpl(ASTFactory.identifier3("F")));
     JUnitTestCase.assertSame(type, type.substitute2(<Type2> [argument], <Type2> [parameter]));
   }
   static dartSuite() {
@@ -1014,7 +1423,7 @@
    */
   static ClassElementImpl _objectElement;
   static ClassElementImpl classElement(String typeName, InterfaceType superclassType, List<String> parameterNames) {
-    ClassElementImpl element = new ClassElementImpl(ASTFactory.identifier2(typeName));
+    ClassElementImpl element = new ClassElementImpl(ASTFactory.identifier3(typeName));
     element.supertype = superclassType;
     InterfaceTypeImpl type = new InterfaceTypeImpl.con1(element);
     element.type = type;
@@ -1023,7 +1432,7 @@
       List<TypeVariableElementImpl> typeVariables = new List<TypeVariableElementImpl>(count);
       List<TypeVariableTypeImpl> typeArguments = new List<TypeVariableTypeImpl>(count);
       for (int i = 0; i < count; i++) {
-        TypeVariableElementImpl variable = new TypeVariableElementImpl(ASTFactory.identifier2(parameterNames[i]));
+        TypeVariableElementImpl variable = new TypeVariableElementImpl(ASTFactory.identifier3(parameterNames[i]));
         typeVariables[i] = variable;
         typeArguments[i] = new TypeVariableTypeImpl(variable);
         variable.type = typeArguments[i];
@@ -1034,25 +1443,25 @@
     return element;
   }
   static ClassElementImpl classElement2(String typeName, List<String> parameterNames) => classElement(typeName, object.type, parameterNames);
-  static ConstructorElementImpl constructorElement(String name) => new ConstructorElementImpl(name == null ? null : ASTFactory.identifier2(name));
-  static ExportElementImpl exportFor(LibraryElement exportedLibrary4, List<NamespaceCombinator> combinators4) {
+  static ConstructorElementImpl constructorElement(String name) => new ConstructorElementImpl(name == null ? null : ASTFactory.identifier3(name));
+  static ExportElementImpl exportFor(LibraryElement exportedLibrary2, List<NamespaceCombinator> combinators2) {
     ExportElementImpl spec = new ExportElementImpl();
-    spec.exportedLibrary = exportedLibrary4;
-    spec.combinators = combinators4;
+    spec.exportedLibrary = exportedLibrary2;
+    spec.combinators = combinators2;
     return spec;
   }
-  static FieldElementImpl fieldElement(String name, bool isStatic, bool isFinal, bool isConst, Type2 type34) {
-    FieldElementImpl field = new FieldElementImpl.con1(ASTFactory.identifier2(name));
+  static FieldElementImpl fieldElement(String name, bool isStatic, bool isFinal, bool isConst, Type2 type2) {
+    FieldElementImpl field = new FieldElementImpl.con1(ASTFactory.identifier3(name));
     field.const3 = isConst;
     field.final2 = isFinal;
     field.static = isStatic;
-    field.type = type34;
+    field.type = type2;
     PropertyAccessorElementImpl getter = new PropertyAccessorElementImpl.con2(field);
     getter.getter = true;
     getter.synthetic = true;
     field.getter = getter;
     FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter);
-    getterType.returnType = type34;
+    getterType.returnType = type2;
     getter.type = getterType;
     if (!isConst && !isFinal) {
       PropertyAccessorElementImpl setter = new PropertyAccessorElementImpl.con2(field);
@@ -1060,7 +1469,7 @@
       setter.synthetic = true;
       field.setter = setter;
       FunctionTypeImpl setterType = new FunctionTypeImpl.con1(getter);
-      setterType.normalParameterTypes = <Type2> [type34];
+      setterType.normalParameterTypes = <Type2> [type2];
       setterType.returnType = VoidTypeImpl.instance;
       setter.type = setterType;
     }
@@ -1069,7 +1478,7 @@
   static FunctionElementImpl functionElement(String functionName) => functionElement4(functionName, null, null, null, null);
   static FunctionElementImpl functionElement2(String functionName, ClassElement returnElement) => functionElement3(functionName, returnElement, null, null);
   static FunctionElementImpl functionElement3(String functionName, ClassElement returnElement, List<ClassElement> normalParameters, List<ClassElement> optionalParameters) {
-    FunctionElementImpl functionElement = new FunctionElementImpl.con1(ASTFactory.identifier2(functionName));
+    FunctionElementImpl functionElement = new FunctionElementImpl.con1(ASTFactory.identifier3(functionName));
     FunctionTypeImpl functionType = new FunctionTypeImpl.con1(functionElement);
     functionElement.type = functionType;
     if (returnElement != null) {
@@ -1094,7 +1503,7 @@
     return functionElement;
   }
   static FunctionElementImpl functionElement4(String functionName, ClassElement returnElement, List<ClassElement> normalParameters, List<String> names, List<ClassElement> namedParameters) {
-    FunctionElementImpl functionElement = new FunctionElementImpl.con1(ASTFactory.identifier2(functionName));
+    FunctionElementImpl functionElement = new FunctionElementImpl.con1(ASTFactory.identifier3(functionName));
     FunctionTypeImpl functionType = new FunctionTypeImpl.con1(functionElement);
     functionElement.type = functionType;
     if (returnElement != null) {
@@ -1128,29 +1537,29 @@
     }
     return _objectElement;
   }
-  static PropertyAccessorElementImpl getterElement(String name, bool isStatic, Type2 type35) {
-    FieldElementImpl field = new FieldElementImpl.con1(ASTFactory.identifier2(name));
+  static PropertyAccessorElementImpl getterElement(String name, bool isStatic, Type2 type2) {
+    FieldElementImpl field = new FieldElementImpl.con1(ASTFactory.identifier3(name));
     field.static = isStatic;
     field.synthetic = true;
-    field.type = type35;
+    field.type = type2;
     PropertyAccessorElementImpl getter = new PropertyAccessorElementImpl.con2(field);
     getter.getter = true;
     field.getter = getter;
     FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter);
-    getterType.returnType = type35;
+    getterType.returnType = type2;
     getter.type = getterType;
     return getter;
   }
-  static ImportElementImpl importFor(LibraryElement importedLibrary5, PrefixElement prefix13, List<NamespaceCombinator> combinators5) {
+  static ImportElementImpl importFor(LibraryElement importedLibrary2, PrefixElement prefix2, List<NamespaceCombinator> combinators2) {
     ImportElementImpl spec = new ImportElementImpl();
-    spec.importedLibrary = importedLibrary5;
-    spec.prefix = prefix13;
-    spec.combinators = combinators5;
+    spec.importedLibrary = importedLibrary2;
+    spec.prefix = prefix2;
+    spec.combinators = combinators2;
     return spec;
   }
   static LibraryElementImpl library(AnalysisContext context, String libraryName) {
     String fileName = "${libraryName}.dart";
-    FileBasedSource source = new FileBasedSource.con1(context.sourceFactory, FileUtilities2.createFile(fileName));
+    FileBasedSource source = new FileBasedSource.con1(context.sourceFactory.contentCache, FileUtilities2.createFile(fileName));
     CompilationUnitElementImpl unit = new CompilationUnitElementImpl(fileName);
     unit.source = source;
     LibraryElementImpl library = new LibraryElementImpl(context, ASTFactory.libraryIdentifier2([libraryName]));
@@ -1158,13 +1567,13 @@
     return library;
   }
   static LocalVariableElementImpl localVariableElement(Identifier name) => new LocalVariableElementImpl(name);
-  static LocalVariableElementImpl localVariableElement2(String name) => new LocalVariableElementImpl(ASTFactory.identifier2(name));
-  static MethodElementImpl methodElement(String methodName, Type2 returnType14, List<Type2> argumentTypes) {
-    MethodElementImpl method = new MethodElementImpl.con1(ASTFactory.identifier2(methodName));
+  static LocalVariableElementImpl localVariableElement2(String name) => new LocalVariableElementImpl(ASTFactory.identifier3(name));
+  static MethodElementImpl methodElement(String methodName, Type2 returnType2, List<Type2> argumentTypes) {
+    MethodElementImpl method = new MethodElementImpl.con1(ASTFactory.identifier3(methodName));
     int count = argumentTypes.length;
     List<ParameterElement> parameters = new List<ParameterElement>(count);
     for (int i = 0; i < count; i++) {
-      ParameterElementImpl parameter = new ParameterElementImpl(ASTFactory.identifier2("a${i}"));
+      ParameterElementImpl parameter = new ParameterElementImpl(ASTFactory.identifier3("a${i}"));
       parameter.type = argumentTypes[i];
       parameter.parameterKind = ParameterKind.REQUIRED;
       parameters[i] = parameter;
@@ -1172,43 +1581,43 @@
     method.parameters = parameters;
     FunctionTypeImpl methodType = new FunctionTypeImpl.con1(method);
     methodType.normalParameterTypes = argumentTypes;
-    methodType.returnType = returnType14;
+    methodType.returnType = returnType2;
     method.type = methodType;
     return method;
   }
   static ParameterElementImpl namedParameter(String name) {
-    ParameterElementImpl parameter = new ParameterElementImpl(ASTFactory.identifier2(name));
+    ParameterElementImpl parameter = new ParameterElementImpl(ASTFactory.identifier3(name));
     parameter.parameterKind = ParameterKind.NAMED;
     return parameter;
   }
   static ParameterElementImpl positionalParameter(String name) {
-    ParameterElementImpl parameter = new ParameterElementImpl(ASTFactory.identifier2(name));
+    ParameterElementImpl parameter = new ParameterElementImpl(ASTFactory.identifier3(name));
     parameter.parameterKind = ParameterKind.POSITIONAL;
     return parameter;
   }
-  static PrefixElementImpl prefix(String name) => new PrefixElementImpl(ASTFactory.identifier2(name));
+  static PrefixElementImpl prefix(String name) => new PrefixElementImpl(ASTFactory.identifier3(name));
   static ParameterElementImpl requiredParameter(String name) {
-    ParameterElementImpl parameter = new ParameterElementImpl(ASTFactory.identifier2(name));
+    ParameterElementImpl parameter = new ParameterElementImpl(ASTFactory.identifier3(name));
     parameter.parameterKind = ParameterKind.REQUIRED;
     return parameter;
   }
-  static PropertyAccessorElementImpl setterElement(String name, bool isStatic, Type2 type36) {
-    FieldElementImpl field = new FieldElementImpl.con1(ASTFactory.identifier2(name));
+  static PropertyAccessorElementImpl setterElement(String name, bool isStatic, Type2 type2) {
+    FieldElementImpl field = new FieldElementImpl.con1(ASTFactory.identifier3(name));
     field.static = isStatic;
     field.synthetic = true;
-    field.type = type36;
+    field.type = type2;
     PropertyAccessorElementImpl getter = new PropertyAccessorElementImpl.con2(field);
     getter.getter = true;
     field.getter = getter;
     FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter);
-    getterType.returnType = type36;
+    getterType.returnType = type2;
     getter.type = getterType;
     PropertyAccessorElementImpl setter = new PropertyAccessorElementImpl.con2(field);
     setter.setter = true;
     setter.synthetic = true;
     field.setter = setter;
     FunctionTypeImpl setterType = new FunctionTypeImpl.con1(getter);
-    setterType.normalParameterTypes = <Type2> [type36];
+    setterType.normalParameterTypes = <Type2> [type2];
     setterType.returnType = VoidTypeImpl.instance;
     setter.type = setterType;
     return setter;
@@ -1222,13 +1631,13 @@
   }
 }
 class ClassElementImplTest extends EngineTestCase {
-  void test_allSupertypes_interface() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    ClassElement elementB = ElementFactory.classElement("B", elementA.type, []);
+  void test_getAllSupertypes_interface() {
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
     ClassElementImpl elementC = ElementFactory.classElement2("C", []);
-    InterfaceType typeObject = elementA.supertype;
-    InterfaceType typeA = elementA.type;
-    InterfaceType typeB = elementB.type;
+    InterfaceType typeObject = classA.supertype;
+    InterfaceType typeA = classA.type;
+    InterfaceType typeB = classB.type;
     InterfaceType typeC = elementC.type;
     elementC.interfaces = <InterfaceType> [typeB];
     List<InterfaceType> supers = elementC.allSupertypes;
@@ -1239,16 +1648,16 @@
     JUnitTestCase.assertTrue(types.contains(typeObject));
     JUnitTestCase.assertFalse(types.contains(typeC));
   }
-  void test_allSupertypes_mixins() {
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    ClassElement elementB = ElementFactory.classElement("B", elementA.type, []);
-    ClassElementImpl elementC = ElementFactory.classElement2("C", []);
-    InterfaceType typeObject = elementA.supertype;
-    InterfaceType typeA = elementA.type;
-    InterfaceType typeB = elementB.type;
-    InterfaceType typeC = elementC.type;
-    elementC.mixins = <InterfaceType> [typeB];
-    List<InterfaceType> supers = elementC.allSupertypes;
+  void test_getAllSupertypes_mixins() {
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    InterfaceType typeObject = classA.supertype;
+    InterfaceType typeA = classA.type;
+    InterfaceType typeB = classB.type;
+    InterfaceType typeC = classC.type;
+    classC.mixins = <InterfaceType> [typeB];
+    List<InterfaceType> supers = classC.allSupertypes;
     List<InterfaceType> types = new List<InterfaceType>();
     types.addAll(supers);
     JUnitTestCase.assertFalse(types.contains(typeA));
@@ -1256,90 +1665,112 @@
     JUnitTestCase.assertTrue(types.contains(typeObject));
     JUnitTestCase.assertFalse(types.contains(typeC));
   }
+  void test_getMethod_declared() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    String methodName = "m";
+    MethodElement method = ElementFactory.methodElement(methodName, null, []);
+    classA.methods = <MethodElement> [method];
+    JUnitTestCase.assertSame(method, classA.getMethod(methodName));
+  }
+  void test_getMethod_undeclared() {
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    String methodName = "m";
+    MethodElement method = ElementFactory.methodElement(methodName, null, []);
+    classA.methods = <MethodElement> [method];
+    JUnitTestCase.assertNull(classA.getMethod("${methodName}x"));
+  }
   void test_lookUpGetter_declared() {
-    LibraryElementImpl library6 = ElementFactory.library(new AnalysisContextImpl(), "lib");
+    LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A", []);
     String getterName = "g";
     PropertyAccessorElement getter = ElementFactory.getterElement(getterName, false, null);
     classA.accessors = <PropertyAccessorElement> [getter];
-    ((library6.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
-    JUnitTestCase.assertSame(getter, classA.lookUpGetter(getterName, library6));
+    ((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
+    JUnitTestCase.assertSame(getter, classA.lookUpGetter(getterName, library2));
   }
   void test_lookUpGetter_inherited() {
-    LibraryElementImpl library7 = ElementFactory.library(new AnalysisContextImpl(), "lib");
+    LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A", []);
     String getterName = "g";
     PropertyAccessorElement getter = ElementFactory.getterElement(getterName, false, null);
     classA.accessors = <PropertyAccessorElement> [getter];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    ((library7.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA, classB];
-    JUnitTestCase.assertSame(getter, classB.lookUpGetter(getterName, library7));
+    ((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA, classB];
+    JUnitTestCase.assertSame(getter, classB.lookUpGetter(getterName, library2));
   }
   void test_lookUpGetter_undeclared() {
-    LibraryElementImpl library8 = ElementFactory.library(new AnalysisContextImpl(), "lib");
+    LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ((library8.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
-    JUnitTestCase.assertNull(classA.lookUpGetter("g", library8));
+    ((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
+    JUnitTestCase.assertNull(classA.lookUpGetter("g", library2));
   }
   void test_lookUpMethod_declared() {
-    LibraryElementImpl library9 = ElementFactory.library(new AnalysisContextImpl(), "lib");
+    LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A", []);
     String methodName = "m";
     MethodElement method = ElementFactory.methodElement(methodName, null, []);
     classA.methods = <MethodElement> [method];
-    ((library9.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
-    JUnitTestCase.assertSame(method, classA.lookUpMethod(methodName, library9));
+    ((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
+    JUnitTestCase.assertSame(method, classA.lookUpMethod(methodName, library2));
   }
   void test_lookUpMethod_inherited() {
-    LibraryElementImpl library10 = ElementFactory.library(new AnalysisContextImpl(), "lib");
+    LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A", []);
     String methodName = "m";
     MethodElement method = ElementFactory.methodElement(methodName, null, []);
     classA.methods = <MethodElement> [method];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    ((library10.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA, classB];
-    JUnitTestCase.assertSame(method, classB.lookUpMethod(methodName, library10));
+    ((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA, classB];
+    JUnitTestCase.assertSame(method, classB.lookUpMethod(methodName, library2));
   }
   void test_lookUpMethod_undeclared() {
-    LibraryElementImpl library11 = ElementFactory.library(new AnalysisContextImpl(), "lib");
+    LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ((library11.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
-    JUnitTestCase.assertNull(classA.lookUpMethod("m", library11));
+    ((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
+    JUnitTestCase.assertNull(classA.lookUpMethod("m", library2));
   }
   void test_lookUpSetter_declared() {
-    LibraryElementImpl library12 = ElementFactory.library(new AnalysisContextImpl(), "lib");
+    LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A", []);
     String setterName = "s";
     PropertyAccessorElement setter = ElementFactory.setterElement(setterName, false, null);
     classA.accessors = <PropertyAccessorElement> [setter];
-    ((library12.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
-    JUnitTestCase.assertSame(setter, classA.lookUpSetter(setterName, library12));
+    ((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
+    JUnitTestCase.assertSame(setter, classA.lookUpSetter(setterName, library2));
   }
   void test_lookUpSetter_inherited() {
-    LibraryElementImpl library13 = ElementFactory.library(new AnalysisContextImpl(), "lib");
+    LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A", []);
     String setterName = "s";
     PropertyAccessorElement setter = ElementFactory.setterElement(setterName, false, null);
     classA.accessors = <PropertyAccessorElement> [setter];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    ((library13.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA, classB];
-    JUnitTestCase.assertSame(setter, classB.lookUpSetter(setterName, library13));
+    ((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA, classB];
+    JUnitTestCase.assertSame(setter, classB.lookUpSetter(setterName, library2));
   }
   void test_lookUpSetter_undeclared() {
-    LibraryElementImpl library14 = ElementFactory.library(new AnalysisContextImpl(), "lib");
+    LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ((library14.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
-    JUnitTestCase.assertNull(classA.lookUpSetter("s", library14));
+    ((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
+    JUnitTestCase.assertNull(classA.lookUpSetter("s", library2));
   }
   static dartSuite() {
     _ut.group('ClassElementImplTest', () {
-      _ut.test('test_allSupertypes_interface', () {
+      _ut.test('test_getAllSupertypes_interface', () {
         final __test = new ClassElementImplTest();
-        runJUnitTest(__test, __test.test_allSupertypes_interface);
+        runJUnitTest(__test, __test.test_getAllSupertypes_interface);
       });
-      _ut.test('test_allSupertypes_mixins', () {
+      _ut.test('test_getAllSupertypes_mixins', () {
         final __test = new ClassElementImplTest();
-        runJUnitTest(__test, __test.test_allSupertypes_mixins);
+        runJUnitTest(__test, __test.test_getAllSupertypes_mixins);
+      });
+      _ut.test('test_getMethod_declared', () {
+        final __test = new ClassElementImplTest();
+        runJUnitTest(__test, __test.test_getMethod_declared);
+      });
+      _ut.test('test_getMethod_undeclared', () {
+        final __test = new ClassElementImplTest();
+        runJUnitTest(__test, __test.test_getMethod_undeclared);
       });
       _ut.test('test_lookUpGetter_declared', () {
         final __test = new ClassElementImplTest();
@@ -1382,9 +1813,9 @@
 }
 class ElementImplTest extends EngineTestCase {
   void test_equals() {
-    LibraryElementImpl library15 = ElementFactory.library(new AnalysisContextImpl(), "lib");
+    LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classElement = ElementFactory.classElement2("C", []);
-    ((library15.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classElement];
+    ((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classElement];
     FieldElement field = ElementFactory.fieldElement("next", false, false, false, classElement.type);
     classElement.fields = <FieldElement> [field];
     JUnitTestCase.assertTrue(field == field);
@@ -1393,7 +1824,7 @@
     JUnitTestCase.assertFalse(field.getter == field.setter);
   }
   void test_isAccessibleIn_private_differentLibrary() {
-    AnalysisContextImpl context = new AnalysisContextImpl();
+    AnalysisContextImpl context = createAnalysisContext();
     LibraryElementImpl library1 = ElementFactory.library(context, "lib1");
     ClassElement classElement = ElementFactory.classElement2("_C", []);
     ((library1.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classElement];
@@ -1401,13 +1832,13 @@
     JUnitTestCase.assertFalse(classElement.isAccessibleIn(library2));
   }
   void test_isAccessibleIn_private_sameLibrary() {
-    LibraryElementImpl library16 = ElementFactory.library(new AnalysisContextImpl(), "lib");
+    LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
     ClassElement classElement = ElementFactory.classElement2("_C", []);
-    ((library16.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classElement];
-    JUnitTestCase.assertTrue(classElement.isAccessibleIn(library16));
+    ((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classElement];
+    JUnitTestCase.assertTrue(classElement.isAccessibleIn(library2));
   }
   void test_isAccessibleIn_public_differentLibrary() {
-    AnalysisContextImpl context = new AnalysisContextImpl();
+    AnalysisContextImpl context = createAnalysisContext();
     LibraryElementImpl library1 = ElementFactory.library(context, "lib1");
     ClassElement classElement = ElementFactory.classElement2("C", []);
     ((library1.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classElement];
@@ -1415,10 +1846,10 @@
     JUnitTestCase.assertTrue(classElement.isAccessibleIn(library2));
   }
   void test_isAccessibleIn_public_sameLibrary() {
-    LibraryElementImpl library17 = ElementFactory.library(new AnalysisContextImpl(), "lib");
+    LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
     ClassElement classElement = ElementFactory.classElement2("C", []);
-    ((library17.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classElement];
-    JUnitTestCase.assertTrue(classElement.isAccessibleIn(library17));
+    ((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classElement];
+    JUnitTestCase.assertTrue(classElement.isAccessibleIn(library2));
   }
   static dartSuite() {
     _ut.group('ElementImplTest', () {
@@ -1447,35 +1878,35 @@
 }
 class FunctionTypeImplTest extends EngineTestCase {
   void test_creation() {
-    JUnitTestCase.assertNotNull(new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier2("f"))));
+    JUnitTestCase.assertNotNull(new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier3("f"))));
   }
   void test_getElement() {
-    FunctionElementImpl typeElement = new FunctionElementImpl.con1(ASTFactory.identifier2("f"));
+    FunctionElementImpl typeElement = new FunctionElementImpl.con1(ASTFactory.identifier3("f"));
     FunctionTypeImpl type = new FunctionTypeImpl.con1(typeElement);
     JUnitTestCase.assertEquals(typeElement, type.element);
   }
   void test_getNamedParameterTypes() {
-    FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier2("f")));
+    FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier3("f")));
     Map<String, Type2> types = type.namedParameterTypes;
     EngineTestCase.assertSize2(0, types);
   }
   void test_getNormalParameterTypes() {
-    FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier2("f")));
+    FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier3("f")));
     List<Type2> types = type.normalParameterTypes;
     EngineTestCase.assertLength(0, types);
   }
   void test_getReturnType() {
-    FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier2("f")));
-    Type2 returnType10 = type.returnType;
-    JUnitTestCase.assertEquals(VoidTypeImpl.instance, returnType10);
+    FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier3("f")));
+    Type2 returnType2 = type.returnType;
+    JUnitTestCase.assertEquals(VoidTypeImpl.instance, returnType2);
   }
   void test_getTypeArguments() {
-    FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier2("f")));
+    FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier3("f")));
     List<Type2> types = type.typeArguments;
     EngineTestCase.assertLength(0, types);
   }
   void test_hashCode_element() {
-    FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier2("f")));
+    FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier3("f")));
     type.hashCode;
   }
   void test_hashCode_noElement() {
@@ -1484,7 +1915,7 @@
   }
   void test_isSubtypeOf_baseCase_classFunction() {
     ClassElementImpl functionElement = ElementFactory.classElement2("Function", []);
-    InterfaceTypeImpl functionType = new InterfaceTypeImpl_14(functionElement);
+    InterfaceTypeImpl functionType = new InterfaceTypeImpl_18(functionElement);
     FunctionType f = ElementFactory.functionElement("f").type;
     JUnitTestCase.assertTrue(f.isSubtypeOf(functionType));
   }
@@ -1652,38 +2083,38 @@
     JUnitTestCase.assertFalse(s.isSubtypeOf(t));
   }
   void test_setNamedParameterTypes() {
-    FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier2("f")));
+    FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier3("f")));
     LinkedHashMap<String, Type2> expectedTypes = new LinkedHashMap<String, Type2>();
-    expectedTypes["a"] = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier2("C")));
+    expectedTypes["a"] = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier3("C")));
     type.namedParameterTypes = expectedTypes;
     Map<String, Type2> types = type.namedParameterTypes;
     JUnitTestCase.assertEquals(expectedTypes, types);
   }
   void test_setNormalParameterTypes() {
-    FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier2("f")));
-    List<Type2> expectedTypes = <Type2> [new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier2("C")))];
+    FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier3("f")));
+    List<Type2> expectedTypes = <Type2> [new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier3("C")))];
     type.normalParameterTypes = expectedTypes;
     List<Type2> types = type.normalParameterTypes;
     JUnitTestCase.assertEquals(expectedTypes, types);
   }
   void test_setReturnType() {
-    FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier2("f")));
-    Type2 expectedType = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier2("C")));
+    FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier3("f")));
+    Type2 expectedType = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier3("C")));
     type.returnType = expectedType;
-    Type2 returnType11 = type.returnType;
-    JUnitTestCase.assertEquals(expectedType, returnType11);
+    Type2 returnType2 = type.returnType;
+    JUnitTestCase.assertEquals(expectedType, returnType2);
   }
   void test_setTypeArguments() {
-    FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier2("f")));
-    Type2 expectedType = new TypeVariableTypeImpl(new TypeVariableElementImpl(ASTFactory.identifier2("C")));
+    FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier3("f")));
+    Type2 expectedType = new TypeVariableTypeImpl(new TypeVariableElementImpl(ASTFactory.identifier3("C")));
     type.typeArguments = <Type2> [expectedType];
     List<Type2> arguments = type.typeArguments;
     EngineTestCase.assertLength(1, arguments);
     JUnitTestCase.assertEquals(expectedType, arguments[0]);
   }
   void test_substitute2_equal() {
-    FunctionTypeImpl functionType = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier2("f")));
-    TypeVariableTypeImpl parameterType = new TypeVariableTypeImpl(new TypeVariableElementImpl(ASTFactory.identifier2("E")));
+    FunctionTypeImpl functionType = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier3("f")));
+    TypeVariableTypeImpl parameterType = new TypeVariableTypeImpl(new TypeVariableElementImpl(ASTFactory.identifier3("E")));
     functionType.returnType = parameterType;
     functionType.normalParameterTypes = <Type2> [parameterType];
     functionType.optionalParameterTypes = <Type2> [parameterType];
@@ -1691,7 +2122,7 @@
     String namedParameterName = "c";
     namedParameterTypes[namedParameterName] = parameterType;
     functionType.namedParameterTypes = namedParameterTypes;
-    InterfaceTypeImpl argumentType = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier2("D")));
+    InterfaceTypeImpl argumentType = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier3("D")));
     FunctionType result = functionType.substitute2(<Type2> [argumentType], <Type2> [parameterType]);
     JUnitTestCase.assertEquals(argumentType, result.returnType);
     List<Type2> normalParameters = result.normalParameterTypes;
@@ -1705,11 +2136,11 @@
     JUnitTestCase.assertEquals(argumentType, namedParameters[namedParameterName]);
   }
   void test_substitute2_notEqual() {
-    FunctionTypeImpl functionType = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier2("f")));
-    Type2 returnType = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier2("R")));
-    Type2 normalParameterType = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier2("A")));
-    Type2 optionalParameterType = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier2("B")));
-    Type2 namedParameterType = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier2("C")));
+    FunctionTypeImpl functionType = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier3("f")));
+    Type2 returnType = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier3("R")));
+    Type2 normalParameterType = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier3("A")));
+    Type2 optionalParameterType = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier3("B")));
+    Type2 namedParameterType = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier3("C")));
     functionType.returnType = returnType;
     functionType.normalParameterTypes = <Type2> [normalParameterType];
     functionType.optionalParameterTypes = <Type2> [optionalParameterType];
@@ -1717,8 +2148,8 @@
     String namedParameterName = "c";
     namedParameterTypes[namedParameterName] = namedParameterType;
     functionType.namedParameterTypes = namedParameterTypes;
-    InterfaceTypeImpl argumentType = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier2("D")));
-    TypeVariableTypeImpl parameterType = new TypeVariableTypeImpl(new TypeVariableElementImpl(ASTFactory.identifier2("E")));
+    InterfaceTypeImpl argumentType = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier3("D")));
+    TypeVariableTypeImpl parameterType = new TypeVariableTypeImpl(new TypeVariableElementImpl(ASTFactory.identifier3("E")));
     FunctionType result = functionType.substitute2(<Type2> [argumentType], <Type2> [parameterType]);
     JUnitTestCase.assertEquals(returnType, result.returnType);
     List<Type2> normalParameters = result.normalParameterTypes;
@@ -1896,8 +2327,8 @@
     });
   }
 }
-class InterfaceTypeImpl_14 extends InterfaceTypeImpl {
-  InterfaceTypeImpl_14(ClassElement arg0) : super.con1(arg0);
+class InterfaceTypeImpl_18 extends InterfaceTypeImpl {
+  InterfaceTypeImpl_18(ClassElement arg0) : super.con1(arg0);
   bool isDartCoreFunction() => true;
 }
 main() {
diff --git a/pkg/analyzer_experimental/test/generated/parser_test.dart b/pkg/analyzer_experimental/test/generated/parser_test.dart
index 3244f2b..0cd547e 100644
--- a/pkg/analyzer_experimental/test/generated/parser_test.dart
+++ b/pkg/analyzer_experimental/test/generated/parser_test.dart
@@ -27,10 +27,10 @@
 class SimpleParserTest extends ParserTestCase {
   void fail_parseCommentReference_this() {
     CommentReference reference = ParserTestCase.parse("parseCommentReference", <Object> ["this", 5], "");
-    SimpleIdentifier identifier19 = EngineTestCase.assertInstanceOf(SimpleIdentifier, reference.identifier);
-    JUnitTestCase.assertNotNull(identifier19.token);
-    JUnitTestCase.assertEquals("a", identifier19.name);
-    JUnitTestCase.assertEquals(5, identifier19.offset);
+    SimpleIdentifier identifier2 = EngineTestCase.assertInstanceOf(SimpleIdentifier, reference.identifier);
+    JUnitTestCase.assertNotNull(identifier2.token);
+    JUnitTestCase.assertEquals("a", identifier2.name);
+    JUnitTestCase.assertEquals(5, identifier2.offset);
   }
   void test_computeStringValue_emptyInterpolationPrefix() {
     JUnitTestCase.assertEquals("", computeStringValue("'''"));
@@ -263,10 +263,10 @@
   }
   void test_parseArgument_named() {
     NamedExpression expression = ParserTestCase.parse5("parseArgument", "n: x", []);
-    Label name23 = expression.name;
-    JUnitTestCase.assertNotNull(name23);
-    JUnitTestCase.assertNotNull(name23.label);
-    JUnitTestCase.assertNotNull(name23.colon);
+    Label name2 = expression.name;
+    JUnitTestCase.assertNotNull(name2);
+    JUnitTestCase.assertNotNull(name2.label);
+    JUnitTestCase.assertNotNull(name2.colon);
     JUnitTestCase.assertNotNull(expression.expression);
   }
   void test_parseArgument_unnamed() {
@@ -281,23 +281,23 @@
   }
   void test_parseArgumentList_empty() {
     ArgumentList argumentList = ParserTestCase.parse5("parseArgumentList", "()", []);
-    NodeList<Expression> arguments8 = argumentList.arguments;
-    EngineTestCase.assertSize(0, arguments8);
+    NodeList<Expression> arguments2 = argumentList.arguments;
+    EngineTestCase.assertSize(0, arguments2);
   }
   void test_parseArgumentList_mixed() {
     ArgumentList argumentList = ParserTestCase.parse5("parseArgumentList", "(w, x, y: y, z: z)", []);
-    NodeList<Expression> arguments9 = argumentList.arguments;
-    EngineTestCase.assertSize(4, arguments9);
+    NodeList<Expression> arguments2 = argumentList.arguments;
+    EngineTestCase.assertSize(4, arguments2);
   }
   void test_parseArgumentList_noNamed() {
     ArgumentList argumentList = ParserTestCase.parse5("parseArgumentList", "(x, y, z)", []);
-    NodeList<Expression> arguments10 = argumentList.arguments;
-    EngineTestCase.assertSize(3, arguments10);
+    NodeList<Expression> arguments2 = argumentList.arguments;
+    EngineTestCase.assertSize(3, arguments2);
   }
   void test_parseArgumentList_onlyNamed() {
     ArgumentList argumentList = ParserTestCase.parse5("parseArgumentList", "(x: x, y: y)", []);
-    NodeList<Expression> arguments11 = argumentList.arguments;
-    EngineTestCase.assertSize(2, arguments11);
+    NodeList<Expression> arguments2 = argumentList.arguments;
+    EngineTestCase.assertSize(2, arguments2);
   }
   void test_parseAssertStatement() {
     AssertStatement statement = ParserTestCase.parse5("parseAssertStatement", "assert (x);", []);
@@ -311,9 +311,9 @@
     PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpression", <Object> [false], "(x)(y).z");
     FunctionExpressionInvocation invocation = propertyAccess.target as FunctionExpressionInvocation;
     JUnitTestCase.assertNotNull(invocation.function);
-    ArgumentList argumentList12 = invocation.argumentList;
-    JUnitTestCase.assertNotNull(argumentList12);
-    EngineTestCase.assertSize(1, argumentList12.arguments);
+    ArgumentList argumentList2 = invocation.argumentList;
+    JUnitTestCase.assertNotNull(argumentList2);
+    EngineTestCase.assertSize(1, argumentList2.arguments);
     JUnitTestCase.assertNotNull(propertyAccess.operator);
     JUnitTestCase.assertNotNull(propertyAccess.propertyName);
   }
@@ -338,9 +338,9 @@
     PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpression", <Object> [false], "x(y).z");
     MethodInvocation invocation = propertyAccess.target as MethodInvocation;
     JUnitTestCase.assertEquals("x", invocation.methodName.name);
-    ArgumentList argumentList13 = invocation.argumentList;
-    JUnitTestCase.assertNotNull(argumentList13);
-    EngineTestCase.assertSize(1, argumentList13.arguments);
+    ArgumentList argumentList2 = invocation.argumentList;
+    JUnitTestCase.assertNotNull(argumentList2);
+    EngineTestCase.assertSize(1, argumentList2.arguments);
     JUnitTestCase.assertNotNull(propertyAccess.operator);
     JUnitTestCase.assertNotNull(propertyAccess.propertyName);
   }
@@ -655,9 +655,9 @@
     JUnitTestCase.assertNull(field.keyword);
     VariableDeclarationList list = field.fields;
     JUnitTestCase.assertNotNull(list);
-    NodeList<VariableDeclaration> variables4 = list.variables;
-    EngineTestCase.assertSize(1, variables4);
-    VariableDeclaration variable = variables4[0];
+    NodeList<VariableDeclaration> variables2 = list.variables;
+    EngineTestCase.assertSize(1, variables2);
+    VariableDeclaration variable = variables2[0];
     JUnitTestCase.assertNotNull(variable.name);
   }
   void test_parseClassMember_field_namedGet() {
@@ -667,9 +667,9 @@
     JUnitTestCase.assertNull(field.keyword);
     VariableDeclarationList list = field.fields;
     JUnitTestCase.assertNotNull(list);
-    NodeList<VariableDeclaration> variables5 = list.variables;
-    EngineTestCase.assertSize(1, variables5);
-    VariableDeclaration variable = variables5[0];
+    NodeList<VariableDeclaration> variables2 = list.variables;
+    EngineTestCase.assertSize(1, variables2);
+    VariableDeclaration variable = variables2[0];
     JUnitTestCase.assertNotNull(variable.name);
   }
   void test_parseClassMember_field_namedOperator() {
@@ -679,9 +679,9 @@
     JUnitTestCase.assertNull(field.keyword);
     VariableDeclarationList list = field.fields;
     JUnitTestCase.assertNotNull(list);
-    NodeList<VariableDeclaration> variables6 = list.variables;
-    EngineTestCase.assertSize(1, variables6);
-    VariableDeclaration variable = variables6[0];
+    NodeList<VariableDeclaration> variables2 = list.variables;
+    EngineTestCase.assertSize(1, variables2);
+    VariableDeclaration variable = variables2[0];
     JUnitTestCase.assertNotNull(variable.name);
   }
   void test_parseClassMember_field_namedSet() {
@@ -691,9 +691,9 @@
     JUnitTestCase.assertNull(field.keyword);
     VariableDeclarationList list = field.fields;
     JUnitTestCase.assertNotNull(list);
-    NodeList<VariableDeclaration> variables7 = list.variables;
-    EngineTestCase.assertSize(1, variables7);
-    VariableDeclaration variable = variables7[0];
+    NodeList<VariableDeclaration> variables2 = list.variables;
+    EngineTestCase.assertSize(1, variables2);
+    VariableDeclaration variable = variables2[0];
     JUnitTestCase.assertNotNull(variable.name);
   }
   void test_parseClassMember_getter_void() {
@@ -903,6 +903,66 @@
     JUnitTestCase.assertNotNull(constructor.redirectedConstructor);
     JUnitTestCase.assertNotNull(constructor.body);
   }
+  void test_parseClassTypeAlias() {
+    Token token2 = TokenFactory.token(Keyword.TYPEDEF);
+    ClassTypeAlias classTypeAlias = ParserTestCase.parse("parseClassTypeAlias", <Object> [emptyCommentAndMetadata(), token2], "A = B;");
+    JUnitTestCase.assertNotNull(classTypeAlias.keyword);
+    JUnitTestCase.assertEquals("A", classTypeAlias.name.name);
+    JUnitTestCase.assertNotNull(classTypeAlias.equals);
+    JUnitTestCase.assertNull(classTypeAlias.abstractKeyword);
+    JUnitTestCase.assertNotNullMsg("B", classTypeAlias.superclass.name.name);
+    JUnitTestCase.assertNull(classTypeAlias.withClause);
+    JUnitTestCase.assertNull(classTypeAlias.implementsClause);
+    JUnitTestCase.assertNotNull(classTypeAlias.semicolon);
+  }
+  void test_parseClassTypeAlias_abstract() {
+    Token token2 = TokenFactory.token(Keyword.TYPEDEF);
+    ClassTypeAlias classTypeAlias = ParserTestCase.parse("parseClassTypeAlias", <Object> [emptyCommentAndMetadata(), token2], "A = abstract B;");
+    JUnitTestCase.assertNotNull(classTypeAlias.keyword);
+    JUnitTestCase.assertEquals("A", classTypeAlias.name.name);
+    JUnitTestCase.assertNotNull(classTypeAlias.equals);
+    JUnitTestCase.assertNotNull(classTypeAlias.abstractKeyword);
+    JUnitTestCase.assertNotNullMsg("B", classTypeAlias.superclass.name.name);
+    JUnitTestCase.assertNull(classTypeAlias.withClause);
+    JUnitTestCase.assertNull(classTypeAlias.implementsClause);
+    JUnitTestCase.assertNotNull(classTypeAlias.semicolon);
+  }
+  void test_parseClassTypeAlias_implements() {
+    Token token2 = TokenFactory.token(Keyword.TYPEDEF);
+    ClassTypeAlias classTypeAlias = ParserTestCase.parse("parseClassTypeAlias", <Object> [emptyCommentAndMetadata(), token2], "A = B implements C;");
+    JUnitTestCase.assertNotNull(classTypeAlias.keyword);
+    JUnitTestCase.assertEquals("A", classTypeAlias.name.name);
+    JUnitTestCase.assertNotNull(classTypeAlias.equals);
+    JUnitTestCase.assertNull(classTypeAlias.abstractKeyword);
+    JUnitTestCase.assertNotNullMsg("B", classTypeAlias.superclass.name.name);
+    JUnitTestCase.assertNull(classTypeAlias.withClause);
+    JUnitTestCase.assertNotNull(classTypeAlias.implementsClause);
+    JUnitTestCase.assertNotNull(classTypeAlias.semicolon);
+  }
+  void test_parseClassTypeAlias_with() {
+    Token token2 = TokenFactory.token(Keyword.TYPEDEF);
+    ClassTypeAlias classTypeAlias = ParserTestCase.parse("parseClassTypeAlias", <Object> [emptyCommentAndMetadata(), token2], "A = B with C;");
+    JUnitTestCase.assertNotNull(classTypeAlias.keyword);
+    JUnitTestCase.assertEquals("A", classTypeAlias.name.name);
+    JUnitTestCase.assertNotNull(classTypeAlias.equals);
+    JUnitTestCase.assertNull(classTypeAlias.abstractKeyword);
+    JUnitTestCase.assertNotNullMsg("B", classTypeAlias.superclass.name.name);
+    JUnitTestCase.assertNotNull(classTypeAlias.withClause);
+    JUnitTestCase.assertNull(classTypeAlias.implementsClause);
+    JUnitTestCase.assertNotNull(classTypeAlias.semicolon);
+  }
+  void test_parseClassTypeAlias_with_implements() {
+    Token token2 = TokenFactory.token(Keyword.TYPEDEF);
+    ClassTypeAlias classTypeAlias = ParserTestCase.parse("parseClassTypeAlias", <Object> [emptyCommentAndMetadata(), token2], "A = B with C implements D;");
+    JUnitTestCase.assertNotNull(classTypeAlias.keyword);
+    JUnitTestCase.assertEquals("A", classTypeAlias.name.name);
+    JUnitTestCase.assertNotNull(classTypeAlias.equals);
+    JUnitTestCase.assertNull(classTypeAlias.abstractKeyword);
+    JUnitTestCase.assertNotNullMsg("B", classTypeAlias.superclass.name.name);
+    JUnitTestCase.assertNotNull(classTypeAlias.withClause);
+    JUnitTestCase.assertNotNull(classTypeAlias.implementsClause);
+    JUnitTestCase.assertNotNull(classTypeAlias.semicolon);
+  }
   void test_parseCombinators_h() {
     List<Combinator> combinators = ParserTestCase.parse5("parseCombinators", "hide a;", []);
     EngineTestCase.assertSize(1, combinators);
@@ -983,42 +1043,42 @@
   void test_parseCommentReference_new_prefixed() {
     CommentReference reference = ParserTestCase.parse("parseCommentReference", <Object> ["new a.b", 7], "");
     PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(PrefixedIdentifier, reference.identifier);
-    SimpleIdentifier prefix11 = prefixedIdentifier.prefix;
-    JUnitTestCase.assertNotNull(prefix11.token);
-    JUnitTestCase.assertEquals("a", prefix11.name);
-    JUnitTestCase.assertEquals(11, prefix11.offset);
+    SimpleIdentifier prefix2 = prefixedIdentifier.prefix;
+    JUnitTestCase.assertNotNull(prefix2.token);
+    JUnitTestCase.assertEquals("a", prefix2.name);
+    JUnitTestCase.assertEquals(11, prefix2.offset);
     JUnitTestCase.assertNotNull(prefixedIdentifier.period);
-    SimpleIdentifier identifier20 = prefixedIdentifier.identifier;
-    JUnitTestCase.assertNotNull(identifier20.token);
-    JUnitTestCase.assertEquals("b", identifier20.name);
-    JUnitTestCase.assertEquals(13, identifier20.offset);
+    SimpleIdentifier identifier2 = prefixedIdentifier.identifier;
+    JUnitTestCase.assertNotNull(identifier2.token);
+    JUnitTestCase.assertEquals("b", identifier2.name);
+    JUnitTestCase.assertEquals(13, identifier2.offset);
   }
   void test_parseCommentReference_new_simple() {
     CommentReference reference = ParserTestCase.parse("parseCommentReference", <Object> ["new a", 5], "");
-    SimpleIdentifier identifier21 = EngineTestCase.assertInstanceOf(SimpleIdentifier, reference.identifier);
-    JUnitTestCase.assertNotNull(identifier21.token);
-    JUnitTestCase.assertEquals("a", identifier21.name);
-    JUnitTestCase.assertEquals(9, identifier21.offset);
+    SimpleIdentifier identifier2 = EngineTestCase.assertInstanceOf(SimpleIdentifier, reference.identifier);
+    JUnitTestCase.assertNotNull(identifier2.token);
+    JUnitTestCase.assertEquals("a", identifier2.name);
+    JUnitTestCase.assertEquals(9, identifier2.offset);
   }
   void test_parseCommentReference_prefixed() {
     CommentReference reference = ParserTestCase.parse("parseCommentReference", <Object> ["a.b", 7], "");
     PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(PrefixedIdentifier, reference.identifier);
-    SimpleIdentifier prefix12 = prefixedIdentifier.prefix;
-    JUnitTestCase.assertNotNull(prefix12.token);
-    JUnitTestCase.assertEquals("a", prefix12.name);
-    JUnitTestCase.assertEquals(7, prefix12.offset);
+    SimpleIdentifier prefix2 = prefixedIdentifier.prefix;
+    JUnitTestCase.assertNotNull(prefix2.token);
+    JUnitTestCase.assertEquals("a", prefix2.name);
+    JUnitTestCase.assertEquals(7, prefix2.offset);
     JUnitTestCase.assertNotNull(prefixedIdentifier.period);
-    SimpleIdentifier identifier22 = prefixedIdentifier.identifier;
-    JUnitTestCase.assertNotNull(identifier22.token);
-    JUnitTestCase.assertEquals("b", identifier22.name);
-    JUnitTestCase.assertEquals(9, identifier22.offset);
+    SimpleIdentifier identifier2 = prefixedIdentifier.identifier;
+    JUnitTestCase.assertNotNull(identifier2.token);
+    JUnitTestCase.assertEquals("b", identifier2.name);
+    JUnitTestCase.assertEquals(9, identifier2.offset);
   }
   void test_parseCommentReference_simple() {
     CommentReference reference = ParserTestCase.parse("parseCommentReference", <Object> ["a", 5], "");
-    SimpleIdentifier identifier23 = EngineTestCase.assertInstanceOf(SimpleIdentifier, reference.identifier);
-    JUnitTestCase.assertNotNull(identifier23.token);
-    JUnitTestCase.assertEquals("a", identifier23.name);
-    JUnitTestCase.assertEquals(5, identifier23.offset);
+    SimpleIdentifier identifier2 = EngineTestCase.assertInstanceOf(SimpleIdentifier, reference.identifier);
+    JUnitTestCase.assertNotNull(identifier2.token);
+    JUnitTestCase.assertEquals("a", identifier2.name);
+    JUnitTestCase.assertEquals(5, identifier2.offset);
   }
   void test_parseCommentReferences_multiLine() {
     List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/** xxx [a] yyy [b] zzz */", 3)];
@@ -1152,6 +1212,10 @@
     JUnitTestCase.assertNotNull(declaration.functionExpression);
     JUnitTestCase.assertNull(declaration.propertyKeyword);
   }
+  void test_parseCompilationUnitMember_function_void() {
+    FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "void f() {}");
+    JUnitTestCase.assertNotNull(declaration.returnType);
+  }
   void test_parseCompilationUnitMember_getter_external_noType() {
     FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "external get p;");
     JUnitTestCase.assertNotNull(declaration.externalKeyword);
@@ -1543,34 +1607,34 @@
   }
   void test_parseFinalConstVarOrType_const_noType() {
     FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType", <Object> [false], "const");
-    Token keyword32 = result.keyword;
-    JUnitTestCase.assertNotNull(keyword32);
-    JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword32.type);
-    JUnitTestCase.assertEquals(Keyword.CONST, ((keyword32 as KeywordToken)).keyword);
+    Token keyword2 = result.keyword;
+    JUnitTestCase.assertNotNull(keyword2);
+    JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword2.type);
+    JUnitTestCase.assertEquals(Keyword.CONST, ((keyword2 as KeywordToken)).keyword);
     JUnitTestCase.assertNull(result.type);
   }
   void test_parseFinalConstVarOrType_const_type() {
     FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType", <Object> [false], "const A a");
-    Token keyword33 = result.keyword;
-    JUnitTestCase.assertNotNull(keyword33);
-    JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword33.type);
-    JUnitTestCase.assertEquals(Keyword.CONST, ((keyword33 as KeywordToken)).keyword);
+    Token keyword2 = result.keyword;
+    JUnitTestCase.assertNotNull(keyword2);
+    JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword2.type);
+    JUnitTestCase.assertEquals(Keyword.CONST, ((keyword2 as KeywordToken)).keyword);
     JUnitTestCase.assertNotNull(result.type);
   }
   void test_parseFinalConstVarOrType_final_noType() {
     FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType", <Object> [false], "final");
-    Token keyword34 = result.keyword;
-    JUnitTestCase.assertNotNull(keyword34);
-    JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword34.type);
-    JUnitTestCase.assertEquals(Keyword.FINAL, ((keyword34 as KeywordToken)).keyword);
+    Token keyword2 = result.keyword;
+    JUnitTestCase.assertNotNull(keyword2);
+    JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword2.type);
+    JUnitTestCase.assertEquals(Keyword.FINAL, ((keyword2 as KeywordToken)).keyword);
     JUnitTestCase.assertNull(result.type);
   }
   void test_parseFinalConstVarOrType_final_type() {
     FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType", <Object> [false], "final A a");
-    Token keyword35 = result.keyword;
-    JUnitTestCase.assertNotNull(keyword35);
-    JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword35.type);
-    JUnitTestCase.assertEquals(Keyword.FINAL, ((keyword35 as KeywordToken)).keyword);
+    Token keyword2 = result.keyword;
+    JUnitTestCase.assertNotNull(keyword2);
+    JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword2.type);
+    JUnitTestCase.assertEquals(Keyword.FINAL, ((keyword2 as KeywordToken)).keyword);
     JUnitTestCase.assertNotNull(result.type);
   }
   void test_parseFinalConstVarOrType_type_parameterized() {
@@ -1595,10 +1659,10 @@
   }
   void test_parseFinalConstVarOrType_var() {
     FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType", <Object> [false], "var");
-    Token keyword36 = result.keyword;
-    JUnitTestCase.assertNotNull(keyword36);
-    JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword36.type);
-    JUnitTestCase.assertEquals(Keyword.VAR, ((keyword36 as KeywordToken)).keyword);
+    Token keyword2 = result.keyword;
+    JUnitTestCase.assertNotNull(keyword2);
+    JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword2.type);
+    JUnitTestCase.assertEquals(Keyword.VAR, ((keyword2 as KeywordToken)).keyword);
     JUnitTestCase.assertNull(result.type);
   }
   void test_parseFormalParameter_final_withType_named() {
@@ -1853,10 +1917,10 @@
     ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (var i = 0;;) {}", []);
     JUnitTestCase.assertNotNull(statement.forKeyword);
     JUnitTestCase.assertNotNull(statement.leftParenthesis);
-    VariableDeclarationList variables8 = statement.variables;
-    JUnitTestCase.assertNotNull(variables8);
-    EngineTestCase.assertSize(0, variables8.metadata);
-    EngineTestCase.assertSize(1, variables8.variables);
+    VariableDeclarationList variables2 = statement.variables;
+    JUnitTestCase.assertNotNull(variables2);
+    EngineTestCase.assertSize(0, variables2.metadata);
+    EngineTestCase.assertSize(1, variables2.variables);
     JUnitTestCase.assertNull(statement.initialization);
     JUnitTestCase.assertNotNull(statement.leftSeparator);
     JUnitTestCase.assertNull(statement.condition);
@@ -1869,10 +1933,10 @@
     ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (@A var i = 0;;) {}", []);
     JUnitTestCase.assertNotNull(statement.forKeyword);
     JUnitTestCase.assertNotNull(statement.leftParenthesis);
-    VariableDeclarationList variables9 = statement.variables;
-    JUnitTestCase.assertNotNull(variables9);
-    EngineTestCase.assertSize(1, variables9.metadata);
-    EngineTestCase.assertSize(1, variables9.variables);
+    VariableDeclarationList variables2 = statement.variables;
+    JUnitTestCase.assertNotNull(variables2);
+    EngineTestCase.assertSize(1, variables2.metadata);
+    EngineTestCase.assertSize(1, variables2.variables);
     JUnitTestCase.assertNull(statement.initialization);
     JUnitTestCase.assertNotNull(statement.leftSeparator);
     JUnitTestCase.assertNull(statement.condition);
@@ -1885,9 +1949,9 @@
     ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (var i = 0; i < count;) {}", []);
     JUnitTestCase.assertNotNull(statement.forKeyword);
     JUnitTestCase.assertNotNull(statement.leftParenthesis);
-    VariableDeclarationList variables10 = statement.variables;
-    JUnitTestCase.assertNotNull(variables10);
-    EngineTestCase.assertSize(1, variables10.variables);
+    VariableDeclarationList variables2 = statement.variables;
+    JUnitTestCase.assertNotNull(variables2);
+    EngineTestCase.assertSize(1, variables2.variables);
     JUnitTestCase.assertNull(statement.initialization);
     JUnitTestCase.assertNotNull(statement.leftSeparator);
     JUnitTestCase.assertNotNull(statement.condition);
@@ -1900,9 +1964,9 @@
     ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (var i = 0; i < count; i++) {}", []);
     JUnitTestCase.assertNotNull(statement.forKeyword);
     JUnitTestCase.assertNotNull(statement.leftParenthesis);
-    VariableDeclarationList variables11 = statement.variables;
-    JUnitTestCase.assertNotNull(variables11);
-    EngineTestCase.assertSize(1, variables11.variables);
+    VariableDeclarationList variables2 = statement.variables;
+    JUnitTestCase.assertNotNull(variables2);
+    EngineTestCase.assertSize(1, variables2.variables);
     JUnitTestCase.assertNull(statement.initialization);
     JUnitTestCase.assertNotNull(statement.leftSeparator);
     JUnitTestCase.assertNotNull(statement.condition);
@@ -1915,9 +1979,9 @@
     ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (int i = 0, j = count; i < j; i++, j--) {}", []);
     JUnitTestCase.assertNotNull(statement.forKeyword);
     JUnitTestCase.assertNotNull(statement.leftParenthesis);
-    VariableDeclarationList variables12 = statement.variables;
-    JUnitTestCase.assertNotNull(variables12);
-    EngineTestCase.assertSize(2, variables12.variables);
+    VariableDeclarationList variables2 = statement.variables;
+    JUnitTestCase.assertNotNull(variables2);
+    EngineTestCase.assertSize(2, variables2.variables);
     JUnitTestCase.assertNull(statement.initialization);
     JUnitTestCase.assertNotNull(statement.leftSeparator);
     JUnitTestCase.assertNotNull(statement.condition);
@@ -1930,9 +1994,9 @@
     ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (var i = 0;; i++) {}", []);
     JUnitTestCase.assertNotNull(statement.forKeyword);
     JUnitTestCase.assertNotNull(statement.leftParenthesis);
-    VariableDeclarationList variables13 = statement.variables;
-    JUnitTestCase.assertNotNull(variables13);
-    EngineTestCase.assertSize(1, variables13.variables);
+    VariableDeclarationList variables2 = statement.variables;
+    JUnitTestCase.assertNotNull(variables2);
+    EngineTestCase.assertSize(1, variables2.variables);
     JUnitTestCase.assertNull(statement.initialization);
     JUnitTestCase.assertNotNull(statement.leftSeparator);
     JUnitTestCase.assertNull(statement.condition);
@@ -1968,6 +2032,12 @@
     JUnitTestCase.assertNotNull(functionBody.expression);
     JUnitTestCase.assertNotNull(functionBody.semicolon);
   }
+  void test_parseFunctionBody_nativeFunctionBody() {
+    NativeFunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <Object> [false, false], "native 'str';");
+    JUnitTestCase.assertNotNull(functionBody.nativeToken);
+    JUnitTestCase.assertNotNull(functionBody.stringLiteral);
+    JUnitTestCase.assertNotNull(functionBody.semicolon);
+  }
   void test_parseFunctionDeclaration_function() {
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), null);
@@ -2169,11 +2239,11 @@
     TypeName type = new TypeName.full(new SimpleIdentifier.full(null), null);
     FieldDeclaration declaration = ParserTestCase.parse("parseInitializedIdentifierList", <Object> [commentAndMetadata(comment, []), staticKeyword, null, type], "a = 1, b, c = 3;");
     JUnitTestCase.assertEquals(comment, declaration.documentationComment);
-    VariableDeclarationList fields4 = declaration.fields;
-    JUnitTestCase.assertNotNull(fields4);
-    JUnitTestCase.assertNull(fields4.keyword);
-    JUnitTestCase.assertEquals(type, fields4.type);
-    EngineTestCase.assertSize(3, fields4.variables);
+    VariableDeclarationList fields2 = declaration.fields;
+    JUnitTestCase.assertNotNull(fields2);
+    JUnitTestCase.assertNull(fields2.keyword);
+    JUnitTestCase.assertEquals(type, fields2.type);
+    EngineTestCase.assertSize(3, fields2.variables);
     JUnitTestCase.assertEquals(staticKeyword, declaration.keyword);
     JUnitTestCase.assertNotNull(declaration.semicolon);
   }
@@ -2183,18 +2253,18 @@
     Token varKeyword = TokenFactory.token(Keyword.VAR);
     FieldDeclaration declaration = ParserTestCase.parse("parseInitializedIdentifierList", <Object> [commentAndMetadata(comment, []), staticKeyword, varKeyword, null], "a = 1, b, c = 3;");
     JUnitTestCase.assertEquals(comment, declaration.documentationComment);
-    VariableDeclarationList fields5 = declaration.fields;
-    JUnitTestCase.assertNotNull(fields5);
-    JUnitTestCase.assertEquals(varKeyword, fields5.keyword);
-    JUnitTestCase.assertNull(fields5.type);
-    EngineTestCase.assertSize(3, fields5.variables);
+    VariableDeclarationList fields2 = declaration.fields;
+    JUnitTestCase.assertNotNull(fields2);
+    JUnitTestCase.assertEquals(varKeyword, fields2.keyword);
+    JUnitTestCase.assertNull(fields2.type);
+    EngineTestCase.assertSize(3, fields2.variables);
     JUnitTestCase.assertEquals(staticKeyword, declaration.keyword);
     JUnitTestCase.assertNotNull(declaration.semicolon);
   }
   void test_parseInstanceCreationExpression_qualifiedType() {
-    Token token5 = TokenFactory.token(Keyword.NEW);
-    InstanceCreationExpression expression = ParserTestCase.parse("parseInstanceCreationExpression", <Object> [token5], "A.B()");
-    JUnitTestCase.assertEquals(token5, expression.keyword);
+    Token token2 = TokenFactory.token(Keyword.NEW);
+    InstanceCreationExpression expression = ParserTestCase.parse("parseInstanceCreationExpression", <Object> [token2], "A.B()");
+    JUnitTestCase.assertEquals(token2, expression.keyword);
     ConstructorName name = expression.constructorName;
     JUnitTestCase.assertNotNull(name);
     JUnitTestCase.assertNotNull(name.type);
@@ -2203,9 +2273,9 @@
     JUnitTestCase.assertNotNull(expression.argumentList);
   }
   void test_parseInstanceCreationExpression_qualifiedType_named() {
-    Token token6 = TokenFactory.token(Keyword.NEW);
-    InstanceCreationExpression expression = ParserTestCase.parse("parseInstanceCreationExpression", <Object> [token6], "A.B.c()");
-    JUnitTestCase.assertEquals(token6, expression.keyword);
+    Token token2 = TokenFactory.token(Keyword.NEW);
+    InstanceCreationExpression expression = ParserTestCase.parse("parseInstanceCreationExpression", <Object> [token2], "A.B.c()");
+    JUnitTestCase.assertEquals(token2, expression.keyword);
     ConstructorName name = expression.constructorName;
     JUnitTestCase.assertNotNull(name);
     JUnitTestCase.assertNotNull(name.type);
@@ -2214,9 +2284,9 @@
     JUnitTestCase.assertNotNull(expression.argumentList);
   }
   void test_parseInstanceCreationExpression_type() {
-    Token token7 = TokenFactory.token(Keyword.NEW);
-    InstanceCreationExpression expression = ParserTestCase.parse("parseInstanceCreationExpression", <Object> [token7], "A()");
-    JUnitTestCase.assertEquals(token7, expression.keyword);
+    Token token2 = TokenFactory.token(Keyword.NEW);
+    InstanceCreationExpression expression = ParserTestCase.parse("parseInstanceCreationExpression", <Object> [token2], "A()");
+    JUnitTestCase.assertEquals(token2, expression.keyword);
     ConstructorName name = expression.constructorName;
     JUnitTestCase.assertNotNull(name);
     JUnitTestCase.assertNotNull(name.type);
@@ -2225,9 +2295,9 @@
     JUnitTestCase.assertNotNull(expression.argumentList);
   }
   void test_parseInstanceCreationExpression_type_named() {
-    Token token8 = TokenFactory.token(Keyword.NEW);
-    InstanceCreationExpression expression = ParserTestCase.parse("parseInstanceCreationExpression", <Object> [token8], "A<B>.c()");
-    JUnitTestCase.assertEquals(token8, expression.keyword);
+    Token token2 = TokenFactory.token(Keyword.NEW);
+    InstanceCreationExpression expression = ParserTestCase.parse("parseInstanceCreationExpression", <Object> [token2], "A<B>.c()");
+    JUnitTestCase.assertEquals(token2, expression.keyword);
     ConstructorName name = expression.constructorName;
     JUnitTestCase.assertNotNull(name);
     JUnitTestCase.assertNotNull(name.type);
@@ -2252,20 +2322,20 @@
     JUnitTestCase.assertEquals(name, identifier.name);
   }
   void test_parseListLiteral_empty_oneToken() {
-    Token token9 = TokenFactory.token(Keyword.CONST);
+    Token token2 = TokenFactory.token(Keyword.CONST);
     TypeArgumentList typeArguments = new TypeArgumentList.full(null, null, null);
-    ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [token9, typeArguments], "[]");
-    JUnitTestCase.assertEquals(token9, literal.modifier);
+    ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [token2, typeArguments], "[]");
+    JUnitTestCase.assertEquals(token2, literal.modifier);
     JUnitTestCase.assertEquals(typeArguments, literal.typeArguments);
     JUnitTestCase.assertNotNull(literal.leftBracket);
     EngineTestCase.assertSize(0, literal.elements);
     JUnitTestCase.assertNotNull(literal.rightBracket);
   }
   void test_parseListLiteral_empty_twoTokens() {
-    Token token10 = TokenFactory.token(Keyword.CONST);
+    Token token2 = TokenFactory.token(Keyword.CONST);
     TypeArgumentList typeArguments = new TypeArgumentList.full(null, null, null);
-    ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [token10, typeArguments], "[ ]");
-    JUnitTestCase.assertEquals(token10, literal.modifier);
+    ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [token2, typeArguments], "[ ]");
+    JUnitTestCase.assertEquals(token2, literal.modifier);
     JUnitTestCase.assertEquals(typeArguments, literal.typeArguments);
     JUnitTestCase.assertNotNull(literal.leftBracket);
     EngineTestCase.assertSize(0, literal.elements);
@@ -2334,10 +2404,10 @@
     JUnitTestCase.assertNotNull(expression.rightOperand);
   }
   void test_parseMapLiteral_empty() {
-    Token token11 = TokenFactory.token(Keyword.CONST);
+    Token token2 = TokenFactory.token(Keyword.CONST);
     TypeArgumentList typeArguments = new TypeArgumentList.full(null, null, null);
-    MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [token11, typeArguments], "{}");
-    JUnitTestCase.assertEquals(token11, literal.modifier);
+    MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [token2, typeArguments], "{}");
+    JUnitTestCase.assertEquals(token2, literal.modifier);
     JUnitTestCase.assertEquals(typeArguments, literal.typeArguments);
     JUnitTestCase.assertNotNull(literal.leftBracket);
     EngineTestCase.assertSize(0, literal.entries);
@@ -3023,9 +3093,9 @@
     TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} catch (e, s) {} finally {}", []);
     JUnitTestCase.assertNotNull(statement.tryKeyword);
     JUnitTestCase.assertNotNull(statement.body);
-    NodeList<CatchClause> catchClauses3 = statement.catchClauses;
-    EngineTestCase.assertSize(1, catchClauses3);
-    CatchClause clause = catchClauses3[0];
+    NodeList<CatchClause> catchClauses2 = statement.catchClauses;
+    EngineTestCase.assertSize(1, catchClauses2);
+    CatchClause clause = catchClauses2[0];
     JUnitTestCase.assertNull(clause.onKeyword);
     JUnitTestCase.assertNull(clause.exceptionType);
     JUnitTestCase.assertNotNull(clause.catchKeyword);
@@ -3056,9 +3126,9 @@
     TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} on Error {}", []);
     JUnitTestCase.assertNotNull(statement.tryKeyword);
     JUnitTestCase.assertNotNull(statement.body);
-    NodeList<CatchClause> catchClauses4 = statement.catchClauses;
-    EngineTestCase.assertSize(1, catchClauses4);
-    CatchClause clause = catchClauses4[0];
+    NodeList<CatchClause> catchClauses2 = statement.catchClauses;
+    EngineTestCase.assertSize(1, catchClauses2);
+    CatchClause clause = catchClauses2[0];
     JUnitTestCase.assertNotNull(clause.onKeyword);
     JUnitTestCase.assertNotNull(clause.exceptionType);
     JUnitTestCase.assertNull(clause.catchKeyword);
@@ -3073,9 +3143,9 @@
     TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} on Error catch (e, s) {}", []);
     JUnitTestCase.assertNotNull(statement.tryKeyword);
     JUnitTestCase.assertNotNull(statement.body);
-    NodeList<CatchClause> catchClauses5 = statement.catchClauses;
-    EngineTestCase.assertSize(1, catchClauses5);
-    CatchClause clause = catchClauses5[0];
+    NodeList<CatchClause> catchClauses2 = statement.catchClauses;
+    EngineTestCase.assertSize(1, catchClauses2);
+    CatchClause clause = catchClauses2[0];
     JUnitTestCase.assertNotNull(clause.onKeyword);
     JUnitTestCase.assertNotNull(clause.exceptionType);
     JUnitTestCase.assertNotNull(clause.catchKeyword);
@@ -3090,9 +3160,9 @@
     TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} on Error catch (e, s) {} finally {}", []);
     JUnitTestCase.assertNotNull(statement.tryKeyword);
     JUnitTestCase.assertNotNull(statement.body);
-    NodeList<CatchClause> catchClauses6 = statement.catchClauses;
-    EngineTestCase.assertSize(1, catchClauses6);
-    CatchClause clause = catchClauses6[0];
+    NodeList<CatchClause> catchClauses2 = statement.catchClauses;
+    EngineTestCase.assertSize(1, catchClauses2);
+    CatchClause clause = catchClauses2[0];
     JUnitTestCase.assertNotNull(clause.onKeyword);
     JUnitTestCase.assertNotNull(clause.exceptionType);
     JUnitTestCase.assertNotNull(clause.catchKeyword);
@@ -3271,9 +3341,9 @@
     JUnitTestCase.assertNotNull(expression.operator);
     JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type);
     JUnitTestCase.assertNotNull(expression.operand);
-    PropertyAccess operand4 = expression.operand as PropertyAccess;
-    JUnitTestCase.assertTrue(operand4.target is SuperExpression);
-    JUnitTestCase.assertEquals("x", operand4.propertyName.name);
+    PropertyAccess operand2 = expression.operand as PropertyAccess;
+    JUnitTestCase.assertTrue(operand2.target is SuperExpression);
+    JUnitTestCase.assertEquals("x", operand2.propertyName.name);
   }
   void test_parseUnaryExpression_increment_normal() {
     PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "++x", []);
@@ -3286,18 +3356,18 @@
     JUnitTestCase.assertNotNull(expression.operator);
     JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type);
     JUnitTestCase.assertNotNull(expression.operand);
-    IndexExpression operand5 = expression.operand as IndexExpression;
-    JUnitTestCase.assertTrue(operand5.realTarget is SuperExpression);
-    JUnitTestCase.assertTrue(operand5.index is IntegerLiteral);
+    IndexExpression operand2 = expression.operand as IndexExpression;
+    JUnitTestCase.assertTrue(operand2.realTarget is SuperExpression);
+    JUnitTestCase.assertTrue(operand2.index is IntegerLiteral);
   }
   void test_parseUnaryExpression_increment_super_propertyAccess() {
     PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "++super.x", []);
     JUnitTestCase.assertNotNull(expression.operator);
     JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type);
     JUnitTestCase.assertNotNull(expression.operand);
-    PropertyAccess operand6 = expression.operand as PropertyAccess;
-    JUnitTestCase.assertTrue(operand6.target is SuperExpression);
-    JUnitTestCase.assertEquals("x", operand6.propertyName.name);
+    PropertyAccess operand2 = expression.operand as PropertyAccess;
+    JUnitTestCase.assertTrue(operand2.target is SuperExpression);
+    JUnitTestCase.assertEquals("x", operand2.propertyName.name);
   }
   void test_parseUnaryExpression_minus_normal() {
     PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "-x", []);
@@ -3537,7 +3607,7 @@
    * @throws Exception if the method could not be invoked or throws an exception
    */
   String computeStringValue(String lexeme) {
-    AnalysisErrorListener listener = new AnalysisErrorListener_15();
+    AnalysisErrorListener listener = new AnalysisErrorListener_19();
     Parser parser = new Parser(null, listener);
     return invokeParserMethodImpl(parser, "computeStringValue", <Object> [lexeme], null) as String;
   }
@@ -4168,6 +4238,26 @@
         final __test = new SimpleParserTest();
         runJUnitTest(__test, __test.test_parseClassMember_redirectingFactory_nonConst);
       });
+      _ut.test('test_parseClassTypeAlias', () {
+        final __test = new SimpleParserTest();
+        runJUnitTest(__test, __test.test_parseClassTypeAlias);
+      });
+      _ut.test('test_parseClassTypeAlias_abstract', () {
+        final __test = new SimpleParserTest();
+        runJUnitTest(__test, __test.test_parseClassTypeAlias_abstract);
+      });
+      _ut.test('test_parseClassTypeAlias_implements', () {
+        final __test = new SimpleParserTest();
+        runJUnitTest(__test, __test.test_parseClassTypeAlias_implements);
+      });
+      _ut.test('test_parseClassTypeAlias_with', () {
+        final __test = new SimpleParserTest();
+        runJUnitTest(__test, __test.test_parseClassTypeAlias_with);
+      });
+      _ut.test('test_parseClassTypeAlias_with_implements', () {
+        final __test = new SimpleParserTest();
+        runJUnitTest(__test, __test.test_parseClassTypeAlias_with_implements);
+      });
       _ut.test('test_parseCombinators_h', () {
         final __test = new SimpleParserTest();
         runJUnitTest(__test, __test.test_parseCombinators_h);
@@ -4276,6 +4366,10 @@
         final __test = new SimpleParserTest();
         runJUnitTest(__test, __test.test_parseCompilationUnitMember_function_type);
       });
+      _ut.test('test_parseCompilationUnitMember_function_void', () {
+        final __test = new SimpleParserTest();
+        runJUnitTest(__test, __test.test_parseCompilationUnitMember_function_void);
+      });
       _ut.test('test_parseCompilationUnitMember_getter_external_noType', () {
         final __test = new SimpleParserTest();
         runJUnitTest(__test, __test.test_parseCompilationUnitMember_getter_external_noType);
@@ -4716,6 +4810,10 @@
         final __test = new SimpleParserTest();
         runJUnitTest(__test, __test.test_parseFunctionBody_expression);
       });
+      _ut.test('test_parseFunctionBody_nativeFunctionBody', () {
+        final __test = new SimpleParserTest();
+        runJUnitTest(__test, __test.test_parseFunctionBody_nativeFunctionBody);
+      });
       _ut.test('test_parseFunctionDeclarationStatement', () {
         final __test = new SimpleParserTest();
         runJUnitTest(__test, __test.test_parseFunctionDeclarationStatement);
@@ -5639,7 +5737,7 @@
     });
   }
 }
-class AnalysisErrorListener_15 implements AnalysisErrorListener {
+class AnalysisErrorListener_19 implements AnalysisErrorListener {
   void onError(AnalysisError event) {
     JUnitTestCase.fail("Unexpected compilation error: ${event.message} (${event.offset}, ${event.length})");
   }
@@ -5763,6 +5861,18 @@
     BinaryExpression expression = ParserTestCase.parseExpression("super ^ y ^ z", []);
     EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
   }
+  void test_cascade_withAssignment() {
+    CascadeExpression cascade = ParserTestCase.parseExpression("new Map()..[3] = 4 ..[0] = 11;", []);
+    Expression target2 = cascade.target;
+    for (Expression section in cascade.cascadeSections) {
+      EngineTestCase.assertInstanceOf(AssignmentExpression, section);
+      Expression lhs = ((section as AssignmentExpression)).leftHandSide;
+      EngineTestCase.assertInstanceOf(IndexExpression, lhs);
+      IndexExpression index = lhs as IndexExpression;
+      JUnitTestCase.assertTrue(index.isCascaded());
+      JUnitTestCase.assertSame(target2, index.realTarget);
+    }
+  }
   void test_conditionalExpression_precedence_argumentDefinitionTest_not() {
     ConditionalExpression conditional = ParserTestCase.parseExpression("!?a?!?b:!?c", []);
     EngineTestCase.assertInstanceOf(PrefixExpression, conditional.condition);
@@ -5956,6 +6066,10 @@
         final __test = new ComplexParserTest();
         runJUnitTest(__test, __test.test_bitwiseXorExpression_super);
       });
+      _ut.test('test_cascade_withAssignment', () {
+        final __test = new ComplexParserTest();
+        runJUnitTest(__test, __test.test_cascade_withAssignment);
+      });
       _ut.test('test_conditionalExpression_precedence_argumentDefinitionTest_not', () {
         final __test = new ComplexParserTest();
         runJUnitTest(__test, __test.test_conditionalExpression_precedence_argumentDefinitionTest_not);
@@ -6084,13 +6198,13 @@
    * @param node the AST node being validated
    */
   void validate(ASTNode node) {
-    ASTNode parent22 = node.parent;
+    ASTNode parent2 = node.parent;
     if (node is CompilationUnit) {
-      if (parent22 != null) {
+      if (parent2 != null) {
         _errors.add("Compilation units should not have a parent");
       }
     } else {
-      if (parent22 == null) {
+      if (parent2 == null) {
         _errors.add("No parent for ${node.runtimeType.toString()}");
       }
     }
@@ -6105,15 +6219,15 @@
     if (nodeStart < 0 || nodeLength < 0) {
       _errors.add("No source info for ${node.runtimeType.toString()}");
     }
-    if (parent22 != null) {
+    if (parent2 != null) {
       int nodeEnd = nodeStart + nodeLength;
-      int parentStart = parent22.offset;
-      int parentEnd = parentStart + parent22.length;
+      int parentStart = parent2.offset;
+      int parentEnd = parentStart + parent2.length;
       if (nodeStart < parentStart) {
-        _errors.add("Invalid source start (${nodeStart}) for ${node.runtimeType.toString()} inside ${parent22.runtimeType.toString()} (${parentStart})");
+        _errors.add("Invalid source start (${nodeStart}) for ${node.runtimeType.toString()} inside ${parent2.runtimeType.toString()} (${parentStart})");
       }
       if (nodeEnd > parentEnd) {
-        _errors.add("Invalid source end (${nodeEnd}) for ${node.runtimeType.toString()} inside ${parent22.runtimeType.toString()} (${parentStart})");
+        _errors.add("Invalid source end (${nodeEnd}) for ${node.runtimeType.toString()} inside ${parent2.runtimeType.toString()} (${parentStart})");
       }
     }
   }
@@ -6292,7 +6406,9 @@
     listener.setLineInfo(new TestSource(), scanner.lineStarts);
     Parser parser = new Parser(null, listener);
     Object result = invokeParserMethodImpl(parser, methodName, objects, tokenStream);
-    JUnitTestCase.assertNotNull(result);
+    if (!listener.hasErrors()) {
+      JUnitTestCase.assertNotNull(result);
+    }
     return result as Object;
   }
   /**
@@ -6574,15 +6690,15 @@
     CompilationUnit unit = ParserTestCase.parseCompilationUnit("class Bar<T extends Foo> {m(x){if (x is ) return;if (x is !)}}", [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_STATEMENT]);
     ClassDeclaration declaration = unit.declarations[0] as ClassDeclaration;
     MethodDeclaration method = declaration.members[0] as MethodDeclaration;
-    BlockFunctionBody body5 = method.body as BlockFunctionBody;
-    IfStatement ifStatement = body5.block.statements[1] as IfStatement;
+    BlockFunctionBody body2 = method.body as BlockFunctionBody;
+    IfStatement ifStatement = body2.block.statements[1] as IfStatement;
     IsExpression expression = ifStatement.condition as IsExpression;
     JUnitTestCase.assertNotNull(expression.expression);
     JUnitTestCase.assertNotNull(expression.isOperator);
     JUnitTestCase.assertNotNull(expression.notOperator);
-    TypeName type29 = expression.type;
-    JUnitTestCase.assertNotNull(type29);
-    JUnitTestCase.assertTrue(type29.name.isSynthetic());
+    TypeName type2 = expression.type;
+    JUnitTestCase.assertNotNull(type2);
+    JUnitTestCase.assertTrue(type2.name.isSynthetic());
     EngineTestCase.assertInstanceOf(EmptyStatement, ifStatement.thenStatement);
   }
   void test_logicalAndExpression_missing_LHS() {
@@ -6732,9 +6848,9 @@
   }
   void test_typedef_eof() {
     CompilationUnit unit = ParserTestCase.parseCompilationUnit("typedef n", [ParserErrorCode.EXPECTED_TOKEN, ParserErrorCode.MISSING_TYPEDEF_PARAMETERS]);
-    NodeList<CompilationUnitMember> declarations3 = unit.declarations;
-    EngineTestCase.assertSize(1, declarations3);
-    CompilationUnitMember member = declarations3[0];
+    NodeList<CompilationUnitMember> declarations2 = unit.declarations;
+    EngineTestCase.assertSize(1, declarations2);
+    CompilationUnitMember member = declarations2[0];
     EngineTestCase.assertInstanceOf(FunctionTypeAlias, member);
   }
   static dartSuite() {
@@ -7074,6 +7190,9 @@
   void fail_invalidCommentReference__nonNew_tooMuch() {
     ParserTestCase.parse4("parseCommentReference", <Object> ["a.b.c.d", 0], "", [ParserErrorCode.INVALID_COMMENT_REFERENCE]);
   }
+  void fail_missingClosingParenthesis() {
+    ParserTestCase.parse5("parseFormalParameterList", "(int a, int b ;", [ParserErrorCode.MISSING_CLOSING_PARENTHESIS]);
+  }
   void fail_missingExpressionInThrow_withCascade() {
     ParserTestCase.parse5("parseThrowExpression", "throw;", [ParserErrorCode.MISSING_EXPRESSION_IN_THROW]);
   }
@@ -7086,6 +7205,10 @@
   void fail_missingFunctionParameters_local_nonVoid_expression() {
     ParserTestCase.parse5("parseStatement", "int f => x;", [ParserErrorCode.MISSING_FUNCTION_PARAMETERS]);
   }
+  void fail_namedFunctionExpression() {
+    Expression expression = ParserTestCase.parse5("parsePrimaryExpression", "f() {}", [ParserErrorCode.NAMED_FUNCTION_EXPRESSION]);
+    EngineTestCase.assertInstanceOf(FunctionExpression, expression);
+  }
   void fail_unexpectedToken_invalidPostfixExpression() {
     ParserTestCase.parse5("parseExpression", "f()++", [ParserErrorCode.UNEXPECTED_TOKEN]);
   }
@@ -7223,6 +7346,24 @@
   void test_expectedCaseOrDefault() {
     ParserTestCase.parse5("parseSwitchStatement", "switch (e) {break;}", [ParserErrorCode.EXPECTED_CASE_OR_DEFAULT]);
   }
+  void test_expectedClassMember_inClass_afterType() {
+    ParserTestCase.parse4("parseClassMember", <Object> ["C"], "heart 2 heart", [ParserErrorCode.EXPECTED_CLASS_MEMBER]);
+  }
+  void test_expectedClassMember_inClass_beforeType() {
+    ParserTestCase.parse4("parseClassMember", <Object> ["C"], "4 score", [ParserErrorCode.EXPECTED_CLASS_MEMBER]);
+  }
+  void test_expectedExecutable_inClass_afterVoid() {
+    ParserTestCase.parse4("parseClassMember", <Object> ["C"], "void 2 void", [ParserErrorCode.EXPECTED_EXECUTABLE]);
+  }
+  void test_expectedExecutable_topLevel_afterType() {
+    ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "heart 2 heart", [ParserErrorCode.EXPECTED_EXECUTABLE]);
+  }
+  void test_expectedExecutable_topLevel_afterVoid() {
+    ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "void 2 void", [ParserErrorCode.EXPECTED_EXECUTABLE]);
+  }
+  void test_expectedExecutable_topLevel_beforeType() {
+    ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "4 score", [ParserErrorCode.EXPECTED_EXECUTABLE]);
+  }
   void test_expectedStringLiteral() {
     StringLiteral expression = ParserTestCase.parse5("parseStringLiteral", "1", [ParserErrorCode.EXPECTED_STRING_LITERAL]);
     JUnitTestCase.assertTrue(expression.isSynthetic());
@@ -7338,6 +7479,9 @@
   void test_invalidHexEscape_tooFewDigits() {
     ParserTestCase.parse5("parseStringLiteral", "'\\x0'", [ParserErrorCode.INVALID_HEX_ESCAPE]);
   }
+  void test_invalidOperator() {
+    ParserTestCase.parse4("parseClassMember", <Object> ["C"], "void operator ===(x) {}", [ParserErrorCode.INVALID_OPERATOR]);
+  }
   void test_invalidOperatorForSuper() {
     ParserTestCase.parse5("parseUnaryExpression", "++super", [ParserErrorCode.INVALID_OPERATOR_FOR_SUPER]);
   }
@@ -7423,6 +7567,9 @@
     SimpleIdentifier expression = ParserTestCase.parse5("parseSimpleIdentifier", "1", [ParserErrorCode.MISSING_IDENTIFIER]);
     JUnitTestCase.assertTrue(expression.isSynthetic());
   }
+  void test_missingKeywordOperator() {
+    ParserTestCase.parse4("parseOperator", <Object> [emptyCommentAndMetadata(), null, null], "+(x) {}", [ParserErrorCode.MISSING_KEYWORD_OPERATOR]);
+  }
   void test_missingNameInLibraryDirective() {
     CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "library;", [ParserErrorCode.MISSING_NAME_IN_LIBRARY_DIRECTIVE]);
     JUnitTestCase.assertNotNull(unit);
@@ -7529,6 +7676,27 @@
   void test_staticTopLevelDeclaration_variable() {
     ParserTestCase.parse5("parseCompilationUnit", "static var x;", [ParserErrorCode.STATIC_TOP_LEVEL_DECLARATION]);
   }
+  void test_switchHasCaseAfterDefaultCase() {
+    ParserTestCase.parse5("parseSwitchStatement", "switch (a) {default: return 0; case 1: return 1;}", [ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE]);
+  }
+  void test_switchHasCaseAfterDefaultCase_repeated() {
+    ParserTestCase.parse5("parseSwitchStatement", "switch (a) {default: return 0; case 1: return 1; case 2: return 2;}", [ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE, ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE]);
+  }
+  void test_switchHasMultipleDefaultCases() {
+    ParserTestCase.parse5("parseSwitchStatement", "switch (a) {default: return 0; default: return 1;}", [ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES]);
+  }
+  void test_switchHasMultipleDefaultCases_repeated() {
+    ParserTestCase.parse5("parseSwitchStatement", "switch (a) {default: return 0; default: return 1; default: return 2;}", [ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES, ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES]);
+  }
+  void test_topLevelOperator_withoutType() {
+    ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "operator +(bool x, bool y) => x | y;", [ParserErrorCode.TOP_LEVEL_OPERATOR]);
+  }
+  void test_topLevelOperator_withType() {
+    ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "bool operator +(bool x, bool y) => x | y;", [ParserErrorCode.TOP_LEVEL_OPERATOR]);
+  }
+  void test_topLevelOperator_withVoid() {
+    ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "void operator +(bool x, bool y) => x | y;", [ParserErrorCode.TOP_LEVEL_OPERATOR]);
+  }
   void test_unexpectedTerminatorForParameterGroup_named() {
     ParserTestCase.parse5("parseFormalParameterList", "(a, b})", [ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP]);
   }
@@ -7753,6 +7921,30 @@
         final __test = new ErrorParserTest();
         runJUnitTest(__test, __test.test_expectedCaseOrDefault);
       });
+      _ut.test('test_expectedClassMember_inClass_afterType', () {
+        final __test = new ErrorParserTest();
+        runJUnitTest(__test, __test.test_expectedClassMember_inClass_afterType);
+      });
+      _ut.test('test_expectedClassMember_inClass_beforeType', () {
+        final __test = new ErrorParserTest();
+        runJUnitTest(__test, __test.test_expectedClassMember_inClass_beforeType);
+      });
+      _ut.test('test_expectedExecutable_inClass_afterVoid', () {
+        final __test = new ErrorParserTest();
+        runJUnitTest(__test, __test.test_expectedExecutable_inClass_afterVoid);
+      });
+      _ut.test('test_expectedExecutable_topLevel_afterType', () {
+        final __test = new ErrorParserTest();
+        runJUnitTest(__test, __test.test_expectedExecutable_topLevel_afterType);
+      });
+      _ut.test('test_expectedExecutable_topLevel_afterVoid', () {
+        final __test = new ErrorParserTest();
+        runJUnitTest(__test, __test.test_expectedExecutable_topLevel_afterVoid);
+      });
+      _ut.test('test_expectedExecutable_topLevel_beforeType', () {
+        final __test = new ErrorParserTest();
+        runJUnitTest(__test, __test.test_expectedExecutable_topLevel_beforeType);
+      });
       _ut.test('test_expectedStringLiteral', () {
         final __test = new ErrorParserTest();
         runJUnitTest(__test, __test.test_expectedStringLiteral);
@@ -7905,6 +8097,10 @@
         final __test = new ErrorParserTest();
         runJUnitTest(__test, __test.test_invalidHexEscape_tooFewDigits);
       });
+      _ut.test('test_invalidOperator', () {
+        final __test = new ErrorParserTest();
+        runJUnitTest(__test, __test.test_invalidOperator);
+      });
       _ut.test('test_invalidOperatorForSuper', () {
         final __test = new ErrorParserTest();
         runJUnitTest(__test, __test.test_invalidOperatorForSuper);
@@ -8013,6 +8209,10 @@
         final __test = new ErrorParserTest();
         runJUnitTest(__test, __test.test_missingIdentifier_number);
       });
+      _ut.test('test_missingKeywordOperator', () {
+        final __test = new ErrorParserTest();
+        runJUnitTest(__test, __test.test_missingKeywordOperator);
+      });
       _ut.test('test_missingNameInLibraryDirective', () {
         final __test = new ErrorParserTest();
         runJUnitTest(__test, __test.test_missingNameInLibraryDirective);
@@ -8149,6 +8349,34 @@
         final __test = new ErrorParserTest();
         runJUnitTest(__test, __test.test_staticTopLevelDeclaration_variable);
       });
+      _ut.test('test_switchHasCaseAfterDefaultCase', () {
+        final __test = new ErrorParserTest();
+        runJUnitTest(__test, __test.test_switchHasCaseAfterDefaultCase);
+      });
+      _ut.test('test_switchHasCaseAfterDefaultCase_repeated', () {
+        final __test = new ErrorParserTest();
+        runJUnitTest(__test, __test.test_switchHasCaseAfterDefaultCase_repeated);
+      });
+      _ut.test('test_switchHasMultipleDefaultCases', () {
+        final __test = new ErrorParserTest();
+        runJUnitTest(__test, __test.test_switchHasMultipleDefaultCases);
+      });
+      _ut.test('test_switchHasMultipleDefaultCases_repeated', () {
+        final __test = new ErrorParserTest();
+        runJUnitTest(__test, __test.test_switchHasMultipleDefaultCases_repeated);
+      });
+      _ut.test('test_topLevelOperator_withType', () {
+        final __test = new ErrorParserTest();
+        runJUnitTest(__test, __test.test_topLevelOperator_withType);
+      });
+      _ut.test('test_topLevelOperator_withVoid', () {
+        final __test = new ErrorParserTest();
+        runJUnitTest(__test, __test.test_topLevelOperator_withVoid);
+      });
+      _ut.test('test_topLevelOperator_withoutType', () {
+        final __test = new ErrorParserTest();
+        runJUnitTest(__test, __test.test_topLevelOperator_withoutType);
+      });
       _ut.test('test_unexpectedTerminatorForParameterGroup_named', () {
         final __test = new ErrorParserTest();
         runJUnitTest(__test, __test.test_unexpectedTerminatorForParameterGroup_named);
@@ -8248,6 +8476,7 @@
   'isFunctionExpression_1': new MethodTrampoline(1, (Parser target, arg0) => target.isFunctionExpression(arg0)),
   'isHexDigit_1': new MethodTrampoline(1, (Parser target, arg0) => target.isHexDigit(arg0)),
   'isInitializedVariableDeclaration_0': new MethodTrampoline(0, (Parser target) => target.isInitializedVariableDeclaration()),
+  'isOperator_1': new MethodTrampoline(1, (Parser target, arg0) => target.isOperator(arg0)),
   'isSwitchMember_0': new MethodTrampoline(0, (Parser target) => target.isSwitchMember()),
   'lexicallyFirst_1': new MethodTrampoline(1, (Parser target, arg0) => target.lexicallyFirst(arg0)),
   'matches_1': new MethodTrampoline(1, (Parser target, arg0) => target.matches(arg0)),
@@ -8362,6 +8591,7 @@
   'parseVariableDeclarationList_1': new MethodTrampoline(1, (Parser target, arg0) => target.parseVariableDeclarationList(arg0)),
   'parseVariableDeclarationList_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg2) => target.parseVariableDeclarationList2(arg0, arg1, arg2)),
   'parseVariableDeclarationStatement_1': new MethodTrampoline(1, (Parser target, arg0) => target.parseVariableDeclarationStatement(arg0)),
+  'parseVariableDeclarationStatement_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg2) => target.parseVariableDeclarationStatement2(arg0, arg1, arg2)),
   'parseWhileStatement_0': new MethodTrampoline(0, (Parser target) => target.parseWhileStatement()),
   'parseWithClause_0': new MethodTrampoline(0, (Parser target) => target.parseWithClause()),
   'peek_0': new MethodTrampoline(0, (Parser target) => target.peek()),
diff --git a/pkg/analyzer_experimental/test/generated/resolver_test.dart b/pkg/analyzer_experimental/test/generated/resolver_test.dart
index da96c97..130f6f0 100644
--- a/pkg/analyzer_experimental/test/generated/resolver_test.dart
+++ b/pkg/analyzer_experimental/test/generated/resolver_test.dart
@@ -10,17 +10,339 @@
 import 'package:analyzer_experimental/src/generated/source_io.dart';
 import 'package:analyzer_experimental/src/generated/error.dart';
 import 'package:analyzer_experimental/src/generated/scanner.dart';
+import 'package:analyzer_experimental/src/generated/ast.dart' hide Annotation;
+import 'package:analyzer_experimental/src/generated/parser.dart' show ParserErrorCode;
 import 'package:analyzer_experimental/src/generated/element.dart';
 import 'package:analyzer_experimental/src/generated/resolver.dart';
 import 'package:analyzer_experimental/src/generated/engine.dart';
 import 'package:analyzer_experimental/src/generated/java_engine_io.dart';
-import 'package:analyzer_experimental/src/generated/ast.dart' hide Annotation;
 import 'package:analyzer_experimental/src/generated/sdk.dart' show DartSdk;
+import 'package:analyzer_experimental/src/generated/sdk_io.dart' show DirectoryBasedDartSdk;
 import 'package:unittest/unittest.dart' as _ut;
 import 'test_support.dart';
 import 'ast_test.dart' show ASTFactory;
 import 'element_test.dart' show ElementFactory;
 
+class TypePropagationTest extends ResolverTestCase {
+  void test_as() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  bool get g => true;", "}", "A f(var p) {", "  if ((p as A).g) {", "    return p;", "  } else {", "    return null;", "  }", "}"]));
+    LibraryElement library = resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+    CompilationUnit unit = resolveCompilationUnit(source, library);
+    ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
+    InterfaceType typeA = classA.element.type;
+    FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
+    BlockFunctionBody body2 = function.functionExpression.body as BlockFunctionBody;
+    IfStatement ifStatement = body2.block.statements[0] as IfStatement;
+    ReturnStatement statement = ((ifStatement.thenStatement as Block)).statements[0] as ReturnStatement;
+    SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
+    JUnitTestCase.assertSame(typeA, variableName.staticType);
+  }
+  void test_assert() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "A f(var p) {", "  assert (p is A);", "  return p;", "}"]));
+    LibraryElement library = resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+    CompilationUnit unit = resolveCompilationUnit(source, library);
+    ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
+    InterfaceType typeA = classA.element.type;
+    FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
+    BlockFunctionBody body2 = function.functionExpression.body as BlockFunctionBody;
+    ReturnStatement statement = body2.block.statements[1] as ReturnStatement;
+    SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
+    JUnitTestCase.assertSame(typeA, variableName.staticType);
+  }
+  void test_assignment() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  var v;", "  v = 0;", "  return v;", "}"]));
+    LibraryElement library = resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+    CompilationUnit unit = resolveCompilationUnit(source, library);
+    FunctionDeclaration function = unit.declarations[0] as FunctionDeclaration;
+    BlockFunctionBody body2 = function.functionExpression.body as BlockFunctionBody;
+    ReturnStatement statement = body2.block.statements[2] as ReturnStatement;
+    SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
+    JUnitTestCase.assertSame(typeProvider.intType, variableName.staticType);
+  }
+  void test_assignment_afterInitializer() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  var v = 0;", "  v = 1.0;", "  return v;", "}"]));
+    LibraryElement library = resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+    CompilationUnit unit = resolveCompilationUnit(source, library);
+    FunctionDeclaration function = unit.declarations[0] as FunctionDeclaration;
+    BlockFunctionBody body2 = function.functionExpression.body as BlockFunctionBody;
+    ReturnStatement statement = body2.block.statements[2] as ReturnStatement;
+    SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
+    JUnitTestCase.assertSame(typeProvider.doubleType, variableName.staticType);
+  }
+  void test_initializer() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  var v = 0;", "  return v;", "}"]));
+    LibraryElement library = resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+    CompilationUnit unit = resolveCompilationUnit(source, library);
+    FunctionDeclaration function = unit.declarations[0] as FunctionDeclaration;
+    BlockFunctionBody body2 = function.functionExpression.body as BlockFunctionBody;
+    ReturnStatement statement = body2.block.statements[1] as ReturnStatement;
+    SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
+    JUnitTestCase.assertSame(typeProvider.intType, variableName.staticType);
+  }
+  void test_is_conditional() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "A f(var p) {", "  return (p is A) ? p : null;", "}"]));
+    LibraryElement library = resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+    CompilationUnit unit = resolveCompilationUnit(source, library);
+    ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
+    InterfaceType typeA = classA.element.type;
+    FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
+    BlockFunctionBody body2 = function.functionExpression.body as BlockFunctionBody;
+    ReturnStatement statement = body2.block.statements[0] as ReturnStatement;
+    ConditionalExpression conditional = statement.expression as ConditionalExpression;
+    SimpleIdentifier variableName = conditional.thenExpression as SimpleIdentifier;
+    JUnitTestCase.assertSame(typeA, variableName.staticType);
+  }
+  void test_is_if() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "A f(var p) {", "  if (p is A) {", "    return p;", "  } else {", "    return null;", "  }", "}"]));
+    LibraryElement library = resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+    CompilationUnit unit = resolveCompilationUnit(source, library);
+    ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
+    InterfaceType typeA = classA.element.type;
+    FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
+    BlockFunctionBody body2 = function.functionExpression.body as BlockFunctionBody;
+    IfStatement ifStatement = body2.block.statements[0] as IfStatement;
+    ReturnStatement statement = ((ifStatement.thenStatement as Block)).statements[0] as ReturnStatement;
+    SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
+    JUnitTestCase.assertSame(typeA, variableName.staticType);
+  }
+  void test_is_if_logicalAnd() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "A f(var p) {", "  if (p is A && p != null) {", "    return p;", "  } else {", "    return null;", "  }", "}"]));
+    LibraryElement library = resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+    CompilationUnit unit = resolveCompilationUnit(source, library);
+    ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
+    InterfaceType typeA = classA.element.type;
+    FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
+    BlockFunctionBody body2 = function.functionExpression.body as BlockFunctionBody;
+    IfStatement ifStatement = body2.block.statements[0] as IfStatement;
+    ReturnStatement statement = ((ifStatement.thenStatement as Block)).statements[0] as ReturnStatement;
+    SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
+    JUnitTestCase.assertSame(typeA, variableName.staticType);
+  }
+  void test_is_postConditional() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "A f(var p) {", "  A a = (p is A) ? p : throw null;", "  return p;", "}"]));
+    LibraryElement library = resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+    CompilationUnit unit = resolveCompilationUnit(source, library);
+    ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
+    InterfaceType typeA = classA.element.type;
+    FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
+    BlockFunctionBody body2 = function.functionExpression.body as BlockFunctionBody;
+    ReturnStatement statement = body2.block.statements[1] as ReturnStatement;
+    SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
+    JUnitTestCase.assertSame(typeA, variableName.staticType);
+  }
+  void test_is_postIf() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "A f(var p) {", "  if (p is A) {", "    A a = p;", "  } else {", "    return null;", "  }", "  return p;", "}"]));
+    LibraryElement library = resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+    CompilationUnit unit = resolveCompilationUnit(source, library);
+    ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
+    InterfaceType typeA = classA.element.type;
+    FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
+    BlockFunctionBody body2 = function.functionExpression.body as BlockFunctionBody;
+    ReturnStatement statement = body2.block.statements[1] as ReturnStatement;
+    SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
+    JUnitTestCase.assertSame(typeA, variableName.staticType);
+  }
+  void test_is_subclass() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "class B extends A {", "  B m() => this;", "}", "A f(A p) {", "  if (p is B) {", "    return p.m();", "  }", "}"]));
+    LibraryElement library = resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+    CompilationUnit unit = resolveCompilationUnit(source, library);
+    FunctionDeclaration function = unit.declarations[2] as FunctionDeclaration;
+    BlockFunctionBody body2 = function.functionExpression.body as BlockFunctionBody;
+    IfStatement ifStatement = body2.block.statements[0] as IfStatement;
+    ReturnStatement statement = ((ifStatement.thenStatement as Block)).statements[0] as ReturnStatement;
+    MethodInvocation invocation = statement.expression as MethodInvocation;
+    JUnitTestCase.assertNotNull(invocation.methodName.element);
+  }
+  void test_isNot_conditional() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "A f(var p) {", "  return (p is! A) ? null : p;", "}"]));
+    LibraryElement library = resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+    CompilationUnit unit = resolveCompilationUnit(source, library);
+    ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
+    InterfaceType typeA = classA.element.type;
+    FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
+    BlockFunctionBody body2 = function.functionExpression.body as BlockFunctionBody;
+    ReturnStatement statement = body2.block.statements[0] as ReturnStatement;
+    ConditionalExpression conditional = statement.expression as ConditionalExpression;
+    SimpleIdentifier variableName = conditional.elseExpression as SimpleIdentifier;
+    JUnitTestCase.assertSame(typeA, variableName.staticType);
+  }
+  void test_isNot_if() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "A f(var p) {", "  if (p is! A) {", "    return null;", "  } else {", "    return p;", "  }", "}"]));
+    LibraryElement library = resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+    CompilationUnit unit = resolveCompilationUnit(source, library);
+    ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
+    InterfaceType typeA = classA.element.type;
+    FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
+    BlockFunctionBody body2 = function.functionExpression.body as BlockFunctionBody;
+    IfStatement ifStatement = body2.block.statements[0] as IfStatement;
+    ReturnStatement statement = ((ifStatement.elseStatement as Block)).statements[0] as ReturnStatement;
+    SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
+    JUnitTestCase.assertSame(typeA, variableName.staticType);
+  }
+  void test_isNot_if_logicalOr() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "A f(var p) {", "  if (p is! A || null == p) {", "    return null;", "  } else {", "    return p;", "  }", "}"]));
+    LibraryElement library = resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+    CompilationUnit unit = resolveCompilationUnit(source, library);
+    ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
+    InterfaceType typeA = classA.element.type;
+    FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
+    BlockFunctionBody body2 = function.functionExpression.body as BlockFunctionBody;
+    IfStatement ifStatement = body2.block.statements[0] as IfStatement;
+    ReturnStatement statement = ((ifStatement.elseStatement as Block)).statements[0] as ReturnStatement;
+    SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
+    JUnitTestCase.assertSame(typeA, variableName.staticType);
+  }
+  void test_isNot_postConditional() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "A f(var p) {", "  A a = (p is! A) ? throw null : p;", "  return p;", "}"]));
+    LibraryElement library = resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+    CompilationUnit unit = resolveCompilationUnit(source, library);
+    ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
+    InterfaceType typeA = classA.element.type;
+    FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
+    BlockFunctionBody body2 = function.functionExpression.body as BlockFunctionBody;
+    ReturnStatement statement = body2.block.statements[1] as ReturnStatement;
+    SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
+    JUnitTestCase.assertSame(typeA, variableName.staticType);
+  }
+  void test_isNot_postIf() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "A f(var p) {", "  if (p is! A) {", "    return null;", "  }", "  return p;", "}"]));
+    LibraryElement library = resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+    CompilationUnit unit = resolveCompilationUnit(source, library);
+    ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
+    InterfaceType typeA = classA.element.type;
+    FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
+    BlockFunctionBody body2 = function.functionExpression.body as BlockFunctionBody;
+    ReturnStatement statement = body2.block.statements[1] as ReturnStatement;
+    SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
+    JUnitTestCase.assertSame(typeA, variableName.staticType);
+  }
+  void test_query() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["import 'dart:html';", "", "main() {", "  var v1 = query('a');", "  var v2 = query('A');", "  var v3 = query('body:active');", "  var v4 = query('button[foo=\"bar\"]');", "  var v5 = query('div.class');", "  var v6 = query('input#id');", "  var v7 = query('select#id');", "  // invocation of method", "  var m1 = document.query('div');", " // unsupported currently", "  var b1 = query('noSuchTag');", "  var b2 = query('DART_EDITOR_NO_SUCH_TYPE');", "  var b3 = query('body div');", "  return [v1, v2, v3, v4, v5, v6, v7, m1, b1, b2, b3];", "}"]));
+    LibraryElement library = resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+    CompilationUnit unit = resolveCompilationUnit(source, library);
+    FunctionDeclaration main = unit.declarations[0] as FunctionDeclaration;
+    BlockFunctionBody body2 = main.functionExpression.body as BlockFunctionBody;
+    ReturnStatement statement = body2.block.statements[11] as ReturnStatement;
+    NodeList<Expression> elements2 = ((statement.expression as ListLiteral)).elements;
+    JUnitTestCase.assertEquals("AnchorElement", elements2[0].staticType.name);
+    JUnitTestCase.assertEquals("AnchorElement", elements2[1].staticType.name);
+    JUnitTestCase.assertEquals("BodyElement", elements2[2].staticType.name);
+    JUnitTestCase.assertEquals("ButtonElement", elements2[3].staticType.name);
+    JUnitTestCase.assertEquals("DivElement", elements2[4].staticType.name);
+    JUnitTestCase.assertEquals("InputElement", elements2[5].staticType.name);
+    JUnitTestCase.assertEquals("SelectElement", elements2[6].staticType.name);
+    JUnitTestCase.assertEquals("DivElement", elements2[7].staticType.name);
+    JUnitTestCase.assertEquals("Element", elements2[8].staticType.name);
+    JUnitTestCase.assertEquals("Element", elements2[9].staticType.name);
+    JUnitTestCase.assertEquals("Element", elements2[10].staticType.name);
+  }
+  static dartSuite() {
+    _ut.group('TypePropagationTest', () {
+      _ut.test('test_as', () {
+        final __test = new TypePropagationTest();
+        runJUnitTest(__test, __test.test_as);
+      });
+      _ut.test('test_assert', () {
+        final __test = new TypePropagationTest();
+        runJUnitTest(__test, __test.test_assert);
+      });
+      _ut.test('test_assignment', () {
+        final __test = new TypePropagationTest();
+        runJUnitTest(__test, __test.test_assignment);
+      });
+      _ut.test('test_assignment_afterInitializer', () {
+        final __test = new TypePropagationTest();
+        runJUnitTest(__test, __test.test_assignment_afterInitializer);
+      });
+      _ut.test('test_initializer', () {
+        final __test = new TypePropagationTest();
+        runJUnitTest(__test, __test.test_initializer);
+      });
+      _ut.test('test_isNot_conditional', () {
+        final __test = new TypePropagationTest();
+        runJUnitTest(__test, __test.test_isNot_conditional);
+      });
+      _ut.test('test_isNot_if', () {
+        final __test = new TypePropagationTest();
+        runJUnitTest(__test, __test.test_isNot_if);
+      });
+      _ut.test('test_isNot_if_logicalOr', () {
+        final __test = new TypePropagationTest();
+        runJUnitTest(__test, __test.test_isNot_if_logicalOr);
+      });
+      _ut.test('test_isNot_postConditional', () {
+        final __test = new TypePropagationTest();
+        runJUnitTest(__test, __test.test_isNot_postConditional);
+      });
+      _ut.test('test_isNot_postIf', () {
+        final __test = new TypePropagationTest();
+        runJUnitTest(__test, __test.test_isNot_postIf);
+      });
+      _ut.test('test_is_conditional', () {
+        final __test = new TypePropagationTest();
+        runJUnitTest(__test, __test.test_is_conditional);
+      });
+      _ut.test('test_is_if', () {
+        final __test = new TypePropagationTest();
+        runJUnitTest(__test, __test.test_is_if);
+      });
+      _ut.test('test_is_if_logicalAnd', () {
+        final __test = new TypePropagationTest();
+        runJUnitTest(__test, __test.test_is_if_logicalAnd);
+      });
+      _ut.test('test_is_postConditional', () {
+        final __test = new TypePropagationTest();
+        runJUnitTest(__test, __test.test_is_postConditional);
+      });
+      _ut.test('test_is_postIf', () {
+        final __test = new TypePropagationTest();
+        runJUnitTest(__test, __test.test_is_postIf);
+      });
+      _ut.test('test_is_subclass', () {
+        final __test = new TypePropagationTest();
+        runJUnitTest(__test, __test.test_is_subclass);
+      });
+      _ut.test('test_query', () {
+        final __test = new TypePropagationTest();
+        runJUnitTest(__test, __test.test_query);
+      });
+    });
+  }
+}
 class NonErrorResolverTest extends ResolverTestCase {
   void test_argumentDefinitionTestNonParameter_formalParameter() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["f(var v) {", "  return ?v;", "}"]));
@@ -70,14 +392,20 @@
     assertNoErrors();
     verify([source]);
   }
-  void test_constConstructorWithNonFinalField_const() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  const int x;", "  const A() {}", "}"]));
+  void test_constConstructorWithNonFinalField_constInstanceVar() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  const int x = 0;", "  const A() {}", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
-  void test_constConstructorWithNonFinalField_final() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  final int x;", "  const A() {}", "}"]));
+  void test_constConstructorWithNonFinalField_finalInstanceVar() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  final int x = 0;", "  const A() {}", "}"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_constConstructorWithNonFinalField_static() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  static int x;", "  const A() {}", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
@@ -94,12 +422,38 @@
     assertErrors([]);
     verify([source]);
   }
+  void test_duplicateDefinition_emptyName() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["Map _globalMap = {", "  'a' : () {},", "  'b' : () {}", "}"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
   void test_duplicateDefinition_getter() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["bool get a => true;"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
+  void test_exportOfNonLibrary_libraryDeclared() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["library L;", "export 'lib1.dart';"]));
+    addSource("/lib1.dart", EngineTestCase.createSource(["library lib1;"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_exportOfNonLibrary_libraryNotDeclared() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["library L;", "export 'lib1.dart';"]));
+    addSource("/lib1.dart", EngineTestCase.createSource([""]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_fieldInitializedByMultipleInitializers() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int x;", "  int y;", "  A() : x = 0, y = 0 {}", "}"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
   void test_fieldInitializedInInitializerAndDeclaration_fieldNotFinal() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int x = 0;", "  A() : x = 1 {}", "}"]));
     resolve(source, []);
@@ -124,6 +478,62 @@
     assertNoErrors();
     verify([source]);
   }
+  void test_finalInitializedInDeclarationAndConstructor_initializer() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  final x;", "  A() : x = 1 {}", "}"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_finalInitializedInDeclarationAndConstructor_initializingFormal() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  final x;", "  A(this.x) {}", "}"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_finalNotInitialized_atDeclaration() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  final int x = 0;", "  A() {}", "}"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_finalNotInitialized_fieldFormal() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  final int x = 0;", "  A() {}", "}"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_finalNotInitialized_initializer() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  final int x;", "  A() : x = 0 {}", "}"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_importOfNonLibrary_libraryDeclared() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["library lib;", "import 'part.dart';"]));
+    addSource("/part.dart", EngineTestCase.createSource(["library lib1;"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_importOfNonLibrary_libraryNotDeclared() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["library lib;", "import 'part.dart';"]));
+    addSource("/part.dart", EngineTestCase.createSource([""]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_inconsistentCaseExpressionTypes() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["f(var p) {", "  switch (p) {", "    case 1:", "      break;", "    case 2:", "      break;", "  }", "}"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_initializingFormalForNonExistantField() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int x;", "  A(this.x) {}", "}"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
   void test_invalidAssignment() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  var x;", "  var y;", "  x = y;", "}"]));
     resolve(source, []);
@@ -179,7 +589,7 @@
     verify([source]);
   }
   void test_returnOfInvalidType_dynamic() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  static void testLogicalOp() {", "    testOr(a, b, onTypeError) {", "      try {", "        return a || b;", "      } on TypeError catch (t) {", "        return onTypeError;", "      }", "    }", "  }", "}"]));
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class TypeError {}", "class A {", "  static void testLogicalOp() {", "    testOr(a, b, onTypeError) {", "      try {", "        return a || b;", "      } on TypeError catch (t) {", "        return onTypeError;", "      }", "    }", "  }", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
@@ -208,6 +618,32 @@
     assertNoErrors();
     verify([source]);
   }
+  void test_undefinedGetter_typeSubstitution() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A<E> {", "  E element;", "}", "class B extends A<List> {", "  m() {", "    element.last;", "  }", "}"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_undefinedIdentifier_hide() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["library L;", "export 'lib1.dart' hide a;"]));
+    addSource("/lib1.dart", EngineTestCase.createSource(["library lib1;"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_undefinedIdentifier_show() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["library L;", "export 'lib1.dart' show a;"]));
+    addSource("/lib1.dart", EngineTestCase.createSource(["library lib1;"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_undefinedOperator_tilde() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["const A = 3;", "const B = ~((1 << A) - 1);"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
   static dartSuite() {
     _ut.group('NonErrorResolverTest', () {
       _ut.test('test_argumentDefinitionTestNonParameter_formalParameter', () {
@@ -242,13 +678,17 @@
         final __test = new NonErrorResolverTest();
         runJUnitTest(__test, __test.test_caseExpressionTypeImplementsEquals_int);
       });
-      _ut.test('test_constConstructorWithNonFinalField_const', () {
+      _ut.test('test_constConstructorWithNonFinalField_constInstanceVar', () {
         final __test = new NonErrorResolverTest();
-        runJUnitTest(__test, __test.test_constConstructorWithNonFinalField_const);
+        runJUnitTest(__test, __test.test_constConstructorWithNonFinalField_constInstanceVar);
       });
-      _ut.test('test_constConstructorWithNonFinalField_final', () {
+      _ut.test('test_constConstructorWithNonFinalField_finalInstanceVar', () {
         final __test = new NonErrorResolverTest();
-        runJUnitTest(__test, __test.test_constConstructorWithNonFinalField_final);
+        runJUnitTest(__test, __test.test_constConstructorWithNonFinalField_finalInstanceVar);
+      });
+      _ut.test('test_constConstructorWithNonFinalField_static', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_constConstructorWithNonFinalField_static);
       });
       _ut.test('test_constConstructorWithNonFinalField_syntheticField', () {
         final __test = new NonErrorResolverTest();
@@ -258,10 +698,26 @@
         final __test = new NonErrorResolverTest();
         runJUnitTest(__test, __test.test_defaultValueInFunctionTypeAlias);
       });
+      _ut.test('test_duplicateDefinition_emptyName', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_duplicateDefinition_emptyName);
+      });
       _ut.test('test_duplicateDefinition_getter', () {
         final __test = new NonErrorResolverTest();
         runJUnitTest(__test, __test.test_duplicateDefinition_getter);
       });
+      _ut.test('test_exportOfNonLibrary_libraryDeclared', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_exportOfNonLibrary_libraryDeclared);
+      });
+      _ut.test('test_exportOfNonLibrary_libraryNotDeclared', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_exportOfNonLibrary_libraryNotDeclared);
+      });
+      _ut.test('test_fieldInitializedByMultipleInitializers', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_fieldInitializedByMultipleInitializers);
+      });
       _ut.test('test_fieldInitializedInInitializerAndDeclaration_fieldNotFinal', () {
         final __test = new NonErrorResolverTest();
         runJUnitTest(__test, __test.test_fieldInitializedInInitializerAndDeclaration_fieldNotFinal);
@@ -278,6 +734,42 @@
         final __test = new NonErrorResolverTest();
         runJUnitTest(__test, __test.test_fieldInitializerOutsideConstructor_defaultParameters);
       });
+      _ut.test('test_finalInitializedInDeclarationAndConstructor_initializer', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_finalInitializedInDeclarationAndConstructor_initializer);
+      });
+      _ut.test('test_finalInitializedInDeclarationAndConstructor_initializingFormal', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_finalInitializedInDeclarationAndConstructor_initializingFormal);
+      });
+      _ut.test('test_finalNotInitialized_atDeclaration', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_finalNotInitialized_atDeclaration);
+      });
+      _ut.test('test_finalNotInitialized_fieldFormal', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_finalNotInitialized_fieldFormal);
+      });
+      _ut.test('test_finalNotInitialized_initializer', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_finalNotInitialized_initializer);
+      });
+      _ut.test('test_importOfNonLibrary_libraryDeclared', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_importOfNonLibrary_libraryDeclared);
+      });
+      _ut.test('test_importOfNonLibrary_libraryNotDeclared', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_importOfNonLibrary_libraryNotDeclared);
+      });
+      _ut.test('test_inconsistentCaseExpressionTypes', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_inconsistentCaseExpressionTypes);
+      });
+      _ut.test('test_initializingFormalForNonExistantField', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_initializingFormalForNonExistantField);
+      });
       _ut.test('test_invalidAssignment', () {
         final __test = new NonErrorResolverTest();
         runJUnitTest(__test, __test.test_invalidAssignment);
@@ -334,6 +826,22 @@
         final __test = new NonErrorResolverTest();
         runJUnitTest(__test, __test.test_typeArgumentNotMatchingBounds_new);
       });
+      _ut.test('test_undefinedGetter_typeSubstitution', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_undefinedGetter_typeSubstitution);
+      });
+      _ut.test('test_undefinedIdentifier_hide', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_undefinedIdentifier_hide);
+      });
+      _ut.test('test_undefinedIdentifier_show', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_undefinedIdentifier_show);
+      });
+      _ut.test('test_undefinedOperator_tilde', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_undefinedOperator_tilde);
+      });
     });
   }
 }
@@ -364,17 +872,17 @@
   void test_addExport() {
     Library exportLibrary = library("/exported.dart");
     _library5.addExport(ASTFactory.exportDirective2("exported.dart", []), exportLibrary);
-    List<Library> exports3 = _library5.exports;
-    EngineTestCase.assertLength(1, exports3);
-    JUnitTestCase.assertSame(exportLibrary, exports3[0]);
+    List<Library> exports2 = _library5.exports;
+    EngineTestCase.assertLength(1, exports2);
+    JUnitTestCase.assertSame(exportLibrary, exports2[0]);
     _errorListener.assertNoErrors();
   }
   void test_addImport() {
     Library importLibrary = library("/imported.dart");
     _library5.addImport(ASTFactory.importDirective2("imported.dart", null, []), importLibrary);
-    List<Library> imports3 = _library5.imports;
-    EngineTestCase.assertLength(1, imports3);
-    JUnitTestCase.assertSame(importLibrary, imports3[0]);
+    List<Library> imports2 = _library5.imports;
+    EngineTestCase.assertLength(1, imports2);
+    JUnitTestCase.assertSame(importLibrary, imports2[0]);
     _errorListener.assertNoErrors();
   }
   void test_getExplicitlyImportsCore() {
@@ -429,7 +937,7 @@
     _library5.libraryElement = element;
     JUnitTestCase.assertSame(element, _library5.libraryElement);
   }
-  Library library(String definingCompilationUnitPath) => new Library(_analysisContext, _errorListener, new FileBasedSource.con1(_sourceFactory, FileUtilities2.createFile(definingCompilationUnitPath)));
+  Library library(String definingCompilationUnitPath) => new Library(_analysisContext, _errorListener, new FileBasedSource.con1(_sourceFactory.contentCache, FileUtilities2.createFile(definingCompilationUnitPath)));
   static dartSuite() {
     _ut.group('LibraryTest', () {
       _ut.test('test_addExport', () {
@@ -515,7 +1023,7 @@
     verify([source]);
   }
   void test_invalidAssignment_instanceVariable() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", " int x;", "}", "f() {", "  A a;", "  a.x = '0';", "}"]));
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int x;", "}", "f() {", "  A a;", "  a.x = '0';", "}"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.INVALID_ASSIGNMENT]);
     verify([source]);
@@ -527,30 +1035,29 @@
     verify([source]);
   }
   void test_invalidAssignment_staticVariable() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", " static int x;", "}", "f() {", "  A.x = '0';", "}"]));
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  static int x;", "}", "f() {", "  A.x = '0';", "}"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.INVALID_ASSIGNMENT]);
     verify([source]);
   }
   void test_invocationOfNonFunction_class() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", " void m() {", "  A();", " }", "}"]));
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  void m() {", "    A();", "  }", "}"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION]);
-    verify([source]);
   }
   void test_invocationOfNonFunction_localVariable() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", " int x;", " return x();", "}"]));
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  int x;", "  return x();", "}"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION]);
     verify([source]);
   }
   void test_invocationOfNonFunction_ordinaryInvocation() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", " int x;", "}", "class B {", " m() {", "  A.x();", " }", "}"]));
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int x;", "}", "class B {", "  m() {", "    A.x();", "  }", "}"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION]);
   }
   void test_invocationOfNonFunction_staticInvocation() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", " static int get g => 0;", " f() {", "  A.g();", " }", "}"]));
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  static int get g => 0;", "  f() {", "    A.g();", "  }", "}"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION]);
   }
@@ -561,19 +1068,19 @@
     verify([source]);
   }
   void test_nonBoolCondition_do() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", " do {} while (3);", "}"]));
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  do {} while (3);", "}"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.NON_BOOL_CONDITION]);
     verify([source]);
   }
   void test_nonBoolCondition_if() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", " if (3) return 2; else return 1;", "}"]));
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  if (3) return 2; else return 1;", "}"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.NON_BOOL_CONDITION]);
     verify([source]);
   }
   void test_nonBoolCondition_while() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", " while (3) {}", "}"]));
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  while (3) {}", "}"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.NON_BOOL_CONDITION]);
     verify([source]);
@@ -614,6 +1121,11 @@
     assertErrors([StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
     verify([source]);
   }
+  void test_undefinedFunction() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["void f() {", "  g();", "}"]));
+    resolve(source, []);
+    assertErrors([StaticTypeWarningCode.UNDEFINED_FUNCTION]);
+  }
   void test_undefinedGetter() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["class T {}", "f(T e) { return e.m; }"]));
     resolve(source, []);
@@ -624,6 +1136,11 @@
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.UNDEFINED_GETTER]);
   }
+  void test_undefinedMethod() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  void m() {", "    n();", "  }", "}"]));
+    resolve(source, []);
+    assertErrors([StaticTypeWarningCode.UNDEFINED_METHOD]);
+  }
   void test_undefinedSetter() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["class T {}", "f(T e1) { e1.m = 0; }"]));
     resolve(source, []);
@@ -638,7 +1155,6 @@
     Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "class B extends A {", "  m() { return super.m(); }", "}"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.UNDEFINED_SUPER_METHOD]);
-    verify([source]);
   }
   void test_wrongNumberOfTypeArguments_tooFew() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["class A<E, F> {}", "A<A> a = null;"]));
@@ -722,6 +1238,10 @@
         final __test = new StaticTypeWarningCodeTest();
         runJUnitTest(__test, __test.test_typeArgumentNotMatchingBounds_new);
       });
+      _ut.test('test_undefinedFunction', () {
+        final __test = new StaticTypeWarningCodeTest();
+        runJUnitTest(__test, __test.test_undefinedFunction);
+      });
       _ut.test('test_undefinedGetter', () {
         final __test = new StaticTypeWarningCodeTest();
         runJUnitTest(__test, __test.test_undefinedGetter);
@@ -730,6 +1250,10 @@
         final __test = new StaticTypeWarningCodeTest();
         runJUnitTest(__test, __test.test_undefinedGetter_static);
       });
+      _ut.test('test_undefinedMethod', () {
+        final __test = new StaticTypeWarningCodeTest();
+        runJUnitTest(__test, __test.test_undefinedMethod);
+      });
       _ut.test('test_undefinedSetter', () {
         final __test = new StaticTypeWarningCodeTest();
         runJUnitTest(__test, __test.test_undefinedSetter);
@@ -781,7 +1305,7 @@
     _listener.assertNoErrors();
   }
   void fail_visitFieldFormalParameter_type() {
-    FormalParameter node = ASTFactory.fieldFormalParameter(null, ASTFactory.typeName3("int", []), "p");
+    FormalParameter node = ASTFactory.fieldFormalParameter(null, ASTFactory.typeName4("int", []), "p");
     JUnitTestCase.assertSame(_typeProvider.intType, resolve5(node, []));
     _listener.assertNoErrors();
   }
@@ -814,21 +1338,27 @@
     SourceFactory factory = new SourceFactory.con2([new FileUriResolver()]);
     AnalysisContextImpl context = new AnalysisContextImpl();
     context.sourceFactory = factory;
-    Source librarySource = new FileBasedSource.con1(factory, FileUtilities2.createFile("/lib.dart"));
+    Source librarySource = new FileBasedSource.con1(factory.contentCache, FileUtilities2.createFile("/lib.dart"));
     _library = new Library(context, _listener, librarySource);
     LibraryElementImpl element = new LibraryElementImpl(context, ASTFactory.libraryIdentifier2(["lib"]));
     element.definingCompilationUnit = new CompilationUnitElementImpl("lib.dart");
     _library.libraryElement = element;
     _typeProvider = new TestTypeProvider();
-    _visitor = new TypeResolverVisitor(_library, librarySource, _typeProvider);
+    _visitor = new TypeResolverVisitor.con1(_library, librarySource, _typeProvider);
   }
   void test_visitCatchClause_exception() {
     CatchClause clause = ASTFactory.catchClause("e", []);
+    SimpleIdentifier exceptionParameter2 = clause.exceptionParameter;
+    exceptionParameter2.element = new LocalVariableElementImpl(exceptionParameter2);
     resolve(clause, _typeProvider.objectType, null, []);
     _listener.assertNoErrors();
   }
   void test_visitCatchClause_exception_stackTrace() {
     CatchClause clause = ASTFactory.catchClause2("e", "s", []);
+    SimpleIdentifier exceptionParameter2 = clause.exceptionParameter;
+    exceptionParameter2.element = new LocalVariableElementImpl(exceptionParameter2);
+    SimpleIdentifier stackTraceParameter2 = clause.stackTraceParameter;
+    stackTraceParameter2.element = new LocalVariableElementImpl(stackTraceParameter2);
     resolve(clause, _typeProvider.objectType, _typeProvider.stackTraceType, []);
     _listener.assertNoErrors();
   }
@@ -836,6 +1366,8 @@
     ClassElement exceptionElement = ElementFactory.classElement2("E", []);
     TypeName exceptionType = ASTFactory.typeName(exceptionElement, []);
     CatchClause clause = ASTFactory.catchClause4(exceptionType, "e", []);
+    SimpleIdentifier exceptionParameter2 = clause.exceptionParameter;
+    exceptionParameter2.element = new LocalVariableElementImpl(exceptionParameter2);
     resolve(clause, exceptionElement.type, null, [exceptionElement]);
     _listener.assertNoErrors();
   }
@@ -844,6 +1376,10 @@
     TypeName exceptionType = ASTFactory.typeName(exceptionElement, []);
     ((exceptionType.name as SimpleIdentifier)).element = exceptionElement;
     CatchClause clause = ASTFactory.catchClause5(exceptionType, "e", "s", []);
+    SimpleIdentifier exceptionParameter2 = clause.exceptionParameter;
+    exceptionParameter2.element = new LocalVariableElementImpl(exceptionParameter2);
+    SimpleIdentifier stackTraceParameter2 = clause.stackTraceParameter;
+    stackTraceParameter2.element = new LocalVariableElementImpl(stackTraceParameter2);
     resolve(clause, exceptionElement.type, _typeProvider.stackTraceType, [exceptionElement]);
     _listener.assertNoErrors();
   }
@@ -859,12 +1395,12 @@
     declaration.name.element = elementA;
     resolveNode(declaration, [elementA, elementB, elementC, elementD]);
     JUnitTestCase.assertSame(elementB.type, elementA.supertype);
-    List<InterfaceType> mixins3 = elementA.mixins;
-    EngineTestCase.assertLength(1, mixins3);
-    JUnitTestCase.assertSame(elementC.type, mixins3[0]);
-    List<InterfaceType> interfaces3 = elementA.interfaces;
-    EngineTestCase.assertLength(1, interfaces3);
-    JUnitTestCase.assertSame(elementD.type, interfaces3[0]);
+    List<InterfaceType> mixins2 = elementA.mixins;
+    EngineTestCase.assertLength(1, mixins2);
+    JUnitTestCase.assertSame(elementC.type, mixins2[0]);
+    List<InterfaceType> interfaces2 = elementA.interfaces;
+    EngineTestCase.assertLength(1, interfaces2);
+    JUnitTestCase.assertSame(elementD.type, interfaces2[0]);
     _listener.assertNoErrors();
   }
   void test_visitClassTypeAlias() {
@@ -872,51 +1408,51 @@
     ClassElement elementB = ElementFactory.classElement2("B", []);
     ClassElement elementC = ElementFactory.classElement2("C", []);
     ClassElement elementD = ElementFactory.classElement2("D", []);
-    WithClause withClause3 = ASTFactory.withClause([ASTFactory.typeName(elementC, [])]);
-    ImplementsClause implementsClause3 = ASTFactory.implementsClause([ASTFactory.typeName(elementD, [])]);
-    ClassTypeAlias alias = ASTFactory.classTypeAlias("A", null, null, ASTFactory.typeName(elementB, []), withClause3, implementsClause3);
+    WithClause withClause2 = ASTFactory.withClause([ASTFactory.typeName(elementC, [])]);
+    ImplementsClause implementsClause2 = ASTFactory.implementsClause([ASTFactory.typeName(elementD, [])]);
+    ClassTypeAlias alias = ASTFactory.classTypeAlias("A", null, null, ASTFactory.typeName(elementB, []), withClause2, implementsClause2);
     alias.name.element = elementA;
     resolveNode(alias, [elementA, elementB, elementC, elementD]);
     JUnitTestCase.assertSame(elementB.type, elementA.supertype);
-    List<InterfaceType> mixins4 = elementA.mixins;
-    EngineTestCase.assertLength(1, mixins4);
-    JUnitTestCase.assertSame(elementC.type, mixins4[0]);
-    List<InterfaceType> interfaces4 = elementA.interfaces;
-    EngineTestCase.assertLength(1, interfaces4);
-    JUnitTestCase.assertSame(elementD.type, interfaces4[0]);
+    List<InterfaceType> mixins2 = elementA.mixins;
+    EngineTestCase.assertLength(1, mixins2);
+    JUnitTestCase.assertSame(elementC.type, mixins2[0]);
+    List<InterfaceType> interfaces2 = elementA.interfaces;
+    EngineTestCase.assertLength(1, interfaces2);
+    JUnitTestCase.assertSame(elementD.type, interfaces2[0]);
     _listener.assertNoErrors();
   }
   void test_visitSimpleFormalParameter_noType() {
     FormalParameter node = ASTFactory.simpleFormalParameter3("p");
-    node.identifier.element = new ParameterElementImpl(ASTFactory.identifier2("p"));
+    node.identifier.element = new ParameterElementImpl(ASTFactory.identifier3("p"));
     JUnitTestCase.assertSame(_typeProvider.dynamicType, resolve5(node, []));
     _listener.assertNoErrors();
   }
   void test_visitSimpleFormalParameter_type() {
-    InterfaceType intType9 = _typeProvider.intType;
-    ClassElement intElement = intType9.element;
+    InterfaceType intType2 = _typeProvider.intType;
+    ClassElement intElement = intType2.element;
     FormalParameter node = ASTFactory.simpleFormalParameter4(ASTFactory.typeName(intElement, []), "p");
-    SimpleIdentifier identifier18 = node.identifier;
-    ParameterElementImpl element = new ParameterElementImpl(identifier18);
-    identifier18.element = element;
-    JUnitTestCase.assertSame(intType9, resolve5(node, [intElement]));
+    SimpleIdentifier identifier2 = node.identifier;
+    ParameterElementImpl element = new ParameterElementImpl(identifier2);
+    identifier2.element = element;
+    JUnitTestCase.assertSame(intType2, resolve5(node, [intElement]));
     _listener.assertNoErrors();
   }
   void test_visitTypeName_noParameters_noArguments() {
     ClassElement classA = ElementFactory.classElement2("A", []);
-    TypeName typeName5 = ASTFactory.typeName(classA, []);
-    typeName5.type = null;
-    resolveNode(typeName5, [classA]);
-    JUnitTestCase.assertSame(classA.type, typeName5.type);
+    TypeName typeName2 = ASTFactory.typeName(classA, []);
+    typeName2.type = null;
+    resolveNode(typeName2, [classA]);
+    JUnitTestCase.assertSame(classA.type, typeName2.type);
     _listener.assertNoErrors();
   }
   void test_visitTypeName_parameters_arguments() {
     ClassElement classA = ElementFactory.classElement2("A", ["E"]);
     ClassElement classB = ElementFactory.classElement2("B", []);
-    TypeName typeName6 = ASTFactory.typeName(classA, [ASTFactory.typeName(classB, [])]);
-    typeName6.type = null;
-    resolveNode(typeName6, [classA, classB]);
-    InterfaceType resultType = typeName6.type as InterfaceType;
+    TypeName typeName2 = ASTFactory.typeName(classA, [ASTFactory.typeName(classB, [])]);
+    typeName2.type = null;
+    resolveNode(typeName2, [classA, classB]);
+    InterfaceType resultType = typeName2.type as InterfaceType;
     JUnitTestCase.assertSame(classA, resultType.element);
     List<Type2> resultArguments = resultType.typeArguments;
     EngineTestCase.assertLength(1, resultArguments);
@@ -925,16 +1461,23 @@
   }
   void test_visitTypeName_parameters_noArguments() {
     ClassElement classA = ElementFactory.classElement2("A", ["E"]);
-    TypeName typeName7 = ASTFactory.typeName(classA, []);
-    typeName7.type = null;
-    resolveNode(typeName7, [classA]);
-    InterfaceType resultType = typeName7.type as InterfaceType;
+    TypeName typeName2 = ASTFactory.typeName(classA, []);
+    typeName2.type = null;
+    resolveNode(typeName2, [classA]);
+    InterfaceType resultType = typeName2.type as InterfaceType;
     JUnitTestCase.assertSame(classA, resultType.element);
     List<Type2> resultArguments = resultType.typeArguments;
     EngineTestCase.assertLength(1, resultArguments);
     JUnitTestCase.assertSame(DynamicTypeImpl.instance, resultArguments[0]);
     _listener.assertNoErrors();
   }
+  void test_visitTypeName_void() {
+    ClassElement classA = ElementFactory.classElement2("A", []);
+    TypeName typeName = ASTFactory.typeName4("void", []);
+    resolveNode(typeName, [classA]);
+    JUnitTestCase.assertSame(VoidTypeImpl.instance, typeName.type);
+    _listener.assertNoErrors();
+  }
   /**
    * Analyze the given catch clause and assert that the types of the parameters have been set to the
    * given types. The types can be null if the catch clause does not have the corresponding
@@ -947,13 +1490,13 @@
    */
   void resolve(CatchClause node, InterfaceType exceptionType, InterfaceType stackTraceType, List<Element> definedElements) {
     resolveNode(node, definedElements);
-    SimpleIdentifier exceptionParameter3 = node.exceptionParameter;
-    if (exceptionParameter3 != null) {
-      JUnitTestCase.assertSame(exceptionType, exceptionParameter3.staticType);
+    SimpleIdentifier exceptionParameter2 = node.exceptionParameter;
+    if (exceptionParameter2 != null) {
+      JUnitTestCase.assertSame(exceptionType, exceptionParameter2.staticType);
     }
-    SimpleIdentifier stackTraceParameter3 = node.stackTraceParameter;
-    if (stackTraceParameter3 != null) {
-      JUnitTestCase.assertSame(stackTraceType, stackTraceParameter3.staticType);
+    SimpleIdentifier stackTraceParameter2 = node.stackTraceParameter;
+    if (stackTraceParameter2 != null) {
+      JUnitTestCase.assertSame(stackTraceType, stackTraceParameter2.staticType);
     }
   }
   /**
@@ -1028,6 +1571,10 @@
         final __test = new TypeResolverVisitorTest();
         runJUnitTest(__test, __test.test_visitTypeName_parameters_noArguments);
       });
+      _ut.test('test_visitTypeName_void', () {
+        final __test = new TypeResolverVisitorTest();
+        runJUnitTest(__test, __test.test_visitTypeName_void);
+      });
     });
   }
 }
@@ -1067,7 +1614,7 @@
    * @return the source object representing the added file
    */
   Source addSource(String filePath, String contents) {
-    Source source = new FileBasedSource.con1(_sourceFactory, FileUtilities2.createFile(filePath));
+    Source source = new FileBasedSource.con1(_sourceFactory.contentCache, FileUtilities2.createFile(filePath));
     _sourceFactory.setContents(source, contents);
     ChangeSet changeSet = new ChangeSet();
     changeSet.added(source);
@@ -1098,7 +1645,7 @@
     List<CompilationUnitElementImpl> sourcedCompilationUnits = new List<CompilationUnitElementImpl>(count);
     for (int i = 0; i < count; i++) {
       String typeName = typeNames[i];
-      ClassElementImpl type = new ClassElementImpl(ASTFactory.identifier2(typeName));
+      ClassElementImpl type = new ClassElementImpl(ASTFactory.identifier3(typeName));
       String fileName = "${typeName}.dart";
       CompilationUnitElementImpl compilationUnit = new CompilationUnitElementImpl(fileName);
       compilationUnit.source = createSource2(fileName);
@@ -1117,6 +1664,15 @@
   GatheringErrorListener get errorListener => _errorListener;
   SourceFactory get sourceFactory => _sourceFactory;
   /**
+   * Return a type provider that can be used to test the results of resolution.
+   * @return a type provider
+   */
+  TypeProvider get typeProvider {
+    Source coreSource = _analysisContext.sourceFactory.forUri(DartSdk.DART_CORE);
+    LibraryElement coreElement = _analysisContext.getLibraryElement(coreSource);
+    return new TypeProviderImpl(coreElement);
+  }
+  /**
    * Given a library and all of its parts, resolve the contents of the library and the contents of
    * the parts. This assumes that the sources for the library and its parts have already been added
    * to the content provider using the method {@link #addSource(String,String)}.
@@ -1130,6 +1686,14 @@
     return resolver.resolveLibrary(librarySource, true);
   }
   /**
+   * Return the resolved compilation unit corresponding to the given source in the given library.
+   * @param source the source of the compilation unit to be returned
+   * @param library the library in which the compilation unit is to be resolved
+   * @return the resolved compilation unit
+   * @throws Exception if the compilation unit could not be resolved
+   */
+  CompilationUnit resolveCompilationUnit(Source source, LibraryElement library) => _analysisContext.resolveCompilationUnit(source, library);
+  /**
    * Verify that all of the identifiers in the compilation units associated with the given sources
    * have been resolved.
    * @param resolvedElementMap a table mapping the AST nodes that have been resolved to the element
@@ -1150,7 +1714,7 @@
    * @return the source that was created
    */
   FileBasedSource createSource2(String fileName) {
-    FileBasedSource source = new FileBasedSource.con1(_sourceFactory, FileUtilities2.createFile(fileName));
+    FileBasedSource source = new FileBasedSource.con1(_sourceFactory.contentCache, FileUtilities2.createFile(fileName));
     _sourceFactory.setContents(source, "");
     return source;
   }
@@ -1191,7 +1755,7 @@
     JUnitTestCase.assertSame(typeType, provider.typeType);
   }
   ClassElement classElement(String typeName, InterfaceType superclassType, List<String> parameterNames) {
-    ClassElementImpl element = new ClassElementImpl(ASTFactory.identifier2(typeName));
+    ClassElementImpl element = new ClassElementImpl(ASTFactory.identifier3(typeName));
     element.supertype = superclassType;
     InterfaceTypeImpl type = new InterfaceTypeImpl.con1(element);
     element.type = type;
@@ -1200,7 +1764,7 @@
       List<TypeVariableElementImpl> typeVariables = new List<TypeVariableElementImpl>(count);
       List<TypeVariableTypeImpl> typeArguments = new List<TypeVariableTypeImpl>(count);
       for (int i = 0; i < count; i++) {
-        TypeVariableElementImpl variable = new TypeVariableElementImpl(ASTFactory.identifier2(parameterNames[i]));
+        TypeVariableElementImpl variable = new TypeVariableElementImpl(ASTFactory.identifier3(parameterNames[i]));
         typeVariables[i] = variable;
         typeArguments[i] = new TypeVariableTypeImpl(variable);
         variable.type = typeArguments[i];
@@ -1298,13 +1862,6 @@
     assertErrors([CompileTimeErrorCode.DUPLICATE_NAMED_ARGUMENT]);
     verify([source]);
   }
-  void fail_exportOfNonLibrary() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["library L;", "export 'lib1.dart';"]));
-    addSource("/lib1.dart", EngineTestCase.createSource(["part of lib;"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.EXPORT_OF_NON_LIBRARY]);
-    verify([source]);
-  }
   void fail_extendsOrImplementsDisallowedClass_extends_null() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["class A extends Null {}"]));
     resolve(source, []);
@@ -1317,44 +1874,8 @@
     assertErrors([CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
     verify([source]);
   }
-  void fail_fieldInitializedByMultipleInitializers() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int x;", "  A() : x = 0, x = 1 {}", "}"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS]);
-    verify([source]);
-  }
-  void fail_finalInitializedInDeclarationAndConstructor_assignment() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  final x = 0;", "  A() { x = 1; }", "}"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR]);
-    verify([source]);
-  }
-  void fail_finalInitializedInDeclarationAndConstructor_initializingFormal() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  final x = 0;", "  A(this.x) {}", "}"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR]);
-    verify([source]);
-  }
-  void fail_finalInitializedMultipleTimes() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  final x;", "  A(this.x) { x = 0; }", "}"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.FINAL_INITIALIZED_MULTIPLE_TIMES]);
-    verify([source]);
-  }
-  void fail_finalNotInitialized_library() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["final F;"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.FINAL_NOT_INITIALIZED]);
-    verify([source]);
-  }
-  void fail_finalNotInitialized_local() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  final int x;", "}"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.FINAL_NOT_INITIALIZED]);
-    verify([source]);
-  }
-  void fail_finalNotInitialized_static() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  static final F;", "}"]));
+  void fail_finalNotInitialized_inConstructor() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  final int x;", "  A() {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.FINAL_NOT_INITIALIZED]);
     verify([source]);
@@ -1365,24 +1886,6 @@
     assertErrors([CompileTimeErrorCode.GETTER_AND_METHOD_WITH_SAME_NAME]);
     verify([source]);
   }
-  void fail_implementsDynamic() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A implements dynamic {}"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.IMPLEMENTS_DYNAMIC]);
-    verify([source]);
-  }
-  void fail_implementsRepeated() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "class B implements A, A {}"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.IMPLEMENTS_REPEATED]);
-    verify([source]);
-  }
-  void fail_implementsSelf() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A implements A {}"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.IMPLEMENTS_SELF]);
-    verify([source]);
-  }
   void fail_importDuplicatedLibraryName() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["library test;", "import 'lib1.dart';", "import 'lib2.dart';"]));
     addSource("/lib1.dart", EngineTestCase.createSource(["library lib;"]));
@@ -1391,25 +1894,6 @@
     assertErrors([CompileTimeErrorCode.IMPORT_DUPLICATED_LIBRARY_NAME]);
     verify([source]);
   }
-  void fail_importOfNonLibrary() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["library lib;", "import 'part.dart';"]));
-    addSource("/part.dart", EngineTestCase.createSource(["part of lib;"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY]);
-    verify([source]);
-  }
-  void fail_inconsistentCaseExpressionTypes() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f(var p) {", "  switch (p) {", "    case 3:", "      break;", "    case 'a':", "      break;", "  }", "}"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.INCONSITENT_CASE_EXPRESSION_TYPES]);
-    verify([source]);
-  }
-  void fail_initializerForNonExistantField() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  A(this.x) {}", "}"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTANT_FIELD]);
-    verify([source]);
-  }
   void fail_invalidConstructorName() {
     Source source = addSource("/test.dart", EngineTestCase.createSource([]));
     resolve(source, []);
@@ -1464,12 +1948,6 @@
     assertErrors([CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS]);
     verify([source]);
   }
-  void fail_invalidTypeArgumentForKey() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  m() {", "    return const <int, int>{}", "  }", "}"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_FOR_KEY]);
-    verify([source]);
-  }
   void fail_invalidTypeArgumentInConstList() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["class A<E> {", "  m() {", "    return const <E>[]", "  }", "}"]));
     resolve(source, []);
@@ -1482,18 +1960,6 @@
     assertErrors([CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP]);
     verify([source]);
   }
-  void fail_invalidVariableInInitializer_nonField() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  A(this.x) {}", "}"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.INVALID_VARIABLE_IN_INITIALIZER]);
-    verify([source]);
-  }
-  void fail_invalidVariableInInitializer_static() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  static x = 0;", "  A(this.x) {}", "}"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.INVALID_VARIABLE_IN_INITIALIZER]);
-    verify([source]);
-  }
   void fail_memberWithClassName() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int A = 0;", "}"]));
     resolve(source, []);
@@ -1596,13 +2062,6 @@
     assertErrors([CompileTimeErrorCode.OVERRIDE_MISSING_REQUIRED_PARAMETERS]);
     verify([source]);
   }
-  void fail_partOfNonPart() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["library l1;", "part 'l2.dart';"]));
-    addSource("/l2.dart", EngineTestCase.createSource(["library l2;"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.PART_OF_NON_PART]);
-    verify([source]);
-  }
   void fail_prefixCollidesWithTopLevelMembers() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["import 'dart:uri' as uri;", "var uri = null;"]));
     resolve(source, []);
@@ -1828,7 +2287,7 @@
   void test_builtInIdentifierAsType() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  typedef x;", "}"]));
     resolve(source, []);
-    assertErrors([CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE]);
+    assertErrors([CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE, StaticWarningCode.UNDEFINED_CLASS]);
     verify([source]);
   }
   void test_builtInIdentifierAsTypedefName_classTypeAlias() {
@@ -1861,12 +2320,6 @@
     assertErrors([CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
     verify([source]);
   }
-  void test_compileTimeConstantRaisesExceptionDivideByZero() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["const int INF = 0 / 0;"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.COMPILE_TIME_CONSTANT_RAISES_EXCEPTION_DIVIDE_BY_ZERO]);
-    verify([source]);
-  }
   void test_conflictingConstructorNameAndMember_field() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int x;", "  A.x() {}", "}"]));
     resolve(source, []);
@@ -1935,7 +2388,14 @@
     assertErrors([CompileTimeErrorCode.DUPLICATE_DEFINITION]);
     verify([librarySource, sourceA, sourceB]);
   }
-  void test_extendsNonClass() {
+  void test_exportOfNonLibrary() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["library L;", "export 'lib1.dart';"]));
+    addSource("/lib1.dart", EngineTestCase.createSource(["part of lib;"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.EXPORT_OF_NON_LIBRARY]);
+    verify([source]);
+  }
+  void test_extendsNonClass_class() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["int A;", "class B extends A {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.EXTENDS_NON_CLASS]);
@@ -2001,6 +2461,24 @@
     assertErrors([CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
     verify([source]);
   }
+  void test_fieldInitializedByMultipleInitializers() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int x;", "  A() : x = 0, x = 1 {}", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS]);
+    verify([source]);
+  }
+  void test_fieldInitializedByMultipleInitializers_multipleInits() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int x;", "  A() : x = 0, x = 1, x = 2 {}", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS, CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS]);
+    verify([source]);
+  }
+  void test_fieldInitializedByMultipleInitializers_multipleNames() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int x;", "  int y;", "  A() : x = 0, x = 1, y = 0, y = 1 {}", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS, CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS]);
+    verify([source]);
+  }
   void test_fieldInitializedInInitializerAndDeclaration_const() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  const int x = 0;", "  A() : x = 1 {}", "}"]));
     resolve(source, []);
@@ -2013,7 +2491,7 @@
     assertErrors([CompileTimeErrorCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION]);
     verify([source]);
   }
-  void test_fieldInitializeInParameterAndInitializer() {
+  void test_fieldInitializedInParameterAndInitializer() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int x;", "  A(this.x) : x = 1 {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER]);
@@ -2025,22 +2503,222 @@
     assertErrors([CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]);
     verify([source]);
   }
-  void test_fieldInitializerOutsideConstructor_defaultParameters() {
+  void test_fieldInitializerOutsideConstructor_defaultParameter() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int x;", "  m([this.x]) {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]);
     verify([source]);
   }
-  void test_implementsNonClass() {
+  /**
+   * This test doesn't test the FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR code, but tests the
+   * FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION code instead. It is provided here to show
+   * coverage over all of the permutations of initializers in constructor declarations.
+   * <p>
+   * Note: FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION covers a subset of
+   * FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR, since it more specific, we use it instead of
+   * the broader code
+   */
+  void test_finalInitializedInDeclarationAndConstructor_initializers() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  final x = 0;", "  A() : x = 0 {}", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION]);
+    verify([source]);
+  }
+  void test_finalInitializedInDeclarationAndConstructor_initializingFormal() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  final x = 0;", "  A(this.x) {}", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR]);
+    verify([source]);
+  }
+  void test_finalInitializedMultipleTimes_initializers() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  final x;", "  A() : x = 0, x = 0 {}", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS]);
+    verify([source]);
+  }
+  /**
+   * This test doesn't test the FINAL_INITIALIZED_MULTIPLE_TIMES code, but tests the
+   * FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER code instead. It is provided here to show
+   * coverage over all of the permutations of initializers in constructor declarations.
+   * <p>
+   * Note: FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER covers a subset of
+   * FINAL_INITIALIZED_MULTIPLE_TIMES, since it more specific, we use it instead of the broader code
+   */
+  void test_finalInitializedMultipleTimes_initializingFormal_initializer() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  final x;", "  A(this.x) : x = 0 {}", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER]);
+    verify([source]);
+  }
+  void test_finalInitializedMultipleTimes_initializingFormals() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  final x;", "  A(this.x, this.x) {}", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.FINAL_INITIALIZED_MULTIPLE_TIMES]);
+    verify([source]);
+  }
+  void test_finalNotInitialized_instanceField_const() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  const F;", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.FINAL_NOT_INITIALIZED]);
+    verify([source]);
+  }
+  void test_finalNotInitialized_instanceField_const_static() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  static const F;", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.FINAL_NOT_INITIALIZED]);
+    verify([source]);
+  }
+  void test_finalNotInitialized_instanceField_final() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  final F;", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.FINAL_NOT_INITIALIZED]);
+    verify([source]);
+  }
+  void test_finalNotInitialized_instanceField_final_static() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  static final F;", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.FINAL_NOT_INITIALIZED]);
+    verify([source]);
+  }
+  void test_finalNotInitialized_library_const() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["const F;"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.FINAL_NOT_INITIALIZED]);
+    verify([source]);
+  }
+  void test_finalNotInitialized_library_final() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["final F;"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.FINAL_NOT_INITIALIZED]);
+    verify([source]);
+  }
+  void test_finalNotInitialized_local_const() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  const int x;", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.FINAL_NOT_INITIALIZED]);
+    verify([source]);
+  }
+  void test_finalNotInitialized_local_final() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  final int x;", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.FINAL_NOT_INITIALIZED]);
+    verify([source]);
+  }
+  void test_implementsDynamic() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A implements dynamic {}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.IMPLEMENTS_DYNAMIC]);
+    verify([source]);
+  }
+  void test_implementsNonClass_class() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["int A;", "class B implements A {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.IMPLEMENTS_NON_CLASS]);
     verify([source]);
   }
+  void test_implementsNonClass_typedef() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "int B;", "typedef C = A implements B;"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.IMPLEMENTS_NON_CLASS]);
+    verify([source]);
+  }
+  void test_implementsRepeated() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "class B implements A, A {}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.IMPLEMENTS_REPEATED]);
+    verify([source]);
+  }
+  void test_implementsRepeated_3times() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {} class C{}", "class B implements A, A, A, A {}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.IMPLEMENTS_REPEATED, CompileTimeErrorCode.IMPLEMENTS_REPEATED, CompileTimeErrorCode.IMPLEMENTS_REPEATED]);
+    verify([source]);
+  }
+  void test_implementsSelf() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A implements A {}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.IMPLEMENTS_SELF]);
+    verify([source]);
+  }
+  void test_importOfNonLibrary() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["library lib;", "import 'part.dart';"]));
+    addSource("/part.dart", EngineTestCase.createSource(["part of lib;"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY]);
+    verify([source]);
+  }
+  void test_inconsistentCaseExpressionTypes() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["f(var p) {", "  switch (p) {", "    case 1:", "      break;", "    case 'a':", "      break;", "  }", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES]);
+    verify([source]);
+  }
+  void test_inconsistentCaseExpressionTypes_repeated() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["f(var p) {", "  switch (p) {", "    case 1:", "      break;", "    case 'a':", "      break;", "    case 'b':", "      break;", "  }", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES, CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES]);
+    verify([source]);
+  }
+  void test_initializerForNonExistant_initializer() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  A() : x = 0 {}", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTANT_FIELD]);
+  }
+  void test_initializerForStaticField() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  static x;", "  A() : x = 0 {}", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.INITIALIZER_FOR_STATIC_FIELD]);
+    verify([source]);
+  }
+  void test_initializingFormalForNonExistantField() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  A(this.x) {}", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD]);
+    verify([source]);
+  }
+  void test_initializingFormalForNonExistantField_notInEnclosingClass() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "int x;", "}", "class B extends A {", "  B(this.x) {}", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD]);
+    verify([source]);
+  }
+  void test_initializingFormalForNonExistantField_optional() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  A([this.x]) {}", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD]);
+    verify([source]);
+  }
+  void test_initializingFormalForNonExistantField_static() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  static x;", "  A([this.x]) {}", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_STATIC_FIELD]);
+    verify([source]);
+  }
+  void test_invalidTypeArgumentForKey() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  m() {", "    return const <int, int>{}", "  }", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_FOR_KEY]);
+    verify([source]);
+  }
+  void test_invalidUri_export() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["library L;", "export 'unknown.dart';"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.INVALID_URI]);
+  }
+  void test_invalidUri_import() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["library L;", "import 'unknown.dart';"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.INVALID_URI]);
+  }
+  void test_invalidUri_part() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["library L;", "part 'unknown.dart';"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.INVALID_URI]);
+  }
   void test_labelInOuterScope() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["class int {}", "", "class A {", "  void m(int i) {", "    l: while (i > 0) {", "      void f() {", "        break l;", "      };", "    }", "  }", "}"]));
     resolve(source, []);
-    assertErrors([CompileTimeErrorCode.LABEL_IN_OUTER_SCOPE, ResolverErrorCode.CANNOT_BE_RESOLVED]);
+    assertErrors([CompileTimeErrorCode.LABEL_IN_OUTER_SCOPE, StaticWarningCode.UNDEFINED_OPERATOR]);
   }
   void test_labelUndefined_break() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  x: while (true) {", "    break y;", "  }", "}"]));
@@ -2052,6 +2730,30 @@
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.LABEL_UNDEFINED]);
   }
+  void test_mixinOfNonClass_class() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["int A;", "class B with A {}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.MIXIN_OF_NON_CLASS]);
+    verify([source]);
+  }
+  void test_mixinOfNonClass_typedef() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "int B;", "typedef C = A with B;"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.MIXIN_OF_NON_CLASS]);
+    verify([source]);
+  }
+  void test_nativeFunctionBodyInNonSDKCode_function() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["int m(a) native 'string';"]));
+    resolve(source, []);
+    assertErrors([ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE]);
+    verify([source]);
+  }
+  void test_nativeFunctionBodyInNonSDKCode_method() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A{", "  static int m(a) native 'string';", "}"]));
+    resolve(source, []);
+    assertErrors([ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE]);
+    verify([source]);
+  }
   void test_newWithInvalidTypeParameters() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "f() { return new A<A>(); }"]));
     resolve(source, []);
@@ -2076,6 +2778,13 @@
     assertErrors([CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE]);
     verify([source]);
   }
+  void test_partOfNonPart() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["library l1;", "part 'l2.dart';"]));
+    addSource("/l2.dart", EngineTestCase.createSource(["library l2;"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.PART_OF_NON_PART]);
+    verify([source]);
+  }
   void test_rethrowOutsideCatch() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  rethrow;", "}"]));
     resolve(source, []);
@@ -2085,7 +2794,7 @@
   void test_uriWithInterpolation_constant() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["import 'stuff_\$platform.dart';"]));
     resolve(source, []);
-    assertErrors([CompileTimeErrorCode.URI_WITH_INTERPOLATION]);
+    assertErrors([CompileTimeErrorCode.URI_WITH_INTERPOLATION, StaticWarningCode.UNDEFINED_IDENTIFIER]);
   }
   void test_uriWithInterpolation_nonConstant() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["library lib;", "part '\${'a'}.dart';"]));
@@ -2122,10 +2831,6 @@
         final __test = new CompileTimeErrorCodeTest();
         runJUnitTest(__test, __test.test_caseExpressionTypeImplementsEquals);
       });
-      _ut.test('test_compileTimeConstantRaisesExceptionDivideByZero', () {
-        final __test = new CompileTimeErrorCodeTest();
-        runJUnitTest(__test, __test.test_compileTimeConstantRaisesExceptionDivideByZero);
-      });
       _ut.test('test_conflictingConstructorNameAndMember_field', () {
         final __test = new CompileTimeErrorCodeTest();
         runJUnitTest(__test, __test.test_conflictingConstructorNameAndMember_field);
@@ -2170,9 +2875,13 @@
         final __test = new CompileTimeErrorCodeTest();
         runJUnitTest(__test, __test.test_duplicateMemberError);
       });
-      _ut.test('test_extendsNonClass', () {
+      _ut.test('test_exportOfNonLibrary', () {
         final __test = new CompileTimeErrorCodeTest();
-        runJUnitTest(__test, __test.test_extendsNonClass);
+        runJUnitTest(__test, __test.test_exportOfNonLibrary);
+      });
+      _ut.test('test_extendsNonClass_class', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_extendsNonClass_class);
       });
       _ut.test('test_extendsOrImplementsDisallowedClass_extends_String', () {
         final __test = new CompileTimeErrorCodeTest();
@@ -2214,9 +2923,17 @@
         final __test = new CompileTimeErrorCodeTest();
         runJUnitTest(__test, __test.test_extendsOrImplementsDisallowedClass_implements_num);
       });
-      _ut.test('test_fieldInitializeInParameterAndInitializer', () {
+      _ut.test('test_fieldInitializedByMultipleInitializers', () {
         final __test = new CompileTimeErrorCodeTest();
-        runJUnitTest(__test, __test.test_fieldInitializeInParameterAndInitializer);
+        runJUnitTest(__test, __test.test_fieldInitializedByMultipleInitializers);
+      });
+      _ut.test('test_fieldInitializedByMultipleInitializers_multipleInits', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_fieldInitializedByMultipleInitializers_multipleInits);
+      });
+      _ut.test('test_fieldInitializedByMultipleInitializers_multipleNames', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_fieldInitializedByMultipleInitializers_multipleNames);
       });
       _ut.test('test_fieldInitializedInInitializerAndDeclaration_const', () {
         final __test = new CompileTimeErrorCodeTest();
@@ -2226,17 +2943,145 @@
         final __test = new CompileTimeErrorCodeTest();
         runJUnitTest(__test, __test.test_fieldInitializedInInitializerAndDeclaration_final);
       });
+      _ut.test('test_fieldInitializedInParameterAndInitializer', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_fieldInitializedInParameterAndInitializer);
+      });
       _ut.test('test_fieldInitializerOutsideConstructor', () {
         final __test = new CompileTimeErrorCodeTest();
         runJUnitTest(__test, __test.test_fieldInitializerOutsideConstructor);
       });
-      _ut.test('test_fieldInitializerOutsideConstructor_defaultParameters', () {
+      _ut.test('test_fieldInitializerOutsideConstructor_defaultParameter', () {
         final __test = new CompileTimeErrorCodeTest();
-        runJUnitTest(__test, __test.test_fieldInitializerOutsideConstructor_defaultParameters);
+        runJUnitTest(__test, __test.test_fieldInitializerOutsideConstructor_defaultParameter);
       });
-      _ut.test('test_implementsNonClass', () {
+      _ut.test('test_finalInitializedInDeclarationAndConstructor_initializers', () {
         final __test = new CompileTimeErrorCodeTest();
-        runJUnitTest(__test, __test.test_implementsNonClass);
+        runJUnitTest(__test, __test.test_finalInitializedInDeclarationAndConstructor_initializers);
+      });
+      _ut.test('test_finalInitializedInDeclarationAndConstructor_initializingFormal', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_finalInitializedInDeclarationAndConstructor_initializingFormal);
+      });
+      _ut.test('test_finalInitializedMultipleTimes_initializers', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_finalInitializedMultipleTimes_initializers);
+      });
+      _ut.test('test_finalInitializedMultipleTimes_initializingFormal_initializer', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_finalInitializedMultipleTimes_initializingFormal_initializer);
+      });
+      _ut.test('test_finalInitializedMultipleTimes_initializingFormals', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_finalInitializedMultipleTimes_initializingFormals);
+      });
+      _ut.test('test_finalNotInitialized_instanceField_const', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_finalNotInitialized_instanceField_const);
+      });
+      _ut.test('test_finalNotInitialized_instanceField_const_static', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_finalNotInitialized_instanceField_const_static);
+      });
+      _ut.test('test_finalNotInitialized_instanceField_final', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_finalNotInitialized_instanceField_final);
+      });
+      _ut.test('test_finalNotInitialized_instanceField_final_static', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_finalNotInitialized_instanceField_final_static);
+      });
+      _ut.test('test_finalNotInitialized_library_const', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_finalNotInitialized_library_const);
+      });
+      _ut.test('test_finalNotInitialized_library_final', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_finalNotInitialized_library_final);
+      });
+      _ut.test('test_finalNotInitialized_local_const', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_finalNotInitialized_local_const);
+      });
+      _ut.test('test_finalNotInitialized_local_final', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_finalNotInitialized_local_final);
+      });
+      _ut.test('test_implementsDynamic', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_implementsDynamic);
+      });
+      _ut.test('test_implementsNonClass_class', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_implementsNonClass_class);
+      });
+      _ut.test('test_implementsNonClass_typedef', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_implementsNonClass_typedef);
+      });
+      _ut.test('test_implementsRepeated', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_implementsRepeated);
+      });
+      _ut.test('test_implementsRepeated_3times', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_implementsRepeated_3times);
+      });
+      _ut.test('test_implementsSelf', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_implementsSelf);
+      });
+      _ut.test('test_importOfNonLibrary', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_importOfNonLibrary);
+      });
+      _ut.test('test_inconsistentCaseExpressionTypes', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_inconsistentCaseExpressionTypes);
+      });
+      _ut.test('test_inconsistentCaseExpressionTypes_repeated', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_inconsistentCaseExpressionTypes_repeated);
+      });
+      _ut.test('test_initializerForNonExistant_initializer', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_initializerForNonExistant_initializer);
+      });
+      _ut.test('test_initializerForStaticField', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_initializerForStaticField);
+      });
+      _ut.test('test_initializingFormalForNonExistantField', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_initializingFormalForNonExistantField);
+      });
+      _ut.test('test_initializingFormalForNonExistantField_notInEnclosingClass', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_initializingFormalForNonExistantField_notInEnclosingClass);
+      });
+      _ut.test('test_initializingFormalForNonExistantField_optional', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_initializingFormalForNonExistantField_optional);
+      });
+      _ut.test('test_initializingFormalForNonExistantField_static', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_initializingFormalForNonExistantField_static);
+      });
+      _ut.test('test_invalidTypeArgumentForKey', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_invalidTypeArgumentForKey);
+      });
+      _ut.test('test_invalidUri_export', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_invalidUri_export);
+      });
+      _ut.test('test_invalidUri_import', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_invalidUri_import);
+      });
+      _ut.test('test_invalidUri_part', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_invalidUri_part);
       });
       _ut.test('test_labelInOuterScope', () {
         final __test = new CompileTimeErrorCodeTest();
@@ -2250,6 +3095,22 @@
         final __test = new CompileTimeErrorCodeTest();
         runJUnitTest(__test, __test.test_labelUndefined_continue);
       });
+      _ut.test('test_mixinOfNonClass_class', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_mixinOfNonClass_class);
+      });
+      _ut.test('test_mixinOfNonClass_typedef', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_mixinOfNonClass_typedef);
+      });
+      _ut.test('test_nativeFunctionBodyInNonSDKCode_function', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_nativeFunctionBodyInNonSDKCode_function);
+      });
+      _ut.test('test_nativeFunctionBodyInNonSDKCode_method', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_nativeFunctionBodyInNonSDKCode_method);
+      });
       _ut.test('test_newWithInvalidTypeParameters', () {
         final __test = new CompileTimeErrorCodeTest();
         runJUnitTest(__test, __test.test_newWithInvalidTypeParameters);
@@ -2266,6 +3127,10 @@
         final __test = new CompileTimeErrorCodeTest();
         runJUnitTest(__test, __test.test_nonConstMapValue);
       });
+      _ut.test('test_partOfNonPart', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_partOfNonPart);
+      });
       _ut.test('test_rethrowOutsideCatch', () {
         final __test = new CompileTimeErrorCodeTest();
         runJUnitTest(__test, __test.test_rethrowOutsideCatch);
@@ -2324,9 +3189,9 @@
       writer.print(unresolvedTypeCount);
       writer.print("/");
       writer.print(_resolvedTypeCount + unresolvedTypeCount);
-      writer.printlnObject(" TypeNames.");
+      writer.println(" TypeNames.");
       if (unresolvedTypeCount > 0) {
-        writer.printlnObject("TypeNames:");
+        writer.println("TypeNames:");
         for (TypeName identifier in _unresolvedTypes) {
           writer.print("  ");
           writer.print(identifier.toString());
@@ -2334,11 +3199,11 @@
           writer.print(getFileName(identifier));
           writer.print(" : ");
           writer.print(identifier.offset);
-          writer.printlnObject(")");
+          writer.println(")");
         }
       }
       if (unresolvedExpressionCount > 0) {
-        writer.printlnObject("Expressions:");
+        writer.println("Expressions:");
         for (Expression identifier in _unresolvedExpressions) {
           writer.print("  ");
           writer.print(identifier.toString());
@@ -2346,7 +3211,7 @@
           writer.print(getFileName(identifier));
           writer.print(" : ");
           writer.print(identifier.offset);
-          writer.printlnObject(")");
+          writer.println(")");
         }
       }
       JUnitTestCase.fail(writer.toString());
@@ -2370,18 +3235,18 @@
     return super.visitPrefixedIdentifier(node);
   }
   Object visitSimpleIdentifier(SimpleIdentifier node) {
-    ASTNode parent21 = node.parent;
-    if (parent21 is MethodInvocation && identical(node, ((parent21 as MethodInvocation)).methodName)) {
+    ASTNode parent2 = node.parent;
+    if (parent2 is MethodInvocation && identical(node, ((parent2 as MethodInvocation)).methodName)) {
       return null;
-    } else if (parent21 is RedirectingConstructorInvocation && identical(node, ((parent21 as RedirectingConstructorInvocation)).constructorName)) {
+    } else if (parent2 is RedirectingConstructorInvocation && identical(node, ((parent2 as RedirectingConstructorInvocation)).constructorName)) {
       return null;
-    } else if (parent21 is SuperConstructorInvocation && identical(node, ((parent21 as SuperConstructorInvocation)).constructorName)) {
+    } else if (parent2 is SuperConstructorInvocation && identical(node, ((parent2 as SuperConstructorInvocation)).constructorName)) {
       return null;
-    } else if (parent21 is ConstructorName && identical(node, ((parent21 as ConstructorName)).name)) {
+    } else if (parent2 is ConstructorName && identical(node, ((parent2 as ConstructorName)).name)) {
       return null;
-    } else if (parent21 is Label && identical(node, ((parent21 as Label)).label)) {
+    } else if (parent2 is Label && identical(node, ((parent2 as Label)).label)) {
       return null;
-    } else if (parent21 is ImportDirective && identical(node, ((parent21 as ImportDirective)).prefix)) {
+    } else if (parent2 is ImportDirective && identical(node, ((parent2 as ImportDirective)).prefix)) {
       return null;
     } else if (node.element is PrefixElement) {
       return null;
@@ -2398,9 +3263,9 @@
   }
   String getFileName(ASTNode node) {
     if (node != null) {
-      ASTNode root3 = node.root;
-      if (root3 is CompilationUnit) {
-        CompilationUnit rootCU = (root3 as CompilationUnit);
+      ASTNode root2 = node.root;
+      if (root2 is CompilationUnit) {
+        CompilationUnit rootCU = (root2 as CompilationUnit);
         if (rootCU.element != null) {
           return rootCU.element.source.fullName;
         } else {
@@ -2469,7 +3334,7 @@
   }
   void test_visitAssignmentExpression_compound() {
     InterfaceType intType2 = _typeProvider.intType;
-    SimpleIdentifier leftHandSide = ASTFactory.identifier2("a");
+    SimpleIdentifier leftHandSide = ASTFactory.identifier3("a");
     leftHandSide.staticType = intType2;
     AssignmentExpression assignment = ASTFactory.assignmentExpression(leftHandSide, TokenType.PLUS_EQ, ASTFactory.integer(1));
     resolveNode(assignment, []);
@@ -2477,23 +3342,23 @@
     _listener.assertNoErrors();
   }
   void test_visitAssignmentExpression_simple() {
-    AssignmentExpression expression = ASTFactory.assignmentExpression(ASTFactory.identifier2("x"), TokenType.EQ, ASTFactory.integer(0));
+    AssignmentExpression expression = ASTFactory.assignmentExpression(ASTFactory.identifier3("x"), TokenType.EQ, ASTFactory.integer(0));
     resolveNode(expression, []);
     JUnitTestCase.assertNull(expression.element);
     _listener.assertNoErrors();
   }
   void test_visitBinaryExpression() {
     InterfaceType numType2 = _typeProvider.numType;
-    SimpleIdentifier left = ASTFactory.identifier2("i");
+    SimpleIdentifier left = ASTFactory.identifier3("i");
     left.staticType = numType2;
-    BinaryExpression expression = ASTFactory.binaryExpression(left, TokenType.PLUS, ASTFactory.identifier2("j"));
+    BinaryExpression expression = ASTFactory.binaryExpression(left, TokenType.PLUS, ASTFactory.identifier3("j"));
     resolveNode(expression, []);
     JUnitTestCase.assertEquals(getMethod(numType2, "+"), expression.element);
     _listener.assertNoErrors();
   }
   void test_visitBreakStatement_withLabel() {
     String label = "loop";
-    LabelElementImpl labelElement = new LabelElementImpl(ASTFactory.identifier2(label), false, false);
+    LabelElementImpl labelElement = new LabelElementImpl(ASTFactory.identifier3(label), false, false);
     BreakStatement statement = ASTFactory.breakStatement2(label);
     JUnitTestCase.assertSame(labelElement, resolve(statement, labelElement));
     _listener.assertNoErrors();
@@ -2525,7 +3390,7 @@
   }
   void test_visitContinueStatement_withLabel() {
     String label = "loop";
-    LabelElementImpl labelElement = new LabelElementImpl(ASTFactory.identifier2(label), false, false);
+    LabelElementImpl labelElement = new LabelElementImpl(ASTFactory.identifier3(label), false, false);
     ContinueStatement statement = ASTFactory.continueStatement2(label);
     JUnitTestCase.assertSame(labelElement, resolve2(statement, labelElement));
     _listener.assertNoErrors();
@@ -2558,23 +3423,23 @@
   }
   void test_visitIndexExpression_get() {
     ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    InterfaceType intType3 = _typeProvider.intType;
-    MethodElement getter = ElementFactory.methodElement("[]", intType3, [intType3]);
+    InterfaceType intType2 = _typeProvider.intType;
+    MethodElement getter = ElementFactory.methodElement("[]", intType2, [intType2]);
     classA.methods = <MethodElement> [getter];
-    SimpleIdentifier array = ASTFactory.identifier2("a");
+    SimpleIdentifier array = ASTFactory.identifier3("a");
     array.staticType = classA.type;
-    IndexExpression expression = ASTFactory.indexExpression(array, ASTFactory.identifier2("i"));
+    IndexExpression expression = ASTFactory.indexExpression(array, ASTFactory.identifier3("i"));
     JUnitTestCase.assertSame(getter, resolve4(expression, []));
     _listener.assertNoErrors();
   }
   void test_visitIndexExpression_set() {
     ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    InterfaceType intType4 = _typeProvider.intType;
-    MethodElement setter = ElementFactory.methodElement("[]=", intType4, [intType4]);
+    InterfaceType intType2 = _typeProvider.intType;
+    MethodElement setter = ElementFactory.methodElement("[]=", intType2, [intType2]);
     classA.methods = <MethodElement> [setter];
-    SimpleIdentifier array = ASTFactory.identifier2("a");
+    SimpleIdentifier array = ASTFactory.identifier3("a");
     array.staticType = classA.type;
-    IndexExpression expression = ASTFactory.indexExpression(array, ASTFactory.identifier2("i"));
+    IndexExpression expression = ASTFactory.indexExpression(array, ASTFactory.identifier3("i"));
     ASTFactory.assignmentExpression(expression, TokenType.EQ, ASTFactory.integer(0));
     JUnitTestCase.assertSame(setter, resolve4(expression, []));
     _listener.assertNoErrors();
@@ -2613,20 +3478,20 @@
     classA.constructors = <ConstructorElement> [constructor];
     ConstructorName name = ASTFactory.constructorName(ASTFactory.typeName(classA, []), constructorName);
     name.element = constructor;
-    InstanceCreationExpression creation = ASTFactory.instanceCreationExpression(Keyword.NEW, name, [ASTFactory.namedExpression(parameterName, ASTFactory.integer(0))]);
+    InstanceCreationExpression creation = ASTFactory.instanceCreationExpression(Keyword.NEW, name, [ASTFactory.namedExpression2(parameterName, ASTFactory.integer(0))]);
     resolveNode(creation, []);
     JUnitTestCase.assertSame(constructor, creation.element);
     JUnitTestCase.assertSame(parameter, ((creation.argumentList.arguments[0] as NamedExpression)).name.label.element);
     _listener.assertNoErrors();
   }
   void test_visitMethodInvocation() {
-    InterfaceType numType3 = _typeProvider.numType;
-    SimpleIdentifier left = ASTFactory.identifier2("i");
-    left.staticType = numType3;
+    InterfaceType numType2 = _typeProvider.numType;
+    SimpleIdentifier left = ASTFactory.identifier3("i");
+    left.staticType = numType2;
     String methodName = "abs";
     MethodInvocation invocation = ASTFactory.methodInvocation(left, methodName, []);
     resolveNode(invocation, []);
-    JUnitTestCase.assertSame(getMethod(numType3, methodName), invocation.methodName.element);
+    JUnitTestCase.assertSame(getMethod(numType2, methodName), invocation.methodName.element);
     _listener.assertNoErrors();
   }
   void test_visitMethodInvocation_namedParameter() {
@@ -2637,34 +3502,34 @@
     ParameterElement parameter = ElementFactory.namedParameter(parameterName);
     method.parameters = <ParameterElement> [parameter];
     classA.methods = <MethodElement> [method];
-    SimpleIdentifier left = ASTFactory.identifier2("i");
+    SimpleIdentifier left = ASTFactory.identifier3("i");
     left.staticType = classA.type;
-    MethodInvocation invocation = ASTFactory.methodInvocation(left, methodName, [ASTFactory.namedExpression(parameterName, ASTFactory.integer(0))]);
+    MethodInvocation invocation = ASTFactory.methodInvocation(left, methodName, [ASTFactory.namedExpression2(parameterName, ASTFactory.integer(0))]);
     resolveNode(invocation, []);
     JUnitTestCase.assertSame(method, invocation.methodName.element);
     JUnitTestCase.assertSame(parameter, ((invocation.argumentList.arguments[0] as NamedExpression)).name.label.element);
     _listener.assertNoErrors();
   }
   void test_visitPostfixExpression() {
-    InterfaceType numType4 = _typeProvider.numType;
-    SimpleIdentifier operand = ASTFactory.identifier2("i");
-    operand.staticType = numType4;
+    InterfaceType numType2 = _typeProvider.numType;
+    SimpleIdentifier operand = ASTFactory.identifier3("i");
+    operand.staticType = numType2;
     PostfixExpression expression = ASTFactory.postfixExpression(operand, TokenType.PLUS_PLUS);
     resolveNode(expression, []);
-    JUnitTestCase.assertEquals(getMethod(numType4, "+"), expression.element);
+    JUnitTestCase.assertEquals(getMethod(numType2, "+"), expression.element);
     _listener.assertNoErrors();
   }
   void test_visitPrefixedIdentifier_dynamic() {
     Type2 dynamicType2 = _typeProvider.dynamicType;
-    SimpleIdentifier target = ASTFactory.identifier2("a");
+    SimpleIdentifier target = ASTFactory.identifier3("a");
     VariableElementImpl variable = ElementFactory.localVariableElement(target);
     variable.type = dynamicType2;
     target.element = variable;
     target.staticType = dynamicType2;
-    PrefixedIdentifier identifier5 = ASTFactory.identifier(target, ASTFactory.identifier2("b"));
-    resolveNode(identifier5, []);
-    JUnitTestCase.assertNull(identifier5.element);
-    JUnitTestCase.assertNull(identifier5.identifier.element);
+    PrefixedIdentifier identifier2 = ASTFactory.identifier(target, ASTFactory.identifier3("b"));
+    resolveNode(identifier2, []);
+    JUnitTestCase.assertNull(identifier2.element);
+    JUnitTestCase.assertNull(identifier2.identifier.element);
     _listener.assertNoErrors();
   }
   void test_visitPrefixedIdentifier_nonDynamic() {
@@ -2672,24 +3537,24 @@
     String getterName = "b";
     PropertyAccessorElement getter = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement> [getter];
-    SimpleIdentifier target = ASTFactory.identifier2("a");
+    SimpleIdentifier target = ASTFactory.identifier3("a");
     VariableElementImpl variable = ElementFactory.localVariableElement(target);
     variable.type = classA.type;
     target.element = variable;
     target.staticType = classA.type;
-    PrefixedIdentifier identifier6 = ASTFactory.identifier(target, ASTFactory.identifier2(getterName));
-    resolveNode(identifier6, []);
-    JUnitTestCase.assertSame(getter, identifier6.element);
-    JUnitTestCase.assertSame(getter, identifier6.identifier.element);
+    PrefixedIdentifier identifier2 = ASTFactory.identifier(target, ASTFactory.identifier3(getterName));
+    resolveNode(identifier2, []);
+    JUnitTestCase.assertSame(getter, identifier2.element);
+    JUnitTestCase.assertSame(getter, identifier2.identifier.element);
     _listener.assertNoErrors();
   }
   void test_visitPrefixExpression() {
-    InterfaceType numType5 = _typeProvider.numType;
-    SimpleIdentifier operand = ASTFactory.identifier2("i");
-    operand.staticType = numType5;
+    InterfaceType numType2 = _typeProvider.numType;
+    SimpleIdentifier operand = ASTFactory.identifier3("i");
+    operand.staticType = numType2;
     PrefixExpression expression = ASTFactory.prefixExpression(TokenType.PLUS_PLUS, operand);
     resolveNode(expression, []);
-    JUnitTestCase.assertEquals(getMethod(numType5, "+"), expression.element);
+    JUnitTestCase.assertEquals(getMethod(numType2, "+"), expression.element);
     _listener.assertNoErrors();
   }
   void test_visitPropertyAccess_getter_identifier() {
@@ -2697,7 +3562,7 @@
     String getterName = "b";
     PropertyAccessorElement getter = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement> [getter];
-    SimpleIdentifier target = ASTFactory.identifier2("a");
+    SimpleIdentifier target = ASTFactory.identifier3("a");
     target.staticType = classA.type;
     PropertyAccess access = ASTFactory.propertyAccess2(target, getterName);
     resolveNode(access, []);
@@ -2732,30 +3597,30 @@
   void test_visitSimpleIdentifier_classScope() {
     InterfaceType doubleType2 = _typeProvider.doubleType;
     String fieldName = "NAN";
-    SimpleIdentifier node = ASTFactory.identifier2(fieldName);
+    SimpleIdentifier node = ASTFactory.identifier3(fieldName);
     resolveInClass(node, doubleType2.element);
     JUnitTestCase.assertEquals(getGetter(doubleType2, fieldName), node.element);
     _listener.assertNoErrors();
   }
   void test_visitSimpleIdentifier_lexicalScope() {
-    SimpleIdentifier node = ASTFactory.identifier2("i");
+    SimpleIdentifier node = ASTFactory.identifier3("i");
     VariableElementImpl element = ElementFactory.localVariableElement(node);
     JUnitTestCase.assertSame(element, resolve3(node, [element]));
     _listener.assertNoErrors();
   }
   void test_visitSimpleIdentifier_lexicalScope_field_setter() {
-    InterfaceType intType5 = _typeProvider.intType;
+    InterfaceType intType2 = _typeProvider.intType;
     ClassElementImpl classA = ElementFactory.classElement2("A", []);
     String fieldName = "a";
-    FieldElement field = ElementFactory.fieldElement(fieldName, false, false, false, intType5);
+    FieldElement field = ElementFactory.fieldElement(fieldName, false, false, false, intType2);
     classA.fields = <FieldElement> [field];
     classA.accessors = <PropertyAccessorElement> [field.getter, field.setter];
-    SimpleIdentifier node = ASTFactory.identifier2(fieldName);
+    SimpleIdentifier node = ASTFactory.identifier3(fieldName);
     ASTFactory.assignmentExpression(node, TokenType.EQ, ASTFactory.integer(0));
     resolveInClass(node, classA);
-    Element element56 = node.element;
-    EngineTestCase.assertInstanceOf(PropertyAccessorElement, element56);
-    JUnitTestCase.assertTrue(((element56 as PropertyAccessorElement)).isSetter());
+    Element element2 = node.element;
+    EngineTestCase.assertInstanceOf(PropertyAccessorElement, element2);
+    JUnitTestCase.assertTrue(((element2 as PropertyAccessorElement)).isSetter());
     _listener.assertNoErrors();
   }
   void test_visitSuperConstructorInvocation() {
@@ -2780,7 +3645,7 @@
     ClassElementImpl subclass = ElementFactory.classElement("B", superclass.type, []);
     ConstructorElementImpl subConstructor = ElementFactory.constructorElement(null);
     subclass.constructors = <ConstructorElement> [subConstructor];
-    SuperConstructorInvocation invocation = ASTFactory.superConstructorInvocation([ASTFactory.namedExpression(parameterName, ASTFactory.integer(0))]);
+    SuperConstructorInvocation invocation = ASTFactory.superConstructorInvocation([ASTFactory.namedExpression2(parameterName, ASTFactory.integer(0))]);
     resolveInClass(invocation, subclass);
     JUnitTestCase.assertEquals(superConstructor, invocation.element);
     JUnitTestCase.assertSame(parameter, ((invocation.argumentList.arguments[0] as NamedExpression)).name.label.element);
@@ -2792,16 +3657,17 @@
    */
   ElementResolver createResolver() {
     AnalysisContextImpl context = new AnalysisContextImpl();
-    SourceFactory sourceFactory = new SourceFactory.con2([new DartUriResolver(DartSdk.defaultSdk)]);
+    ContentCache contentCache = new ContentCache();
+    SourceFactory sourceFactory = new SourceFactory.con1(contentCache, [new DartUriResolver(DirectoryBasedDartSdk.defaultSdk)]);
     context.sourceFactory = sourceFactory;
-    FileBasedSource source = new FileBasedSource.con1(sourceFactory, FileUtilities2.createFile("/test.dart"));
+    FileBasedSource source = new FileBasedSource.con1(contentCache, FileUtilities2.createFile("/test.dart"));
     CompilationUnitElementImpl definingCompilationUnit = new CompilationUnitElementImpl("test.dart");
     definingCompilationUnit.source = source;
     _definingLibrary = ElementFactory.library(context, "test");
     _definingLibrary.definingCompilationUnit = definingCompilationUnit;
     Library library = new Library(context, _listener, source);
     library.libraryElement = _definingLibrary;
-    _visitor = new ResolverVisitor(library, source, _typeProvider);
+    _visitor = new ResolverVisitor.con1(library, source, _typeProvider);
     try {
       return _visitor.elementResolver_J2DAccessor as ElementResolver;
     } catch (exception) {
@@ -3057,6 +3923,96 @@
     });
   }
 }
+class TypeOverrideManagerTest extends EngineTestCase {
+  void test_exitScope_noScopes() {
+    TypeOverrideManager manager = new TypeOverrideManager();
+    try {
+      manager.exitScope();
+      JUnitTestCase.fail("Expected IllegalStateException");
+    } on IllegalStateException catch (exception) {
+    }
+  }
+  void test_exitScope_oneScope() {
+    TypeOverrideManager manager = new TypeOverrideManager();
+    manager.enterScope();
+    manager.exitScope();
+    try {
+      manager.exitScope();
+      JUnitTestCase.fail("Expected IllegalStateException");
+    } on IllegalStateException catch (exception) {
+    }
+  }
+  void test_exitScope_twoScopes() {
+    TypeOverrideManager manager = new TypeOverrideManager();
+    manager.enterScope();
+    manager.exitScope();
+    manager.enterScope();
+    manager.exitScope();
+    try {
+      manager.exitScope();
+      JUnitTestCase.fail("Expected IllegalStateException");
+    } on IllegalStateException catch (exception) {
+    }
+  }
+  void test_getType_enclosedOverride() {
+    TypeOverrideManager manager = new TypeOverrideManager();
+    LocalVariableElementImpl element = ElementFactory.localVariableElement2("v");
+    InterfaceType type2 = ElementFactory.classElement2("C", []).type;
+    manager.enterScope();
+    manager.setType(element, type2);
+    manager.enterScope();
+    JUnitTestCase.assertSame(type2, manager.getType(element));
+  }
+  void test_getType_immediateOverride() {
+    TypeOverrideManager manager = new TypeOverrideManager();
+    LocalVariableElementImpl element = ElementFactory.localVariableElement2("v");
+    InterfaceType type2 = ElementFactory.classElement2("C", []).type;
+    manager.enterScope();
+    manager.setType(element, type2);
+    JUnitTestCase.assertSame(type2, manager.getType(element));
+  }
+  void test_getType_noOverride() {
+    TypeOverrideManager manager = new TypeOverrideManager();
+    manager.enterScope();
+    JUnitTestCase.assertNull(manager.getType(ElementFactory.localVariableElement2("v")));
+  }
+  void test_getType_noScope() {
+    TypeOverrideManager manager = new TypeOverrideManager();
+    JUnitTestCase.assertNull(manager.getType(ElementFactory.localVariableElement2("v")));
+  }
+  static dartSuite() {
+    _ut.group('TypeOverrideManagerTest', () {
+      _ut.test('test_exitScope_noScopes', () {
+        final __test = new TypeOverrideManagerTest();
+        runJUnitTest(__test, __test.test_exitScope_noScopes);
+      });
+      _ut.test('test_exitScope_oneScope', () {
+        final __test = new TypeOverrideManagerTest();
+        runJUnitTest(__test, __test.test_exitScope_oneScope);
+      });
+      _ut.test('test_exitScope_twoScopes', () {
+        final __test = new TypeOverrideManagerTest();
+        runJUnitTest(__test, __test.test_exitScope_twoScopes);
+      });
+      _ut.test('test_getType_enclosedOverride', () {
+        final __test = new TypeOverrideManagerTest();
+        runJUnitTest(__test, __test.test_getType_enclosedOverride);
+      });
+      _ut.test('test_getType_immediateOverride', () {
+        final __test = new TypeOverrideManagerTest();
+        runJUnitTest(__test, __test.test_getType_immediateOverride);
+      });
+      _ut.test('test_getType_noOverride', () {
+        final __test = new TypeOverrideManagerTest();
+        runJUnitTest(__test, __test.test_getType_noOverride);
+      });
+      _ut.test('test_getType_noScope', () {
+        final __test = new TypeOverrideManagerTest();
+        runJUnitTest(__test, __test.test_getType_noScope);
+      });
+    });
+  }
+}
 class StaticWarningCodeTest extends ResolverTestCase {
   void fail_argumentTypeNotAssignable() {
     Source source = addSource("/test.dart", EngineTestCase.createSource([]));
@@ -3292,12 +4248,6 @@
     assertErrors([StaticWarningCode.SWITCH_EXPRESSION_NOT_ASSIGNABLE]);
     verify([source]);
   }
-  void fail_undefinedClass() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() { C.m(); }"]));
-    resolve(source, []);
-    assertErrors([StaticWarningCode.UNDEFINED_CLASS]);
-    verify([source]);
-  }
   void fail_undefinedGetter() {
     Source source = addSource("/test.dart", EngineTestCase.createSource([]));
     resolve(source, []);
@@ -3310,12 +4260,6 @@
     assertErrors([StaticWarningCode.UNDEFINED_IDENTIFIER]);
     verify([source]);
   }
-  void fail_undefinedIdentifier_initializer() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["var a = b;"]));
-    resolve(source, []);
-    assertErrors([StaticWarningCode.UNDEFINED_IDENTIFIER]);
-    verify([source]);
-  }
   void fail_undefinedSetter() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["class C {}", "f(var p) {", "  C.m = 0;", "}"]));
     resolve(source, []);
@@ -3359,6 +4303,26 @@
     assertErrors([StaticWarningCode.PART_OF_DIFFERENT_LIBRARY]);
     verify([source]);
   }
+  void test_undefinedClass_instanceCreation() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() { new C(); }"]));
+    resolve(source, []);
+    assertErrors([StaticWarningCode.UNDEFINED_CLASS]);
+  }
+  void test_undefinedClass_variableDeclaration() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() { C c; }"]));
+    resolve(source, []);
+    assertErrors([StaticWarningCode.UNDEFINED_CLASS]);
+  }
+  void test_undefinedIdentifier_initializer() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["var a = b;"]));
+    resolve(source, []);
+    assertErrors([StaticWarningCode.UNDEFINED_IDENTIFIER]);
+  }
+  void test_undefinedIdentifier_methodInvocation() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() { C.m(); }"]));
+    resolve(source, []);
+    assertErrors([StaticWarningCode.UNDEFINED_IDENTIFIER]);
+  }
   static dartSuite() {
     _ut.group('StaticWarningCodeTest', () {
       _ut.test('test_constWithAbstractClass', () {
@@ -3377,6 +4341,22 @@
         final __test = new StaticWarningCodeTest();
         runJUnitTest(__test, __test.test_partOfDifferentLibrary);
       });
+      _ut.test('test_undefinedClass_instanceCreation', () {
+        final __test = new StaticWarningCodeTest();
+        runJUnitTest(__test, __test.test_undefinedClass_instanceCreation);
+      });
+      _ut.test('test_undefinedClass_variableDeclaration', () {
+        final __test = new StaticWarningCodeTest();
+        runJUnitTest(__test, __test.test_undefinedClass_variableDeclaration);
+      });
+      _ut.test('test_undefinedIdentifier_initializer', () {
+        final __test = new StaticWarningCodeTest();
+        runJUnitTest(__test, __test.test_undefinedIdentifier_initializer);
+      });
+      _ut.test('test_undefinedIdentifier_methodInvocation', () {
+        final __test = new StaticWarningCodeTest();
+        runJUnitTest(__test, __test.test_undefinedIdentifier_methodInvocation);
+      });
     });
   }
 }
@@ -3595,7 +4575,7 @@
    */
   static AnalysisContextImpl contextWithCore() {
     AnalysisContextImpl context = new AnalysisContextImpl();
-    SourceFactory sourceFactory = new SourceFactory.con2([new DartUriResolver(DartSdk.defaultSdk), new FileUriResolver()]);
+    SourceFactory sourceFactory = new SourceFactory.con2([new DartUriResolver(DirectoryBasedDartSdk.defaultSdk), new FileUriResolver()]);
     context.sourceFactory = sourceFactory;
     TestTypeProvider provider = new TestTypeProvider();
     CompilationUnitElementImpl coreUnit = new CompilationUnitElementImpl("core.dart");
@@ -3607,6 +4587,16 @@
     CompilationUnitElementImpl htmlUnit = new CompilationUnitElementImpl("html_dartium.dart");
     Source htmlSource = sourceFactory.forUri(DartSdk.DART_HTML);
     htmlUnit.source = htmlSource;
+    ClassElementImpl elementElement = ElementFactory.classElement2("Element", []);
+    InterfaceType elementType = elementElement.type;
+    ClassElementImpl documentElement = ElementFactory.classElement("Document", elementType, []);
+    ClassElementImpl htmlDocumentElement = ElementFactory.classElement("HtmlDocument", documentElement.type, []);
+    htmlDocumentElement.methods = <MethodElement> [ElementFactory.methodElement("query", elementType, <Type2> [provider.stringType])];
+    htmlUnit.types = <ClassElement> [ElementFactory.classElement("AnchorElement", elementType, []), ElementFactory.classElement("BodyElement", elementType, []), ElementFactory.classElement("ButtonElement", elementType, []), ElementFactory.classElement("DivElement", elementType, []), documentElement, elementElement, htmlDocumentElement, ElementFactory.classElement("InputElement", elementType, []), ElementFactory.classElement("SelectElement", elementType, [])];
+    htmlUnit.functions = <FunctionElement> [ElementFactory.functionElement3("query", elementElement, <ClassElement> [provider.stringType.element], ClassElementImpl.EMPTY_ARRAY)];
+    TopLevelVariableElementImpl document = ElementFactory.topLevelVariableElement2("document");
+    document.type = htmlDocumentElement.type;
+    htmlUnit.topLevelVariables = <TopLevelVariableElement> [document];
     LibraryElementImpl htmlLibrary = new LibraryElementImpl(context, ASTFactory.libraryIdentifier2(["dart", "dom", "html"]));
     htmlLibrary.definingCompilationUnit = htmlUnit;
     Map<Source, LibraryElement> elementMap = new Map<Source, LibraryElement>();
@@ -3629,10 +4619,10 @@
     String typeNameA = "A";
     String typeNameB = "B";
     String typeNameC = "C";
-    ClassElement typeA = new ClassElementImpl(ASTFactory.identifier2(typeNameA));
-    ClassElement typeB1 = new ClassElementImpl(ASTFactory.identifier2(typeNameB));
-    ClassElement typeB2 = new ClassElementImpl(ASTFactory.identifier2(typeNameB));
-    ClassElement typeC = new ClassElementImpl(ASTFactory.identifier2(typeNameC));
+    ClassElement typeA = new ClassElementImpl(ASTFactory.identifier3(typeNameA));
+    ClassElement typeB1 = new ClassElementImpl(ASTFactory.identifier3(typeNameB));
+    ClassElement typeB2 = new ClassElementImpl(ASTFactory.identifier3(typeNameB));
+    ClassElement typeC = new ClassElementImpl(ASTFactory.identifier3(typeNameC));
     LibraryElement importedLibrary1 = createTestLibrary2(context, "imported1", []);
     ((importedLibrary1.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [typeA, typeB1];
     ImportElementImpl import1 = new ImportElementImpl();
@@ -3665,7 +4655,7 @@
   void test_creation_nonEmpty() {
     AnalysisContext context = new AnalysisContextImpl();
     String importedTypeName = "A";
-    ClassElement importedType = new ClassElementImpl(ASTFactory.identifier2(importedTypeName));
+    ClassElement importedType = new ClassElementImpl(ASTFactory.identifier3(importedTypeName));
     LibraryElement importedLibrary = createTestLibrary2(context, "imported", []);
     ((importedLibrary.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [importedType];
     LibraryElementImpl definingLibrary = createTestLibrary2(context, "importing", []);
@@ -3736,10 +4726,10 @@
    * structures that are expected to have been resolved have an element associated with them.
    */
   ResolutionVerifier() {
-    _jtd_constructor_323_impl();
+    _jtd_constructor_349_impl();
   }
-  _jtd_constructor_323_impl() {
-    _jtd_constructor_324_impl(null);
+  _jtd_constructor_349_impl() {
+    _jtd_constructor_350_impl(null);
   }
   /**
    * Initialize a newly created verifier to verify that all of the identifiers in the visited AST
@@ -3750,9 +4740,9 @@
    * therefore not cause the test to fail
    */
   ResolutionVerifier.con1(Set<ASTNode> knownExceptions2) {
-    _jtd_constructor_324_impl(knownExceptions2);
+    _jtd_constructor_350_impl(knownExceptions2);
   }
-  _jtd_constructor_324_impl(Set<ASTNode> knownExceptions2) {
+  _jtd_constructor_350_impl(Set<ASTNode> knownExceptions2) {
     this._knownExceptions = knownExceptions2;
   }
   /**
@@ -3764,13 +4754,13 @@
       if (!_unresolvedNodes.isEmpty) {
         writer.print("Failed to resolve ");
         writer.print(_unresolvedNodes.length);
-        writer.printlnObject(" nodes:");
+        writer.println(" nodes:");
         printNodes(writer, _unresolvedNodes);
       }
       if (!_wrongTypedNodes.isEmpty) {
         writer.print("Resolved ");
         writer.print(_wrongTypedNodes.length);
-        writer.printlnObject(" to the wrong type of element:");
+        writer.println(" to the wrong type of element:");
         printNodes(writer, _wrongTypedNodes);
       }
       JUnitTestCase.fail(writer.toString());
@@ -3801,11 +4791,11 @@
   }
   Object visitImportDirective(ImportDirective node) {
     checkResolved2(node, node.element, ImportElement);
-    SimpleIdentifier prefix10 = node.prefix;
-    if (prefix10 == null) {
+    SimpleIdentifier prefix2 = node.prefix;
+    if (prefix2 == null) {
       return null;
     }
-    return checkResolved2(prefix10, prefix10.element, PrefixElement);
+    return checkResolved2(prefix2, prefix2.element, PrefixElement);
   }
   Object visitIndexExpression(IndexExpression node) {
     node.visitChildren(this);
@@ -3874,7 +4864,7 @@
       writer.print(getFileName(identifier));
       writer.print(" : ");
       writer.print(identifier.offset);
-      writer.printlnObject(")");
+      writer.println(")");
     }
   }
 }
@@ -3887,7 +4877,7 @@
   void test_creation_nonEmpty() {
     AnalysisContext context = new AnalysisContextImpl();
     String importedTypeName = "A";
-    ClassElement importedType = new ClassElementImpl(ASTFactory.identifier2(importedTypeName));
+    ClassElement importedType = new ClassElementImpl(ASTFactory.identifier3(importedTypeName));
     LibraryElement importedLibrary = createTestLibrary2(context, "imported", []);
     ((importedLibrary.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [importedType];
     LibraryElementImpl definingLibrary = createTestLibrary2(context, "importing", []);
@@ -3980,17 +4970,17 @@
     _listener.assertNoErrors();
   }
   void test_visitAssignmentExpression_compound() {
-    InterfaceType numType6 = _typeProvider.numType;
+    InterfaceType numType2 = _typeProvider.numType;
     SimpleIdentifier identifier = resolvedVariable(_typeProvider.intType, "i");
     AssignmentExpression node = ASTFactory.assignmentExpression(identifier, TokenType.PLUS_EQ, resolvedInteger(1));
-    node.element = getMethod(numType6, "+");
-    JUnitTestCase.assertSame(numType6, analyze(node));
+    node.element = getMethod(numType2, "+");
+    JUnitTestCase.assertSame(numType2, analyze(node));
     _listener.assertNoErrors();
   }
   void test_visitAssignmentExpression_simple() {
-    InterfaceType intType6 = _typeProvider.intType;
-    Expression node = ASTFactory.assignmentExpression(resolvedVariable(intType6, "i"), TokenType.EQ, resolvedInteger(0));
-    JUnitTestCase.assertSame(intType6, analyze(node));
+    InterfaceType intType2 = _typeProvider.intType;
+    Expression node = ASTFactory.assignmentExpression(resolvedVariable(intType2, "i"), TokenType.EQ, resolvedInteger(0));
+    JUnitTestCase.assertSame(intType2, analyze(node));
     _listener.assertNoErrors();
   }
   void test_visitBinaryExpression_equals() {
@@ -4016,7 +5006,7 @@
   void test_visitBinaryExpression_plus() {
     BinaryExpression node = ASTFactory.binaryExpression(resolvedInteger(2), TokenType.PLUS, resolvedInteger(2));
     node.element = getMethod(_typeProvider.numType, "+");
-    JUnitTestCase.assertSame(_typeProvider.numType, analyze(node));
+    JUnitTestCase.assertSame(_typeProvider.intType, analyze(node));
     _listener.assertNoErrors();
   }
   void test_visitBooleanLiteral_false() {
@@ -4050,131 +5040,131 @@
     _listener.assertNoErrors();
   }
   void test_visitFunctionExpression_named_block() {
-    Type2 dynamicType3 = _typeProvider.dynamicType;
+    Type2 dynamicType2 = _typeProvider.dynamicType;
     FormalParameter p1 = ASTFactory.namedFormalParameter(ASTFactory.simpleFormalParameter3("p1"), resolvedInteger(0));
-    setType(p1, dynamicType3);
+    setType(p1, dynamicType2);
     FormalParameter p2 = ASTFactory.namedFormalParameter(ASTFactory.simpleFormalParameter3("p2"), resolvedInteger(0));
-    setType(p2, dynamicType3);
+    setType(p2, dynamicType2);
     FunctionExpression node = resolvedFunctionExpression(ASTFactory.formalParameterList([p1, p2]), ASTFactory.blockFunctionBody([]));
     analyze3(p1);
     analyze3(p2);
     Type2 resultType = analyze(node);
     Map<String, Type2> expectedNamedTypes = new Map<String, Type2>();
-    expectedNamedTypes["p1"] = dynamicType3;
-    expectedNamedTypes["p2"] = dynamicType3;
-    assertFunctionType(dynamicType3, null, null, expectedNamedTypes, resultType);
+    expectedNamedTypes["p1"] = dynamicType2;
+    expectedNamedTypes["p2"] = dynamicType2;
+    assertFunctionType(dynamicType2, null, null, expectedNamedTypes, resultType);
     _listener.assertNoErrors();
   }
   void test_visitFunctionExpression_named_expression() {
-    Type2 dynamicType4 = _typeProvider.dynamicType;
+    Type2 dynamicType2 = _typeProvider.dynamicType;
     FormalParameter p = ASTFactory.namedFormalParameter(ASTFactory.simpleFormalParameter3("p"), resolvedInteger(0));
-    setType(p, dynamicType4);
+    setType(p, dynamicType2);
     FunctionExpression node = resolvedFunctionExpression(ASTFactory.formalParameterList([p]), ASTFactory.expressionFunctionBody(resolvedInteger(0)));
     analyze3(p);
     Type2 resultType = analyze(node);
     Map<String, Type2> expectedNamedTypes = new Map<String, Type2>();
-    expectedNamedTypes["p"] = dynamicType4;
+    expectedNamedTypes["p"] = dynamicType2;
     assertFunctionType(_typeProvider.intType, null, null, expectedNamedTypes, resultType);
     _listener.assertNoErrors();
   }
   void test_visitFunctionExpression_normal_block() {
-    Type2 dynamicType5 = _typeProvider.dynamicType;
+    Type2 dynamicType2 = _typeProvider.dynamicType;
     FormalParameter p1 = ASTFactory.simpleFormalParameter3("p1");
-    setType(p1, dynamicType5);
+    setType(p1, dynamicType2);
     FormalParameter p2 = ASTFactory.simpleFormalParameter3("p2");
-    setType(p2, dynamicType5);
+    setType(p2, dynamicType2);
     FunctionExpression node = resolvedFunctionExpression(ASTFactory.formalParameterList([p1, p2]), ASTFactory.blockFunctionBody([]));
     analyze3(p1);
     analyze3(p2);
     Type2 resultType = analyze(node);
-    assertFunctionType(dynamicType5, <Type2> [dynamicType5, dynamicType5], null, null, resultType);
+    assertFunctionType(dynamicType2, <Type2> [dynamicType2, dynamicType2], null, null, resultType);
     _listener.assertNoErrors();
   }
   void test_visitFunctionExpression_normal_expression() {
-    Type2 dynamicType6 = _typeProvider.dynamicType;
+    Type2 dynamicType2 = _typeProvider.dynamicType;
     FormalParameter p = ASTFactory.simpleFormalParameter3("p");
-    setType(p, dynamicType6);
+    setType(p, dynamicType2);
     FunctionExpression node = resolvedFunctionExpression(ASTFactory.formalParameterList([p]), ASTFactory.expressionFunctionBody(resolvedInteger(0)));
     analyze3(p);
     Type2 resultType = analyze(node);
-    assertFunctionType(_typeProvider.intType, <Type2> [dynamicType6], null, null, resultType);
+    assertFunctionType(_typeProvider.intType, <Type2> [dynamicType2], null, null, resultType);
     _listener.assertNoErrors();
   }
   void test_visitFunctionExpression_normalAndNamed_block() {
-    Type2 dynamicType7 = _typeProvider.dynamicType;
+    Type2 dynamicType2 = _typeProvider.dynamicType;
     FormalParameter p1 = ASTFactory.simpleFormalParameter3("p1");
-    setType(p1, dynamicType7);
+    setType(p1, dynamicType2);
     FormalParameter p2 = ASTFactory.namedFormalParameter(ASTFactory.simpleFormalParameter3("p2"), resolvedInteger(0));
-    setType(p2, dynamicType7);
+    setType(p2, dynamicType2);
     FunctionExpression node = resolvedFunctionExpression(ASTFactory.formalParameterList([p1, p2]), ASTFactory.blockFunctionBody([]));
     analyze3(p2);
     Type2 resultType = analyze(node);
     Map<String, Type2> expectedNamedTypes = new Map<String, Type2>();
-    expectedNamedTypes["p2"] = dynamicType7;
-    assertFunctionType(dynamicType7, <Type2> [dynamicType7], null, expectedNamedTypes, resultType);
+    expectedNamedTypes["p2"] = dynamicType2;
+    assertFunctionType(dynamicType2, <Type2> [dynamicType2], null, expectedNamedTypes, resultType);
     _listener.assertNoErrors();
   }
   void test_visitFunctionExpression_normalAndNamed_expression() {
-    Type2 dynamicType8 = _typeProvider.dynamicType;
+    Type2 dynamicType2 = _typeProvider.dynamicType;
     FormalParameter p1 = ASTFactory.simpleFormalParameter3("p1");
-    setType(p1, dynamicType8);
+    setType(p1, dynamicType2);
     FormalParameter p2 = ASTFactory.namedFormalParameter(ASTFactory.simpleFormalParameter3("p2"), resolvedInteger(0));
-    setType(p2, dynamicType8);
+    setType(p2, dynamicType2);
     FunctionExpression node = resolvedFunctionExpression(ASTFactory.formalParameterList([p1, p2]), ASTFactory.expressionFunctionBody(resolvedInteger(0)));
     analyze3(p2);
     Type2 resultType = analyze(node);
     Map<String, Type2> expectedNamedTypes = new Map<String, Type2>();
-    expectedNamedTypes["p2"] = dynamicType8;
-    assertFunctionType(_typeProvider.intType, <Type2> [dynamicType8], null, expectedNamedTypes, resultType);
+    expectedNamedTypes["p2"] = dynamicType2;
+    assertFunctionType(_typeProvider.intType, <Type2> [dynamicType2], null, expectedNamedTypes, resultType);
     _listener.assertNoErrors();
   }
   void test_visitFunctionExpression_normalAndPositional_block() {
-    Type2 dynamicType9 = _typeProvider.dynamicType;
+    Type2 dynamicType2 = _typeProvider.dynamicType;
     FormalParameter p1 = ASTFactory.simpleFormalParameter3("p1");
-    setType(p1, dynamicType9);
+    setType(p1, dynamicType2);
     FormalParameter p2 = ASTFactory.positionalFormalParameter(ASTFactory.simpleFormalParameter3("p2"), resolvedInteger(0));
-    setType(p2, dynamicType9);
+    setType(p2, dynamicType2);
     FunctionExpression node = resolvedFunctionExpression(ASTFactory.formalParameterList([p1, p2]), ASTFactory.blockFunctionBody([]));
     analyze3(p1);
     analyze3(p2);
     Type2 resultType = analyze(node);
-    assertFunctionType(dynamicType9, <Type2> [dynamicType9], <Type2> [dynamicType9], null, resultType);
+    assertFunctionType(dynamicType2, <Type2> [dynamicType2], <Type2> [dynamicType2], null, resultType);
     _listener.assertNoErrors();
   }
   void test_visitFunctionExpression_normalAndPositional_expression() {
-    Type2 dynamicType10 = _typeProvider.dynamicType;
+    Type2 dynamicType2 = _typeProvider.dynamicType;
     FormalParameter p1 = ASTFactory.simpleFormalParameter3("p1");
-    setType(p1, dynamicType10);
+    setType(p1, dynamicType2);
     FormalParameter p2 = ASTFactory.positionalFormalParameter(ASTFactory.simpleFormalParameter3("p2"), resolvedInteger(0));
-    setType(p2, dynamicType10);
+    setType(p2, dynamicType2);
     FunctionExpression node = resolvedFunctionExpression(ASTFactory.formalParameterList([p1, p2]), ASTFactory.expressionFunctionBody(resolvedInteger(0)));
     analyze3(p1);
     analyze3(p2);
     Type2 resultType = analyze(node);
-    assertFunctionType(_typeProvider.intType, <Type2> [dynamicType10], <Type2> [dynamicType10], null, resultType);
+    assertFunctionType(_typeProvider.intType, <Type2> [dynamicType2], <Type2> [dynamicType2], null, resultType);
     _listener.assertNoErrors();
   }
   void test_visitFunctionExpression_positional_block() {
-    Type2 dynamicType11 = _typeProvider.dynamicType;
+    Type2 dynamicType2 = _typeProvider.dynamicType;
     FormalParameter p1 = ASTFactory.positionalFormalParameter(ASTFactory.simpleFormalParameter3("p1"), resolvedInteger(0));
-    setType(p1, dynamicType11);
+    setType(p1, dynamicType2);
     FormalParameter p2 = ASTFactory.positionalFormalParameter(ASTFactory.simpleFormalParameter3("p2"), resolvedInteger(0));
-    setType(p2, dynamicType11);
+    setType(p2, dynamicType2);
     FunctionExpression node = resolvedFunctionExpression(ASTFactory.formalParameterList([p1, p2]), ASTFactory.blockFunctionBody([]));
     analyze3(p1);
     analyze3(p2);
     Type2 resultType = analyze(node);
-    assertFunctionType(dynamicType11, null, <Type2> [dynamicType11, dynamicType11], null, resultType);
+    assertFunctionType(dynamicType2, null, <Type2> [dynamicType2, dynamicType2], null, resultType);
     _listener.assertNoErrors();
   }
   void test_visitFunctionExpression_positional_expression() {
-    Type2 dynamicType12 = _typeProvider.dynamicType;
+    Type2 dynamicType2 = _typeProvider.dynamicType;
     FormalParameter p = ASTFactory.positionalFormalParameter(ASTFactory.simpleFormalParameter3("p"), resolvedInteger(0));
-    setType(p, dynamicType12);
+    setType(p, dynamicType2);
     FunctionExpression node = resolvedFunctionExpression(ASTFactory.formalParameterList([p]), ASTFactory.expressionFunctionBody(resolvedInteger(0)));
     analyze3(p);
     Type2 resultType = analyze(node);
-    assertFunctionType(_typeProvider.intType, null, <Type2> [dynamicType12], null, resultType);
+    assertFunctionType(_typeProvider.intType, null, <Type2> [dynamicType2], null, resultType);
     _listener.assertNoErrors();
   }
   void test_visitIndexExpression_getter() {
@@ -4186,45 +5176,48 @@
     _listener.assertNoErrors();
   }
   void test_visitIndexExpression_setter() {
-    InterfaceType listType3 = _typeProvider.listType;
-    SimpleIdentifier identifier = resolvedVariable(listType3, "a");
+    InterfaceType listType2 = _typeProvider.listType;
+    SimpleIdentifier identifier = resolvedVariable(listType2, "a");
     IndexExpression node = ASTFactory.indexExpression(identifier, resolvedInteger(2));
-    node.element = listType3.element.methods[1];
+    node.element = listType2.element.methods[1];
     ASTFactory.assignmentExpression(node, TokenType.EQ, ASTFactory.integer(0));
-    JUnitTestCase.assertSame(listType3.typeArguments[0], analyze(node));
+    JUnitTestCase.assertSame(listType2.typeArguments[0], analyze(node));
     _listener.assertNoErrors();
   }
   void test_visitIndexExpression_typeParameters() {
-    InterfaceType intType7 = _typeProvider.intType;
-    InterfaceType listType4 = _typeProvider.listType;
-    MethodElement methodElement = getMethod(listType4, "[]");
-    SimpleIdentifier identifier = ASTFactory.identifier2("list");
-    identifier.staticType = listType4.substitute5(<Type2> [intType7]);
+    InterfaceType intType2 = _typeProvider.intType;
+    InterfaceType listType2 = _typeProvider.listType;
+    MethodElement methodElement = getMethod(listType2, "[]");
+    SimpleIdentifier identifier = ASTFactory.identifier3("list");
+    InterfaceType listOfIntType = listType2.substitute5(<Type2> [intType2]);
+    identifier.staticType = listOfIntType;
     IndexExpression indexExpression2 = ASTFactory.indexExpression(identifier, ASTFactory.integer(0));
-    indexExpression2.element = methodElement;
-    JUnitTestCase.assertSame(intType7, analyze(indexExpression2));
+    indexExpression2.element = MethodMember.from(methodElement, listOfIntType);
+    JUnitTestCase.assertSame(intType2, analyze(indexExpression2));
     _listener.assertNoErrors();
   }
   void test_visitIndexExpression_typeParameters_inSetterContext() {
-    InterfaceType intType8 = _typeProvider.intType;
-    InterfaceType listType5 = _typeProvider.listType;
-    MethodElement methodElement = getMethod(listType5, "[]=");
-    SimpleIdentifier identifier = ASTFactory.identifier2("list");
-    identifier.staticType = listType5.substitute5(<Type2> [intType8]);
-    IndexExpression indexExpression3 = ASTFactory.indexExpression(identifier, ASTFactory.integer(0));
-    indexExpression3.element = methodElement;
-    ASTFactory.assignmentExpression(indexExpression3, TokenType.EQ, ASTFactory.integer(0));
-    JUnitTestCase.assertSame(intType8, analyze(indexExpression3));
+    InterfaceType intType2 = _typeProvider.intType;
+    InterfaceType listType2 = _typeProvider.listType;
+    MethodElement methodElement = getMethod(listType2, "[]=");
+    SimpleIdentifier identifier = ASTFactory.identifier3("list");
+    InterfaceType listOfIntType = listType2.substitute5(<Type2> [intType2]);
+    identifier.staticType = listOfIntType;
+    IndexExpression indexExpression2 = ASTFactory.indexExpression(identifier, ASTFactory.integer(0));
+    indexExpression2.element = MethodMember.from(methodElement, listOfIntType);
+    ASTFactory.assignmentExpression(indexExpression2, TokenType.EQ, ASTFactory.integer(0));
+    JUnitTestCase.assertSame(intType2, analyze(indexExpression2));
     _listener.assertNoErrors();
   }
   void test_visitInstanceCreationExpression_named() {
-    ClassElement classElement = ElementFactory.classElement2("C", []);
+    ClassElementImpl classElement = ElementFactory.classElement2("C", []);
     String constructorName = "m";
     ConstructorElementImpl constructor = ElementFactory.constructorElement(constructorName);
     FunctionTypeImpl constructorType = new FunctionTypeImpl.con1(constructor);
     constructorType.returnType = classElement.type;
     constructor.type = constructorType;
-    InstanceCreationExpression node = ASTFactory.instanceCreationExpression2(null, ASTFactory.typeName(classElement, []), [ASTFactory.identifier2(constructorName)]);
+    classElement.constructors = <ConstructorElement> [constructor];
+    InstanceCreationExpression node = ASTFactory.instanceCreationExpression2(null, ASTFactory.typeName(classElement, []), [ASTFactory.identifier3(constructorName)]);
     node.element = constructor;
     JUnitTestCase.assertSame(classElement.type, analyze(node));
     _listener.assertNoErrors();
@@ -4237,9 +5230,9 @@
     FunctionTypeImpl constructorType = new FunctionTypeImpl.con1(constructor);
     constructorType.returnType = elementC.type;
     constructor.type = constructorType;
-    TypeName typeName4 = ASTFactory.typeName(elementC, [ASTFactory.typeName(elementI, [])]);
-    typeName4.type = elementC.type.substitute5(<Type2> [elementI.type]);
-    InstanceCreationExpression node = ASTFactory.instanceCreationExpression2(null, typeName4, []);
+    TypeName typeName2 = ASTFactory.typeName(elementC, [ASTFactory.typeName(elementI, [])]);
+    typeName2.type = elementC.type.substitute5(<Type2> [elementI.type]);
+    InstanceCreationExpression node = ASTFactory.instanceCreationExpression2(null, typeName2, []);
     node.element = constructor;
     InterfaceType interfaceType = analyze(node) as InterfaceType;
     List<Type2> typeArgs = interfaceType.typeArguments;
@@ -4248,11 +5241,12 @@
     _listener.assertNoErrors();
   }
   void test_visitInstanceCreationExpression_unnamed() {
-    ClassElement classElement = ElementFactory.classElement2("C", []);
+    ClassElementImpl classElement = ElementFactory.classElement2("C", []);
     ConstructorElementImpl constructor = ElementFactory.constructorElement(null);
     FunctionTypeImpl constructorType = new FunctionTypeImpl.con1(constructor);
     constructorType.returnType = classElement.type;
     constructor.type = constructorType;
+    classElement.constructors = <ConstructorElement> [constructor];
     InstanceCreationExpression node = ASTFactory.instanceCreationExpression2(null, ASTFactory.typeName(classElement, []), []);
     node.element = constructor;
     JUnitTestCase.assertSame(classElement.type, analyze(node));
@@ -4264,12 +5258,12 @@
     _listener.assertNoErrors();
   }
   void test_visitIsExpression_negated() {
-    Expression node = ASTFactory.isExpression(resolvedString("a"), true, ASTFactory.typeName3("String", []));
+    Expression node = ASTFactory.isExpression(resolvedString("a"), true, ASTFactory.typeName4("String", []));
     JUnitTestCase.assertSame(_typeProvider.boolType, analyze(node));
     _listener.assertNoErrors();
   }
   void test_visitIsExpression_notNegated() {
-    Expression node = ASTFactory.isExpression(resolvedString("a"), false, ASTFactory.typeName3("String", []));
+    Expression node = ASTFactory.isExpression(resolvedString("a"), false, ASTFactory.typeName4("String", []));
     JUnitTestCase.assertSame(_typeProvider.boolType, analyze(node));
     _listener.assertNoErrors();
   }
@@ -4298,7 +5292,7 @@
     _listener.assertNoErrors();
   }
   void test_visitNamedExpression() {
-    Expression node = ASTFactory.namedExpression("n", resolvedString("a"));
+    Expression node = ASTFactory.namedExpression2("n", resolvedString("a"));
     JUnitTestCase.assertSame(_typeProvider.stringType, analyze(node));
     _listener.assertNoErrors();
   }
@@ -4325,24 +5319,24 @@
   void test_visitPrefixedIdentifier_getter() {
     Type2 boolType2 = _typeProvider.boolType;
     PropertyAccessorElementImpl getter = ElementFactory.getterElement("b", false, boolType2);
-    PrefixedIdentifier node = ASTFactory.identifier4("a", "b");
+    PrefixedIdentifier node = ASTFactory.identifier5("a", "b");
     node.identifier.element = getter;
     JUnitTestCase.assertSame(boolType2, analyze(node));
     _listener.assertNoErrors();
   }
   void test_visitPrefixedIdentifier_setter() {
-    Type2 boolType3 = _typeProvider.boolType;
-    FieldElementImpl field = ElementFactory.fieldElement("b", false, false, false, boolType3);
-    PropertyAccessorElement setter5 = field.setter;
-    PrefixedIdentifier node = ASTFactory.identifier4("a", "b");
-    node.identifier.element = setter5;
-    JUnitTestCase.assertSame(boolType3, analyze(node));
+    Type2 boolType2 = _typeProvider.boolType;
+    FieldElementImpl field = ElementFactory.fieldElement("b", false, false, false, boolType2);
+    PropertyAccessorElement setter2 = field.setter;
+    PrefixedIdentifier node = ASTFactory.identifier5("a", "b");
+    node.identifier.element = setter2;
+    JUnitTestCase.assertSame(boolType2, analyze(node));
     _listener.assertNoErrors();
   }
   void test_visitPrefixedIdentifier_variable() {
     VariableElementImpl variable = ElementFactory.localVariableElement2("b");
     variable.type = _typeProvider.boolType;
-    PrefixedIdentifier node = ASTFactory.identifier4("a", "b");
+    PrefixedIdentifier node = ASTFactory.identifier5("a", "b");
     node.identifier.element = variable;
     JUnitTestCase.assertSame(_typeProvider.boolType, analyze(node));
     _listener.assertNoErrors();
@@ -4382,20 +5376,20 @@
     _listener.assertNoErrors();
   }
   void test_visitPropertyAccess_getter() {
-    Type2 boolType4 = _typeProvider.boolType;
-    PropertyAccessorElementImpl getter = ElementFactory.getterElement("b", false, boolType4);
-    PropertyAccess node = ASTFactory.propertyAccess2(ASTFactory.identifier2("a"), "b");
+    Type2 boolType2 = _typeProvider.boolType;
+    PropertyAccessorElementImpl getter = ElementFactory.getterElement("b", false, boolType2);
+    PropertyAccess node = ASTFactory.propertyAccess2(ASTFactory.identifier3("a"), "b");
     node.propertyName.element = getter;
-    JUnitTestCase.assertSame(boolType4, analyze(node));
+    JUnitTestCase.assertSame(boolType2, analyze(node));
     _listener.assertNoErrors();
   }
   void test_visitPropertyAccess_setter() {
-    Type2 boolType5 = _typeProvider.boolType;
-    FieldElementImpl field = ElementFactory.fieldElement("b", false, false, false, boolType5);
-    PropertyAccessorElement setter6 = field.setter;
-    PropertyAccess node = ASTFactory.propertyAccess2(ASTFactory.identifier2("a"), "b");
-    node.propertyName.element = setter6;
-    JUnitTestCase.assertSame(boolType5, analyze(node));
+    Type2 boolType2 = _typeProvider.boolType;
+    FieldElementImpl field = ElementFactory.fieldElement("b", false, false, false, boolType2);
+    PropertyAccessorElement setter2 = field.setter;
+    PropertyAccess node = ASTFactory.propertyAccess2(ASTFactory.identifier3("a"), "b");
+    node.propertyName.element = setter2;
+    JUnitTestCase.assertSame(boolType2, analyze(node));
     _listener.assertNoErrors();
   }
   void test_visitSimpleStringLiteral() {
@@ -4510,10 +5504,10 @@
     JUnitTestCase.assertEquals(expectedType.name, actualType.name);
     JUnitTestCase.assertEquals(expectedType.element, actualType.element);
     List<Type2> expectedArguments = expectedType.typeArguments;
-    int length9 = expectedArguments.length;
+    int length2 = expectedArguments.length;
     List<Type2> actualArguments = actualType.typeArguments;
-    EngineTestCase.assertLength(length9, actualArguments);
-    for (int i = 0; i < length9; i++) {
+    EngineTestCase.assertLength(length2, actualArguments);
+    for (int i = 0; i < length2; i++) {
       assertType2(expectedArguments[i], actualArguments[i]);
     }
   }
@@ -4529,16 +5523,17 @@
    */
   StaticTypeAnalyzer createAnalyzer() {
     AnalysisContextImpl context = new AnalysisContextImpl();
-    SourceFactory sourceFactory = new SourceFactory.con2([new DartUriResolver(DartSdk.defaultSdk)]);
+    SourceFactory sourceFactory = new SourceFactory.con2([new DartUriResolver(DirectoryBasedDartSdk.defaultSdk)]);
     context.sourceFactory = sourceFactory;
-    FileBasedSource source = new FileBasedSource.con1(sourceFactory, FileUtilities2.createFile("/lib.dart"));
+    FileBasedSource source = new FileBasedSource.con1(sourceFactory.contentCache, FileUtilities2.createFile("/lib.dart"));
     CompilationUnitElementImpl definingCompilationUnit = new CompilationUnitElementImpl("lib.dart");
     definingCompilationUnit.source = source;
     LibraryElementImpl definingLibrary = new LibraryElementImpl(context, null);
     definingLibrary.definingCompilationUnit = definingCompilationUnit;
     Library library = new Library(context, _listener, source);
     library.libraryElement = definingLibrary;
-    ResolverVisitor visitor = new ResolverVisitor(library, source, _typeProvider);
+    ResolverVisitor visitor = new ResolverVisitor.con1(library, source, _typeProvider);
+    visitor.overrideManager.enterScope();
     try {
       return visitor.typeAnalyzer_J2DAccessor as StaticTypeAnalyzer;
     } catch (exception) {
@@ -4563,14 +5558,14 @@
    * @param body the body of the function
    * @return a resolved function expression
    */
-  FunctionExpression resolvedFunctionExpression(FormalParameterList parameters16, FunctionBody body) {
-    for (FormalParameter parameter in parameters16.parameters) {
+  FunctionExpression resolvedFunctionExpression(FormalParameterList parameters2, FunctionBody body) {
+    for (FormalParameter parameter in parameters2.parameters) {
       ParameterElementImpl element = new ParameterElementImpl(parameter.identifier);
       element.parameterKind = parameter.kind;
       element.type = _typeProvider.dynamicType;
       parameter.identifier.element = element;
     }
-    FunctionExpression node = ASTFactory.functionExpression2(parameters16, body);
+    FunctionExpression node = ASTFactory.functionExpression2(parameters2, body);
     FunctionElementImpl element = new FunctionElementImpl.con1(null);
     element.type = new FunctionTypeImpl.con1(element);
     node.element = element;
@@ -4602,12 +5597,12 @@
    * @param variableName the name of the variable
    * @return a simple identifier that has been resolved to a variable element with the given type
    */
-  SimpleIdentifier resolvedVariable(InterfaceType type37, String variableName) {
-    SimpleIdentifier identifier = ASTFactory.identifier2(variableName);
+  SimpleIdentifier resolvedVariable(InterfaceType type2, String variableName) {
+    SimpleIdentifier identifier = ASTFactory.identifier3(variableName);
     VariableElementImpl element = ElementFactory.localVariableElement(identifier);
-    element.type = type37;
+    element.type = type2;
     identifier.element = element;
-    identifier.staticType = type37;
+    identifier.staticType = type2;
     return identifier;
   }
   /**
@@ -4615,14 +5610,14 @@
    * @param parameter the parameter whose type is to be set
    * @param type the new type of the given parameter
    */
-  void setType(FormalParameter parameter, Type2 type38) {
-    SimpleIdentifier identifier17 = parameter.identifier;
-    Element element57 = identifier17.element;
-    if (element57 is! ParameterElement) {
-      element57 = new ParameterElementImpl(identifier17);
-      identifier17.element = element57;
+  void setType(FormalParameter parameter, Type2 type2) {
+    SimpleIdentifier identifier2 = parameter.identifier;
+    Element element2 = identifier2.element;
+    if (element2 is! ParameterElement) {
+      element2 = new ParameterElementImpl(identifier2);
+      identifier2.element = element2;
     }
-    ((element57 as ParameterElementImpl)).type = type38;
+    ((element2 as ParameterElementImpl)).type = type2;
   }
   static dartSuite() {
     _ut.group('StaticTypeAnalyzerTest', () {
@@ -4881,10 +5876,10 @@
   void test_define_duplicate() {
     LibraryElement definingLibrary2 = createTestLibrary();
     GatheringErrorListener errorListener2 = new GatheringErrorListener();
-    Scope rootScope = new Scope_12(definingLibrary2, errorListener2);
+    Scope rootScope = new Scope_16(definingLibrary2, errorListener2);
     EnclosedScope scope = new EnclosedScope(rootScope);
-    VariableElement element1 = ElementFactory.localVariableElement(ASTFactory.identifier2("v1"));
-    VariableElement element2 = ElementFactory.localVariableElement(ASTFactory.identifier2("v1"));
+    VariableElement element1 = ElementFactory.localVariableElement(ASTFactory.identifier3("v1"));
+    VariableElement element2 = ElementFactory.localVariableElement(ASTFactory.identifier3("v1"));
     scope.define(element1);
     scope.define(element2);
     errorListener2.assertErrors3([ErrorSeverity.ERROR]);
@@ -4892,11 +5887,11 @@
   void test_define_normal() {
     LibraryElement definingLibrary3 = createTestLibrary();
     GatheringErrorListener errorListener3 = new GatheringErrorListener();
-    Scope rootScope = new Scope_13(definingLibrary3, errorListener3);
+    Scope rootScope = new Scope_17(definingLibrary3, errorListener3);
     EnclosedScope outerScope = new EnclosedScope(rootScope);
     EnclosedScope innerScope = new EnclosedScope(outerScope);
-    VariableElement element1 = ElementFactory.localVariableElement(ASTFactory.identifier2("v1"));
-    VariableElement element2 = ElementFactory.localVariableElement(ASTFactory.identifier2("v2"));
+    VariableElement element1 = ElementFactory.localVariableElement(ASTFactory.identifier3("v1"));
+    VariableElement element2 = ElementFactory.localVariableElement(ASTFactory.identifier3("v2"));
     outerScope.define(element1);
     innerScope.define(element2);
     errorListener3.assertNoErrors();
@@ -4914,18 +5909,18 @@
     });
   }
 }
-class Scope_12 extends Scope {
+class Scope_16 extends Scope {
   LibraryElement definingLibrary2;
   GatheringErrorListener errorListener2;
-  Scope_12(this.definingLibrary2, this.errorListener2) : super();
+  Scope_16(this.definingLibrary2, this.errorListener2) : super();
   LibraryElement get definingLibrary => definingLibrary2;
   AnalysisErrorListener get errorListener => errorListener2;
   Element lookup3(String name, LibraryElement referencingLibrary) => null;
 }
-class Scope_13 extends Scope {
+class Scope_17 extends Scope {
   LibraryElement definingLibrary3;
   GatheringErrorListener errorListener3;
-  Scope_13(this.definingLibrary3, this.errorListener3) : super();
+  Scope_17(this.definingLibrary3, this.errorListener3) : super();
   LibraryElement get definingLibrary => definingLibrary3;
   AnalysisErrorListener get errorListener => errorListener3;
   Element lookup3(String name, LibraryElement referencingLibrary) => null;
@@ -4946,7 +5941,7 @@
     JUnitTestCase.assertNull(element.entryPoint);
     EngineTestCase.assertLength(0, element.importedLibraries);
     EngineTestCase.assertLength(0, element.imports);
-    JUnitTestCase.assertNull(element.library);
+    JUnitTestCase.assertSame(element, element.library);
     EngineTestCase.assertLength(0, element.prefixes);
     EngineTestCase.assertLength(0, element.parts);
     CompilationUnitElement unit = element.definingCompilationUnit;
@@ -4973,7 +5968,7 @@
   void test_missingPartOfDirective() {
     addSource("/a.dart", "class A {}");
     Source librarySource = addSource("/lib.dart", EngineTestCase.createSource(["library lib;", "", "part 'a.dart';"]));
-    LibraryElement element = buildLibrary(librarySource, [ResolverErrorCode.MISSING_PART_OF_DIRECTIVE]);
+    LibraryElement element = buildLibrary(librarySource, [CompileTimeErrorCode.PART_OF_NON_PART]);
     JUnitTestCase.assertNotNull(element);
   }
   void test_multipleFiles() {
@@ -5006,7 +6001,7 @@
    * @return the source object representing the added file
    */
   Source addSource(String filePath, String contents) {
-    Source source = new FileBasedSource.con1(_sourceFactory, FileUtilities2.createFile(filePath));
+    Source source = new FileBasedSource.con1(_sourceFactory.contentCache, FileUtilities2.createFile(filePath));
     _sourceFactory.setContents(source, contents);
     return source;
   }
@@ -5017,9 +6012,9 @@
    */
   void assertTypes(CompilationUnitElement unit, List<String> typeNames) {
     JUnitTestCase.assertNotNull(unit);
-    List<ClassElement> types3 = unit.types;
-    EngineTestCase.assertLength(typeNames.length, types3);
-    for (ClassElement type in types3) {
+    List<ClassElement> types2 = unit.types;
+    EngineTestCase.assertLength(typeNames.length, types2);
+    for (ClassElement type in types2) {
       JUnitTestCase.assertNotNull(type);
       String actualTypeName = type.name;
       bool wasExpected = false;
@@ -5043,7 +6038,7 @@
    */
   LibraryElement buildLibrary(Source librarySource, List<ErrorCode> expectedErrorCodes) {
     AnalysisContextImpl context = new AnalysisContextImpl();
-    context.sourceFactory = new SourceFactory.con2([new DartUriResolver(DartSdk.defaultSdk), new FileUriResolver()]);
+    context.sourceFactory = new SourceFactory.con2([new DartUriResolver(DirectoryBasedDartSdk.defaultSdk), new FileUriResolver()]);
     GatheringErrorListener listener = new GatheringErrorListener();
     LibraryResolver resolver = new LibraryResolver.con2(context, listener);
     LibraryElementBuilder builder = new LibraryElementBuilder(resolver);
@@ -5086,8 +6081,8 @@
     LibraryElement definingLibrary = createTestLibrary();
     GatheringErrorListener errorListener = new GatheringErrorListener();
     ScopeTest_TestScope scope = new ScopeTest_TestScope(definingLibrary, errorListener);
-    VariableElement element1 = ElementFactory.localVariableElement(ASTFactory.identifier2("v1"));
-    VariableElement element2 = ElementFactory.localVariableElement(ASTFactory.identifier2("v1"));
+    VariableElement element1 = ElementFactory.localVariableElement(ASTFactory.identifier3("v1"));
+    VariableElement element2 = ElementFactory.localVariableElement(ASTFactory.identifier3("v1"));
     scope.define(element1);
     scope.define(element2);
     errorListener.assertErrors3([ErrorSeverity.ERROR]);
@@ -5096,8 +6091,8 @@
     LibraryElement definingLibrary = createTestLibrary();
     GatheringErrorListener errorListener = new GatheringErrorListener();
     ScopeTest_TestScope scope = new ScopeTest_TestScope(definingLibrary, errorListener);
-    VariableElement element1 = ElementFactory.localVariableElement(ASTFactory.identifier2("v1"));
-    VariableElement element2 = ElementFactory.localVariableElement(ASTFactory.identifier2("v2"));
+    VariableElement element1 = ElementFactory.localVariableElement(ASTFactory.identifier3("v1"));
+    VariableElement element2 = ElementFactory.localVariableElement(ASTFactory.identifier3("v2"));
     scope.define(element1);
     scope.define(element2);
     errorListener.assertNoErrors();
@@ -5175,6 +6170,12 @@
     assertNoErrors();
     verify([source]);
   }
+  void test_class_definesCall() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int call(int x) { return x; }", "}", "int f(A a) {", "  return a(0);", "}"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
   void test_class_extends_implements() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["class A extends B implements C {}", "class B {}", "class C {}"]));
     resolve(source, []);
@@ -5187,6 +6188,12 @@
     assertNoErrors();
     verify([source]);
   }
+  void test_extractedMethodAsConstant() {
+    Source source = addSource("/test.dart", EngineTestCase.createSource(["abstract class Comparable<T> {", "  int compareTo(T other);", "  static int compare(Comparable a, Comparable b) => a.compareTo(b);", "}", "class A {", "  void sort([compare = Comparable.compare]) {}", "}"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
   void test_forEachLoops_nonConflicting() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  List list = [1,2,3];", "  for (int x in list) {}", "  for (int x in list) {}", "}"]));
     resolve(source, []);
@@ -5211,6 +6218,13 @@
     assertNoErrors();
     verify([source]);
   }
+  void test_importWithPrefix() {
+    addSource("/two.dart", EngineTestCase.createSource(["library two;", "f(int x) {", "  return x * x;", "}"]));
+    Source source = addSource("/one.dart", EngineTestCase.createSource(["library one;", "import 'two.dart' as _two;", "main() {", "  _two.f(0);", "}"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
   void test_indexExpression_typeParameters() {
     Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  List<int> a;", "  a[0];", "  List<List<int>> b;", "  b[0][0];", "  List<List<List<int>>> c;", "  c[0][0][0];", "}"]));
     resolve(source, []);
@@ -5297,6 +6311,10 @@
   }
   static dartSuite() {
     _ut.group('SimpleResolverTest', () {
+      _ut.test('test_class_definesCall', () {
+        final __test = new SimpleResolverTest();
+        runJUnitTest(__test, __test.test_class_definesCall);
+      });
       _ut.test('test_class_extends_implements', () {
         final __test = new SimpleResolverTest();
         runJUnitTest(__test, __test.test_class_extends_implements);
@@ -5305,6 +6323,10 @@
         final __test = new SimpleResolverTest();
         runJUnitTest(__test, __test.test_empty);
       });
+      _ut.test('test_extractedMethodAsConstant', () {
+        final __test = new SimpleResolverTest();
+        runJUnitTest(__test, __test.test_extractedMethodAsConstant);
+      });
       _ut.test('test_forEachLoops_nonConflicting', () {
         final __test = new SimpleResolverTest();
         runJUnitTest(__test, __test.test_forEachLoops_nonConflicting);
@@ -5321,6 +6343,10 @@
         final __test = new SimpleResolverTest();
         runJUnitTest(__test, __test.test_getterAndSetterWithDifferentTypes);
       });
+      _ut.test('test_importWithPrefix', () {
+        final __test = new SimpleResolverTest();
+        runJUnitTest(__test, __test.test_importWithPrefix);
+      });
       _ut.test('test_indexExpression_typeParameters', () {
         final __test = new SimpleResolverTest();
         runJUnitTest(__test, __test.test_indexExpression_typeParameters);
@@ -5369,6 +6395,7 @@
 //  LibraryElementBuilderTest.dartSuite();
 //  LibraryTest.dartSuite();
 //  StaticTypeAnalyzerTest.dartSuite();
+//  TypeOverrideManagerTest.dartSuite();
 //  TypeProviderImplTest.dartSuite();
 //  TypeResolverVisitorTest.dartSuite();
 //  EnclosedScopeTest.dartSuite();
@@ -5381,4 +6408,5 @@
 //  SimpleResolverTest.dartSuite();
 //  StaticTypeWarningCodeTest.dartSuite();
 //  StaticWarningCodeTest.dartSuite();
+//  TypePropagationTest.dartSuite();
 }
\ No newline at end of file
diff --git a/pkg/analyzer_experimental/test/generated/scanner_test.dart b/pkg/analyzer_experimental/test/generated/scanner_test.dart
index 4f0fe36..5ea98f7 100644
--- a/pkg/analyzer_experimental/test/generated/scanner_test.dart
+++ b/pkg/analyzer_experimental/test/generated/scanner_test.dart
@@ -19,18 +19,18 @@
     int keywordCount = keywords.length;
     List<String> textToTest = new List<String>(keywordCount * 3);
     for (int i = 0; i < keywordCount; i++) {
-      String syntax3 = keywords[i].syntax;
-      textToTest[i] = syntax3;
-      textToTest[i + keywordCount] = "${syntax3}x";
-      textToTest[i + keywordCount * 2] = syntax3.substring(0, syntax3.length - 1);
+      String syntax2 = keywords[i].syntax;
+      textToTest[i] = syntax2;
+      textToTest[i + keywordCount] = "${syntax2}x";
+      textToTest[i + keywordCount * 2] = syntax2.substring(0, syntax2.length - 1);
     }
     KeywordState firstState = KeywordState.KEYWORD_STATE;
     for (int i = 0; i < textToTest.length; i++) {
       String text = textToTest[i];
       int index = 0;
-      int length10 = text.length;
+      int length2 = text.length;
       KeywordState state = firstState;
-      while (index < length10 && state != null) {
+      while (index < length2 && state != null) {
         state = state.next(text.codeUnitAt(index));
         index++;
       }
@@ -555,6 +555,10 @@
         final __test = new CharBufferScannerTest();
         runJUnitTest(__test, __test.test_keyword_with);
       });
+      _ut.test('test_lineInfo', () {
+        final __test = new CharBufferScannerTest();
+        runJUnitTest(__test, __test.test_lineInfo);
+      });
       _ut.test('test_lt', () {
         final __test = new CharBufferScannerTest();
         runJUnitTest(__test, __test.test_lt);
@@ -789,10 +793,10 @@
     StringScanner scanner = new StringScanner(null, "a", listener);
     scanner.setSourceStart(3, 9, offsetDelta);
     scanner.tokenize();
-    List<int> lineStarts3 = scanner.lineStarts;
-    JUnitTestCase.assertNotNull(lineStarts3);
-    JUnitTestCase.assertEquals(3, lineStarts3.length);
-    JUnitTestCase.assertEquals(33, lineStarts3[2]);
+    List<int> lineStarts2 = scanner.lineStarts;
+    JUnitTestCase.assertNotNull(lineStarts2);
+    JUnitTestCase.assertEquals(3, lineStarts2.length);
+    JUnitTestCase.assertEquals(33, lineStarts2[2]);
   }
   Token scan(String source, GatheringErrorListener listener) {
     StringScanner scanner = new StringScanner(null, source, listener);
@@ -1202,6 +1206,10 @@
         final __test = new StringScannerTest();
         runJUnitTest(__test, __test.test_keyword_with);
       });
+      _ut.test('test_lineInfo', () {
+        final __test = new StringScannerTest();
+        runJUnitTest(__test, __test.test_lineInfo);
+      });
       _ut.test('test_lt', () {
         final __test = new StringScannerTest();
         runJUnitTest(__test, __test.test_lt);
@@ -1458,8 +1466,8 @@
     Token currentToken = token;
     while (currentToken != null && currentToken.type != TokenType.EOF) {
       validateStream(builder, currentToken.precedingComments);
-      TokenType type30 = currentToken.type;
-      if (identical(type30, TokenType.OPEN_CURLY_BRACKET) || identical(type30, TokenType.OPEN_PAREN) || identical(type30, TokenType.OPEN_SQUARE_BRACKET) || identical(type30, TokenType.STRING_INTERPOLATION_EXPRESSION)) {
+      TokenType type2 = currentToken.type;
+      if (identical(type2, TokenType.OPEN_CURLY_BRACKET) || identical(type2, TokenType.OPEN_PAREN) || identical(type2, TokenType.OPEN_SQUARE_BRACKET) || identical(type2, TokenType.STRING_INTERPOLATION_EXPRESSION)) {
         if (currentToken is! BeginToken) {
           builder.append("\r\nExpected BeginToken, found ");
           builder.append(currentToken.runtimeType.toString());
@@ -1794,6 +1802,16 @@
   void test_keyword_with() {
     assertKeywordToken("with");
   }
+  void test_lineInfo() {
+    String source = "/*\r *\r */";
+    GatheringErrorListener listener = new GatheringErrorListener();
+    Token token = scan(source, listener);
+    JUnitTestCase.assertSame(TokenType.MULTI_LINE_COMMENT, token.precedingComments.type);
+    listener.assertNoErrors();
+    LineInfo info = listener.getLineInfo(new TestSource());
+    JUnitTestCase.assertNotNull(info);
+    JUnitTestCase.assertEquals(3, info.getLocation(source.length - 1).lineNumber);
+  }
   void test_lt() {
     assertToken(TokenType.LT, "<");
   }
@@ -1886,12 +1904,12 @@
   }
   void test_startAndEnd() {
     Token token = scan2("a");
-    Token previous5 = token.previous;
-    JUnitTestCase.assertEquals(token, previous5.next);
-    JUnitTestCase.assertEquals(previous5, previous5.previous);
-    Token next7 = token.next;
-    JUnitTestCase.assertEquals(next7, next7.next);
-    JUnitTestCase.assertEquals(token, next7.previous);
+    Token previous2 = token.previous;
+    JUnitTestCase.assertEquals(token, previous2.next);
+    JUnitTestCase.assertEquals(previous2, previous2.previous);
+    Token next2 = token.next;
+    JUnitTestCase.assertEquals(next2, next2.next);
+    JUnitTestCase.assertEquals(token, next2.previous);
   }
   void test_string_multi_double() {
     assertToken(TokenType.STRING, "\"\"\"multi-line\nstring\"\"\"");
@@ -2004,18 +2022,18 @@
     JUnitTestCase.assertEquals(0, token.offset);
     JUnitTestCase.assertEquals(source.length, token.length);
     JUnitTestCase.assertEquals(source, token.lexeme);
-    Object value3 = token.value();
-    JUnitTestCase.assertTrue(value3 is Keyword);
-    JUnitTestCase.assertEquals(source, ((value3 as Keyword)).syntax);
+    Object value2 = token.value();
+    JUnitTestCase.assertTrue(value2 is Keyword);
+    JUnitTestCase.assertEquals(source, ((value2 as Keyword)).syntax);
     token = scan2(" ${source} ");
     JUnitTestCase.assertNotNull(token);
     JUnitTestCase.assertEquals(TokenType.KEYWORD, token.type);
     JUnitTestCase.assertEquals(1, token.offset);
     JUnitTestCase.assertEquals(source.length, token.length);
     JUnitTestCase.assertEquals(source, token.lexeme);
-    value3 = token.value();
-    JUnitTestCase.assertTrue(value3 is Keyword);
-    JUnitTestCase.assertEquals(source, ((value3 as Keyword)).syntax);
+    value2 = token.value();
+    JUnitTestCase.assertTrue(value2 is Keyword);
+    JUnitTestCase.assertEquals(source, ((value2 as Keyword)).syntax);
     JUnitTestCase.assertEquals(TokenType.EOF, token.next.type);
   }
   /**
diff --git a/pkg/analyzer_experimental/test/generated/test_support.dart b/pkg/analyzer_experimental/test/generated/test_support.dart
index cf2e434..6e85ac9 100644
--- a/pkg/analyzer_experimental/test/generated/test_support.dart
+++ b/pkg/analyzer_experimental/test/generated/test_support.dart
@@ -12,7 +12,7 @@
 import 'package:analyzer_experimental/src/generated/error.dart';
 import 'package:analyzer_experimental/src/generated/scanner.dart';
 import 'package:analyzer_experimental/src/generated/element.dart' show InterfaceType, MethodElement, PropertyAccessorElement;
-import 'package:analyzer_experimental/src/generated/engine.dart' show AnalysisContext;
+import 'package:analyzer_experimental/src/generated/engine.dart' show AnalysisContext, AnalysisContextImpl;
 import 'package:unittest/unittest.dart' as _ut;
 
 /**
@@ -45,17 +45,17 @@
    * Initialize a newly created error listener to collect errors.
    */
   GatheringErrorListener() : super() {
-    _jtd_constructor_321_impl();
+    _jtd_constructor_347_impl();
   }
-  _jtd_constructor_321_impl() {
+  _jtd_constructor_347_impl() {
   }
   /**
    * Initialize a newly created error listener to collect errors.
    */
   GatheringErrorListener.con1(String rawSource2) {
-    _jtd_constructor_322_impl(rawSource2);
+    _jtd_constructor_348_impl(rawSource2);
   }
-  _jtd_constructor_322_impl(String rawSource2) {
+  _jtd_constructor_348_impl(String rawSource2) {
     this._rawSource = rawSource2;
     this._markedSource = rawSource2;
   }
@@ -205,18 +205,30 @@
    */
   List<AnalysisError> get errors => _errors;
   /**
+   * Return the line information associated with the given source, or {@code null} if no line
+   * information has been associated with the source.
+   * @param source the source with which the line information is associated
+   * @return the line information associated with the source
+   */
+  LineInfo getLineInfo(Source source) => _lineInfoMap[source];
+  /**
    * Return {@code true} if an error with the given error code has been gathered.
    * @param errorCode the error code being searched for
    * @return {@code true} if an error with the given error code has been gathered
    */
-  bool hasError(ErrorCode errorCode5) {
+  bool hasError(ErrorCode errorCode2) {
     for (AnalysisError error in _errors) {
-      if (identical(error.errorCode, errorCode5)) {
+      if (identical(error.errorCode, errorCode2)) {
         return true;
       }
     }
     return false;
   }
+  /**
+   * Return {@code true} if at least one error has been gathered.
+   * @return {@code true} if at least one error has been gathered
+   */
+  bool hasErrors() => _errors.length > 0;
   void onError(AnalysisError error) {
     if (_rawSource != null) {
       int left = error.offset;
@@ -275,31 +287,31 @@
     writer.print(expectedErrors.length);
     writer.print(" errors:");
     for (AnalysisError error in expectedErrors) {
-      Source source11 = error.source;
-      LineInfo lineInfo = _lineInfoMap[source11];
-      writer.println();
+      Source source2 = error.source;
+      LineInfo lineInfo = _lineInfoMap[source2];
+      writer.newLine();
       if (lineInfo == null) {
-        int offset10 = error.offset;
-        writer.printf("  %s %s (%d..%d)", [source11 == null ? "" : source11.shortName, error.errorCode, offset10, offset10 + error.length]);
+        int offset2 = error.offset;
+        writer.printf("  %s %s (%d..%d)", [source2 == null ? "" : source2.shortName, error.errorCode, offset2, offset2 + error.length]);
       } else {
         LineInfo_Location location = lineInfo.getLocation(error.offset);
-        writer.printf("  %s %s (%d, %d/%d)", [source11 == null ? "" : source11.shortName, error.errorCode, location.lineNumber, location.columnNumber, error.length]);
+        writer.printf("  %s %s (%d, %d/%d)", [source2 == null ? "" : source2.shortName, error.errorCode, location.lineNumber, location.columnNumber, error.length]);
       }
     }
-    writer.println();
+    writer.newLine();
     writer.print("found ");
     writer.print(_errors.length);
     writer.print(" errors:");
     for (AnalysisError error in _errors) {
-      Source source12 = error.source;
-      LineInfo lineInfo = _lineInfoMap[source12];
-      writer.println();
+      Source source3 = error.source;
+      LineInfo lineInfo = _lineInfoMap[source3];
+      writer.newLine();
       if (lineInfo == null) {
-        int offset11 = error.offset;
-        writer.printf("  %s %s (%d..%d): %s", [source12 == null ? "" : source12.shortName, error.errorCode, offset11, offset11 + error.length, error.message]);
+        int offset3 = error.offset;
+        writer.printf("  %s %s (%d..%d): %s", [source3 == null ? "" : source3.shortName, error.errorCode, offset3, offset3 + error.length, error.message]);
       } else {
         LineInfo_Location location = lineInfo.getLocation(error.offset);
-        writer.printf("  %s %s (%d, %d/%d): %s", [source12 == null ? "" : source12.shortName, error.errorCode, location.lineNumber, location.columnNumber, error.length, error.message]);
+        writer.printf("  %s %s (%d, %d/%d): %s", [source3 == null ? "" : source3.shortName, error.errorCode, location.lineNumber, location.columnNumber, error.length, error.message]);
       }
     }
     JUnitTestCase.fail(writer.toString());
@@ -536,6 +548,20 @@
     }
   }
   /**
+   * Assert that the given set is non-{@code null} and has the expected number of elements.
+   * @param expectedSize the expected number of elements
+   * @param set the set being tested
+   * @throws AssertionFailedError if the set is {@code null} or does not have the expected number of
+   * elements
+   */
+  static void assertSize3(int expectedSize, Set<Object> set) {
+    if (set == null) {
+      JUnitTestCase.fail("Expected set of size ${expectedSize}; found null");
+    } else if (set.length != expectedSize) {
+      JUnitTestCase.fail("Expected set of size ${expectedSize}; contained ${set.length} elements");
+    }
+  }
+  /**
    * Convert the given array of lines into a single source string.
    * @param lines the lines to be merged into a single source string
    * @return the source string composed of the given lines
@@ -543,7 +569,7 @@
   static String createSource(List<String> lines) {
     PrintStringWriter writer = new PrintStringWriter();
     for (String line in lines) {
-      writer.printlnObject(line);
+      writer.println(line);
     }
     return writer.toString();
   }
@@ -567,6 +593,11 @@
     }
     return diffPos;
   }
+  AnalysisContextImpl createAnalysisContext() {
+    AnalysisContextImpl context = new AnalysisContextImpl();
+    context.sourceFactory = new SourceFactory.con2([]);
+    return context;
+  }
   /**
    * Return the getter in the given type with the given name. Inherited getters are ignored.
    * @param type the type in which the getter is declared
@@ -606,8 +637,9 @@
 }
 
 class TestSource implements Source {
+  int get hashCode => 0;
   bool operator ==(Object object) {
-    return this == object;
+    return object is TestSource;
   }
   AnalysisContext get context {
     throw new UnsupportedOperationException();
diff --git a/pkg/http/test/safe_http_server.dart b/pkg/http/test/safe_http_server.dart
index 7019df1..b6e1c83 100644
--- a/pkg/http/test/safe_http_server.dart
+++ b/pkg/http/test/safe_http_server.dart
@@ -31,7 +31,7 @@
       : super(server),
         _inner = server;
 
-  Future close() => _inner.close();
+  void close() => _inner.close();
 
   int get port => _inner.port;
 
@@ -136,7 +136,8 @@
   Future close() => _inner.close();
   void write(Object obj) => _inner.write(obj);
   void writeAll(Iterable objects, [String separator = ""]) =>
-      _inner.writeAll(objects, separator);
+    _inner.writeAll(objects, separator);
   void writeCharCode(int charCode) => _inner.writeCharCode(charCode);
   void writeln([Object obj = ""]) => _inner.writeln(obj);
+  void addError(error) => _inner.addError(error);
 }
diff --git a/pkg/intl/lib/message_lookup_by_library.dart b/pkg/intl/lib/message_lookup_by_library.dart
index 27b9699..e3d1fb7 100644
--- a/pkg/intl/lib/message_lookup_by_library.dart
+++ b/pkg/intl/lib/message_lookup_by_library.dart
@@ -75,12 +75,6 @@
   bool _lookupInProgress = false;
 
   /**
-   * Return true if the locale exists, or if it is null. Null is treated
-   * as meaning that we use the default locale.
-   */
-  bool localeExists(localeName);
-
-  /**
    * Return the localized version of a message. We are passed the original
    * version of the message, which consists of a
    * [message_str] that will be translated, and which may be interpolated
diff --git a/pkg/intl/lib/number_format.dart b/pkg/intl/lib/number_format.dart
index c700e62..1745178 100644
--- a/pkg/intl/lib/number_format.dart
+++ b/pkg/intl/lib/number_format.dart
@@ -475,7 +475,7 @@
       format._negativePrefix = _parseAffix();
       // Skip over the negative trunk, verifying that it's identical to the
       // positive trunk.
-      for (var each in _iterator(trunk)) {
+      for (var each in _iterable(trunk)) {
         if (pattern.current != each && pattern.current != null) {
           throw new FormatException(
               "Positive and negative trunks must be the same");
@@ -720,10 +720,27 @@
 }
 
 /**
+ * Returns an [Iterable] on the string as a list of substrings.
+ */
+Iterable _iterable(String s) => new _StringIterable(s);
+
+/**
  * Return an iterator on the string as a list of substrings.
  */
 Iterator _iterator(String s) => new _StringIterator(s);
 
+// TODO(nweiz): remove this when issue 3780 is fixed.
+/**
+ * Provides an Iterable that wraps [_iterator] so it can be used in a `for`
+ * loop.
+ */
+class _StringIterable extends Iterable<String> {
+  final Iterator<String> iterator;
+
+  _StringIterable(String s)
+      : iterator = _iterator(s);
+}
+
 /**
  * Provides an iterator over a string as a list of substrings, and also
  * gives us a lookahead of one via the [peek] method.
diff --git a/pkg/pkg.status b/pkg/pkg.status
index 195a42f..d638e12 100644
--- a/pkg/pkg.status
+++ b/pkg/pkg.status
@@ -118,6 +118,7 @@
 [ $compiler == dart2js ]
 unittest/test/instance_test: Skip
 
+
 [ $compiler == dart2js && $runtime == drt ]
 intl/test/date_time_format_uninitialized_test: Pass, Fail # http://dartbug.com/9000
 
diff --git a/pkg/scheduled_test/lib/src/scheduled_server/safe_http_server.dart b/pkg/scheduled_test/lib/src/scheduled_server/safe_http_server.dart
index 2e5b9cc..b6e1c83 100644
--- a/pkg/scheduled_test/lib/src/scheduled_server/safe_http_server.dart
+++ b/pkg/scheduled_test/lib/src/scheduled_server/safe_http_server.dart
@@ -57,7 +57,7 @@
       // Manually handle cancelOnError so the above (ignored) errors don't
       // cause unsubscription.
       if (cancelOnError) subscription.cancel();
-      if (onError != null) onError(e);
+      if (onError != null) onError(error);
     }, onDone: onDone);
     return subscription;
   }
@@ -139,4 +139,5 @@
     _inner.writeAll(objects, separator);
   void writeCharCode(int charCode) => _inner.writeCharCode(charCode);
   void writeln([Object obj = ""]) => _inner.writeln(obj);
+  void addError(error) => _inner.addError(error);
 }
diff --git a/pkg/unittest/lib/mock.dart b/pkg/unittest/lib/mock.dart
index 8bdb115..9ee6d8a 100644
--- a/pkg/unittest/lib/mock.dart
+++ b/pkg/unittest/lib/mock.dart
@@ -90,6 +90,9 @@
  */
 
 library mock;
+
+import 'dart:mirrors' show MirrorSystem;
+
 import 'matcher.dart';
 
 /**
@@ -1293,7 +1296,7 @@
    * thrown.
    */
   noSuchMethod(Invocation invocation) {
-    var method = invocation.memberName;
+    var method = MirrorSystem.getName(invocation.memberName);
     var args = invocation.positionalArguments;
     if (invocation.isGetter) {
       method = 'get $method';
diff --git a/pkg/unittest/lib/unittest.dart b/pkg/unittest/lib/unittest.dart
index ec79288..50d308b 100644
--- a/pkg/unittest/lib/unittest.dart
+++ b/pkg/unittest/lib/unittest.dart
@@ -201,11 +201,9 @@
 /** Separator used between group names and test names. */
 String groupSep = ' ';
 
+// TODO(nweiz): present an unmodifiable view of this once issue 8321 is fixed.
 /** Tests executed in this suite. */
-final List<TestCase> _testCases = new List<TestCase>();
-
-/** Get the list of tests. */
-final List<TestCase> testCases = new UnmodifiableListView(_testCases);
+final List<TestCase> testCases = new List<TestCase>();
 
 /** Setup function called before each test in a group */
 Function _testSetup;
@@ -217,8 +215,8 @@
 
 /** [TestCase] currently being executed. */
 TestCase get currentTestCase =>
-    (_currentTestCaseIndex >= 0 && _currentTestCaseIndex < _testCases.length)
-        ? _testCases[_currentTestCaseIndex]
+    (_currentTestCaseIndex >= 0 && _currentTestCaseIndex < testCases.length)
+        ? testCases[_currentTestCaseIndex]
         : null;
 
 /** Whether the framework is in an initialized state. */
@@ -254,8 +252,8 @@
  */
 void test(String spec, TestFunction body) {
   ensureInitialized();
-  _testCases.add(new TestCase._internal(_testCases.length + 1, _fullSpec(spec),
-                                        body));
+  testCases.add(new TestCase._internal(testCases.length + 1, _fullSpec(spec),
+                                       body));
 }
 
 /**
@@ -277,8 +275,8 @@
 
   ensureInitialized();
 
-  _soloTest = new TestCase._internal(_testCases.length + 1, _fullSpec(spec), body);
-  _testCases.add(_soloTest);
+  _soloTest = new TestCase._internal(testCases.length + 1, _fullSpec(spec), body);
+  testCases.add(_soloTest);
 }
 
 /** Sentinel value for [_SpreadArgsHelper]. */
@@ -313,15 +311,15 @@
         this.id = _makeCallbackId(id, callback) {
     ensureInitialized();
     if (!(_currentTestCaseIndex >= 0 &&
-           _currentTestCaseIndex < _testCases.length &&
-           _testCases[_currentTestCaseIndex] != null)) {
+           _currentTestCaseIndex < testCases.length &&
+           testCases[_currentTestCaseIndex] != null)) {
       print("No valid test, did you forget to run your test inside a call "
           "to test()?");
     }
     assert(_currentTestCaseIndex >= 0 &&
-           _currentTestCaseIndex < _testCases.length &&
-           _testCases[_currentTestCaseIndex] != null);
-    testCase = _testCases[_currentTestCaseIndex];
+           _currentTestCaseIndex < testCases.length &&
+           testCases[_currentTestCaseIndex] != null);
+    testCase = testCases[_currentTestCaseIndex];
     if (isDone != null || minExpected > 0) {
       testCase._callbackFunctionsOutstanding++;
       complete = false;
@@ -650,8 +648,8 @@
  *  error was caught outside of this library.
  */
 void _reportTestError(String msg, String trace) {
- if (_currentTestCaseIndex < _testCases.length) {
-    final testCase = _testCases[_currentTestCaseIndex];
+ if (_currentTestCaseIndex < testCases.length) {
+    final testCase = testCases[_currentTestCaseIndex];
     testCase.error(msg, trace);
   } else {
     _uncaughtErrorMessage = "$msg: $trace";
@@ -692,7 +690,7 @@
   } else if (testFilter is Function) {
     filterFunction = testFilter;
   }
-  _testCases.retainWhere(filterFunction);
+  testCases.retainWhere(filterFunction);
 }
 
 /** Runs all queued tests, one at a time. */
@@ -747,10 +745,10 @@
 void _registerException(testNum, e, [trace]) {
   trace = trace == null ? '' : trace.toString();
   String message = (e is TestFailure) ? e.message : 'Caught $e';
-  if (_testCases[testNum].result == null) {
-    _testCases[testNum].fail(message, trace);
+  if (testCases[testNum].result == null) {
+    testCases[testNum].fail(message, trace);
   } else {
-    _testCases[testNum].error(message, trace);
+    testCases[testNum].error(message, trace);
   }
 }
 
@@ -761,11 +759,11 @@
  */
 void _nextBatch() {
   while (true) {
-    if (_currentTestCaseIndex >= _testCases.length) {
+    if (_currentTestCaseIndex >= testCases.length) {
       _completeTests();
       break;
     }
-    final testCase = _testCases[_currentTestCaseIndex];
+    final testCase = testCases[_currentTestCaseIndex];
     var f = _guardAsync(testCase._run, null, _currentTestCaseIndex);
     if (f != null) {
       f.whenComplete(() {
@@ -784,7 +782,7 @@
   int failed = 0;
   int errors = 0;
 
-  for (TestCase t in _testCases) {
+  for (TestCase t in testCases) {
     switch (t.result) {
       case PASS:  passed++; break;
       case FAIL:  failed++; break;
@@ -833,9 +831,9 @@
 
 /** Select a solo test by ID. */
 void setSoloTest(int id) {
-  for (var i = 0; i < _testCases.length; i++) {
-    if (_testCases[i].id == id) {
-      _soloTest = _testCases[i];
+  for (var i = 0; i < testCases.length; i++) {
+    if (testCases[i].id == id) {
+      _soloTest = testCases[i];
       break;
     }
   }
@@ -844,12 +842,12 @@
 /** Enable/disable a test by ID. */
 void _setTestEnabledState(int testId, bool state) {
   // Try fast path first.
-  if (_testCases.length > testId && _testCases[testId].id == testId) {
-    _testCases[testId].enabled = state;
+  if (testCases.length > testId && testCases[testId].id == testId) {
+    testCases[testId].enabled = state;
   } else {
-    for (var i = 0; i < _testCases.length; i++) {
-      if (_testCases[i].id == testId) {
-        _testCases[i].enabled = state;
+    for (var i = 0; i < testCases.length; i++) {
+      if (testCases[i].id == testId) {
+        testCases[i].enabled = state;
         break;
       }
     }
diff --git a/pkg/unittest/test/unittest_test.dart b/pkg/unittest/test/unittest_test.dart
index f6a2f5d..24ff29d 100644
--- a/pkg/unittest/test/unittest_test.dart
+++ b/pkg/unittest/test/unittest_test.dart
@@ -292,11 +292,6 @@
       });
       test('foo6', () {
       });
-    } else if (testName == 'testCases immutable') {
-      test(testName, () {
-        expect(() => testCases.clear(), throwsUnsupportedError);
-        expect(() => testCases.removeLast(), throwsUnsupportedError);
-      });
     } else if (testName == 'runTests without tests') {
       runTests();
     }
@@ -353,8 +348,6 @@
         'fail2:failure:'
         'error2:Callback called more times than expected (1).:'
         'foo6'),
-    'testCases immutable':
-        buildStatusString(1, 0, 0, 'testCases immutable'),
     'runTests without tests': buildStatusString(0, 0, 0, null)
   };
 
diff --git a/pkg/webdriver/lib/webdriver.dart b/pkg/webdriver/lib/webdriver.dart
index cc6b7d3..fbae2d3 100644
--- a/pkg/webdriver/lib/webdriver.dart
+++ b/pkg/webdriver/lib/webdriver.dart
@@ -217,7 +217,7 @@
 
   void _failRequest(Completer completer, error, [stackTrace]) {
     if (completer != null) {
-      var trace = stackTrace != null ? stackTrace, getAttachedStackTrace(error);
+      var trace = stackTrace != null ? stackTrace : getAttachedStackTrace(error);
       completer.completeError(new WebDriverError(-1, error), trace);
     }
   }
diff --git a/pkg/yaml/lib/composer.dart b/pkg/yaml/lib/src/composer.dart
similarity index 71%
rename from pkg/yaml/lib/composer.dart
rename to pkg/yaml/lib/src/composer.dart
index 90ed330..40b7667 100644
--- a/pkg/yaml/lib/composer.dart
+++ b/pkg/yaml/lib/src/composer.dart
@@ -2,41 +2,45 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-part of yaml;
+library composer;
+
+import 'model.dart';
+import 'visitor.dart';
+import 'yaml_exception.dart';
 
 /// Takes a parsed YAML document (what the spec calls the "serialization tree")
 /// and resolves aliases, resolves tags, and parses scalars to produce the
 /// "representation graph".
-class _Composer extends _Visitor {
+class Composer extends Visitor {
   /// The root node of the serialization tree.
-  _Node root;
+  final Node _root;
 
   /// Map from anchor names to the most recent representation graph node with
   /// that anchor.
-  Map<String, _Node> anchors;
+  final _anchors = <String, Node>{};
 
   /// The next id to use for the represenation graph's anchors. The spec doesn't
   /// use anchors in the representation graph, but we do so that the constructor
   /// can ensure that the same node in the representation graph produces the
   /// same native object.
-  int idCounter;
+  var _idCounter = 0;
 
-  _Composer(this.root) : this.anchors = <String, _Node>{}, this.idCounter = 0;
+  Composer(this._root);
 
   /// Runs the Composer to produce a representation graph.
-  _Node compose() => root.visit(this);
+  Node compose() => _root.visit(this);
 
   /// Returns the anchor to which an alias node refers.
-  _Node visitAlias(_AliasNode alias) {
-    if (!anchors.containsKey(alias.anchor)) {
+  Node visitAlias(AliasNode alias) {
+    if (!_anchors.containsKey(alias.anchor)) {
       throw new YamlException("no anchor for alias ${alias.anchor}");
     }
-    return anchors[alias.anchor];
+    return _anchors[alias.anchor];
   }
 
   /// Parses a scalar node according to its tag, or auto-detects the type if no
   /// tag exists. Currently this only supports the YAML core type schema.
-  _Node visitScalar(_ScalarNode scalar) {
+  Node visitScalar(ScalarNode scalar) {
     if (scalar.tag.name == "!") {
       return setAnchor(scalar, parseString(scalar.content));
     } else if (scalar.tag.name == "?") {
@@ -54,7 +58,7 @@
     };
 
     for (var key in tagParsers.keys) {
-      if (scalar.tag.name != _Tag.yaml(key)) continue;
+      if (scalar.tag.name != Tag.yaml(key)) continue;
       var result = tagParsers[key](scalar.content);
       if (result != null) return setAnchor(scalar, result);
       throw new YamlException('invalid literal for $key: "${scalar.content}"');
@@ -64,69 +68,69 @@
   }
 
   /// Assigns a tag to the sequence and recursively composes its contents.
-  _Node visitSequence(_SequenceNode seq) {
+  Node visitSequence(SequenceNode seq) {
     var tagName = seq.tag.name;
-    if (tagName != "!" && tagName != "?" && tagName != _Tag.yaml("seq")) {
+    if (tagName != "!" && tagName != "?" && tagName != Tag.yaml("seq")) {
       throw new YamlException("invalid tag for sequence: ${tagName}");
     }
 
-    var result = setAnchor(seq, new _SequenceNode(_Tag.yaml("seq"), null));
+    var result = setAnchor(seq, new SequenceNode(Tag.yaml("seq"), null));
     result.content = super.visitSequence(seq);
     return result;
   }
 
   /// Assigns a tag to the mapping and recursively composes its contents.
-  _Node visitMapping(_MappingNode map) {
+  Node visitMapping(MappingNode map) {
     var tagName = map.tag.name;
-    if (tagName != "!" && tagName != "?" && tagName != _Tag.yaml("map")) {
+    if (tagName != "!" && tagName != "?" && tagName != Tag.yaml("map")) {
       throw new YamlException("invalid tag for mapping: ${tagName}");
     }
 
-    var result = setAnchor(map, new _MappingNode(_Tag.yaml("map"), null));
+    var result = setAnchor(map, new MappingNode(Tag.yaml("map"), null));
     result.content = super.visitMapping(map);
     return result;
   }
 
   /// If the serialization tree node [anchored] has an anchor, records that
   /// that anchor is pointing to the representation graph node [result].
-  _Node setAnchor(_Node anchored, _Node result) {
+  Node setAnchor(Node anchored, Node result) {
     if (anchored.anchor == null) return result;
-    result.anchor = '${idCounter++}';
-    anchors[anchored.anchor] = result;
+    result.anchor = '${_idCounter++}';
+    _anchors[anchored.anchor] = result;
     return result;
   }
 
   /// Parses a null scalar.
-  _ScalarNode parseNull(String content) {
+  ScalarNode parseNull(String content) {
     if (!new RegExp(r"^(null|Null|NULL|~|)$").hasMatch(content)) return null;
-    return new _ScalarNode(_Tag.yaml("null"), value: null);
+    return new ScalarNode(Tag.yaml("null"), value: null);
   }
 
   /// Parses a boolean scalar.
-  _ScalarNode parseBool(String content) {
+  ScalarNode parseBool(String content) {
     var match = new RegExp(r"^(?:(true|True|TRUE)|(false|False|FALSE))$").
       firstMatch(content);
     if (match == null) return null;
-    return new _ScalarNode(_Tag.yaml("bool"), value: match.group(1) != null);
+    return new ScalarNode(Tag.yaml("bool"), value: match.group(1) != null);
   }
 
   /// Parses an integer scalar.
-  _ScalarNode parseInt(String content) {
+  ScalarNode parseInt(String content) {
     var match = new RegExp(r"^[-+]?[0-9]+$").firstMatch(content);
     if (match != null) {
-      return new _ScalarNode(_Tag.yaml("int"),
+      return new ScalarNode(Tag.yaml("int"),
           value: int.parse(match.group(0)));
     }
 
     match = new RegExp(r"^0o([0-7]+)$").firstMatch(content);
     if (match != null) {
       int n = int.parse(match.group(1), radix: 8);
-      return new _ScalarNode(_Tag.yaml("int"), value: n);
+      return new ScalarNode(Tag.yaml("int"), value: n);
     }
 
     match = new RegExp(r"^0x[0-9a-fA-F]+$").firstMatch(content);
     if (match != null) {
-      return new _ScalarNode(_Tag.yaml("int"),
+      return new ScalarNode(Tag.yaml("int"),
           value: int.parse(match.group(0)));
     }
 
@@ -134,7 +138,7 @@
   }
 
   /// Parses a floating-point scalar.
-  _ScalarNode parseFloat(String content) {
+  ScalarNode parseFloat(String content) {
     var match = new RegExp(
         r"^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$").
       firstMatch(content);
@@ -142,25 +146,25 @@
       // YAML allows floats of the form "0.", but Dart does not. Fix up those
       // floats by removing the trailing dot.
       var matchStr = match.group(0).replaceAll(new RegExp(r"\.$"), "");
-      return new _ScalarNode(_Tag.yaml("float"),
+      return new ScalarNode(Tag.yaml("float"),
           value: double.parse(matchStr));
     }
 
     match = new RegExp(r"^([+-]?)\.(inf|Inf|INF)$").firstMatch(content);
     if (match != null) {
       var value = match.group(1) == "-" ? -double.INFINITY : double.INFINITY;
-      return new _ScalarNode(_Tag.yaml("float"), value: value);
+      return new ScalarNode(Tag.yaml("float"), value: value);
     }
 
     match = new RegExp(r"^\.(nan|NaN|NAN)$").firstMatch(content);
     if (match != null) {
-      return new _ScalarNode(_Tag.yaml("float"), value: double.NAN);
+      return new ScalarNode(Tag.yaml("float"), value: double.NAN);
     }
 
     return null;
   }
 
   /// Parses a string scalar.
-  _ScalarNode parseString(String content) =>
-    new _ScalarNode(_Tag.yaml("str"), value: content);
+  ScalarNode parseString(String content) =>
+    new ScalarNode(Tag.yaml("str"), value: content);
 }
diff --git a/pkg/yaml/lib/constructor.dart b/pkg/yaml/lib/src/constructor.dart
similarity index 71%
rename from pkg/yaml/lib/constructor.dart
rename to pkg/yaml/lib/src/constructor.dart
index 73a62a8..428c476 100644
--- a/pkg/yaml/lib/constructor.dart
+++ b/pkg/yaml/lib/src/constructor.dart
@@ -2,28 +2,32 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-part of yaml;
+library constructor;
+
+import 'model.dart';
+import 'visitor.dart';
+import 'yaml_map.dart';
 
 /// Takes a parsed and composed YAML document (what the spec calls the
 /// "representation graph") and creates native Dart objects that represent that
 /// document.
-class _Constructor extends _Visitor {
+class Constructor extends Visitor {
   /// The root node of the representation graph.
-  _Node root;
+  final Node _root;
 
   /// Map from anchor names to the most recent Dart node with that anchor.
-  Map<String, dynamic> anchors;
+  final _anchors = <String, dynamic>{};
 
-  _Constructor(this.root) : this.anchors = {};
+  Constructor(this._root);
 
   /// Runs the Constructor to produce a Dart object.
-  construct() => root.visit(this);
+  construct() => _root.visit(this);
 
   /// Returns the value of a scalar.
-  visitScalar(_ScalarNode scalar) => scalar.value;
+  visitScalar(ScalarNode scalar) => scalar.value;
 
   /// Converts a sequence into a List of Dart objects.
-  visitSequence(_SequenceNode seq) {
+  visitSequence(SequenceNode seq) {
     var anchor = getAnchor(seq);
     if (anchor != null) return anchor;
     var dartSeq = setAnchor(seq, []);
@@ -32,7 +36,7 @@
   }
 
   /// Converts a mapping into a Map of Dart objects.
-  visitMapping(_MappingNode map) {
+  visitMapping(MappingNode map) {
     var anchor = getAnchor(map);
     if (anchor != null) return anchor;
     var dartMap = setAnchor(map, new YamlMap());
@@ -42,15 +46,15 @@
 
   /// Returns the Dart object that already represents [anchored], if such a
   /// thing exists.
-  getAnchor(_Node anchored) {
+  getAnchor(Node anchored) {
     if (anchored.anchor == null) return null;
-    if (anchors.containsKey(anchored.anchor)) return anchors[anchored.anchor];
+    if (_anchors.containsKey(anchored.anchor)) return _anchors[anchored.anchor];
   }
 
   /// Records that [value] is the Dart object representing [anchored].
-  setAnchor(_Node anchored, value) {
+  setAnchor(Node anchored, value) {
     if (anchored.anchor == null) return value;
-    anchors[anchored.anchor] = value;
+    _anchors[anchored.anchor] = value;
     return value;
   }
 }
diff --git a/pkg/yaml/lib/deep_equals.dart b/pkg/yaml/lib/src/deep_equals.dart
similarity index 100%
rename from pkg/yaml/lib/deep_equals.dart
rename to pkg/yaml/lib/src/deep_equals.dart
diff --git a/pkg/yaml/lib/model.dart b/pkg/yaml/lib/src/model.dart
similarity index 68%
rename from pkg/yaml/lib/model.dart
rename to pkg/yaml/lib/src/model.dart
index ac237a0..d7ee481 100644
--- a/pkg/yaml/lib/model.dart
+++ b/pkg/yaml/lib/src/model.dart
@@ -2,14 +2,19 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-part of yaml;
+/// This file contains the node classes for the internal representations of YAML
+/// documents. These nodes are used for both the serialization tree and the
+/// representation graph.
+library model;
 
-// This file contains the node classes for the internal representations of YAML
-// documents. These nodes are used for both the serialization tree and the
-// representation graph.
+import 'model.dart';
+import 'parser.dart';
+import 'utils.dart';
+import 'visitor.dart';
+import 'yaml_exception.dart';
 
 /// A tag that indicates the type of a YAML node.
-class _Tag {
+class Tag {
   // TODO(nweiz): it would better match the semantics of the spec if there were
   // a singleton instance of this class for each tag.
 
@@ -25,18 +30,18 @@
   /// The kind of the tag: SCALAR_KIND, SEQUENCE_KIND, or MAPPING_KIND.
   final int kind;
 
-  _Tag(this.name, this.kind);
+  Tag(this.name, this.kind);
 
-  _Tag.scalar(String name) : this(name, SCALAR_KIND);
-  _Tag.sequence(String name) : this(name, SEQUENCE_KIND);
-  _Tag.mapping(String name) : this(name, MAPPING_KIND);
+  Tag.scalar(String name) : this(name, SCALAR_KIND);
+  Tag.sequence(String name) : this(name, SEQUENCE_KIND);
+  Tag.mapping(String name) : this(name, MAPPING_KIND);
 
   /// Returns the standard YAML tag URI for [type].
   static String yaml(String type) => "tag:yaml.org,2002:$type";
 
   /// Two tags are equal if their URIs are equal.
   operator ==(other) {
-    if (other is! _Tag) return false;
+    if (other is! Tag) return false;
     return name == other.name;
   }
 
@@ -52,37 +57,37 @@
 }
 
 /// The abstract class for YAML nodes.
-abstract class _Node {
+abstract class Node {
   /// Every YAML node has a tag that describes its type.
-  _Tag tag;
+  Tag tag;
 
   /// Any YAML node can have an anchor associated with it.
   String anchor;
 
-  _Node(this.tag, [this.anchor]);
+  Node(this.tag, [this.anchor]);
 
   bool operator ==(other) {
-    if (other is! _Node) return false;
+    if (other is! Node) return false;
     return tag == other.tag;
   }
 
-  int get hashCode => _hashCode([tag, anchor]);
+  int get hashCode => hashCodeFor([tag, anchor]);
 
-  visit(_Visitor v);
+  visit(Visitor v);
 }
 
 /// A sequence node represents an ordered list of nodes.
-class _SequenceNode extends _Node {
+class SequenceNode extends Node {
   /// The nodes in the sequence.
-  List<_Node> content;
+  List<Node> content;
 
-  _SequenceNode(String tagName, this.content)
-    : super(new _Tag.sequence(tagName));
+  SequenceNode(String tagName, this.content)
+    : super(new Tag.sequence(tagName));
 
   /// Two sequences are equal if their tags and contents are equal.
   bool operator ==(other) {
     // Should be super != other; bug 2554
-    if (!(super == other) || other is! _SequenceNode) return false;
+    if (!(super == other) || other is! SequenceNode) return false;
     if (content.length != other.content.length) return false;
     for (var i = 0; i < content.length; i++) {
       if (content[i] != other.content[i]) return false;
@@ -92,20 +97,20 @@
 
   String toString() => '$tag [${content.map((e) => '$e').join(', ')}]';
 
-  int get hashCode => super.hashCode ^ _hashCode(content);
+  int get hashCode => super.hashCode ^ hashCodeFor(content);
 
-  visit(_Visitor v) => v.visitSequence(this);
+  visit(Visitor v) => v.visitSequence(this);
 }
 
 /// An alias node is a reference to an anchor.
-class _AliasNode extends _Node {
-  _AliasNode(String anchor) : super(new _Tag.scalar(_Tag.yaml("str")), anchor);
+class AliasNode extends Node {
+  AliasNode(String anchor) : super(new Tag.scalar(Tag.yaml("str")), anchor);
 
-  visit(_Visitor v) => v.visitAlias(this);
+  visit(Visitor v) => v.visitAlias(this);
 }
 
 /// A scalar node represents all YAML nodes that have a single value.
-class _ScalarNode extends _Node {
+class ScalarNode extends Node {
   /// The string value of the scalar node, if it was created by the parser.
   final String _content;
 
@@ -118,14 +123,14 @@
   /// be specified for a newly-parsed scalar that hasn't yet been composed.
   /// Value should be specified for a composed scalar, although `null` is a
   /// valid value.
-  _ScalarNode(String tagName, {String content, this.value})
+  ScalarNode(String tagName, {String content, this.value})
    : _content = content,
-     super(new _Tag.scalar(tagName));
+     super(new Tag.scalar(tagName));
 
   /// Two scalars are equal if their string representations are equal.
   bool operator ==(other) {
     // Should be super != other; bug 2554
-    if (!(super == other) || other is! _ScalarNode) return false;
+    if (!(super == other) || other is! ScalarNode) return false;
     return content == other.content;
   }
 
@@ -151,21 +156,21 @@
 
       var escapedValue = value.codeUnits.map((c) {
         switch (c) {
-        case _Parser.TAB: return "\\t";
-        case _Parser.LF: return "\\n";
-        case _Parser.CR: return "\\r";
-        case _Parser.DOUBLE_QUOTE: return '\\"';
-        case _Parser.NULL: return "\\0";
-        case _Parser.BELL: return "\\a";
-        case _Parser.BACKSPACE: return "\\b";
-        case _Parser.VERTICAL_TAB: return "\\v";
-        case _Parser.FORM_FEED: return "\\f";
-        case _Parser.ESCAPE: return "\\e";
-        case _Parser.BACKSLASH: return "\\\\";
-        case _Parser.NEL: return "\\N";
-        case _Parser.NBSP: return "\\_";
-        case _Parser.LINE_SEPARATOR: return "\\L";
-        case _Parser.PARAGRAPH_SEPARATOR: return "\\P";
+        case Parser.TAB: return "\\t";
+        case Parser.LF: return "\\n";
+        case Parser.CR: return "\\r";
+        case Parser.DOUBLE_QUOTE: return '\\"';
+        case Parser.NULL: return "\\0";
+        case Parser.BELL: return "\\a";
+        case Parser.BACKSPACE: return "\\b";
+        case Parser.VERTICAL_TAB: return "\\v";
+        case Parser.FORM_FEED: return "\\f";
+        case Parser.ESCAPE: return "\\e";
+        case Parser.BACKSLASH: return "\\\\";
+        case Parser.NEL: return "\\N";
+        case Parser.NBSP: return "\\_";
+        case Parser.LINE_SEPARATOR: return "\\L";
+        case Parser.PARAGRAPH_SEPARATOR: return "\\P";
         default:
           if (c < 0x20 || (c >= 0x7f && c < 0x100)) {
             return "\\x${zeroPad(c.toRadixString(16).toUpperCase(), 2)}";
@@ -196,21 +201,21 @@
 
   int get hashCode => super.hashCode ^ content.hashCode;
 
-  visit(_Visitor v) => v.visitScalar(this);
+  visit(Visitor v) => v.visitScalar(this);
 }
 
 /// A mapping node represents an unordered map of nodes to nodes.
-class _MappingNode extends _Node {
+class MappingNode extends Node {
   /// The node map.
-  Map<_Node, _Node> content;
+  Map<Node, Node> content;
 
-  _MappingNode(String tagName, this.content)
-    : super(new _Tag.mapping(tagName));
+  MappingNode(String tagName, this.content)
+    : super(new Tag.mapping(tagName));
 
   /// Two mappings are equal if their tags and contents are equal.
   bool operator ==(other) {
     // Should be super != other; bug 2554
-    if (!(super == other) || other is! _MappingNode) return false;
+    if (!(super == other) || other is! MappingNode) return false;
     if (content.length != other.content.length) return false;
     for (var key in content.keys) {
       if (!other.content.containsKey(key)) return false;
@@ -226,7 +231,7 @@
     return '$tag {$strContent}';
   }
 
-  int get hashCode => super.hashCode ^ _hashCode(content);
+  int get hashCode => super.hashCode ^ hashCodeFor(content);
 
-  visit(_Visitor v) => v.visitMapping(this);
+  visit(Visitor v) => v.visitMapping(this);
 }
diff --git a/pkg/yaml/lib/parser.dart b/pkg/yaml/lib/src/parser.dart
similarity index 85%
rename from pkg/yaml/lib/parser.dart
rename to pkg/yaml/lib/src/parser.dart
index b923fe3..2616038 100644
--- a/pkg/yaml/lib/parser.dart
+++ b/pkg/yaml/lib/src/parser.dart
@@ -2,7 +2,13 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-part of yaml;
+library parser;
+
+import 'dart:collection';
+
+import 'model.dart';
+import 'yaml_exception.dart';
+import 'yaml_map.dart';
 
 /// Translates a string of characters into a YAML serialization tree.
 ///
@@ -17,7 +23,7 @@
 /// named `nb-ns-plain-in-line`, and the method implementing it is named
 /// `nb_ns_plainInLine`. The exception to that rule is methods that just
 /// recognize character classes; these are named `is*`.
-class _Parser {
+class Parser {
   static const TAB = 0x9;
   static const LF = 0xA;
   static const CR = 0xD;
@@ -111,84 +117,84 @@
   static const CHOMPING_CLIP = 2;
 
   /// The source string being parsed.
-  final String s;
+  final String _s;
 
   /// The current position in the source string.
-  int pos = 0;
+  int _pos = 0;
 
   /// The length of the string being parsed.
-  final int len;
+  final int _len;
 
   /// The current (0-based) line in the source string.
-  int line = 0;
+  int _line = 0;
 
   /// The current (0-based) column in the source string.
-  int column = 0;
+  int _column = 0;
 
   /// Whether we're parsing a bare document (that is, one that doesn't begin
   /// with `---`). Bare documents don't allow `%` immediately following
   /// newlines.
-  bool inBareDocument = false;
+  bool _inBareDocument = false;
 
   /// The line number of the farthest position that has been parsed successfully
   /// before backtracking. Used for error reporting.
-  int farthestLine = 0;
+  int _farthestLine = 0;
 
   /// The column number of the farthest position that has been parsed
   /// successfully before backtracking. Used for error reporting.
-  int farthestColumn = 0;
+  int _farthestColumn = 0;
 
   /// The farthest position in the source string that has been parsed
   /// successfully before backtracking. Used for error reporting.
-  int farthestPos = 0;
+  int _farthestPos = 0;
 
   /// The name of the context of the farthest position that has been parsed
   /// successfully before backtracking. Used for error reporting.
-  String farthestContext = "document";
+  String _farthestContext = "document";
 
   /// A stack of the names of parse contexts. Used for error reporting.
-  List<String> contextStack;
+  List<String> _contextStack;
 
   /// Annotations attached to ranges of the source string that add extra
   /// information to any errors that occur in the annotated range.
-  _RangeMap<String> errorAnnotations;
+  _RangeMap<String> _errorAnnotations;
 
   /// The buffer containing the string currently being captured.
-  StringBuffer capturedString;
+  StringBuffer _capturedString;
 
   /// The beginning of the current section of the captured string.
-  int captureStart;
+  int _captureStart;
 
   /// Whether the current string capture is being overridden.
-  bool capturingAs = false;
+  bool _capturingAs = false;
 
-  _Parser(String s)
-    : this.s = s,
-      len = s.length,
-      contextStack = <String>["document"],
-      errorAnnotations = new _RangeMap();
+  Parser(String s)
+    : this._s = s,
+      _len = s.length,
+      _contextStack = <String>["document"],
+      _errorAnnotations = new _RangeMap();
 
   /// Return the character at the current position, then move that position
   /// forward one character. Also updates the current line and column numbers.
   int next() {
-    if (pos == len) return -1;
-    var char = s.codeUnitAt(pos++);
+    if (_pos == _len) return -1;
+    var char = _s.codeUnitAt(_pos++);
     if (isBreak(char)) {
-      line++;
-      column = 0;
+      _line++;
+      _column = 0;
     } else {
-      column++;
+      _column++;
     }
 
-    if (farthestLine < line) {
-      farthestLine = line;
-      farthestColumn = column;
-      farthestContext = contextStack.last;
-    } else if (farthestLine == line && farthestColumn < column) {
-      farthestColumn = column;
-      farthestContext = contextStack.last;
+    if (_farthestLine < _line) {
+      _farthestLine = _line;
+      _farthestColumn = _column;
+      _farthestContext = _contextStack.last;
+    } else if (_farthestLine == _line && _farthestColumn < _column) {
+      _farthestColumn = _column;
+      _farthestContext = _contextStack.last;
     }
-    farthestPos = pos;
+    _farthestPos = _pos;
 
     return char;
   }
@@ -199,8 +205,8 @@
   /// Returns -1 if this would return a character after the end or before the
   /// beginning of the input string.
   int peek([int i = 0]) {
-    var peekPos = pos + i;
-    return (peekPos >= len || peekPos < 0) ? -1 : s.codeUnitAt(peekPos);
+    var peekPos = _pos + i;
+    return (peekPos >= _len || peekPos < 0) ? -1 : _s.codeUnitAt(peekPos);
   }
 
   /// The truthiness operator. Returns `false` if [obj] is `null` or `false`,
@@ -243,11 +249,11 @@
   /// Conceptually, repeats a production any number of times.
   List zeroOrMore(consumer()) {
     var out = [];
-    var oldPos = pos;
+    var oldPos = _pos;
     while (true) {
       var el = consumer();
-      if (!truth(el) || oldPos == pos) return out;
-      oldPos = pos;
+      if (!truth(el) || oldPos == _pos) return out;
+      oldPos = _pos;
       out.add(el);
     }
     return null; // Unreachable.
@@ -270,20 +276,20 @@
   /// Calls [consumer] and returns its result, but rolls back the parser state
   /// if [consumer] returns a falsey value.
   transaction(consumer()) {
-    var oldPos = pos;
-    var oldLine = line;
-    var oldColumn = column;
-    var oldCaptureStart = captureStart;
-    String capturedSoFar = capturedString == null ? null :
-      capturedString.toString();
+    var oldPos = _pos;
+    var oldLine = _line;
+    var oldColumn = _column;
+    var oldCaptureStart = _captureStart;
+    String capturedSoFar = _capturedString == null ? null :
+      _capturedString.toString();
     var res = consumer();
     if (truth(res)) return res;
 
-    pos = oldPos;
-    line = oldLine;
-    column = oldColumn;
-    captureStart = oldCaptureStart;
-    capturedString = capturedSoFar == null ? null :
+    _pos = oldPos;
+    _line = oldLine;
+    _column = oldColumn;
+    _captureStart = oldCaptureStart;
+    _capturedString = capturedSoFar == null ? null :
       new StringBuffer(capturedSoFar);
     return res;
   }
@@ -316,21 +322,21 @@
   /// [consumer] in `transaction`.
   String captureString(consumer()) {
     // captureString calls may not be nested
-    assert(capturedString == null);
+    assert(_capturedString == null);
 
-    captureStart = pos;
-    capturedString = new StringBuffer();
+    _captureStart = _pos;
+    _capturedString = new StringBuffer();
     var res = transaction(consumer);
     if (!truth(res)) {
-      captureStart = null;
-      capturedString = null;
+      _captureStart = null;
+      _capturedString = null;
       return null;
     }
 
     flushCapture();
-    var result = capturedString.toString();
-    captureStart = null;
-    capturedString = null;
+    var result = _capturedString.toString();
+    _captureStart = null;
+    _capturedString = null;
     return result;
   }
 
@@ -338,27 +344,27 @@
       captureAndTransform(consumer, (_) => replacement);
 
   captureAndTransform(consumer(), String transformation(String captured)) {
-    if (capturedString == null) return consumer();
-    if (capturingAs) return consumer();
+    if (_capturedString == null) return consumer();
+    if (_capturingAs) return consumer();
 
     flushCapture();
-    capturingAs = true;
+    _capturingAs = true;
     var res = consumer();
-    capturingAs = false;
+    _capturingAs = false;
     if (!truth(res)) return res;
 
-    capturedString.write(transformation(s.substring(captureStart, pos)));
-    captureStart = pos;
+    _capturedString.write(transformation(_s.substring(_captureStart, _pos)));
+    _captureStart = _pos;
     return res;
   }
 
   void flushCapture() {
-    capturedString.write(s.substring(captureStart, pos));
-    captureStart = pos;
+    _capturedString.write(_s.substring(_captureStart, _pos));
+    _captureStart = _pos;
   }
 
   /// Adds a tag and an anchor to [node], if they're defined.
-  _Node addProps(_Node node, _Pair<_Tag, String> props) {
+  Node addProps(Node node, _Pair<Tag, String> props) {
     if (props == null || node == null) return node;
     if (truth(props.first)) node.tag = props.first;
     if (truth(props.last)) node.anchor = props.last;
@@ -366,19 +372,19 @@
   }
 
   /// Creates a MappingNode from [pairs].
-  _MappingNode map(List<_Pair<_Node, _Node>> pairs) {
-    var content = new Map<_Node, _Node>();
+  MappingNode map(List<_Pair<Node, Node>> pairs) {
+    var content = new Map<Node, Node>();
     pairs.forEach((pair) => content[pair.first] = pair.last);
-    return new _MappingNode("?", content);
+    return new MappingNode("?", content);
   }
 
   /// Runs [fn] in a context named [name]. Used for error reporting.
   context(String name, fn()) {
     try {
-      contextStack.add(name);
+      _contextStack.add(name);
       return fn();
     } finally {
-      var popped = contextStack.removeLast();
+      var popped = _contextStack.removeLast();
       assert(popped == name);
     }
   }
@@ -387,21 +393,21 @@
   /// current position and the position of the cursor after running [fn]. The
   /// cursor is reset after [fn] is run.
   annotateError(String message, fn()) {
-    var start = pos;
+    var start = _pos;
     var end;
     transaction(() {
       fn();
-      end = pos;
+      end = _pos;
       return false;
     });
-    errorAnnotations[new _Range(start, end)] = message;
+    _errorAnnotations[new _Range(start, end)] = message;
   }
 
   /// Throws an error with additional context information.
   error(String message) {
     // Line and column should be one-based.
-    throw new SyntaxError(line + 1, column + 1,
-        "$message (in $farthestContext)");
+    throw new SyntaxError(_line + 1, _column + 1,
+        "$message (in $_farthestContext)");
   }
 
   /// If [result] is falsey, throws an error saying that [expected] was
@@ -411,13 +417,13 @@
     error("expected $expected");
   }
 
-  /// Throws an error saying that the parse failed. Uses [farthestLine],
-  /// [farthestColumn], and [farthestContext] to provide additional information.
+  /// Throws an error saying that the parse failed. Uses [_farthestLine],
+  /// [_farthestColumn], and [_farthestContext] to provide additional information.
   parseFailed() {
-    var message = "invalid YAML in $farthestContext";
-    var extraError = errorAnnotations[farthestPos];
+    var message = "invalid YAML in $_farthestContext";
+    var extraError = _errorAnnotations[_farthestPos];
     if (extraError != null) message = "$message ($extraError)";
-    throw new SyntaxError(farthestLine + 1, farthestColumn + 1, message);
+    throw new SyntaxError(_farthestLine + 1, _farthestColumn + 1, message);
   }
 
   /// Returns the number of spaces after the current position.
@@ -439,7 +445,7 @@
         spaces = captureString(() => zeroOrMore(() => consumeChar(SP))).length;
         if (spaces > maxSpaces) {
           maxSpaces = spaces;
-          maxSpacesLine = line;
+          maxSpacesLine = _line;
         }
       } while (b_break());
       return false;
@@ -462,10 +468,10 @@
   }
 
   /// Returns whether the current position is at the beginning of a line.
-  bool get atStartOfLine => column == 0;
+  bool get atStartOfLine => _column == 0;
 
   /// Returns whether the current position is at the end of the input.
-  bool get atEndOfFile => pos == len;
+  bool get atEndOfFile => _pos == _len;
 
   /// Given an indicator character, returns the type of that indicator (or null
   /// if the indicator isn't found.
@@ -796,7 +802,7 @@
   bool l_directive() => false; // TODO(nweiz): implement
 
   // 96
-  _Pair<_Tag, String> c_ns_properties(int indent, int ctx) {
+  _Pair<Tag, String> c_ns_properties(int indent, int ctx) {
     var tag, anchor;
     tag = c_ns_tagProperty();
     if (truth(tag)) {
@@ -804,7 +810,7 @@
         if (!truth(s_separate(indent, ctx))) return null;
         return c_ns_anchorProperty();
       });
-      return new _Pair<_Tag, String>(tag, anchor);
+      return new _Pair<Tag, String>(tag, anchor);
     }
 
     anchor = c_ns_anchorProperty();
@@ -813,14 +819,14 @@
         if (!truth(s_separate(indent, ctx))) return null;
         return c_ns_tagProperty();
       });
-      return new _Pair<_Tag, String>(tag, anchor);
+      return new _Pair<Tag, String>(tag, anchor);
     }
 
     return null;
   }
 
   // 97
-  _Tag c_ns_tagProperty() => null; // TODO(nweiz): implement
+  Tag c_ns_tagProperty() => null; // TODO(nweiz): implement
 
   // 101
   String c_ns_anchorProperty() => null; // TODO(nweiz): implement
@@ -833,17 +839,17 @@
     captureString(() => oneOrMore(() => consume(isAnchorChar)));
 
   // 104
-  _Node c_ns_aliasNode() {
+  Node c_ns_aliasNode() {
     if (!truth(c_indicator(C_ALIAS))) return null;
     var name = expect(ns_anchorName(), 'anchor name');
-    return new _AliasNode(name);
+    return new AliasNode(name);
   }
 
   // 105
-  _ScalarNode e_scalar() => new _ScalarNode("?", content: "");
+  ScalarNode e_scalar() => new ScalarNode("?", content: "");
 
   // 106
-  _ScalarNode e_node() => e_scalar();
+  ScalarNode e_node() => e_scalar();
 
   // 107
   bool nb_doubleChar() => or([
@@ -855,12 +861,12 @@
   bool ns_doubleChar() => !isSpace(peek()) && truth(nb_doubleChar());
 
   // 109
-  _Node c_doubleQuoted(int indent, int ctx) => context('string', () {
+  Node c_doubleQuoted(int indent, int ctx) => context('string', () {
     return transaction(() {
       if (!truth(c_indicator(C_DOUBLE_QUOTE))) return null;
       var contents = nb_doubleText(indent, ctx);
       if (!truth(c_indicator(C_DOUBLE_QUOTE))) return null;
-      return new _ScalarNode("!", content: contents);
+      return new ScalarNode("!", content: contents);
     });
   });
 
@@ -943,12 +949,12 @@
   bool ns_singleChar() => !isSpace(peek()) && truth(nb_singleChar());
 
   // 120
-  _Node c_singleQuoted(int indent, int ctx) => context('string', () {
+  Node c_singleQuoted(int indent, int ctx) => context('string', () {
     return transaction(() {
       if (!truth(c_indicator(C_SINGLE_QUOTE))) return null;
       var contents = nb_singleText(indent, ctx);
       if (!truth(c_indicator(C_SINGLE_QUOTE))) return null;
-      return new _ScalarNode("!", content: contents);
+      return new ScalarNode("!", content: contents);
     });
   });
 
@@ -1110,18 +1116,18 @@
   }
 
   // 137
-  _SequenceNode c_flowSequence(int indent, int ctx) => transaction(() {
+  SequenceNode c_flowSequence(int indent, int ctx) => transaction(() {
     if (!truth(c_indicator(C_SEQUENCE_START))) return null;
     zeroOrOne(() => s_separate(indent, ctx));
     var content = zeroOrOne(() => ns_s_flowSeqEntries(indent, inFlow(ctx)));
     if (!truth(c_indicator(C_SEQUENCE_END))) return null;
-    return new _SequenceNode("?", new List<_Node>.from(content));
+    return new SequenceNode("?", new List<Node>.from(content));
   });
 
   // 138
-  Iterable<_Node> ns_s_flowSeqEntries(int indent, int ctx) {
+  Iterable<Node> ns_s_flowSeqEntries(int indent, int ctx) {
     var first = ns_flowSeqEntry(indent, ctx);
-    if (!truth(first)) return new Queue<_Node>();
+    if (!truth(first)) return new Queue<Node>();
     zeroOrOne(() => s_separate(indent, ctx));
 
     var rest;
@@ -1130,25 +1136,25 @@
       rest = zeroOrOne(() => ns_s_flowSeqEntries(indent, ctx));
     }
 
-    if (rest == null) rest = new Queue<_Node>();
+    if (rest == null) rest = new Queue<Node>();
     rest.addFirst(first);
 
     return rest;
   }
 
   // 139
-  _Node ns_flowSeqEntry(int indent, int ctx) => or([
+  Node ns_flowSeqEntry(int indent, int ctx) => or([
     () => ns_flowPair(indent, ctx),
     () => ns_flowNode(indent, ctx)
   ]);
 
   // 140
-  _Node c_flowMapping(int indent, int ctx) {
+  Node c_flowMapping(int indent, int ctx) {
     if (!truth(c_indicator(C_MAPPING_START))) return null;
     zeroOrOne(() => s_separate(indent, ctx));
     var content = zeroOrOne(() => ns_s_flowMapEntries(indent, inFlow(ctx)));
     if (!truth(c_indicator(C_MAPPING_END))) return null;
-    return new _MappingNode("?", content);
+    return new MappingNode("?", content);
   }
 
   // 141
@@ -1175,7 +1181,7 @@
   }
 
   // 142
-  _Pair<_Node, _Node> ns_flowMapEntry(int indent, int ctx) => or([
+  _Pair<Node, Node> ns_flowMapEntry(int indent, int ctx) => or([
     () => transaction(() {
       if (!truth(c_indicator(C_MAPPING_KEY))) return false;
       if (!truth(s_separate(indent, ctx))) return false;
@@ -1185,20 +1191,20 @@
   ]);
 
   // 143
-  _Pair<_Node, _Node> ns_flowMapExplicitEntry(int indent, int ctx) => or([
+  _Pair<Node, Node> ns_flowMapExplicitEntry(int indent, int ctx) => or([
     () => ns_flowMapImplicitEntry(indent, ctx),
-    () => new _Pair<_Node, _Node>(e_node(), e_node())
+    () => new _Pair<Node, Node>(e_node(), e_node())
   ]);
 
   // 144
-  _Pair<_Node, _Node> ns_flowMapImplicitEntry(int indent, int ctx) => or([
+  _Pair<Node, Node> ns_flowMapImplicitEntry(int indent, int ctx) => or([
     () => ns_flowMapYamlKeyEntry(indent, ctx),
     () => c_ns_flowMapEmptyKeyEntry(indent, ctx),
     () => c_ns_flowMapJsonKeyEntry(indent, ctx)
   ]);
 
   // 145
-  _Pair<_Node, _Node> ns_flowMapYamlKeyEntry(int indent, int ctx) {
+  _Pair<Node, Node> ns_flowMapYamlKeyEntry(int indent, int ctx) {
     var key = ns_flowYamlNode(indent, ctx);
     if (!truth(key)) return null;
     var value = or([
@@ -1208,18 +1214,18 @@
       }),
       e_node
     ]);
-    return new _Pair<_Node, _Node>(key, value);
+    return new _Pair<Node, Node>(key, value);
   }
 
   // 146
-  _Pair<_Node, _Node> c_ns_flowMapEmptyKeyEntry(int indent, int ctx) {
+  _Pair<Node, Node> c_ns_flowMapEmptyKeyEntry(int indent, int ctx) {
     var value = c_ns_flowMapSeparateValue(indent, ctx);
     if (!truth(value)) return null;
-    return new _Pair<_Node, _Node>(e_node(), value);
+    return new _Pair<Node, Node>(e_node(), value);
   }
 
   // 147
-  _Node c_ns_flowMapSeparateValue(int indent, int ctx) => transaction(() {
+  Node c_ns_flowMapSeparateValue(int indent, int ctx) => transaction(() {
     if (!truth(c_indicator(C_MAPPING_VALUE))) return null;
     if (isPlainSafe(ctx, peek())) return null;
 
@@ -1233,7 +1239,7 @@
   });
 
   // 148
-  _Pair<_Node, _Node> c_ns_flowMapJsonKeyEntry(int indent, int ctx) {
+  _Pair<Node, Node> c_ns_flowMapJsonKeyEntry(int indent, int ctx) {
     var key = c_flowJsonNode(indent, ctx);
     if (!truth(key)) return null;
     var value = or([
@@ -1243,11 +1249,11 @@
       }),
       e_node
     ]);
-    return new _Pair<_Node, _Node>(key, value);
+    return new _Pair<Node, Node>(key, value);
   }
 
   // 149
-  _Node c_ns_flowMapAdjacentValue(int indent, int ctx) {
+  Node c_ns_flowMapAdjacentValue(int indent, int ctx) {
     if (!truth(c_indicator(C_MAPPING_VALUE))) return null;
     return or([
       () => transaction(() {
@@ -1259,7 +1265,7 @@
   }
 
   // 150
-  _Node ns_flowPair(int indent, int ctx) {
+  Node ns_flowPair(int indent, int ctx) {
     var pair = or([
       () => transaction(() {
         if (!truth(c_indicator(C_MAPPING_KEY))) return null;
@@ -1274,34 +1280,34 @@
   }
 
   // 151
-  _Pair<_Node, _Node> ns_flowPairEntry(int indent, int ctx) => or([
+  _Pair<Node, Node> ns_flowPairEntry(int indent, int ctx) => or([
     () => ns_flowPairYamlKeyEntry(indent, ctx),
     () => c_ns_flowMapEmptyKeyEntry(indent, ctx),
     () => c_ns_flowPairJsonKeyEntry(indent, ctx)
   ]);
 
   // 152
-  _Pair<_Node, _Node> ns_flowPairYamlKeyEntry(int indent, int ctx) =>
+  _Pair<Node, Node> ns_flowPairYamlKeyEntry(int indent, int ctx) =>
     transaction(() {
       var key = ns_s_implicitYamlKey(FLOW_KEY);
       if (!truth(key)) return null;
       var value = c_ns_flowMapSeparateValue(indent, ctx);
       if (!truth(value)) return null;
-      return new _Pair<_Node, _Node>(key, value);
+      return new _Pair<Node, Node>(key, value);
     });
 
   // 153
-  _Pair<_Node, _Node> c_ns_flowPairJsonKeyEntry(int indent, int ctx) =>
+  _Pair<Node, Node> c_ns_flowPairJsonKeyEntry(int indent, int ctx) =>
     transaction(() {
       var key = c_s_implicitJsonKey(FLOW_KEY);
       if (!truth(key)) return null;
       var value = c_ns_flowMapAdjacentValue(indent, ctx);
       if (!truth(value)) return null;
-      return new _Pair<_Node, _Node>(key, value);
+      return new _Pair<Node, Node>(key, value);
     });
 
   // 154
-  _Node ns_s_implicitYamlKey(int ctx) => transaction(() {
+  Node ns_s_implicitYamlKey(int ctx) => transaction(() {
     // TODO(nweiz): this is supposed to be limited to 1024 characters.
 
     // The indentation parameter is "null" since it's unused in this path
@@ -1312,7 +1318,7 @@
   });
 
   // 155
-  _Node c_s_implicitJsonKey(int ctx) => transaction(() {
+  Node c_s_implicitJsonKey(int ctx) => transaction(() {
     // TODO(nweiz): this is supposed to be limited to 1024 characters.
 
     // The indentation parameter is "null" since it's unused in this path
@@ -1323,14 +1329,14 @@
   });
 
   // 156
-  _Node ns_flowYamlContent(int indent, int ctx) {
+  Node ns_flowYamlContent(int indent, int ctx) {
     var str = ns_plain(indent, ctx);
     if (!truth(str)) return null;
-    return new _ScalarNode("?", content: str);
+    return new ScalarNode("?", content: str);
   }
 
   // 157
-  _Node c_flowJsonContent(int indent, int ctx) => or([
+  Node c_flowJsonContent(int indent, int ctx) => or([
     () => c_flowSequence(indent, ctx),
     () => c_flowMapping(indent, ctx),
     () => c_singleQuoted(indent, ctx),
@@ -1338,13 +1344,13 @@
   ]);
 
   // 158
-  _Node ns_flowContent(int indent, int ctx) => or([
+  Node ns_flowContent(int indent, int ctx) => or([
     () => ns_flowYamlContent(indent, ctx),
     () => c_flowJsonContent(indent, ctx)
   ]);
 
   // 159
-  _Node ns_flowYamlNode(int indent, int ctx) => or([
+  Node ns_flowYamlNode(int indent, int ctx) => or([
     c_ns_aliasNode,
     () => ns_flowYamlContent(indent, ctx),
     () {
@@ -1362,7 +1368,7 @@
   ]);
 
   // 160
-  _Node c_flowJsonNode(int indent, int ctx) => transaction(() {
+  Node c_flowJsonNode(int indent, int ctx) => transaction(() {
     var props;
     zeroOrOne(() => transaction(() {
         props = c_ns_properties(indent, ctx);
@@ -1374,7 +1380,7 @@
   });
 
   // 161
-  _Node ns_flowNode(int indent, int ctx) => or([
+  Node ns_flowNode(int indent, int ctx) => or([
     c_ns_aliasNode,
     () => ns_flowContent(indent, ctx),
     () => transaction(() {
@@ -1471,7 +1477,7 @@
   });
 
   // 170
-  _Node c_l_literal(int indent) => transaction(() {
+  Node c_l_literal(int indent) => transaction(() {
     if (!truth(c_indicator(C_LITERAL))) return null;
     var header = c_b_blockHeader();
     if (!truth(header)) return null;
@@ -1480,7 +1486,7 @@
     var content = l_literalContent(indent + additionalIndent, header.chomping);
     if (!truth(content)) return null;
 
-    return new _ScalarNode("!", content: content);
+    return new ScalarNode("!", content: content);
   });
 
   // 171
@@ -1508,7 +1514,7 @@
   });
 
   // 174
-  _Node c_l_folded(int indent) => transaction(() {
+  Node c_l_folded(int indent) => transaction(() {
     if (!truth(c_indicator(C_FOLDED))) return null;
     var header = c_b_blockHeader();
     if (!truth(header)) return null;
@@ -1517,7 +1523,7 @@
     var content = l_foldedContent(indent + additionalIndent, header.chomping);
     if (!truth(content)) return null;
 
-    return new _ScalarNode("!", content: content);
+    return new ScalarNode("!", content: content);
   });
 
   // 175
@@ -1593,7 +1599,7 @@
   });
 
   // 183
-  _SequenceNode l_blockSequence(int indent) => context('sequence', () {
+  SequenceNode l_blockSequence(int indent) => context('sequence', () {
     var additionalIndent = countIndentation() - indent;
     if (additionalIndent <= 0) return null;
 
@@ -1603,11 +1609,11 @@
     }));
     if (!truth(content)) return null;
 
-    return new _SequenceNode("?", content);
+    return new SequenceNode("?", content);
   });
 
   // 184
-  _Node c_l_blockSeqEntry(int indent) => transaction(() {
+  Node c_l_blockSeqEntry(int indent) => transaction(() {
     if (!truth(c_indicator(C_SEQUENCE_ENTRY))) return null;
     if (isNonSpace(peek())) return null;
 
@@ -1615,7 +1621,7 @@
   });
 
   // 185
-  _Node s_l_blockIndented(int indent, int ctx) {
+  Node s_l_blockIndented(int indent, int ctx) {
     var additionalIndent = countIndentation();
     return or([
       () => transaction(() {
@@ -1629,7 +1635,7 @@
   }
 
   // 186
-  _Node ns_l_compactSequence(int indent) => context('sequence', () {
+  Node ns_l_compactSequence(int indent) => context('sequence', () {
     var first = c_l_blockSeqEntry(indent);
     if (!truth(first)) return null;
 
@@ -1639,11 +1645,11 @@
       }));
     content.insert(0, first);
 
-    return new _SequenceNode("?", content);
+    return new SequenceNode("?", content);
   });
 
   // 187
-  _Node l_blockMapping(int indent) => context('mapping', () {
+  Node l_blockMapping(int indent) => context('mapping', () {
     var additionalIndent = countIndentation() - indent;
     if (additionalIndent <= 0) return null;
 
@@ -1657,13 +1663,13 @@
   });
 
   // 188
-  _Pair<_Node, _Node> ns_l_blockMapEntry(int indent) => or([
+  _Pair<Node, Node> ns_l_blockMapEntry(int indent) => or([
     () => c_l_blockMapExplicitEntry(indent),
     () => ns_l_blockMapImplicitEntry(indent)
   ]);
 
   // 189
-  _Pair<_Node, _Node> c_l_blockMapExplicitEntry(int indent) {
+  _Pair<Node, Node> c_l_blockMapExplicitEntry(int indent) {
     var key = c_l_blockMapExplicitKey(indent);
     if (!truth(key)) return null;
 
@@ -1672,37 +1678,37 @@
       e_node
     ]);
 
-    return new _Pair<_Node, _Node>(key, value);
+    return new _Pair<Node, Node>(key, value);
   }
 
   // 190
-  _Node c_l_blockMapExplicitKey(int indent) => transaction(() {
+  Node c_l_blockMapExplicitKey(int indent) => transaction(() {
     if (!truth(c_indicator(C_MAPPING_KEY))) return null;
     return s_l_blockIndented(indent, BLOCK_OUT);
   });
 
   // 191
-  _Node l_blockMapExplicitValue(int indent) => transaction(() {
+  Node l_blockMapExplicitValue(int indent) => transaction(() {
     if (!truth(s_indent(indent))) return null;
     if (!truth(c_indicator(C_MAPPING_VALUE))) return null;
     return s_l_blockIndented(indent, BLOCK_OUT);
   });
 
   // 192
-  _Pair<_Node, _Node> ns_l_blockMapImplicitEntry(int indent) => transaction(() {
+  _Pair<Node, Node> ns_l_blockMapImplicitEntry(int indent) => transaction(() {
     var key = or([ns_s_blockMapImplicitKey, e_node]);
     var value = c_l_blockMapImplicitValue(indent);
-    return truth(value) ? new _Pair<_Node, _Node>(key, value) : null;
+    return truth(value) ? new _Pair<Node, Node>(key, value) : null;
   });
 
   // 193
-  _Node ns_s_blockMapImplicitKey() => context('mapping key', () => or([
+  Node ns_s_blockMapImplicitKey() => context('mapping key', () => or([
     () => c_s_implicitJsonKey(BLOCK_KEY),
     () => ns_s_implicitYamlKey(BLOCK_KEY)
   ]));
 
   // 194
-  _Node c_l_blockMapImplicitValue(int indent) => context('mapping value', () =>
+  Node c_l_blockMapImplicitValue(int indent) => context('mapping value', () =>
     transaction(() {
       if (!truth(c_indicator(C_MAPPING_VALUE))) return null;
       return or([
@@ -1712,7 +1718,7 @@
     }));
 
   // 195
-  _Node ns_l_compactMapping(int indent) => context('mapping', () {
+  Node ns_l_compactMapping(int indent) => context('mapping', () {
     var first = ns_l_blockMapEntry(indent);
     if (!truth(first)) return null;
 
@@ -1726,13 +1732,13 @@
   });
 
   // 196
-  _Node s_l_blockNode(int indent, int ctx) => or([
+  Node s_l_blockNode(int indent, int ctx) => or([
     () => s_l_blockInBlock(indent, ctx),
     () => s_l_flowInBlock(indent)
   ]);
 
   // 197
-  _Node s_l_flowInBlock(int indent) => transaction(() {
+  Node s_l_flowInBlock(int indent) => transaction(() {
     if (!truth(s_separate(indent + 1, FLOW_OUT))) return null;
     var node = ns_flowNode(indent + 1, FLOW_OUT);
     if (!truth(node)) return null;
@@ -1741,13 +1747,13 @@
   });
 
   // 198
-  _Node s_l_blockInBlock(int indent, int ctx) => or([
+  Node s_l_blockInBlock(int indent, int ctx) => or([
     () => s_l_blockScalar(indent, ctx),
     () => s_l_blockCollection(indent, ctx)
   ]);
 
   // 199
-  _Node s_l_blockScalar(int indent, int ctx) => transaction(() {
+  Node s_l_blockScalar(int indent, int ctx) => transaction(() {
     if (!truth(s_separate(indent + 1, ctx))) return null;
     var props = transaction(() {
       var innerProps = c_ns_properties(indent + 1, ctx);
@@ -1762,7 +1768,7 @@
   });
 
   // 200
-  _Node s_l_blockCollection(int indent, int ctx) => transaction(() {
+  Node s_l_blockCollection(int indent, int ctx) => transaction(() {
     var props = transaction(() {
       if (!truth(s_separate(indent + 1, ctx))) return null;
       return c_ns_properties(indent + 1, ctx);
@@ -1796,7 +1802,7 @@
 
   // 206
   bool c_forbidden() {
-    if (!inBareDocument || !atStartOfLine) return false;
+    if (!_inBareDocument || !atStartOfLine) return false;
     var forbidden = false;
     transaction(() {
       if (!truth(or([c_directivesEnd, c_documentEnd]))) return;
@@ -1808,17 +1814,17 @@
   }
 
   // 207
-  _Node l_bareDocument() {
+  Node l_bareDocument() {
     try {
-      inBareDocument = true;
+      _inBareDocument = true;
       return s_l_blockNode(-1, BLOCK_IN);
     } finally {
-      inBareDocument = false;
+      _inBareDocument = false;
     }
   }
 
   // 208
-  _Node l_explicitDocument() {
+  Node l_explicitDocument() {
     if (!truth(c_directivesEnd())) return null;
     var doc = l_bareDocument();
     if (truth(doc)) return doc;
@@ -1829,7 +1835,7 @@
   }
 
   // 209
-  _Node l_directiveDocument() {
+  Node l_directiveDocument() {
     if (!truth(oneOrMore(l_directive))) return null;
     var doc = l_explicitDocument();
     if (doc != null) return doc;
@@ -1838,11 +1844,11 @@
   }
 
   // 210
-  _Node l_anyDocument() =>
+  Node l_anyDocument() =>
     or([l_directiveDocument, l_explicitDocument, l_bareDocument]);
 
   // 211
-  List<_Node> l_yamlStream() {
+  List<Node> l_yamlStream() {
     var docs = [];
     zeroOrMore(l_documentPrefix);
     var first = zeroOrOne(l_anyDocument);
@@ -1868,12 +1874,13 @@
 }
 
 class SyntaxError extends YamlException {
-  final int line;
-  final int column;
+  final int _line;
+  final int _column;
 
-  SyntaxError(this.line, this.column, String msg) : super(msg);
+  SyntaxError(this._line, this._column, String msg) : super(msg);
 
-  String toString() => "Syntax error on line $line, column $column: $msg";
+  String toString() => "Syntax error on line $_line, column $_column: "
+      "${super.toString()}";
 }
 
 /// A pair of values.
@@ -1916,18 +1923,17 @@
 /// expensive.
 class _RangeMap<E> {
   /// The ranges and their associated elements.
-  final List<_Pair<_Range, E>> contents;
+  final List<_Pair<_Range, E>> _contents = <_Pair<_Range, E>>[];
 
-  _RangeMap() : this.contents = <_Pair<_Range, E>>[];
+  _RangeMap();
 
   /// Returns the value associated with the range in which [pos] lies, or null
   /// if there is no such range. If there's more than one such range, the most
   /// recently set one is used.
   E operator[](int pos) {
     // Iterate backwards through contents so the more recent range takes
-    // precedence. TODO(nweiz): clean this up when issue 2804 is fixed.
-    for (var i = contents.length - 1; i >= 0; i--) {
-      var pair = contents[i];
+    // precedence.
+    for (var pair in _contents.reversed) {
       if (pair.first.contains(pos)) return pair.last;
     }
     return null;
@@ -1935,5 +1941,5 @@
 
   /// Associates [value] with [range].
   operator[]=(_Range range, E value) =>
-    contents.add(new _Pair<_Range, E>(range, value));
+    _contents.add(new _Pair<_Range, E>(range, value));
 }
diff --git a/pkg/yaml/lib/src/utils.dart b/pkg/yaml/lib/src/utils.dart
new file mode 100644
index 0000000..a87555d
--- /dev/null
+++ b/pkg/yaml/lib/src/utils.dart
@@ -0,0 +1,39 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library utils;
+
+/// Returns the hash code for [obj]. This includes null, true, false, maps, and
+/// lists. Also handles self-referential structures.
+int hashCodeFor(obj, [List parents]) {
+  if (parents == null) {
+    parents = [];
+  } else if (parents.any((p) => identical(p, obj))) {
+    return -1;
+  }
+
+  parents.add(obj);
+  try {
+    if (obj == null) return 0;
+    if (obj == true) return 1;
+    if (obj == false) return 2;
+    if (obj is Map) {
+      return hashCodeFor(obj.keys, parents) ^
+        hashCodeFor(obj.values, parents);
+    }
+    if (obj is Iterable) {
+      // This is probably a really bad hash function, but presumably we'll get
+      // this in the standard library before it actually matters.
+      int hash = 0;
+      for (var e in obj) {
+        hash ^= hashCodeFor(e, parents);
+      }
+      return hash;
+    }
+    return obj.hashCode;
+  } finally {
+    parents.removeLast();
+  }
+}
+
diff --git a/pkg/yaml/lib/visitor.dart b/pkg/yaml/lib/src/visitor.dart
similarity index 74%
rename from pkg/yaml/lib/visitor.dart
rename to pkg/yaml/lib/src/visitor.dart
index 42dbb22..4a9c54f 100644
--- a/pkg/yaml/lib/visitor.dart
+++ b/pkg/yaml/lib/src/visitor.dart
@@ -2,22 +2,25 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-part of yaml;
+library visitor;
+
+import 'model.dart';
+import 'yaml_map.dart';
 
 /// The visitor pattern for YAML documents.
-class _Visitor {
+class Visitor {
   /// Returns [alias].
-  visitAlias(_AliasNode alias) => alias;
+  visitAlias(AliasNode alias) => alias;
 
   /// Returns [scalar].
-  visitScalar(_ScalarNode scalar) => scalar;
+  visitScalar(ScalarNode scalar) => scalar;
 
   /// Visits each node in [seq] and returns a list of the results.
-  visitSequence(_SequenceNode seq)
+  visitSequence(SequenceNode seq)
       => seq.content.map((e) => e.visit(this)).toList();
 
   /// Visits each key and value in [map] and returns a map of the results.
-  visitMapping(_MappingNode map) {
+  visitMapping(MappingNode map) {
     var out = new YamlMap();
     for (var key in map.content.keys) {
       out[key.visit(this)] = map.content[key].visit(this);
diff --git a/pkg/yaml/lib/src/yaml_exception.dart b/pkg/yaml/lib/src/yaml_exception.dart
new file mode 100644
index 0000000..66697a1
--- /dev/null
+++ b/pkg/yaml/lib/src/yaml_exception.dart
@@ -0,0 +1,15 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library yaml_exception;
+
+/// An error thrown by the YAML processor.
+class YamlException implements Exception {
+  final String _msg;
+
+  YamlException(this._msg);
+
+  String toString() => _msg;
+}
+
diff --git a/pkg/yaml/lib/yaml_map.dart b/pkg/yaml/lib/src/yaml_map.dart
similarity index 70%
rename from pkg/yaml/lib/yaml_map.dart
rename to pkg/yaml/lib/src/yaml_map.dart
index cbf18e5..29fec75 100644
--- a/pkg/yaml/lib/yaml_map.dart
+++ b/pkg/yaml/lib/src/yaml_map.dart
@@ -2,7 +2,10 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-part of yaml;
+library yaml_map;
+
+import 'deep_equals.dart';
+import 'utils.dart';
 
 /// This class wraps behaves almost identically to the normal Dart Map
 /// implementation, with the following differences:
@@ -12,7 +15,7 @@
 ///     have the same contents.
 ///  *  It has a compatible [hashCode] method.
 class YamlMap implements Map {
-  Map _map;
+  final Map _map;
 
   YamlMap() : _map = new Map();
 
@@ -35,7 +38,7 @@
   bool get isEmpty => _map.isEmpty;
   String toString() => _map.toString();
 
-  int get hashCode => _hashCode(_map);
+  int get hashCode => hashCodeFor(_map);
 
   bool operator ==(other) {
     if (other is! YamlMap) return false;
@@ -61,11 +64,11 @@
 /// A class for wrapping normally-unhashable objects that are being used as keys
 /// in a YamlMap.
 class _WrappedHashKey {
-  var value;
+  final value;
 
   _WrappedHashKey(this.value);
 
-  int get hashCode => _hashCode(value);
+  int get hashCode => hashCodeFor(value);
 
   String toString() => value.toString();
 
@@ -75,36 +78,3 @@
     return deepEquals(this.value, other.value);
   }
 }
-
-/// Returns the hash code for [obj]. This includes null, true, false, maps, and
-/// lists. Also handles self-referential structures.
-int _hashCode(obj, [List parents]) {
-  if (parents == null) {
-    parents = [];
-  } else if (parents.any((p) => identical(p, obj))) {
-    return -1;
-  }
-
-  parents.add(obj);
-  try {
-    if (obj == null) return 0;
-    if (obj == true) return 1;
-    if (obj == false) return 2;
-    if (obj is Map) {
-      return _hashCode(obj.keys, parents) ^
-        _hashCode(obj.values, parents);
-    }
-    if (obj is Iterable) {
-      // This is probably a really bad hash function, but presumably we'll get
-      // this in the standard library before it actually matters.
-      int hash = 0;
-      for (var e in obj) {
-        hash ^= _hashCode(e, parents);
-      }
-      return hash;
-    }
-    return obj.hashCode;
-  } finally {
-    parents.removeLast();
-  }
-}
diff --git a/pkg/yaml/lib/yaml.dart b/pkg/yaml/lib/yaml.dart
index e905e76..94e3d42 100644
--- a/pkg/yaml/lib/yaml.dart
+++ b/pkg/yaml/lib/yaml.dart
@@ -24,17 +24,13 @@
 ///     }
 library yaml;
 
-import 'dart:math' as Math;
-import 'dart:collection' show Queue;
+import 'src/composer.dart';
+import 'src/constructor.dart';
+import 'src/parser.dart';
+import 'src/yaml_exception.dart';
 
-import 'deep_equals.dart';
-
-part 'yaml_map.dart';
-part 'model.dart';
-part 'parser.dart';
-part 'visitor.dart';
-part 'composer.dart';
-part 'constructor.dart';
+export 'src/yaml_exception.dart';
+export 'src/yaml_map.dart';
 
 /// Loads a single document from a YAML string. If the string contains more than
 /// one document, this throws an error.
@@ -42,8 +38,8 @@
 /// The return value is mostly normal Dart objects. However, since YAML mappings
 /// support some key types that the default Dart map implementation doesn't
 /// (null, NaN, booleans, lists, and maps), all maps in the returned document
-/// are YamlMaps. These have a few small behavioral differences from the default
-/// Map implementation; for details, see the YamlMap class.
+/// are [YamlMap]s. These have a few small behavioral differences from the
+/// default Map implementation; for details, see the [YamlMap] class.
 loadYaml(String yaml) {
   var stream = loadYamlStream(yaml);
   if (stream.length != 1) {
@@ -57,19 +53,10 @@
 /// The return value is mostly normal Dart objects. However, since YAML mappings
 /// support some key types that the default Dart map implementation doesn't
 /// (null, NaN, booleans, lists, and maps), all maps in the returned document
-/// are YamlMaps. These have a few small behavioral differences from the default
-/// Map implementation; for details, see the YamlMap class.
+/// are [YamlMap]s. These have a few small behavioral differences from the
+/// default Map implementation; for details, see the [YamlMap] class.
 List loadYamlStream(String yaml) {
-  return new _Parser(yaml).l_yamlStream()
-      .map((doc) => new _Constructor(new _Composer(doc).compose()).construct())
+  return new Parser(yaml).l_yamlStream()
+      .map((doc) => new Constructor(new Composer(doc).compose()).construct())
       .toList();
 }
-
-/// An error thrown by the YAML processor.
-class YamlException implements Exception {
-  String msg;
-
-  YamlException(this.msg);
-
-  String toString() => msg;
-}
diff --git a/pkg/yaml/test/yaml_test.dart b/pkg/yaml/test/yaml_test.dart
index 047c273..42cb613 100644
--- a/pkg/yaml/test/yaml_test.dart
+++ b/pkg/yaml/test/yaml_test.dart
@@ -8,7 +8,7 @@
 import "package:expect/expect.dart";
 import 'package:unittest/unittest.dart';
 import 'package:yaml/yaml.dart';
-import 'package:yaml/deep_equals.dart';
+import 'package:yaml/src/deep_equals.dart';
 // TODO(jmesserly): we should not be reaching outside the YAML package
 // The http package has a similar problem.
 import '../../../tests/utils/test_utils.dart';
diff --git a/runtime/bin/bin.gypi b/runtime/bin/bin.gypi
index c32c092..b910a10 100644
--- a/runtime/bin/bin.gypi
+++ b/runtime/bin/bin.gypi
@@ -378,6 +378,10 @@
         'vmstats.h',
         'vmstats_impl.cc',
         'vmstats_impl.h',
+        'vmstats_impl_android.cc',
+        'vmstats_impl_linux.cc',
+        'vmstats_impl_macos.cc',
+        'vmstats_impl_win.cc',
         '<(snapshot_cc_file)',
         '<(resources_cc_file)',
       ],
@@ -423,6 +427,10 @@
         'vmstats.h',
         'vmstats_impl.cc',
         'vmstats_impl.h',
+        'vmstats_impl_android.cc',
+        'vmstats_impl_linux.cc',
+        'vmstats_impl_macos.cc',
+        'vmstats_impl_win.cc',
         # Include generated source files.
         '<(builtin_cc_file)',
         '<(io_cc_file)',
diff --git a/runtime/bin/dbg_message.cc b/runtime/bin/dbg_message.cc
index a1ac5e5..4d9422d 100644
--- a/runtime/bin/dbg_message.cc
+++ b/runtime/bin/dbg_message.cc
@@ -210,8 +210,8 @@
 
 
 static void FormatValue(dart::TextBuffer* buf, Dart_Handle object) {
-  if (Dart_IsInteger(object)) {
-    buf->Printf("\"kind\":\"integer\",");
+  if (Dart_IsNumber(object)) {
+    buf->Printf("\"kind\":\"number\",");
   } else if (Dart_IsString(object)) {
     buf->Printf("\"kind\":\"string\",");
   } else if (Dart_IsBoolean(object)) {
@@ -223,6 +223,11 @@
     buf->Printf("\"kind\":\"list\",\"length\":%"Pd",", len);
   } else {
     buf->Printf("\"kind\":\"object\",");
+    intptr_t class_id = 0;
+    Dart_Handle res = Dart_GetObjClassId(object, &class_id);
+    if (!Dart_IsError(res)) {
+      buf->Printf("\"classId\":%"Pd",", class_id);
+    }
   }
   buf->Printf("\"text\":\"");
   const intptr_t max_chars = 250;
@@ -979,14 +984,18 @@
 }
 
 
-// TODO(hausner): Remove stack trace parameter once we remove the stack
-// trace from the paused event in the wire protocol.
-void DbgMsgQueue::SendBreakpointEvent(Dart_StackTrace trace) {
+void DbgMsgQueue::SendBreakpointEvent(const Dart_CodeLocation& location) {
   dart::TextBuffer msg(128);
   msg.Printf("{ \"event\": \"paused\", \"params\": { ");
   msg.Printf("\"reason\": \"breakpoint\", ");
   msg.Printf("\"isolateId\": %"Pd64"", isolate_id_);
-  FormatLocationFromTrace(&msg, trace, ", ");
+  if (!Dart_IsNull(location.script_url)) {
+    ASSERT(Dart_IsString(location.script_url));
+    msg.Printf(",\"location\": { \"url\":");
+    FormatEncodedString(&msg, location.script_url);
+    msg.Printf(",\"libraryId\":%d,", location.library_id);
+    msg.Printf("\"tokenOffset\":%d}", location.token_pos);
+  }
   msg.Printf("}}");
   DebuggerConnectionHandler::BroadcastMsg(&msg);
 }
@@ -1047,7 +1056,7 @@
   // Setup handlers for isolate events, breakpoints, exceptions and
   // delayed breakpoints.
   Dart_SetIsolateEventHandler(IsolateEventHandler);
-  Dart_SetBreakpointHandler(BreakpointHandler);
+  Dart_SetPausedEventHandler(PausedEventHandler);
   Dart_SetBreakpointResolvedHandler(BptResolvedHandler);
   Dart_SetExceptionThrownHandler(ExceptionThrownHandler);
 }
@@ -1153,14 +1162,20 @@
 
 void DbgMsgQueueList::BptResolvedHandler(Dart_IsolateId isolate_id,
                                          intptr_t bp_id,
-                                         Dart_Handle url,
-                                         intptr_t line_number) {
+                                         const Dart_CodeLocation& location) {
   Dart_EnterScope();
   dart::TextBuffer msg(128);
   msg.Printf("{ \"event\": \"breakpointResolved\", \"params\": {");
-  msg.Printf("\"breakpointId\": %"Pd", \"url\":", bp_id);
-  FormatEncodedString(&msg, url);
-  msg.Printf(",\"line\": %"Pd" }}", line_number);
+  msg.Printf("\"breakpointId\": %"Pd"", bp_id);
+
+  msg.Printf(", \"isolateId\":%"Pd64"", isolate_id);
+  ASSERT(!Dart_IsNull(location.script_url));
+  ASSERT(Dart_IsString(location.script_url));
+  msg.Printf(", \"location\":{\"url\":");
+  FormatEncodedString(&msg, location.script_url);
+  msg.Printf(",\"libraryId\":%d", location.library_id);
+  msg.Printf(",\"tokenOffset\":%d}}}", location.token_pos);
+
   DbgMsgQueue* msg_queue = GetIsolateMsgQueue(isolate_id);
   ASSERT(msg_queue != NULL);
   msg_queue->QueueOutputMsg(&msg);
@@ -1168,15 +1183,14 @@
 }
 
 
-void DbgMsgQueueList::BreakpointHandler(Dart_IsolateId isolate_id,
-                                        Dart_Breakpoint bpt,
-                                        Dart_StackTrace trace) {
+void DbgMsgQueueList::PausedEventHandler(Dart_IsolateId isolate_id,
+                                         const Dart_CodeLocation& loc) {
   DebuggerConnectionHandler::WaitForConnection();
   Dart_EnterScope();
   DbgMsgQueue* msg_queue = GetIsolateMsgQueue(isolate_id);
   ASSERT(msg_queue != NULL);
   msg_queue->SendQueuedMsgs();
-  msg_queue->SendBreakpointEvent(trace);
+  msg_queue->SendBreakpointEvent(loc);
   msg_queue->HandleMessages();
   Dart_ExitScope();
 }
diff --git a/runtime/bin/dbg_message.h b/runtime/bin/dbg_message.h
index 95bc688..e30a421 100644
--- a/runtime/bin/dbg_message.h
+++ b/runtime/bin/dbg_message.h
@@ -169,7 +169,7 @@
   void SendQueuedMsgs();
 
   // Send breakpoint event message over to the debugger.
-  void SendBreakpointEvent(Dart_StackTrace trace);
+  void SendBreakpointEvent(const Dart_CodeLocation& location);
 
   // Send Exception event message over to the debugger.
   void SendExceptionEvent(Dart_Handle exception, Dart_StackTrace trace);
@@ -236,11 +236,9 @@
   // resolution.
   static void BptResolvedHandler(Dart_IsolateId isolate_id,
                                  intptr_t bp_id,
-                                 Dart_Handle url,
-                                 intptr_t line_number);
-  static void BreakpointHandler(Dart_IsolateId isolate_id,
-                                Dart_Breakpoint bpt,
-                                Dart_StackTrace trace);
+                                 const Dart_CodeLocation& location);
+  static void PausedEventHandler(Dart_IsolateId isolate_id,
+                                 const Dart_CodeLocation& loc);
   static void ExceptionThrownHandler(Dart_IsolateId isolate_id,
                                      Dart_Handle exception,
                                      Dart_StackTrace stack_trace);
diff --git a/runtime/bin/filter.cc b/runtime/bin/filter.cc
index 61a499c..1a609c5 100644
--- a/runtime/bin/filter.cc
+++ b/runtime/bin/filter.cc
@@ -278,6 +278,8 @@
   stream_.avail_out = length;
   stream_.next_out = buffer;
   switch (inflate(&stream_, flush ? Z_SYNC_FLUSH : Z_NO_FLUSH)) {
+    case Z_STREAM_END:
+    case Z_BUF_ERROR:
     case Z_OK: {
       intptr_t processed = length - stream_.avail_out;
       if (processed == 0) {
@@ -290,13 +292,6 @@
       }
     }
 
-    case Z_STREAM_END:
-    case Z_BUF_ERROR:
-      // We processed all available input data.
-      delete[] current_buffer_;
-      current_buffer_ = NULL;
-      return 0;
-
     default:
     case Z_MEM_ERROR:
     case Z_NEED_DICT:
diff --git a/runtime/bin/gen_snapshot.cc b/runtime/bin/gen_snapshot.cc
index 05833ba..ea69119 100644
--- a/runtime/bin/gen_snapshot.cc
+++ b/runtime/bin/gen_snapshot.cc
@@ -428,8 +428,10 @@
 static void SetupForGenericSnapshotCreation() {
   SetupForUriResolution();
 
-  // TODO(regis): Reenable this code for arm and mips when possible.
-#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
+  // TODO(regis): Reenable this code for mips when possible.
+#if defined(TARGET_ARCH_IA32) ||                                               \
+    defined(TARGET_ARCH_X64) ||                                                \
+    defined(TARGET_ARCH_ARM)
   Dart_Handle library = LoadGenericSnapshotCreationScript(Builtin::kIOLibrary);
   VerifyLoaded(library);
 #endif
diff --git a/runtime/bin/io_natives.cc b/runtime/bin/io_natives.cc
index 93f4e89..a5c6a9f 100644
--- a/runtime/bin/io_natives.cc
+++ b/runtime/bin/io_natives.cc
@@ -36,6 +36,7 @@
   V(Process_SetExitCode, 1)                                                    \
   V(Process_Exit, 1)                                                           \
   V(Process_Sleep, 1)                                                          \
+  V(Process_Pid, 1)                                                            \
   V(ServerSocket_CreateBindListen, 4)                                          \
   V(ServerSocket_Accept, 2)                                                    \
   V(Socket_CreateConnect, 3)                                                   \
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index 5e266ce..41f2ba9 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -49,7 +49,7 @@
 
 // Global state that defines the VmStats web server port and root directory.
 static int vmstats_port = -1;
-static const char* vmstats_root = NULL;
+static const char* vmstats_root = "";
 
 // Value of the --package-root flag.
 // (This pointer points into an argv buffer and does not need to be
@@ -60,7 +60,9 @@
 // Global flag that is used to indicate that we want to compile all the
 // dart functions and not run anything.
 static bool has_compile_all = false;
-
+// Global flag that is used to indicate that we want to check function
+// fingerprints.
+static bool has_check_function_fingerprints = false;
 
 // Global flag that is used to indicate that we want to print the source code
 // for script that is being run.
@@ -130,6 +132,16 @@
 }
 
 
+static bool ProcessFingerprintedFunctions(const char* arg) {
+  ASSERT(arg != NULL);
+  if (*arg != '\0') {
+    return false;
+  }
+  has_check_function_fingerprints = true;
+  return true;
+}
+
+
 static bool ProcessDebugOption(const char* port) {
   // TODO(hausner): Add support for specifying an IP address on which
   // the debugger should listen.
@@ -228,6 +240,7 @@
   { "--stats-root=", ProcessVmStatsRootOption },
   { "--stats", ProcessVmStatsOption },
   { "--print-script", ProcessPrintScriptOption },
+  { "--check-function-fingerprints", ProcessFingerprintedFunctions },
   { NULL, NULL }
 };
 
@@ -552,13 +565,10 @@
 "  url:<line_num> e.g. test.dart:10\n"
 "  [<class_name>.]<function_name> e.g. B.foo\n"
 "\n"
-"--use-script-snapshot=<file_name>\n"
-"  executes Dart script present in the specified snapshot file\n"
-"\n"
 "--generate-script-snapshot=<file_name>\n"
 "  loads Dart script and generates a snapshot in the specified file\n"
 "\n"
-"--print-source\n"
+"--print-script\n"
 "  generates Dart source code back and prints it after parsing a Dart script\n"
 "\n"
 "--stats[:<port number>]\n"
@@ -736,6 +746,7 @@
       Log::Print("Debugger initialized\n");
     }
   }
+  VmStats::Start(vmstats_port, vmstats_root, verbose_debug_seen);
 
   // Call CreateIsolateAndSetup which creates an isolate and loads up
   // the specified application script.
@@ -760,10 +771,6 @@
 
   Dart_EnterScope();
 
-  if (vmstats_port >= 0) {
-    VmStats::Start(vmstats_port, vmstats_root);
-  }
-
   if (generate_script_snapshot) {
     // First create a snapshot.
     Dart_Handle result;
@@ -792,6 +799,13 @@
       }
     }
 
+    if (has_check_function_fingerprints) {
+      result = Dart_CheckFunctionFingerprints();
+      if (Dart_IsError(result)) {
+        return ErrorExit("%s\n", Dart_GetError(result));
+      }
+    }
+
     // Create a dart options object that can be accessed from dart code.
     Dart_Handle options_result =
         SetupRuntimeOptions(&dart_options, executable_name, script_name);
@@ -824,6 +838,7 @@
       if (Dart_IsError(result)) {
         return ErrorExit("%s\n", Dart_GetError(result));
       }
+
       // Keep handling messages until the last active receive port is closed.
       result = Dart_RunLoop();
       if (Dart_IsError(result)) {
diff --git a/runtime/bin/process.cc b/runtime/bin/process.cc
index 7a0c555..c112e85 100644
--- a/runtime/bin/process.cc
+++ b/runtime/bin/process.cc
@@ -199,6 +199,21 @@
 }
 
 
+void FUNCTION_NAME(Process_Pid)(Dart_NativeArguments args) {
+  Dart_EnterScope();
+  // Ignore result if passing invalid argument and just set exit code to 0.
+  intptr_t pid = -1;
+  Dart_Handle process = Dart_GetNativeArgument(args, 0);
+  if (Dart_IsNull(process)) {
+    pid = Process::CurrentProcessId();
+  } else {
+    Process::GetProcessIdNativeField(process, &pid);
+  }
+  Dart_SetReturnValue(args, Dart_NewInteger(pid));
+  Dart_ExitScope();
+}
+
+
 Dart_Handle Process::GetProcessIdNativeField(Dart_Handle process,
                                              intptr_t* pid) {
   return Dart_GetNativeInstanceField(process, kProcessIdNativeField, pid);
diff --git a/runtime/bin/process_patch.dart b/runtime/bin/process_patch.dart
index ae87f4e..775a08e 100644
--- a/runtime/bin/process_patch.dart
+++ b/runtime/bin/process_patch.dart
@@ -31,9 +31,11 @@
 
 
 patch class _ProcessUtils {
-  /* patch */ static _exit(int status) native "Process_Exit";
-  /* patch */ static _setExitCode(int status) native "Process_SetExitCode";
-  /* patch */ static _sleep(int millis) native "Process_Sleep";
+  /* patch */ static void _exit(int status) native "Process_Exit";
+  /* patch */ static void _setExitCode(int status)
+      native "Process_SetExitCode";
+  /* patch */ static void _sleep(int millis) native "Process_Sleep";
+  /* patch */ static int _pid(Process process) native "Process_Pid";
 }
 
 
@@ -247,6 +249,8 @@
 
   bool _kill(Process p, int signal) native "Process_Kill";
 
+  int get pid => _ProcessUtils._pid(this);
+
   String _path;
   List<String> _arguments;
   String _workingDirectory;
@@ -291,6 +295,8 @@
 
   // Start the underlying process.
   return Process.start(path, arguments, options).then((Process p) {
+    int pid = p.pid;
+
     // Make sure the process stdin is closed.
     p.stdin.close();
 
@@ -314,7 +320,8 @@
             });
 
     return Future.wait([p.exitCode, stdout, stderr]).then((result) {
-      return new _ProcessResult(result[0],
+      return new _ProcessResult(pid,
+                                result[0],
                                 result[1].toString(),
                                 result[2].toString());
     });
@@ -323,10 +330,12 @@
 
 
 class _ProcessResult implements ProcessResult {
-  const _ProcessResult(int this.exitCode,
+  const _ProcessResult(int this.pid,
+                       int this.exitCode,
                        String this.stdout,
                        String this.stderr);
 
+  final int pid;
   final int exitCode;
   final String stdout;
   final String stderr;
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
index bb71cc2..67fbadf 100644
--- a/runtime/bin/socket_patch.dart
+++ b/runtime/bin/socket_patch.dart
@@ -74,6 +74,9 @@
   // Holds the port of the socket, null if not known.
   int localPort;
 
+  // Holds the host or address used to connect or bind the socket.
+  String localHost;
+
   // Native port for socket services.
   static SendPort socketService;
 
@@ -86,6 +89,7 @@
             createError(response, "Failed host name lookup"));
       } else {
         var socket = new _NativeSocket.normal();
+        socket.localHost = host;
         var result = socket.nativeCreateConnect(response, port);
         if (result is OSError) {
           completer.completeError(createError(result, "Connection failed"));
@@ -113,6 +117,7 @@
                                     int port,
                                     int backlog) {
     var socket = new _NativeSocket.listen();
+    socket.localHost = address;
     var result = socket.nativeCreateBindListen(address, port, backlog);
     if (result is OSError) {
       return new Future.error(
@@ -201,6 +206,8 @@
     return nativeGetRemotePeer()[1];
   }
 
+  String get host => localHost;
+
   String get remoteHost {
     return nativeGetRemotePeer()[0];
   }
@@ -564,6 +571,8 @@
 
   int get remotePort => _socket.remotePort;
 
+  String get host => _socket.host;
+
   String get remoteHost => _socket.remoteHost;
 
   bool get readEventsEnabled => _readEventsEnabled;
diff --git a/runtime/bin/vmstats/README b/runtime/bin/vmstats/README
new file mode 100644
index 0000000..17909d4
--- /dev/null
+++ b/runtime/bin/vmstats/README
@@ -0,0 +1,13 @@
+This is the VM Stats program built into the Dart executable.
+
+These files are converted into binary resources during the build, and
+linked into the Dart executable so it is self-contained. These resources
+are available via a built-in HTTP server, enabled with the --stats flag.
+
+Since dart2js requires the dart executable, the vm_stats.dart.js file is
+not re-created with the build. Instead, it should be regenerated whenever
+any of the dart files change, and committed with those changes.  To
+regenerate, from this directory run:
+
+  $ ../../../out/ReleaseIA32/dart-sdk/bin/dart2js -ovmstats.dart.js \
+      vmstats.dart
diff --git a/runtime/bin/vmstats/bargraph.dart b/runtime/bin/vmstats/bargraph.dart
index 865a5a8..89b00a4 100644
--- a/runtime/bin/vmstats/bargraph.dart
+++ b/runtime/bin/vmstats/bargraph.dart
@@ -188,7 +188,7 @@
    * Returns the maximum total from all the samples.
    */
   int get maxTotal {
-    var max = 0;
+    var max = 1;  // Must be non-zero.
     _samples.forEach((Sample s) => max = (s.total() > max ? s.total() : max));
     return max;
   }
diff --git a/runtime/bin/vmstats/isolate_list.dart b/runtime/bin/vmstats/isolate_list.dart
index cff3bb9..3a63b86 100644
--- a/runtime/bin/vmstats/isolate_list.dart
+++ b/runtime/bin/vmstats/isolate_list.dart
@@ -17,6 +17,7 @@
   static const String NEW_SPACE = 'new_space';
   static const String OLD_SPACE = 'old_space';
   static const String STACK_FRAME = 'stack_frame';
+  static const String EMPTY_STACK_FRAME = 'empty_stack_frame';
   static const String STACK_LIMIT = 'stack_limit';
   static const String STACK_TRACE = 'stack_trace';
   static const String STACK_TRACE_TITLE = 'stack_trace_title';
@@ -58,7 +59,7 @@
         stacktrace.classes.addAll([STACK_TRACE, HIDDEN]);
         stacktraceCell.children.add(stacktrace);
 
-        isolateRow.onClick.listen((e) => toggle(isolateRow));
+        isolateRow.onClick.listen((e) => toggleRow(isolateRow));
         updateIsolateDetails(isolate, isolateRow);
       }
     }
@@ -73,20 +74,28 @@
     title.text = "Stack Trace";
     element.children.add(title);
 
-    var stackIterator = response['stacktrace'].iterator;
-    var i = 0;
-    while (stackIterator.moveNext()) {
-      i++;
-      var frame = stackIterator.current;
-      var frameElement = new DivElement();
-      frameElement.$dom_className = STACK_FRAME;
-      var text = '$i: ${frame["url"]}:${frame["line"]}: ${frame["function"]}';
-      var code = frame["code"];
-      if (code['optimized']) {
-        text = '$text (optimized)';
+    var stackTrace = response['stacktrace'];
+    if (stackTrace.length > 0) {
+      var stackIterator = response['stacktrace'].iterator;
+      var i = 0;
+      while (stackIterator.moveNext()) {
+        i++;
+        var frame = stackIterator.current;
+        var frameElement = new DivElement();
+        var text = '$i: ${frame["url"]}:${frame["line"]}: ${frame["function"]}';
+        var code = frame["code"];
+        if (code['optimized']) {
+          text = '$text (optimized)';
+        }
+        frameElement.text = text;
+        frameElement.$dom_className = STACK_FRAME;
+        element.children.add(frameElement);
       }
-      frameElement.text = text;
-      element.children.add(frameElement);
+    } else {
+      DivElement noStack = new DivElement();
+      noStack.$dom_className = EMPTY_STACK_FRAME;
+      noStack.text = "<no stack>";
+      element.children.add(noStack);
     }
   }
 
@@ -114,12 +123,13 @@
         (String response) => setStacktrace(stackTrace, response));
   }
 
-  void toggle(TableRowElement row) {
-    var details = row.query('.$DETAILS');
-    details.classes.toggle(VISIBLE);
-    details.classes.toggle(HIDDEN);
-    var stacktrace = row.query('.$ISOLATE_STACKTRACE_COLUMN');
-    stacktrace.classes.toggle(VISIBLE);
-    stacktrace.classes.toggle(HIDDEN);
+  void toggleRow(TableRowElement row) {
+    toggleElement(row.query('.$DETAILS'));
+    toggleElement(row.query('.$ISOLATE_STACKTRACE_COLUMN'));
+  }
+
+  void toggleElement(Element e) {
+    e.classes.toggle(VISIBLE);
+    e.classes.toggle(HIDDEN);
   }
 }
diff --git a/runtime/bin/vmstats/vmstats.css b/runtime/bin/vmstats/vmstats.css
index 3255d5d..65f7d38 100644
--- a/runtime/bin/vmstats/vmstats.css
+++ b/runtime/bin/vmstats/vmstats.css
@@ -44,12 +44,21 @@
 
 .hidden {
   visibility:hidden;
+  height: 0px;
 }
 
 .stack_trace_title {
   font-weight: bold;
 }
 
+.stack_frame {
+  font-family: "monospace";
+}
+
+.empty_stack_frame {
+  font-style: italic;
+}
+
 td {
   padding-left: 10px;
   padding-right: 10px;
diff --git a/runtime/bin/vmstats/vmstats.dart b/runtime/bin/vmstats/vmstats.dart
index 2eda2c2..9cc43c5 100644
--- a/runtime/bin/vmstats/vmstats.dart
+++ b/runtime/bin/vmstats/vmstats.dart
@@ -18,7 +18,7 @@
 IsolateListModel _isolates;
 Timer _updater;
 
-final int _POLL_INTERVAL = const Duration(seconds: 1);
+final int _POLL_INTERVAL = const Duration(seconds: 3);
 final String CYAN = '#00EE76';
 final String GREEN = '#97FFFF';
 
diff --git a/runtime/bin/vmstats/vmstats.dart.js b/runtime/bin/vmstats/vmstats.dart.js
new file mode 100644
index 0000000..95ac221
--- /dev/null
+++ b/runtime/bin/vmstats/vmstats.dart.js
@@ -0,0 +1,8848 @@
+// Generated by dart2js, the Dart to JavaScript compiler.
+// The code supports the following hooks:
+// dartPrint(message)   - if this function is defined it is called
+//                        instead of the Dart [print] method.
+// dartMainRunner(main) - if this function is defined, the Dart [main]
+//                        method will not be invoked directly.
+//                        Instead, a closure that will invoke [main] is
+//                        passed to [dartMainRunner].
+function Isolate() {}
+init();
+
+var $ = Isolate.$isolateProperties;
+var $$ = {};
+
+// Classes
+$$.ListIterable = {"": "IterableBase;",
+  get$iterator: function(_) {
+    return $.ListIterator$(this);
+  },
+  forEach$1: function(_, action) {
+    var $length, i;
+    $length = this.get$length(this);
+    if (typeof $length !== "number")
+      return this.forEach$1$bailout1(1, action, $length);
+    for (i = 0; i < $length; ++i) {
+      action.call$1(this.elementAt$1(this, i));
+      if ($length !== this.get$length(this))
+        throw $.wrapException($.ConcurrentModificationError$(this));
+    }
+  },
+  forEach$1$bailout1: function(state0, action, $length) {
+    var t1, i;
+    for (t1 = $.getInterceptor($length), i = 0; $.JSNumber_methods.$lt(i, $length); ++i) {
+      action.call$1(this.elementAt$1(this, i));
+      if (t1.$eq($length, this.get$length(this)) !== true)
+        throw $.wrapException($.ConcurrentModificationError$(this));
+    }
+  },
+  get$isEmpty: function(_) {
+    return $.$eq(this.get$length(this), 0);
+  },
+  skip$1: function(_, count) {
+    return $.SubListIterable$(this, count, null);
+  },
+  toList$1$growable: function(_, growable) {
+    var result, i, t1;
+    if (growable === true) {
+      result = $.List_List($);
+      $.JSArray_methods.set$length(result, this.get$length(this));
+    } else
+      result = $.List_List(this.get$length(this));
+    for (i = 0; $.JSNumber_methods.$lt(i, this.get$length(this)); ++i) {
+      t1 = this.elementAt$1(this, i);
+      if (i >= result.length)
+        throw $.ioore(i);
+      result[i] = t1;
+    }
+    return result;
+  },
+  toList$0: function($receiver) {
+    return this.toList$1$growable($receiver, true);
+  },
+  $asIterable: function() {
+    return null;
+  }
+};
+
+$$.SubListIterable = {"": "ListIterable;_iterable,_start,_endOrLength",
+  get$_endIndex: function() {
+    var $length, t1;
+    $length = $.get$length$asx(this._iterable);
+    t1 = this._endOrLength;
+    if (t1 == null || $.JSNull_methods.$gt(t1, $length))
+      return $length;
+    return t1;
+  },
+  get$_startIndex: function() {
+    var $length, t1;
+    $length = $.get$length$asx(this._iterable);
+    t1 = this._start;
+    if ($.JSNumber_methods.$gt(t1, $length))
+      return $length;
+    return t1;
+  },
+  get$length: function(_) {
+    var $length, t1, t2;
+    $length = $.get$length$asx(this._iterable);
+    if (typeof $length !== "number")
+      return this.get$length$bailout2(1, $length);
+    t1 = this._start;
+    if (t1 >= $length)
+      return 0;
+    t2 = this._endOrLength;
+    if (t2 == null || $.JSNull_methods.$ge(t2, $length))
+      return $length - t1;
+    return $.JSNull_methods.$sub(t2, t1);
+  },
+  get$length$bailout2: function(state0, $length) {
+    var t1, t2;
+    t1 = this._start;
+    if ($.JSNumber_methods.$ge(t1, $length))
+      return 0;
+    t2 = this._endOrLength;
+    if (t2 == null || $.JSNull_methods.$ge(t2, $length))
+      return $.$sub$n($length, t1);
+    return $.JSNull_methods.$sub(t2, t1);
+  },
+  elementAt$1: function(_, index) {
+    var t1, realIndex;
+    if (typeof index !== "number")
+      return this.elementAt$1$bailout2(1, index);
+    t1 = this.get$_startIndex();
+    if (typeof t1 !== "number")
+      return this.elementAt$1$bailout2(2, index, t1);
+    realIndex = t1 + index;
+    if (!(index < 0)) {
+      t1 = this.get$_endIndex();
+      if (typeof t1 !== "number")
+        return this.elementAt$1$bailout2(3, index, t1, realIndex);
+      t1 = realIndex >= t1;
+    } else
+      t1 = true;
+    if (t1)
+      throw $.wrapException($.RangeError$range(index, 0, this.get$length(this)));
+    return $.elementAt$1$ax(this._iterable, realIndex);
+  },
+  elementAt$1$bailout2: function(state0, index, t1, realIndex) {
+    switch (state0) {
+      case 0:
+      case 1:
+        state0 = 0;
+        t1 = this.get$_startIndex();
+      case 2:
+        state0 = 0;
+        realIndex = $.$add$ns(t1, index);
+      case 3:
+        if (state0 === 3 || state0 === 0 && !$.$lt$n(index, 0))
+          switch (state0) {
+            case 0:
+              t1 = this.get$_endIndex();
+            case 3:
+              state0 = 0;
+              t1 = $.$ge$n(realIndex, t1);
+          }
+        else
+          t1 = true;
+        if (t1)
+          throw $.wrapException($.RangeError$range(index, 0, this.get$length(this)));
+        return $.elementAt$1$ax(this._iterable, realIndex);
+    }
+  },
+  skip$1: function(_, count) {
+    if (count < 0)
+      throw $.wrapException($.ArgumentError$(count));
+    return $.SubListIterable$(this._iterable, this._start + count, this._endOrLength);
+  },
+  $asIterable: function() {
+    return null;
+  }
+};
+
+$$.ListIterator = {"": "Object;_iterable,_liblib$_length,_index,_liblib$_current",
+  get$current: function() {
+    return this._liblib$_current;
+  },
+  moveNext$0: function() {
+    var t1, t2, t3;
+    t1 = this._liblib$_length;
+    t2 = this._iterable;
+    if ($.$eq(t1, $.get$length$asx(t2)) !== true)
+      throw $.wrapException($.ConcurrentModificationError$(t2));
+    t3 = this._index;
+    if (t3 === t1) {
+      this._liblib$_current = null;
+      return false;
+    }
+    this._liblib$_current = $.elementAt$1$ax(t2, t3);
+    this._index = this._index + 1;
+    return true;
+  }
+};
+
+$$.MappedIterable = {"": "IterableBase;_iterable,_f",
+  _f$1: function(arg0) {
+    return this._f.call$1(arg0);
+  },
+  get$iterator: function(_) {
+    var t1 = this._iterable;
+    return $.MappedIterator$(t1.get$iterator(t1), this._f);
+  },
+  get$length: function(_) {
+    var t1 = this._iterable;
+    return t1.get$length(t1);
+  },
+  get$isEmpty: function(_) {
+    var t1 = this._iterable;
+    return t1.get$isEmpty(t1);
+  },
+  elementAt$1: function(_, index) {
+    var t1 = this._iterable;
+    return this._f$1(t1.elementAt$1(t1, index));
+  },
+  $asIterable: function() {
+    return function (S, T) { return [T]; };
+  }
+};
+
+$$.MappedIterator = {"": "Iterator;_liblib$_current,_iterator,_f",
+  _f$1: function(arg0) {
+    return this._f.call$1(arg0);
+  },
+  moveNext$0: function() {
+    var t1 = this._iterator;
+    if (t1.moveNext$0() === true) {
+      this._liblib$_current = this._f$1(t1.get$current());
+      return true;
+    }
+    this._liblib$_current = null;
+    return false;
+  },
+  get$current: function() {
+    return this._liblib$_current;
+  }
+};
+
+$$.WhereIterable = {"": "IterableBase;_iterable,_f",
+  get$iterator: function(_) {
+    var t1 = this._iterable;
+    return $.WhereIterator$(t1.get$iterator(t1), this._f);
+  },
+  $asIterable: function() {
+    return null;
+  }
+};
+
+$$.WhereIterator = {"": "Iterator;_iterator,_f",
+  _f$1: function(arg0) {
+    return this._f.call$1(arg0);
+  },
+  moveNext$0: function() {
+    for (var t1 = this._iterator; t1.moveNext$0() === true;)
+      if (this._f$1(t1.get$current()) === true)
+        return true;
+    return false;
+  },
+  get$current: function() {
+    return this._iterator.get$current();
+  }
+};
+
+$$.SkipIterable = {"": "IterableBase;_iterable,_skipCount",
+  skip$1: function(_, n) {
+    if (typeof n !== "number" || Math.floor(n) !== n || n < 0)
+      throw $.wrapException($.ArgumentError$(n));
+    return $.SkipIterable$(this._iterable, $.$add$ns(this._skipCount, n));
+  },
+  get$iterator: function(_) {
+    return $.SkipIterator$($.get$iterator$ax(this._iterable), this._skipCount);
+  },
+  SkipIterable$2: function(_iterable, _skipCount) {
+    var t1 = this._skipCount;
+    if (typeof t1 !== "number" || Math.floor(t1) !== t1 || $.$lt$n(t1, 0))
+      throw $.wrapException($.ArgumentError$(t1));
+  },
+  $asIterable: function() {
+    return null;
+  }
+};
+
+$$.SkipIterator = {"": "Iterator;_iterator,_skipCount",
+  moveNext$0: function() {
+    var t1, i, t2;
+    t1 = this._iterator;
+    i = 0;
+    while (true) {
+      t2 = this._skipCount;
+      if (typeof t2 !== "number")
+        return this.moveNext$0$bailout1(1, t1, i, t2);
+      if (!(i < t2))
+        break;
+      t1.moveNext$0();
+      ++i;
+    }
+    this._skipCount = 0;
+    return t1.moveNext$0();
+  },
+  moveNext$0$bailout1: function(state0, t1, i, t2) {
+    switch (state0) {
+      case 0:
+        t1 = this._iterator;
+        i = 0;
+      case 1:
+        L0:
+          while (true)
+            switch (state0) {
+              case 0:
+                t2 = this._skipCount;
+              case 1:
+                state0 = 0;
+                if (!$.JSNumber_methods.$lt(i, t2))
+                  break L0;
+                t1.moveNext$0();
+                ++i;
+            }
+        this._skipCount = 0;
+        return t1.moveNext$0();
+    }
+  },
+  get$current: function() {
+    return this._iterator.get$current();
+  },
+  SkipIterator$2: function(_iterator, _skipCount) {
+  }
+};
+
+$$.ToString__emitPair_anon = {"": "Closure;box_0,result_1,visiting_2",
+  call$2: function(k, v) {
+    var t1, t2;
+    t1 = this.box_0;
+    if (!t1.first_0)
+      this.result_1.write$1(", ");
+    t1.first_0 = false;
+    t1 = this.result_1;
+    t2 = this.visiting_2;
+    $.ToString__emitObject(k, t1, t2);
+    t1.write$1(": ");
+    $.ToString__emitObject(v, t1, t2);
+  }
+};
+
+$$.HashMap_values_anon = {"": "Closure;this_0",
+  call$1: function(each) {
+    return $.$index$asx(this.this_0, each);
+  }
+};
+
+$$.HashMap_addAll_anon = {"": "Closure;this_0",
+  call$2: function(key, value) {
+    $.$indexSet$ax(this.this_0, key, value);
+  }
+};
+
+$$.HashMapKeyIterable = {"": "IterableBase;_map",
+  get$length: function(_) {
+    return this._map._liblib0$_length;
+  },
+  get$isEmpty: function(_) {
+    return this._map._liblib0$_length === 0;
+  },
+  get$iterator: function(_) {
+    var t1 = this._map;
+    return $.HashMapKeyIterator$(t1, t1._computeKeys$0());
+  },
+  forEach$1: function(_, f) {
+    var t1, keys, $length, i;
+    t1 = this._map;
+    keys = t1._computeKeys$0();
+    for ($length = keys.length, i = 0; i < $length; ++i) {
+      f.call$1(keys[i]);
+      if (keys !== t1._keys)
+        throw $.wrapException($.ConcurrentModificationError$(t1));
+    }
+  },
+  $asIterable: function() {
+    return null;
+  }
+};
+
+$$.HashMapKeyIterator = {"": "Object;_map,_keys,_offset,_liblib0$_current",
+  get$current: function() {
+    return this._liblib0$_current;
+  },
+  moveNext$0: function() {
+    var keys, offset, t1;
+    keys = this._keys;
+    offset = this._offset;
+    t1 = this._map;
+    if (keys !== t1._keys)
+      throw $.wrapException($.ConcurrentModificationError$(t1));
+    else if (offset >= keys.length) {
+      this._liblib0$_current = null;
+      return false;
+    } else {
+      this._liblib0$_current = keys[offset];
+      this._offset = offset + 1;
+      return true;
+    }
+  }
+};
+
+$$.LinkedHashMap_values_anon = {"": "Closure;this_0",
+  call$1: function(each) {
+    return $.$index$asx(this.this_0, each);
+  }
+};
+
+$$.LinkedHashMap_addAll_anon = {"": "Closure;this_0",
+  call$2: function(key, value) {
+    $.$indexSet$ax(this.this_0, key, value);
+  }
+};
+
+$$.LinkedHashMapCell = {"": "Object;_key<,_value@,_next@,_previous@"};
+
+$$.LinkedHashMapKeyIterable = {"": "IterableBase;_map",
+  get$length: function(_) {
+    return this._map._liblib0$_length;
+  },
+  get$isEmpty: function(_) {
+    return this._map._liblib0$_length === 0;
+  },
+  get$iterator: function(_) {
+    var t1 = this._map;
+    return $.LinkedHashMapKeyIterator$(t1, t1._modifications);
+  },
+  forEach$1: function(_, f) {
+    var t1, cell, modifications;
+    t1 = this._map;
+    cell = t1._first;
+    modifications = t1._modifications;
+    for (; cell != null;) {
+      f.call$1(cell.get$_key());
+      if (modifications !== t1._modifications)
+        throw $.wrapException($.ConcurrentModificationError$(t1));
+      cell = cell.get$_next();
+    }
+  },
+  $asIterable: function() {
+    return null;
+  }
+};
+
+$$.LinkedHashMapKeyIterator = {"": "Object;_map,_modifications,_cell,_liblib0$_current",
+  get$current: function() {
+    return this._liblib0$_current;
+  },
+  moveNext$0: function() {
+    var t1 = this._map;
+    if (this._modifications !== t1._modifications)
+      throw $.wrapException($.ConcurrentModificationError$(t1));
+    else {
+      t1 = this._cell;
+      if (t1 == null) {
+        this._liblib0$_current = null;
+        return false;
+      } else {
+        this._liblib0$_current = t1.get$_key();
+        this._cell = this._cell.get$_next();
+        return true;
+      }
+    }
+  },
+  LinkedHashMapKeyIterator$2: function(_map, _modifications) {
+    this._cell = this._map._first;
+  }
+};
+
+$$.LinkedHashSetCell = {"": "Object;_element<,_next@,_previous@"};
+
+$$.LinkedHashSetIterator = {"": "Object;_set,_modifications,_cell,_liblib0$_current",
+  get$current: function() {
+    return this._liblib0$_current;
+  },
+  moveNext$0: function() {
+    var t1 = this._set;
+    if (this._modifications !== t1._modifications)
+      throw $.wrapException($.ConcurrentModificationError$(t1));
+    else {
+      t1 = this._cell;
+      if (t1 == null) {
+        this._liblib0$_current = null;
+        return false;
+      } else {
+        this._liblib0$_current = t1.get$_element();
+        this._cell = this._cell.get$_next();
+        return true;
+      }
+    }
+  },
+  LinkedHashSetIterator$2: function(_set, _modifications) {
+    this._cell = this._set._first;
+  }
+};
+
+$$.Function__toMangledNames_anon = {"": "Closure;result_0",
+  call$2: function(symbol, value) {
+    var t1 = this.result_0;
+    t1.$indexSet(t1, symbol.get$_name(), value);
+  }
+};
+
+$$.NoSuchMethodError_toString_anon = {"": "Closure;box_0",
+  call$2: function(key, value) {
+    var t1 = this.box_0;
+    if ($.$gt$n(t1.i_1, 0))
+      t1.sb_0.write$1(", ");
+    t1.sb_0.write$1(key);
+    t1.sb_0.write$1(": ");
+    t1.sb_0.write$1($.Error_safeToString(value));
+    t1.i_1 = $.$add$ns(t1.i_1, 1);
+  }
+};
+
+$$.Interceptor = {"": "Object;",
+  $eq: function(receiver, other) {
+    return receiver === other;
+  },
+  get$hashCode: function(receiver) {
+    return $.Primitives_objectHashCode(receiver);
+  },
+  toString$0: function(receiver) {
+    return "Instance of '" + $.S($.Primitives_objectTypeName(receiver)) + "'";
+  }
+};
+
+$$.JSFunction = {"": "Interceptor;",
+  toString$0: function(receiver) {
+    return "Closure";
+  }
+};
+
+$$.JSBool = {"": "Interceptor;",
+  toString$0: function(receiver) {
+    return String(receiver);
+  },
+  get$hashCode: function(receiver) {
+    return receiver ? 519018 : 218159;
+  },
+  $isbool: true
+};
+
+$$.JSNull = {"": "Interceptor;",
+  $eq: function(receiver, other) {
+    return null == other;
+  },
+  toString$0: function(receiver) {
+    return "null";
+  },
+  get$hashCode: function(receiver) {
+    return 0;
+  }
+};
+
+$$.CloseToken = {"": "Object;", $isCloseToken: true};
+
+$$.JsIsolateSink = {"": "EventSink;_isClosed,_port<",
+  add$1: function(_, message) {
+    $.send$1$x(this._port, message);
+  },
+  $eq: function(_, other) {
+    if (other == null)
+      return false;
+    return typeof other === "object" && other !== null && !!$.getInterceptor(other).$isIsolateSink && $.$eq(this._port, other.get$_port()) === true;
+  },
+  get$hashCode: function(_) {
+    return $.$add$ns($.get$hashCode$(this._port), 499);
+  },
+  $isJsIsolateSink: true,
+  $asIsolateSink: null,
+  $isIsolateSink: true
+};
+
+$$._Manager = {"": "Object;nextIsolateId@,currentManagerId,nextManagerId,currentContext<,rootContext,topEventLoop<,fromCommandLine,isWorker<,supportsWorkers,isolates,mainManager,managers",
+  get$useWorkers: function() {
+    return this.supportsWorkers;
+  },
+  get$needSerialization: function() {
+    return this.get$useWorkers();
+  },
+  _nativeDetectEnvironment$0: function() {
+    var t1, t2;
+    t1 = $.get$globalWindow() == null;
+    this.isWorker = t1 && $.get$globalPostMessageDefined() === true;
+    if (this.isWorker !== true)
+      t2 = $.get$globalWorker() != null && $.get$IsolateNatives_thisScript() != null;
+    else
+      t2 = true;
+    this.supportsWorkers = t2;
+    this.fromCommandLine = t1 && this.isWorker !== true;
+  },
+  _nativeInitWorkerMessageHandler$0: function() {
+    var $function = function (e) { $.IsolateNatives__processWorkerMessage.call$2(this.mainManager, e); };
+    $.get$globalThis().onmessage = $function;
+    $.get$globalThis().dartPrint = function (object) {};
+  },
+  maybeCloseWorker$0: function() {
+    if (this.isWorker === true) {
+      var t1 = this.isolates;
+      t1 = t1.get$isEmpty(t1) && this.topEventLoop.activeTimerCount === 0;
+    } else
+      t1 = false;
+    if (t1) {
+      t1 = this.mainManager;
+      t1.postMessage$1(t1, $._serializeMessage($.makeLiteralMap(["command", "close"])));
+    }
+  },
+  _Manager$0: function() {
+    this._nativeDetectEnvironment$0();
+    this.topEventLoop = $._EventLoop$();
+    this.isolates = $.Map_Map();
+    this.managers = $.Map_Map();
+    if (this.isWorker === true) {
+      this.mainManager = $._MainManagerStub$();
+      this._nativeInitWorkerMessageHandler$0();
+    }
+  }
+};
+
+$$._IsolateContext = {"": "Object;id*,ports,isolateStatics",
+  eval$1: function(code) {
+    var old, result;
+    old = $globalState.currentContext;
+    $globalState.currentContext = this;
+    $ = this.isolateStatics;
+    result = null;
+    try {
+      result = code.call$0();
+    } finally {
+      $globalState.currentContext = old;
+      if (old != null)
+        old._setGlobals$0();
+    }
+    return result;
+  },
+  _setGlobals$0: function() {
+    $ = this.isolateStatics;
+  },
+  lookup$1: function(portId) {
+    var t1 = this.ports;
+    return t1.$index(t1, portId);
+  },
+  register$2: function(_, portId, port) {
+    var t1;
+    if (this.ports.containsKey$1(portId) === true)
+      throw $.wrapException($._ExceptionImplementation$("Registry: ports must be registered only once."));
+    t1 = this.ports;
+    t1.$indexSet(t1, portId, port);
+    t1 = $globalState.isolates;
+    t1.$indexSet(t1, this.id, this);
+  },
+  unregister$1: function(portId) {
+    var t1 = this.ports;
+    t1.remove$1(t1, portId);
+    t1 = this.ports;
+    if (t1.get$isEmpty(t1)) {
+      t1 = $globalState.isolates;
+      t1.remove$1(t1, this.id);
+    }
+  },
+  _IsolateContext$0: function() {
+    var t1, t2;
+    t1 = $._globalState();
+    t2 = t1.get$nextIsolateId();
+    t1.set$nextIsolateId(t2 + 1);
+    this.id = t2;
+    this.ports = $.Map_Map();
+    this.isolateStatics = new Isolate();
+  }
+};
+
+$$._EventLoop = {"": "Object;events,activeTimerCount",
+  enqueue$3: function(isolate, fn, msg) {
+    this.events.addLast$1($._IsolateEvent$(isolate, fn, msg));
+  },
+  dequeue$0: function() {
+    var t1 = this.events;
+    if (t1.get$isEmpty(t1))
+      return;
+    return t1.removeFirst$0();
+  },
+  checkOpenReceivePortsFromCommandLine$0: function() {
+    if ($globalState.rootContext != null)
+      if ($globalState.isolates.containsKey$1($globalState.rootContext.id) === true)
+        if ($globalState.fromCommandLine === true) {
+          var t1 = $globalState.rootContext.ports;
+          t1 = t1.get$isEmpty(t1);
+        } else
+          t1 = false;
+      else
+        t1 = false;
+    else
+      t1 = false;
+    if (t1)
+      throw $.wrapException($._ExceptionImplementation$("Program exited with open ReceivePorts."));
+  },
+  runIteration$0: function() {
+    var $event = this.dequeue$0();
+    if ($event == null) {
+      this.checkOpenReceivePortsFromCommandLine$0();
+      $globalState.maybeCloseWorker$0();
+      return false;
+    }
+    $event.process$0();
+    return true;
+  },
+  _runHelper$0: function() {
+    if ($.get$globalWindow() != null)
+      new $._EventLoop__runHelper_next(this).call$0();
+    else
+      for (; this.runIteration$0();)
+        ;
+  },
+  run$0: function() {
+    var e, trace, exception, t1;
+    if ($globalState.isWorker !== true)
+      this._runHelper$0();
+    else
+      try {
+        this._runHelper$0();
+      } catch (exception) {
+        t1 = $.unwrapException(exception);
+        e = t1;
+        trace = $.getTraceFromException(exception);
+        t1 = $globalState.mainManager;
+        t1.postMessage$1(t1, $._serializeMessage($.makeLiteralMap(["command", "error", "msg", $.S(e) + "\n" + $.S(trace)])));
+      }
+
+  }
+};
+
+$$._EventLoop__runHelper_next = {"": "Closure;this_0",
+  call$0: function() {
+    if (!this.this_0.runIteration$0())
+      return;
+    $.Timer_run(this);
+  }
+};
+
+$$._IsolateEvent = {"": "Object;isolate,fn,message",
+  process$0: function() {
+    this.isolate.eval$1(this.fn);
+  }
+};
+
+$$._MainManagerStub = {"": "Object;",
+  get$id: function(_) {
+    return 0;
+  },
+  set$id: function(_, i) {
+    throw $.wrapException($.UnimplementedError$(null));
+  },
+  postMessage$1: function(_, msg) {
+    $.get$globalThis().postMessage(msg);
+  },
+  terminate$0: function(_) {
+  }
+};
+
+$$.IsolateNatives__processWorkerMessage_anon = {"": "Closure;entryPoint_0,replyTo_1",
+  call$0: function() {
+    var t1, t2;
+    t1 = this.entryPoint_0;
+    t2 = this.replyTo_1;
+    $.lazyPort = $.ReceivePortImpl$();
+    $.send$2$x(t2, "spawned", $._Isolate_port().toSendPort$0());
+    t1.call$0();
+  }
+};
+
+$$._BaseSendPort = {"": "Object;_isolateId<",
+  _checkReplyTo$1: function(replyTo) {
+    if (replyTo != null && (typeof replyTo !== "object" || replyTo === null || !$.getInterceptor(replyTo).$is_NativeJsSendPort) && (typeof replyTo !== "object" || replyTo === null || !$.getInterceptor(replyTo).$is_WorkerSendPort) && true)
+      throw $.wrapException($._ExceptionImplementation$("SendPort.send: Illegal replyTo port type"));
+  },
+  call$1: function(message) {
+    var completer, port;
+    completer = $._CompleterImpl$();
+    port = $.ReceivePortImpl$();
+    this.send$2(this, message, port.toSendPort$0());
+    port.receive$1(new $._BaseSendPort_call_anon(completer, port));
+    return completer.future;
+  },
+  $isSendPort: true
+};
+
+$$._BaseSendPort_call_anon = {"": "Closure;completer_0,port_1",
+  call$2: function(value, ignoreReplyTo) {
+    var t1 = this.port_1;
+    t1.close$0(t1);
+    t1 = this.completer_0;
+    if (typeof value === "object" && value !== null && !!$.getInterceptor(value).$isException)
+      t1.completeError$1(value);
+    else
+      t1.complete$1(t1, value);
+  }
+};
+
+$$._NativeJsSendPort = {"": "_BaseSendPort;_receivePort<,_isolateId",
+  send$2: function(_, message, replyTo) {
+    $._waitForPendingPorts([message, replyTo], new $._NativeJsSendPort_send_anon(this, message, replyTo));
+  },
+  send$1: function($receiver, message) {
+    return this.send$2($receiver, message, null);
+  },
+  $eq: function(_, other) {
+    if (other == null)
+      return false;
+    return typeof other === "object" && other !== null && !!$.getInterceptor(other).$is_NativeJsSendPort && $.$eq(this._receivePort, other._receivePort) === true;
+  },
+  get$hashCode: function(_) {
+    return this._receivePort.get$_id();
+  },
+  $is_NativeJsSendPort: true,
+  $isSendPort: true
+};
+
+$$._NativeJsSendPort_send_anon = {"": "Closure;this_1,message_2,replyTo_3",
+  call$0: function() {
+    var t1, t2, t3, t4, isolate, shouldSerialize, msg;
+    t1 = {};
+    t2 = this.this_1;
+    t3 = this.replyTo_3;
+    t2._checkReplyTo$1(t3);
+    t4 = $globalState.isolates;
+    isolate = t4.$index(t4, t2.get$_isolateId());
+    if (isolate == null)
+      return;
+    if (t2.get$_receivePort().get$_callback() == null)
+      return;
+    shouldSerialize = $globalState.currentContext != null && $.$eq($.get$id$x($globalState.currentContext), t2.get$_isolateId()) !== true;
+    msg = this.message_2;
+    t1.msg_0 = msg;
+    t1.reply_1 = t3;
+    if (shouldSerialize) {
+      t1.msg_0 = $._serializeMessage(t1.msg_0);
+      t1.reply_1 = $._serializeMessage(t1.reply_1);
+    }
+    $globalState.topEventLoop.enqueue$3(isolate, new $._NativeJsSendPort_send__anon(t1, t2, shouldSerialize), "receive " + $.S(msg));
+  }
+};
+
+$$._NativeJsSendPort_send__anon = {"": "Closure;box_0,this_4,shouldSerialize_5",
+  call$0: function() {
+    var t1, t2;
+    t1 = this.this_4;
+    if (t1.get$_receivePort().get$_callback() != null) {
+      if (this.shouldSerialize_5) {
+        t2 = this.box_0;
+        t2.msg_0 = $._deserializeMessage(t2.msg_0);
+        t2.reply_1 = $._deserializeMessage(t2.reply_1);
+      }
+      t1 = t1.get$_receivePort();
+      t2 = this.box_0;
+      t1._callback$2(t2.msg_0, t2.reply_1);
+    }
+  }
+};
+
+$$._WorkerSendPort = {"": "_BaseSendPort;_workerId<,_receivePortId,_isolateId",
+  send$2: function(_, message, replyTo) {
+    $._waitForPendingPorts([message, replyTo], new $._WorkerSendPort_send_anon(this, message, replyTo));
+  },
+  send$1: function($receiver, message) {
+    return this.send$2($receiver, message, null);
+  },
+  $eq: function(_, other) {
+    var t1;
+    if (other == null)
+      return false;
+    if (typeof other === "object" && other !== null && !!$.getInterceptor(other).$is_WorkerSendPort)
+      t1 = $.$eq(this._workerId, other._workerId) === true && $.$eq(this._isolateId, other._isolateId) === true && $.$eq(this._receivePortId, other._receivePortId) === true;
+    else
+      t1 = false;
+    return t1;
+  },
+  get$hashCode: function(_) {
+    var t1, t2, t3;
+    t1 = $.$shl$n(this._workerId, 16);
+    t2 = $.$shl$n(this._isolateId, 8);
+    t3 = this._receivePortId;
+    if (typeof t3 !== "number")
+      throw $.iae(t3);
+    return (t1 ^ t2 ^ t3) >>> 0;
+  },
+  $is_WorkerSendPort: true,
+  $isSendPort: true
+};
+
+$$._WorkerSendPort_send_anon = {"": "Closure;this_0,message_1,replyTo_2",
+  call$0: function() {
+    var t1, t2, workerMessage, manager;
+    t1 = this.this_0;
+    t2 = this.replyTo_2;
+    t1._checkReplyTo$1(t2);
+    workerMessage = $._serializeMessage($.makeLiteralMap(["command", "message", "port", t1, "msg", this.message_1, "replyTo", t2]));
+    if ($globalState.isWorker === true) {
+      t1 = $globalState.mainManager;
+      t1.postMessage$1(t1, workerMessage);
+    } else {
+      t2 = $globalState.managers;
+      manager = t2.$index(t2, t1.get$_workerId());
+      if (manager != null)
+        $.postMessage$1$x(manager, workerMessage);
+    }
+  }
+};
+
+$$.ReceivePortImpl = {"": "Object;_id<,_callback<",
+  _callback$2: function(arg0, arg1) {
+    return this._callback.call$2(arg0, arg1);
+  },
+  receive$1: function(onMessage) {
+    this._callback = onMessage;
+  },
+  close$0: function(_) {
+    this._callback = null;
+    $globalState.currentContext.unregister$1(this._id);
+  },
+  toSendPort$0: function() {
+    return $._NativeJsSendPort$(this, $.get$id$x($globalState.currentContext));
+  },
+  ReceivePortImpl$0: function() {
+    $.register$2$x($._globalState().get$currentContext(), this._id, this);
+  }
+};
+
+$$._waitForPendingPorts_anon = {"": "Closure;callback_0",
+  call$1: function(_) {
+    return this.callback_0.call$0();
+  }
+};
+
+$$._PendingSendPortFinder = {"": "_MessageTraverser;ports,_visited",
+  visitPrimitive$1: function(x) {
+  },
+  visitList$1: function(list) {
+    var t1 = this._visited;
+    if (t1.$index(t1, list) != null)
+      return;
+    t1 = this._visited;
+    t1.$indexSet(t1, list, true);
+    $.forEach$1$ax(list, new $._PendingSendPortFinder_visitList_anon(this));
+  },
+  visitMap$1: function(map) {
+    var t1 = this._visited;
+    if (t1.$index(t1, map) != null)
+      return;
+    t1 = this._visited;
+    t1.$indexSet(t1, map, true);
+    $.forEach$1$ax(map.get$values(map), new $._PendingSendPortFinder_visitMap_anon(this));
+  },
+  visitSendPort$1: function(port) {
+    if (false)
+      this.ports.push(port.get$_futurePort());
+  },
+  visitIsolateSink$1: function(sink) {
+    var t1 = sink._port;
+    if (false)
+      this.ports.push(t1.get$_futurePort());
+  },
+  visitCloseToken$1: function(token) {
+  },
+  _PendingSendPortFinder$0: function() {
+    this._visited = $._JsVisitedMap$();
+  }
+};
+
+$$._PendingSendPortFinder_visitList_anon = {"": "Closure;this_0",
+  call$1: function(e) {
+    return this.this_0._dispatch$1(e);
+  }
+};
+
+$$._PendingSendPortFinder_visitMap_anon = {"": "Closure;this_0",
+  call$1: function(e) {
+    return this.this_0._dispatch$1(e);
+  }
+};
+
+$$._JsSerializer = {"": "_Serializer;_nextFreeRefId,_visited",
+  visitSendPort$1: function(x) {
+    if (typeof x === "object" && x !== null && !!$.getInterceptor(x).$is_NativeJsSendPort)
+      return ["sendport", $globalState.currentManagerId, x._isolateId, x._receivePort.get$_id()];
+    if (typeof x === "object" && x !== null && !!$.getInterceptor(x).$is_WorkerSendPort)
+      return ["sendport", x._workerId, x._isolateId, x._receivePortId];
+    throw $.wrapException("Illegal underlying port " + $.S(x));
+  },
+  visitIsolateSink$1: function(sink) {
+    var isClosed = sink._isClosed;
+    return ["isolateSink", this.visitSendPort$1(sink._port), isClosed];
+  },
+  visitCloseToken$1: function(token) {
+    return ["closeToken"];
+  },
+  _JsSerializer$0: function() {
+    this._visited = $._JsVisitedMap$();
+  }
+};
+
+$$._JsCopier = {"": "_Copier;_visited",
+  visitSendPort$1: function(x) {
+    if (typeof x === "object" && x !== null && !!$.getInterceptor(x).$is_NativeJsSendPort)
+      return $._NativeJsSendPort$(x._receivePort, x._isolateId);
+    if (typeof x === "object" && x !== null && !!$.getInterceptor(x).$is_WorkerSendPort)
+      return $._WorkerSendPort$(x._workerId, x._isolateId, x._receivePortId);
+    throw $.wrapException("Illegal underlying port " + $.S(this.get$p()));
+  },
+  visitIsolateSink$1: function(sink) {
+    var isClosed, result;
+    isClosed = sink._isClosed;
+    result = $.JsIsolateSink$fromPort(this.visitSendPort$1(sink._port));
+    result._isClosed = isClosed;
+    return result;
+  },
+  visitCloseToken$1: function(token) {
+    return token;
+  },
+  _JsCopier$0: function() {
+    this._visited = $._JsVisitedMap$();
+  }
+};
+
+$$._JsDeserializer = {"": "_Deserializer;_deserialized",
+  deserializeSendPort$1: function(list) {
+    var t1, managerId, isolateId, receivePortId, isolate, receivePort;
+    t1 = $.getInterceptor$asx(list);
+    managerId = t1.$index(list, 1);
+    isolateId = t1.$index(list, 2);
+    receivePortId = t1.$index(list, 3);
+    if ($.$eq(managerId, $globalState.currentManagerId) === true) {
+      t1 = $globalState.isolates;
+      isolate = t1.$index(t1, isolateId);
+      if (isolate == null)
+        return;
+      receivePort = isolate.lookup$1(receivePortId);
+      if (receivePort == null)
+        return;
+      return $._NativeJsSendPort$(receivePort, isolateId);
+    } else
+      return $._WorkerSendPort$(managerId, isolateId, receivePortId);
+  },
+  deserializeIsolateSink$1: function(list) {
+    var t1, port, isClosed, result;
+    t1 = $.getInterceptor$asx(list);
+    port = this.deserializeSendPort$1(t1.$index(list, 1));
+    isClosed = t1.$index(list, 2);
+    result = $.JsIsolateSink$fromPort(port);
+    result._isClosed = isClosed;
+    return result;
+  },
+  deserializeCloseToken$1: function(list) {
+    return $.C_CloseToken;
+  }
+};
+
+$$._JsVisitedMap = {"": "Object;tagged",
+  $index: function(_, object) {
+    return object.__MessageTraverser__attached_info__;
+  },
+  $indexSet: function(_, object, info) {
+    $.add$1$ax(this.tagged, object);
+    object.__MessageTraverser__attached_info__ = info;
+  },
+  reset$0: function(_) {
+    this.tagged = $.List_List($);
+  },
+  cleanup$0: function() {
+    var $length, i;
+    for ($length = $.get$length$asx(this.tagged), i = 0; i < $length; ++i)
+      $.$index$asx(this.tagged, i).__MessageTraverser__attached_info__ = null;
+    this.tagged = null;
+  }
+};
+
+$$._MessageTraverserVisitedMap = {"": "Object;",
+  $index: function(_, object) {
+    return;
+  },
+  $indexSet: function(_, object, info) {
+  },
+  reset$0: function(_) {
+  },
+  cleanup$0: function() {
+  }
+};
+
+$$._MessageTraverser = {"": "Object;",
+  traverse$1: function(x) {
+    var result, t1;
+    t1 = x;
+    if (t1 == null || typeof t1 === "string" || typeof t1 === "number" || typeof t1 === "boolean")
+      return this.visitPrimitive$1(x);
+    t1 = this._visited;
+    t1.reset$0(t1);
+    result = null;
+    try {
+      result = this._dispatch$1(x);
+    } finally {
+      this._visited.cleanup$0();
+    }
+    return result;
+  },
+  _dispatch$1: function(x) {
+    if (x == null || typeof x === "string" || typeof x === "number" || typeof x === "boolean")
+      return this.visitPrimitive$1(x);
+    if (typeof x === "object" && x !== null && (x.constructor === Array || $.getInterceptor(x).$isList()))
+      return this.visitList$1(x);
+    if (typeof x === "object" && x !== null && !!$.getInterceptor(x).$isMap)
+      return this.visitMap$1(x);
+    if (typeof x === "object" && x !== null && !!$.getInterceptor(x).$isSendPort)
+      return this.visitSendPort$1(x);
+    if (typeof x === "object" && x !== null && !!$.getInterceptor(x).$isJsIsolateSink)
+      return this.visitIsolateSink$1(x);
+    if (typeof x === "object" && x !== null && !!$.getInterceptor(x).$isCloseToken)
+      return this.visitCloseToken$1(x);
+    $.throwExpression("Message serialization: Illegal value " + $.S(x) + " passed");
+    return;
+  }
+};
+
+$$._Copier = {"": "_MessageTraverser;",
+  visitPrimitive$1: function(x) {
+    return x;
+  },
+  visitList$1: function(list) {
+    var t1, copy, len, i;
+    if (typeof list !== "string" && (typeof list !== "object" || list === null || list.constructor !== Array && !$.getInterceptor(list).$isJavaScriptIndexingBehavior()))
+      return this.visitList$1$bailout1(1, list);
+    t1 = this._visited;
+    copy = t1.$index(t1, list);
+    if (copy != null)
+      return copy;
+    len = list.length;
+    copy = $.List_List(len);
+    t1 = this._visited;
+    t1.$indexSet(t1, list, copy);
+    for (i = 0; i < len; ++i) {
+      if (i >= list.length)
+        throw $.ioore(i);
+      copy[i] = this._dispatch$1(list[i]);
+    }
+    return copy;
+  },
+  visitList$1$bailout1: function(state0, list) {
+    var t1, copy, len, t2, i, t3;
+    t1 = this._visited;
+    copy = t1.$index(t1, list);
+    if (copy != null)
+      return copy;
+    t1 = $.getInterceptor$asx(list);
+    len = t1.get$length(list);
+    copy = $.List_List(len);
+    t2 = this._visited;
+    t2.$indexSet(t2, list, copy);
+    for (t2 = copy.length, i = 0; $.JSNumber_methods.$lt(i, len); ++i) {
+      t3 = this._dispatch$1(t1.$index(list, i));
+      if (i >= t2)
+        throw $.ioore(i);
+      copy[i] = t3;
+    }
+    return copy;
+  },
+  visitMap$1: function(map) {
+    var t1, t2;
+    t1 = {};
+    t2 = this._visited;
+    t1.copy_0 = t2.$index(t2, map);
+    t2 = t1.copy_0;
+    if (t2 != null)
+      return t2;
+    t1.copy_0 = $.HashMap$();
+    t2 = this._visited;
+    t2.$indexSet(t2, map, t1.copy_0);
+    map.forEach$1(map, new $._Copier_visitMap_anon(t1, this));
+    return t1.copy_0;
+  }
+};
+
+$$._Copier_visitMap_anon = {"": "Closure;box_0,this_1",
+  call$2: function(key, val) {
+    var t1, t2;
+    t1 = this.box_0.copy_0;
+    t2 = this.this_1;
+    $.$indexSet$ax(t1, t2._dispatch$1(key), t2._dispatch$1(val));
+  }
+};
+
+$$._Serializer = {"": "_MessageTraverser;",
+  visitPrimitive$1: function(x) {
+    return x;
+  },
+  visitList$1: function(list) {
+    var t1, copyId, id;
+    t1 = this._visited;
+    copyId = t1.$index(t1, list);
+    if (copyId != null)
+      return ["ref", copyId];
+    id = this._nextFreeRefId;
+    this._nextFreeRefId = id + 1;
+    t1 = this._visited;
+    t1.$indexSet(t1, list, id);
+    return ["list", id, this._serializeList$1(list)];
+  },
+  visitMap$1: function(map) {
+    var t1, copyId, id;
+    t1 = this._visited;
+    copyId = t1.$index(t1, map);
+    if (copyId != null)
+      return ["ref", copyId];
+    id = this._nextFreeRefId;
+    this._nextFreeRefId = id + 1;
+    t1 = this._visited;
+    t1.$indexSet(t1, map, id);
+    return ["map", id, this._serializeList$1($.toList$0$ax(map.get$keys())), this._serializeList$1($.toList$0$ax(map.get$values(map)))];
+  },
+  _serializeList$1: function(list) {
+    var len, result, i;
+    if (typeof list !== "string" && (typeof list !== "object" || list === null || list.constructor !== Array && !$.getInterceptor(list).$isJavaScriptIndexingBehavior()))
+      return this._serializeList$1$bailout(1, list);
+    len = list.length;
+    result = $.List_List(len);
+    for (i = 0; i < len; ++i) {
+      if (i >= list.length)
+        throw $.ioore(i);
+      result[i] = this._dispatch$1(list[i]);
+    }
+    return result;
+  },
+  _serializeList$1$bailout: function(state0, list) {
+    var t1, len, result, t2, i, t3;
+    t1 = $.getInterceptor$asx(list);
+    len = t1.get$length(list);
+    result = $.List_List(len);
+    for (t2 = result.length, i = 0; $.JSNumber_methods.$lt(i, len); ++i) {
+      t3 = this._dispatch$1(t1.$index(list, i));
+      if (i >= t2)
+        throw $.ioore(i);
+      result[i] = t3;
+    }
+    return result;
+  }
+};
+
+$$._Deserializer = {"": "Object;",
+  deserialize$1: function(x) {
+    if (x == null || typeof x === "string" || typeof x === "number" || typeof x === "boolean")
+      return x;
+    this._deserialized = $.HashMap$();
+    return this._deserializeHelper$1(x);
+  },
+  _deserializeHelper$1: function(x) {
+    var t1, id;
+    t1 = $.getInterceptor(x);
+    if (x == null || typeof x === "string" || typeof x === "number" || typeof x === "boolean")
+      return x;
+    switch (t1.$index(x, 0)) {
+      case "ref":
+        id = t1.$index(x, 1);
+        t1 = this._deserialized;
+        return t1.$index(t1, id);
+      case "list":
+        return this._deserializeList$1(x);
+      case "map":
+        return this._deserializeMap$1(x);
+      case "sendport":
+        return this.deserializeSendPort$1(x);
+      case "isolateSink":
+        return this.deserializeIsolateSink$1(x);
+      case "closeToken":
+        return this.deserializeCloseToken$1(x);
+      default:
+        $.throwExpression("Unexpected serialized object");
+        return;
+    }
+  },
+  _deserializeList$1: function(x) {
+    var t1, id, dartList, t2, len, i;
+    t1 = $.getInterceptor$asx(x);
+    id = t1.$index(x, 1);
+    dartList = t1.$index(x, 2);
+    if (typeof dartList !== "object" || dartList === null || (dartList.constructor !== Array || !!dartList.immutable$list) && !$.getInterceptor(dartList).$isJavaScriptIndexingBehavior())
+      return this._deserializeList$1$bailout(1, dartList, id);
+    t2 = this._deserialized;
+    t2.$indexSet(t2, id, dartList);
+    len = dartList.length;
+    for (i = 0; i < len; ++i) {
+      if (i >= dartList.length)
+        throw $.ioore(i);
+      t1 = this._deserializeHelper$1(dartList[i]);
+      if (i >= dartList.length)
+        throw $.ioore(i);
+      dartList[i] = t1;
+    }
+    return dartList;
+  },
+  _deserializeList$1$bailout: function(state0, dartList, id) {
+    var t2, len, i;
+    t2 = this._deserialized;
+    t2.$indexSet(t2, id, dartList);
+    t2 = $.getInterceptor$asx(dartList);
+    len = t2.get$length(dartList);
+    for (i = 0; $.JSNumber_methods.$lt(i, len); ++i)
+      t2.$indexSet(dartList, i, this._deserializeHelper$1(t2.$index(dartList, i)));
+    return dartList;
+  },
+  _deserializeMap$1: function(x) {
+    var result, t1, id, t2, keys, values, len, i, key;
+    result = $.HashMap$();
+    t1 = $.getInterceptor$asx(x);
+    id = t1.$index(x, 1);
+    t2 = this._deserialized;
+    t2.$indexSet(t2, id, result);
+    keys = t1.$index(x, 2);
+    if (typeof keys !== "string" && (typeof keys !== "object" || keys === null || keys.constructor !== Array && !$.getInterceptor(keys).$isJavaScriptIndexingBehavior()))
+      return this._deserializeMap$1$bailout(1, x, result, keys, t1);
+    values = t1.$index(x, 3);
+    if (typeof values !== "string" && (typeof values !== "object" || values === null || values.constructor !== Array && !$.getInterceptor(values).$isJavaScriptIndexingBehavior()))
+      return this._deserializeMap$1$bailout(2, 0, result, keys, 0, values);
+    len = keys.length;
+    for (i = 0; i < len; ++i) {
+      if (i >= keys.length)
+        throw $.ioore(i);
+      key = this._deserializeHelper$1(keys[i]);
+      if (i >= values.length)
+        throw $.ioore(i);
+      result.$indexSet(result, key, this._deserializeHelper$1(values[i]));
+    }
+    return result;
+  },
+  _deserializeMap$1$bailout: function(state0, x, result, keys, t1, values) {
+    switch (state0) {
+      case 0:
+        result = $.HashMap$();
+        t1 = $.getInterceptor$asx(x);
+        id = t1.$index(x, 1);
+        t2 = this._deserialized;
+        t2.$indexSet(t2, id, result);
+        keys = t1.$index(x, 2);
+      case 1:
+        state0 = 0;
+        values = t1.$index(x, 3);
+      case 2:
+        var id, t2, t3, len, i;
+        state0 = 0;
+        t3 = $.getInterceptor$asx(keys);
+        len = t3.get$length(keys);
+        for (t1 = $.getInterceptor$asx(values), i = 0; $.JSNumber_methods.$lt(i, len); ++i)
+          result.$indexSet(result, this._deserializeHelper$1(t3.$index(keys, i)), this._deserializeHelper$1(t1.$index(values, i)));
+        return result;
+    }
+  }
+};
+
+$$.TimerImpl = {"": "Object;_once,_inEventLoop,_handle?",
+  cancel$0: function() {
+    if ($.get$globalThis().setTimeout != null) {
+      if (this._inEventLoop)
+        throw $.wrapException($.UnsupportedError$("Timer in event loop cannot be canceled."));
+      if (this._handle == null)
+        return;
+      var t1 = $globalState.topEventLoop;
+      t1.activeTimerCount = t1.activeTimerCount - 1;
+      if (this._once)
+        $.get$globalThis().clearTimeout(this._handle);
+      else
+        $.get$globalThis().clearInterval(this._handle);
+      this._handle = null;
+    } else
+      throw $.wrapException($.UnsupportedError$("Canceling a timer."));
+  },
+  TimerImpl$2: function(milliseconds, callback) {
+    var t1;
+    if (milliseconds === 0)
+      t1 = $.hasTimer() !== true || $._globalState().get$isWorker() === true;
+    else
+      t1 = false;
+    if (t1) {
+      $._globalState().get$topEventLoop().enqueue$3($._globalState().get$currentContext(), callback, "timer");
+      this._inEventLoop = true;
+    } else if ($.hasTimer() === true) {
+      t1 = $._globalState().get$topEventLoop();
+      t1.activeTimerCount = t1.activeTimerCount + 1;
+      t1 = new $.internalCallback(this, callback);
+      this._handle = $.get$globalThis().setTimeout($.convertDartClosureToJS(t1, 0), milliseconds);
+    } else
+      throw $.wrapException($.UnsupportedError$("Timer greater than 0."));
+  },
+  TimerImpl$periodic$2: function(milliseconds, callback) {
+    var t1;
+    if ($.hasTimer() === true) {
+      t1 = $._globalState().get$topEventLoop();
+      t1.activeTimerCount = t1.activeTimerCount + 1;
+      this._handle = $.get$globalThis().setInterval($.convertDartClosureToJS(new $.anon(this, callback), 0), milliseconds);
+    } else
+      throw $.wrapException($.UnsupportedError$("Periodic timer."));
+  }
+};
+
+$$.internalCallback = {"": "Closure;this_0,callback_1",
+  call$0: function() {
+    this.callback_1.call$0();
+    this.this_0.set$_handle(null);
+    var t1 = $globalState.topEventLoop;
+    t1.activeTimerCount = t1.activeTimerCount - 1;
+  }
+};
+
+$$.anon = {"": "Closure;this_0,callback_1",
+  call$0: function() {
+    this.callback_1.call$1(this.this_0);
+  }
+};
+
+$$.JSArray = {"": "Interceptor;",
+  add$1: function(receiver, value) {
+    if (!!receiver.fixed$length)
+      $.throwExpression($.UnsupportedError$("add"));
+    receiver.push(value);
+  },
+  removeLast$0: function(receiver) {
+    if (!!receiver.fixed$length)
+      $.throwExpression($.UnsupportedError$("removeLast"));
+    if (receiver.length === 0)
+      throw $.wrapException($.RangeError$value(-1));
+    return receiver.pop();
+  },
+  remove$1: function(receiver, element) {
+    var i;
+    if (!!receiver.fixed$length)
+      $.throwExpression($.UnsupportedError$("remove"));
+    for (i = 0; i < receiver.length; ++i) {
+      if (i >= receiver.length || false)
+        $.throwExpression($.RangeError$value(i));
+      if ($.$eq(receiver[i], element) === true) {
+        receiver.splice(i, 1);
+        return;
+      }
+    }
+  },
+  addAll$1: function(receiver, collection) {
+    var t1, t2;
+    for (t1 = $.get$iterator$ax(collection); t1.moveNext$0() === true;) {
+      t2 = t1.get$current();
+      if (!!receiver.fixed$length)
+        $.throwExpression($.UnsupportedError$("add"));
+      receiver.push(t2);
+    }
+  },
+  forEach$1: function(receiver, f) {
+    var t1;
+    for (t1 = this.get$iterator(receiver); t1.moveNext$0();)
+      f.call$1(t1.get$current());
+    return;
+  },
+  join$1: function(receiver, separator) {
+    var t1, list, i, t2;
+    t1 = receiver.length;
+    list = $.List_List(t1);
+    for (i = 0; i < receiver.length; ++i) {
+      if (i >= receiver.length || false)
+        $.throwExpression($.RangeError$value(i));
+      t2 = $.S(receiver[i]);
+      if (i >= t1)
+        throw $.ioore(i);
+      list[i] = t2;
+    }
+    return list.join(separator);
+  },
+  skip$1: function(receiver, n) {
+    return $.SubListIterable$(receiver, n, null);
+  },
+  fold$2: function(receiver, initialValue, combine) {
+    var t1;
+    for (t1 = this.get$iterator(receiver); t1.moveNext$0();)
+      initialValue = combine.call$2(initialValue, t1.get$current());
+    return initialValue;
+  },
+  elementAt$1: function(receiver, index) {
+    var t1;
+    if (typeof index !== "number" || Math.floor(index) !== index)
+      $.throwExpression($.ArgumentError$(index));
+    t1 = $.getInterceptor$n(index);
+    if (t1.$ge(index, receiver.length) || t1.$lt(index, 0))
+      $.throwExpression($.RangeError$value(index));
+    return receiver[index];
+  },
+  sublist$2: function(receiver, start, end) {
+    if (typeof end !== "number")
+      return this.sublist$2$bailout(1, start, end, receiver);
+    if (start == null)
+      $.throwExpression($.ArgumentError$(null));
+    if (typeof start !== "number" || Math.floor(start) !== start)
+      throw $.wrapException($.ArgumentError$(start));
+    if (start < 0 || start > receiver.length)
+      throw $.wrapException($.RangeError$range(start, 0, receiver.length));
+    if (typeof end !== "number" || Math.floor(end) !== end)
+      throw $.wrapException($.ArgumentError$(end));
+    if (end < start || end > receiver.length)
+      throw $.wrapException($.RangeError$range(end, start, receiver.length));
+    if (start === end)
+      return [];
+    return receiver.slice(start, end);
+  },
+  sublist$2$bailout: function(state0, start, end, receiver) {
+    if (start == null)
+      $.throwExpression($.ArgumentError$(null));
+    if (typeof start !== "number" || Math.floor(start) !== start)
+      throw $.wrapException($.ArgumentError$(start));
+    if (start < 0 || start > receiver.length)
+      throw $.wrapException($.RangeError$range(start, 0, receiver.length));
+    if (end == null)
+      end = receiver.length;
+    else {
+      if (typeof end !== "number" || Math.floor(end) !== end)
+        throw $.wrapException($.ArgumentError$(end));
+      if (end < start || end > receiver.length)
+        throw $.wrapException($.RangeError$range(end, start, receiver.length));
+    }
+    if (start === end)
+      return [];
+    return receiver.slice(start, end);
+  },
+  sublist$1: function($receiver, start) {
+    return this.sublist$2($receiver, start, null);
+  },
+  get$first: function(receiver) {
+    if (receiver.length > 0)
+      return receiver[0];
+    throw $.wrapException($.StateError$("No elements"));
+  },
+  get$last: function(receiver) {
+    var t1 = receiver.length;
+    if (t1 > 0)
+      return receiver[t1 - 1];
+    throw $.wrapException($.StateError$("No elements"));
+  },
+  setRange$4: function(receiver, start, end, iterable, skipCount) {
+    if (!!receiver.immutable$list)
+      $.throwExpression($.UnsupportedError$("set range"));
+    $.IterableMixinWorkaround_setRangeList(receiver, start, end, iterable, skipCount);
+  },
+  get$isEmpty: function(receiver) {
+    return receiver.length === 0;
+  },
+  toString$0: function(receiver) {
+    var result = $.StringBuffer$("");
+    $.ToString__emitValue(receiver, result, $.List_List($));
+    return result.toString$0(result);
+  },
+  toList$1$growable: function(receiver, growable) {
+    return $.List_List$from(receiver, growable);
+  },
+  toList$0: function($receiver) {
+    return this.toList$1$growable($receiver, true);
+  },
+  get$iterator: function(receiver) {
+    return $.ListIterator$(receiver);
+  },
+  get$hashCode: function(receiver) {
+    return $.Primitives_objectHashCode(receiver);
+  },
+  get$length: function(receiver) {
+    return receiver.length;
+  },
+  set$length: function(receiver, newLength) {
+    if (typeof newLength !== "number" || Math.floor(newLength) !== newLength)
+      throw $.wrapException($.ArgumentError$(newLength));
+    if (newLength < 0)
+      throw $.wrapException($.RangeError$value(newLength));
+    $.checkGrowable(receiver, "set length");
+    receiver.length = newLength;
+  },
+  $index: function(receiver, index) {
+    if (typeof index !== "number" || Math.floor(index) !== index)
+      throw $.wrapException($.ArgumentError$(index));
+    if (index >= receiver.length || index < 0)
+      throw $.wrapException($.RangeError$value(index));
+    return receiver[index];
+  },
+  $indexSet: function(receiver, index, value) {
+    if (!!receiver.immutable$list)
+      $.throwExpression($.UnsupportedError$("indexed set"));
+    if (typeof index !== "number" || Math.floor(index) !== index)
+      throw $.wrapException($.ArgumentError$(index));
+    if (index >= receiver.length || index < 0)
+      throw $.wrapException($.RangeError$value(index));
+    receiver[index] = value;
+  },
+  $asList: function() {
+    return null;
+  },
+  $asIterable: function() {
+    return null;
+  },
+  $isList: function() {
+    return true;
+  },
+  $isIterable: function() {
+    return true;
+  }
+};
+
+$$.JSMutableArray = {"": "JSArray;",
+  $asList: function() {
+    return function () { return [null]; };
+  },
+  $asIterable: function() {
+    return function () { return [null]; };
+  }
+};
+
+$$.JSFixedArray = {"": "JSMutableArray;"};
+
+$$.JSExtendableArray = {"": "JSMutableArray;"};
+
+$$.Primitives_applyFunction_anon = {"": "Closure;namedArguments_0,buffer_1,arguments_2",
+  call$1: function($name) {
+    var t1, t2;
+    this.buffer_1.write$1("$" + $.S($name));
+    t1 = this.arguments_2;
+    t2 = this.namedArguments_0;
+    t1.push(t2.$index(t2, $name));
+  }
+};
+
+$$.DartError = {"": "Object;",
+  get$stack: function() {
+    return this.stack;
+  },
+  toString$0: function(_) {
+    var dartException = this.dartException;
+    if (!!Error.captureStackTrace || this.get$stack() == null)
+      return $.toString$0(dartException);
+    else
+      return $.S(dartException) + "\n" + $.S(this.get$stack());
+  },
+  DartError$1: function(dartException) {
+    this.dartException = dartException;
+    this.toString = $.DartError_toStringWrapper.call$0;
+  }
+};
+
+$$._StackTrace = {"": "Object;_stack",
+  toString$0: function(_) {
+    var t1 = this._stack;
+    return t1 != null ? t1 : "";
+  }
+};
+
+$$.invokeClosure_anon = {"": "Closure;closure_0",
+  call$0: function() {
+    return this.closure_0.call$0();
+  }
+};
+
+$$.invokeClosure_anon0 = {"": "Closure;closure_1,arg1_2",
+  call$0: function() {
+    return this.closure_1.call$1(this.arg1_2);
+  }
+};
+
+$$.invokeClosure_anon1 = {"": "Closure;closure_3,arg1_4,arg2_5",
+  call$0: function() {
+    return this.closure_3.call$2(this.arg1_4, this.arg2_5);
+  }
+};
+
+$$.Closure = {"": "Object;",
+  toString$0: function(_) {
+    return "Closure";
+  }
+};
+
+$$.Null = {"": "Object;"};
+
+$$.JSNumber = {"": "Interceptor;",
+  get$isNaN: function(receiver) {
+    return isNaN(receiver);
+  },
+  get$isInfinite: function(receiver) {
+    return receiver == Infinity || receiver == -Infinity;
+  },
+  remainder$1: function(receiver, b) {
+    return receiver % b;
+  },
+  abs$0: function(receiver) {
+    return Math.abs(receiver);
+  },
+  toInt$0: function(receiver) {
+    var truncated;
+    if (this.get$isNaN(receiver))
+      throw $.wrapException($.UnsupportedError$("NaN"));
+    if (this.get$isInfinite(receiver))
+      throw $.wrapException($.UnsupportedError$("Infinity"));
+    truncated = receiver < 0 ? Math.ceil(receiver) : Math.floor(receiver);
+    return truncated == -0.0 ? 0 : truncated;
+  },
+  truncate$0: function(receiver) {
+    var truncated;
+    if (this.get$isNaN(receiver))
+      $.throwExpression($.UnsupportedError$("NaN"));
+    if (this.get$isInfinite(receiver))
+      $.throwExpression($.UnsupportedError$("Infinity"));
+    truncated = receiver < 0 ? Math.ceil(receiver) : Math.floor(receiver);
+    return truncated == -0.0 ? 0 : truncated;
+  },
+  ceil$0: function(receiver) {
+    return this.toInt$0(Math.ceil(receiver));
+  },
+  floor$0: function(receiver) {
+    return this.toInt$0(Math.floor(receiver));
+  },
+  round$0: function(receiver) {
+    return this.toInt$0(this.roundToDouble$0(receiver));
+  },
+  roundToDouble$0: function(receiver) {
+    if (receiver < 0)
+      return -Math.round(-receiver);
+    else
+      return Math.round(receiver);
+  },
+  toString$0: function(receiver) {
+    if (receiver === 0 && 1 / receiver < 0)
+      return "-0.0";
+    else
+      return "" + receiver;
+  },
+  get$hashCode: function(receiver) {
+    return receiver & 0x1FFFFFFF;
+  },
+  $add: function(receiver, other) {
+    if (typeof other !== "number")
+      throw $.wrapException($.ArgumentError$(other));
+    return receiver + other;
+  },
+  $sub: function(receiver, other) {
+    if (typeof other !== "number")
+      throw $.wrapException($.ArgumentError$(other));
+    return receiver - other;
+  },
+  $div: function(receiver, other) {
+    if (typeof other !== "number")
+      throw $.wrapException($.ArgumentError$(other));
+    return receiver / other;
+  },
+  $mul: function(receiver, other) {
+    return receiver * other;
+  },
+  $tdiv: function(receiver, other) {
+    return this.truncate$0(receiver / other);
+  },
+  $shl: function(receiver, other) {
+    if (other < 0)
+      throw $.wrapException($.ArgumentError$(other));
+    if (other > 31)
+      return 0;
+    return receiver << other >>> 0;
+  },
+  $and: function(receiver, other) {
+    return (receiver & other) >>> 0;
+  },
+  $lt: function(receiver, other) {
+    if (typeof other !== "number")
+      throw $.wrapException($.ArgumentError$(other));
+    return receiver < other;
+  },
+  $gt: function(receiver, other) {
+    if (typeof other !== "number")
+      throw $.wrapException($.ArgumentError$(other));
+    return receiver > other;
+  },
+  $le: function(receiver, other) {
+    if (typeof other !== "number")
+      throw $.wrapException($.ArgumentError$(other));
+    return receiver <= other;
+  },
+  $ge: function(receiver, other) {
+    if (typeof other !== "number")
+      throw $.wrapException($.ArgumentError$(other));
+    return receiver >= other;
+  },
+  $isnum: true
+};
+
+$$.JSInt = {"": "JSNumber;", $isint: true, $isnum: true};
+
+$$.JSDouble = {"": "JSNumber;", $isdouble: true, $isnum: true};
+
+$$.JSString = {"": "Interceptor;",
+  codeUnitAt$1: function(receiver, index) {
+    if (index < 0)
+      throw $.wrapException($.RangeError$value(index));
+    if (index >= receiver.length)
+      throw $.wrapException($.RangeError$value(index));
+    return receiver.charCodeAt(index);
+  },
+  allMatches$1: function(receiver, str) {
+    return $.allMatchesInStringUnchecked(receiver, str);
+  },
+  $add: function(receiver, other) {
+    if (typeof other !== "string")
+      throw $.wrapException($.ArgumentError$(other));
+    return receiver + other;
+  },
+  endsWith$1: function(receiver, other) {
+    var otherLength, t1;
+    otherLength = other.length;
+    t1 = receiver.length;
+    if (otherLength > t1)
+      return false;
+    return other === this.substring$1(receiver, t1 - otherLength);
+  },
+  replaceAll$2: function(receiver, from, to) {
+    return $.stringReplaceAllUnchecked(receiver, from, to);
+  },
+  split$1: function(receiver, pattern) {
+    return receiver.split(pattern);
+  },
+  substring$2: function(receiver, startIndex, endIndex) {
+    if (endIndex == null)
+      endIndex = receiver.length;
+    if (typeof endIndex !== "number")
+      $.throwExpression($.ArgumentError$(endIndex));
+    if (startIndex < 0)
+      throw $.wrapException($.RangeError$value(startIndex));
+    if ($.JSNumber_methods.$gt(startIndex, endIndex))
+      throw $.wrapException($.RangeError$value(startIndex));
+    if ($.$gt$n(endIndex, receiver.length))
+      throw $.wrapException($.RangeError$value(endIndex));
+    return receiver.substring(startIndex, endIndex);
+  },
+  substring$1: function($receiver, startIndex) {
+    return this.substring$2($receiver, startIndex, null);
+  },
+  trim$0: function(receiver) {
+    return receiver.trim();
+  },
+  indexOf$2: function(receiver, other, start) {
+    if (other == null)
+      $.throwExpression($.ArgumentError$(null));
+    if (typeof start !== "number" || Math.floor(start) !== start)
+      throw $.wrapException($.ArgumentError$(start));
+    if (typeof other !== "string")
+      throw $.wrapException($.ArgumentError$(other));
+    if (start < 0)
+      return -1;
+    return receiver.indexOf(other, start);
+  },
+  contains$2: function(receiver, other, startIndex) {
+    if (other == null)
+      $.throwExpression($.ArgumentError$(null));
+    return $.stringContainsUnchecked(receiver, other, startIndex);
+  },
+  get$isEmpty: function(receiver) {
+    return receiver.length === 0;
+  },
+  toString$0: function(receiver) {
+    return receiver;
+  },
+  get$hashCode: function(receiver) {
+    var hash, i;
+    for (hash = 0, i = 0; i < receiver.length; ++i) {
+      hash = 536870911 & hash + receiver.charCodeAt(i);
+      hash = 536870911 & hash + ((524287 & hash) << 10 >>> 0);
+      hash ^= hash >> 6;
+    }
+    hash = 536870911 & hash + ((67108863 & hash) << 3 >>> 0);
+    hash ^= hash >> 11;
+    return 536870911 & hash + ((16383 & hash) << 15 >>> 0);
+  },
+  get$length: function(receiver) {
+    return receiver.length;
+  },
+  $index: function(receiver, index) {
+    if (typeof index !== "number" || Math.floor(index) !== index)
+      throw $.wrapException($.ArgumentError$(index));
+    if (index >= receiver.length || index < 0)
+      throw $.wrapException($.RangeError$value(index));
+    return receiver[index];
+  },
+  $isString: true
+};
+
+$$._convertJsonToDart_anon = {"": "Closure;",
+  call$2: function(key, value) {
+    return value;
+  }
+};
+
+$$._convertJsonToDart_walk = {"": "Closure;revive_0",
+  call$1: function(e) {
+    var list, t1, i, keys, map, key, proto;
+    if (e == null || typeof e != "object")
+      return e;
+    if (Object.getPrototypeOf(e) === Array.prototype) {
+      list = e;
+      for (t1 = this.revive_0, i = 0; i < list.length; ++i)
+        list[i] = t1.call$2(i, this.call$1(list[i]));
+      return list;
+    }
+    keys = Object.keys(e);
+    map = $.makeLiteralMap([]);
+    for (t1 = this.revive_0, i = 0; i < keys.length; ++i) {
+      key = keys[i];
+      map.$indexSet(map, key, t1.call$2(key, this.call$1(e[key])));
+    }
+    proto = e.__proto__;
+    if (typeof proto !== "undefined" && proto !== Object.prototype)
+      map.$indexSet(map, "__proto__", t1.call$2("__proto__", this.call$1(proto)));
+    return map;
+  }
+};
+
+$$.StringMatch = {"": "Object;start,str,pattern",
+  $index: function(_, g) {
+    if ($.$eq(g, 0) !== true)
+      $.throwExpression($.RangeError$value(g));
+    return this.pattern;
+  }
+};
+
+$$._CompleterImpl = {"": "Object;future,_isComplete",
+  complete$1: function(_, value) {
+    if (this._isComplete)
+      throw $.wrapException($.StateError$("Future already completed"));
+    this._isComplete = true;
+    this.future._setValue$1(value);
+  },
+  completeError$2: function(error, stackTrace) {
+    if (this._isComplete)
+      throw $.wrapException($.StateError$("Future already completed"));
+    this._isComplete = true;
+    if (stackTrace != null)
+      $._attachStackTrace(error, stackTrace);
+    this.future._setError$1(error);
+  },
+  completeError$1: function(error) {
+    return this.completeError$2(error, null);
+  }
+};
+
+$$._FutureListenerWrapper = {"": "Object;future,_nextListener@",
+  _sendValue$1: function(value) {
+    this.future._setValue$1(value);
+  },
+  _sendError$1: function(error) {
+    this.future._setError$1(error);
+  }
+};
+
+$$._FutureImpl = {"": "Object;_state@,_resultOrListeners<",
+  get$_isComplete: function() {
+    return this._state !== 0;
+  },
+  get$_hasValue: function() {
+    return this._state === 1;
+  },
+  get$_hasError: function() {
+    return (this._state & 2) !== 0;
+  },
+  get$_hasUnhandledError: function() {
+    return (this._state & 4) !== 0;
+  },
+  then$2$onError: function(f, onError) {
+    var t1;
+    if (!this.get$_isComplete()) {
+      if (onError == null) {
+        t1 = $._ThenFuture$(f);
+        t1._subscribeTo$1(this);
+        return t1;
+      }
+      t1 = $._SubscribeFuture$(f, onError);
+      t1._subscribeTo$1(this);
+      return t1;
+    }
+    if (this.get$_hasError()) {
+      if (onError != null)
+        return this._handleError$2(onError, null);
+      return $._FutureWrapper$(this);
+    } else
+      return this._handleValue$1(f);
+  },
+  then$1: function(f) {
+    return this.then$2$onError(f, null);
+  },
+  catchError$2$test: function(f, test) {
+    var t1;
+    if (this.get$_hasValue())
+      return $._FutureWrapper$(this);
+    if (!this.get$_isComplete()) {
+      t1 = $._CatchErrorFuture$(f, test);
+      t1._subscribeTo$1(this);
+      return t1;
+    } else
+      return this._handleError$2(f, test);
+  },
+  catchError$1: function(f) {
+    return this.catchError$2$test(f, null);
+  },
+  _handleValue$1: function(onValue) {
+    var thenFuture = $._ThenFuture$(onValue);
+    $.Timer_run(new $._FutureImpl__handleValue_anon(thenFuture, this._resultOrListeners));
+    return thenFuture;
+  },
+  _handleError$2: function(onError, test) {
+    var error, errorFuture;
+    this._state = (this._state & 4294967291) >>> 0;
+    error = this._resultOrListeners;
+    errorFuture = $._CatchErrorFuture$(onError, test);
+    $.Timer_run(new $._FutureImpl__handleError_anon(error, errorFuture));
+    return errorFuture;
+  },
+  _setValue$1: function(value) {
+    var listeners, listeners0;
+    if (this.get$_isComplete())
+      throw $.wrapException($.StateError$("Future already completed"));
+    listeners = this._removeListeners$0();
+    this._state = 1;
+    this._resultOrListeners = value;
+    for (; listeners != null; listeners = listeners0) {
+      listeners0 = listeners.get$_nextListener();
+      listeners.set$_nextListener(null);
+      listeners._sendValue$1(value);
+    }
+  },
+  get$_setValue: function() {
+    return new $.BoundClosure$1(this, "_setValue$1");
+  },
+  _setError$1: function(error) {
+    var listeners, listeners0;
+    if (this.get$_isComplete())
+      throw $.wrapException($.StateError$("Future already completed"));
+    listeners = this._removeListeners$0();
+    this._state = 2;
+    this._resultOrListeners = error;
+    if (listeners == null) {
+      this._scheduleUnhandledError$0();
+      return;
+    }
+    do {
+      listeners0 = listeners.get$_nextListener();
+      listeners.set$_nextListener(null);
+      listeners._sendError$1(error);
+      if (listeners0 != null) {
+        listeners = listeners0;
+        continue;
+      } else
+        break;
+    } while (true);
+  },
+  get$_setError: function() {
+    return new $.BoundClosure$1(this, "_setError$1");
+  },
+  _scheduleUnhandledError$0: function() {
+    this._state = (this._state | 4) >>> 0;
+    $.Timer_run(new $._FutureImpl__scheduleUnhandledError_anon(this));
+  },
+  _addListener$1: function(listener) {
+    listener._nextListener = this._resultOrListeners;
+    this._resultOrListeners = listener;
+  },
+  _removeListeners$0: function() {
+    var current, prev, next;
+    current = this._resultOrListeners;
+    this._resultOrListeners = null;
+    for (prev = null; current != null; prev = current, current = next) {
+      next = current.get$_nextListener();
+      current.set$_nextListener(prev);
+    }
+    return prev;
+  },
+  _chain$1: function(future) {
+    var t1;
+    if (!this.get$_isComplete()) {
+      t1 = future._asListener$0();
+      t1._nextListener = this._resultOrListeners;
+      this._resultOrListeners = t1;
+    } else if (this.get$_hasValue())
+      future._setValue$1(this._resultOrListeners);
+    else {
+      this._state = (this._state & 4294967291) >>> 0;
+      future._setError$1(this._resultOrListeners);
+    }
+  },
+  _setOrChainValue$1: function(result) {
+    if (typeof result === "object" && result !== null && !!$.getInterceptor(result).$isFuture)
+      if (!!$.getInterceptor(result).$is_FutureImpl) {
+        result._chain$1(this);
+        return;
+      } else {
+        result.then$2$onError(this.get$_setValue(), this.get$_setError());
+        return;
+      }
+    else
+      this._setValue$1(result);
+  },
+  _asListener$0: function() {
+    return $._FutureListenerWrapper$(this);
+  },
+  _FutureImpl$immediate$1: function(value) {
+    this._state = 1;
+    this._resultOrListeners = value;
+  },
+  $is_FutureImpl: true,
+  $isFuture: true
+};
+
+$$._FutureImpl__FutureImpl$wait_handleError = {"": "Closure;box_0",
+  call$1: function(error) {
+    var t1 = this.box_0;
+    if (t1.values_1 != null) {
+      t1.values_1 = null;
+      t1.completer_0.completeError$1(error);
+    }
+  }
+};
+
+$$._FutureImpl__FutureImpl$wait_anon = {"": "Closure;box_0,pos_1",
+  call$1: function(value) {
+    var t1, t2;
+    t1 = this.box_0;
+    t2 = t1.values_1;
+    if (t2 == null)
+      return;
+    $.$indexSet$ax(t2, this.pos_1, value);
+    t1.remaining_2 = $.$sub$n(t1.remaining_2, 1);
+    if ($.$eq(t1.remaining_2, 0)) {
+      t2 = t1.completer_0;
+      t2.complete$1(t2, t1.values_1);
+    }
+  }
+};
+
+$$._FutureImpl__handleValue_anon = {"": "Closure;thenFuture_0,value_1",
+  call$0: function() {
+    this.thenFuture_0._sendValue$1(this.value_1);
+  }
+};
+
+$$._FutureImpl__handleError_anon = {"": "Closure;error_0,errorFuture_1",
+  call$0: function() {
+    this.errorFuture_1._sendError$1(this.error_0);
+  }
+};
+
+$$._FutureImpl__scheduleUnhandledError_anon = {"": "Closure;this_0",
+  call$0: function() {
+    var t1, error, trace;
+    t1 = this.this_0;
+    if (t1.get$_hasUnhandledError()) {
+      t1.set$_state((t1.get$_state() & 4294967291) >>> 0);
+      error = t1.get$_resultOrListeners();
+      $.Primitives_printString("Uncaught Error: " + $.S(error));
+      trace = $.getAttachedStackTrace(error);
+      if (trace != null)
+        $.Primitives_printString("Stack Trace:\n" + $.S(trace) + "\n");
+      throw $.wrapException(error);
+    }
+  }
+};
+
+$$._TransformFuture = {"": "_FutureImpl;_nextListener@",
+  _subscribeTo$1: function(future) {
+    future._addListener$1(this);
+  },
+  $as_FutureImpl: function (S, T) { return [T]; },
+  $asFuture: function (S, T) { return [T]; }
+};
+
+$$._ThenFuture = {"": "_TransformFuture;_onValue,_nextListener,_state,_resultOrListeners",
+  _onValue$1: function(arg0) {
+    return this._onValue.call$1(arg0);
+  },
+  _sendValue$1: function(value) {
+    var result, e, s, exception, t1;
+    result = null;
+    try {
+      result = this._onValue$1(value);
+    } catch (exception) {
+      t1 = $.unwrapException(exception);
+      e = t1;
+      s = $.getTraceFromException(exception);
+      this._setError$1($._asyncError(e, s));
+      return;
+    }
+
+    this._setOrChainValue$1(result);
+  },
+  _sendError$1: function(error) {
+    this._setError$1(error);
+  },
+  $as_FutureImpl: function (S, T) { return [T]; },
+  $asFuture: function (S, T) { return [T]; }
+};
+
+$$._CatchErrorFuture = {"": "_TransformFuture;_test,_onError,_nextListener,_state,_resultOrListeners",
+  _test$1: function(arg0) {
+    return this._test.call$1(arg0);
+  },
+  _onError$1: function(arg0) {
+    return this._onError.call$1(arg0);
+  },
+  _sendValue$1: function(value) {
+    this._setValue$1(value);
+  },
+  _sendError$1: function(error) {
+    var matchesTest, e, s, result, e0, s0, exception, t1;
+    if (this._test != null) {
+      matchesTest = null;
+      try {
+        matchesTest = this._test$1(error);
+      } catch (exception) {
+        t1 = $.unwrapException(exception);
+        e = t1;
+        s = $.getTraceFromException(exception);
+        this._setError$1($._asyncError(e, s));
+        return;
+      }
+
+      if (matchesTest !== true) {
+        this._setError$1(error);
+        return;
+      }
+    }
+    result = null;
+    try {
+      result = this._onError$1(error);
+    } catch (exception) {
+      t1 = $.unwrapException(exception);
+      e0 = t1;
+      s0 = $.getTraceFromException(exception);
+      this._setError$1($._asyncError(e0, s0));
+      return;
+    }
+
+    this._setOrChainValue$1(result);
+  },
+  $as_FutureImpl: null,
+  $asFuture: null
+};
+
+$$._SubscribeFuture = {"": "_ThenFuture;_onError,_onValue,_nextListener,_state,_resultOrListeners",
+  _onError$1: function(arg0) {
+    return this._onError.call$1(arg0);
+  },
+  _sendError$1: function(error) {
+    var result, e, s, exception, t1;
+    result = null;
+    try {
+      result = this._onError$1(error);
+    } catch (exception) {
+      t1 = $.unwrapException(exception);
+      e = t1;
+      s = $.getTraceFromException(exception);
+      this._setError$1($._asyncError(e, s));
+      return;
+    }
+
+    this._setOrChainValue$1(result);
+  },
+  $as_FutureImpl: function (S, T) { return [T]; },
+  $asFuture: function (S, T) { return [T]; }
+};
+
+$$._FutureWrapper = {"": "Object;_future",
+  then$2$onError: function($function, onError) {
+    return this._future.then$2$onError($function, onError);
+  },
+  then$1: function($function) {
+    return this.then$2$onError($function, null);
+  },
+  catchError$2$test: function($function, test) {
+    return this._future.catchError$2$test($function, test);
+  },
+  catchError$1: function($function) {
+    return this.catchError$2$test($function, null);
+  },
+  $isFuture: true
+};
+
+$$.Stream = {"": "Object;",
+  get$length: function(_) {
+    var t1, future, t2, t3;
+    t1 = {};
+    future = $._FutureImpl$();
+    t1.count_0 = 0;
+    t2 = new $.Stream_length_anon(t1);
+    t3 = future.get$_setError();
+    this.listen$4$cancelOnError$onDone$onError(t2, true, new $.Stream_length_anon0(t1, future), t3);
+    return future;
+  },
+  get$isEmpty: function(_) {
+    var t1, future, t2, t3;
+    t1 = {};
+    future = $._FutureImpl$();
+    t1.subscription_0 = null;
+    t2 = new $.Stream_isEmpty_anon(t1, future);
+    t3 = future.get$_setError();
+    t1.subscription_0 = this.listen$4$cancelOnError$onDone$onError(t2, true, new $.Stream_isEmpty_anon0(future), t3);
+    return future;
+  },
+  skip$1: function(_, count) {
+    return $._SkipStream$(this, count);
+  }
+};
+
+$$.Stream_length_anon = {"": "Closure;box_0",
+  call$1: function(_) {
+    var t1 = this.box_0;
+    t1.count_0 = $.$add$ns(t1.count_0, 1);
+  }
+};
+
+$$.Stream_length_anon0 = {"": "Closure;box_0,future_1",
+  call$0: function() {
+    this.future_1._setValue$1(this.box_0.count_0);
+  }
+};
+
+$$.Stream_isEmpty_anon = {"": "Closure;box_0,future_1",
+  call$1: function(_) {
+    this.box_0.subscription_0.cancel$0();
+    this.future_1._setValue$1(false);
+  }
+};
+
+$$.Stream_isEmpty_anon0 = {"": "Closure;future_2",
+  call$0: function() {
+    this.future_2._setValue$1(true);
+  }
+};
+
+$$.StreamSubscription = {"": "Object;"};
+
+$$.EventSink = {"": "Object;"};
+
+$$._throwDelayed_anon = {"": "Closure;error_0,stackTrace_1",
+  call$0: function() {
+    var t1, t2, trace, t3;
+    t1 = this.stackTrace_1;
+    if (t1 != null)
+      $.Primitives_printString($.JSNull_methods.toString$0(t1));
+    t2 = this.error_0;
+    trace = $.getAttachedStackTrace(t2);
+    t3 = $.getInterceptor(trace);
+    if (trace != null && t3.$eq(trace, t1) !== true)
+      $.Primitives_printString(t3.toString$0(trace));
+    throw $.wrapException(t2);
+  }
+};
+
+$$._ForwardingStream = {"": "Stream;",
+  listen$4$cancelOnError$onDone$onError: function(onData, cancelOnError, onDone, onError) {
+    if (onData == null)
+      onData = $._nullDataHandler;
+    if (onError == null)
+      onError = $._nullErrorHandler;
+    if (onDone == null)
+      onDone = $._nullDoneHandler;
+    return $._ForwardingStreamSubscription$(this, onData, onError, onDone, true === cancelOnError);
+  },
+  listen$3$onDone$onError: function(onData, onDone, onError) {
+    return this.listen$4$cancelOnError$onDone$onError(onData, null, onDone, onError);
+  },
+  _handleData$2: function(data, sink) {
+    sink._sendData$1(data);
+  },
+  _handleError$2: function(error, sink) {
+    sink._sendError$1(error);
+  },
+  _handleDone$1: function(sink) {
+    sink._sendDone$0();
+  }
+};
+
+$$._BaseStreamSubscription = {"": "Object;",
+  _onData$1: function(arg0) {
+    return this._onData.call$1(arg0);
+  },
+  _onError$1: function(arg0) {
+    return this._onError.call$1(arg0);
+  },
+  _onDone$0: function() {
+    return this._onDone.call$0();
+  },
+  _BaseStreamSubscription$3: function(_onData, _onError, _onDone) {
+    if (this._onData == null)
+      this._onData = $._nullDataHandler;
+    if (this._onError == null)
+      this._onError = $._nullErrorHandler;
+    if (this._onDone == null)
+      this._onDone = $._nullDoneHandler;
+  }
+};
+
+$$._ForwardingStreamSubscription = {"": "_BaseStreamSubscription;_stream,_cancelOnError,_subscription,_onData,_onError,_onDone",
+  cancel$0: function() {
+    var t1 = this._subscription;
+    if (t1 != null) {
+      t1.cancel$0();
+      this._subscription = null;
+    }
+  },
+  _sendData$1: function(data) {
+    this._onData$1(data);
+  },
+  _sendError$1: function(error) {
+    this._onError$1(error);
+    if (this._cancelOnError) {
+      this._subscription.cancel$0();
+      this._subscription = null;
+    }
+  },
+  _sendDone$0: function() {
+    var t1 = this._subscription;
+    if (t1 != null) {
+      t1.cancel$0();
+      this._subscription = null;
+    }
+    this._onDone$0();
+  },
+  _handleData$1: function(data) {
+    this._stream._handleData$2(data, this);
+  },
+  get$_handleData: function() {
+    return new $.BoundClosure$1(this, "_handleData$1");
+  },
+  _handleError$1: function(error) {
+    this._stream._handleError$2(error, this);
+  },
+  get$_handleError: function() {
+    return new $.BoundClosure$1(this, "_handleError$1");
+  },
+  _handleDone$0: function() {
+    this._subscription = null;
+    this._stream._handleDone$1(this);
+  },
+  get$_handleDone: function() {
+    return new $.BoundClosure$0(this, "_handleDone$0");
+  },
+  _ForwardingStreamSubscription$5: function(_stream, onData, onError, onDone, _cancelOnError) {
+    var t1, t2;
+    t1 = this.get$_handleData();
+    t2 = this.get$_handleError();
+    this._subscription = this._stream._source.listen$3$onDone$onError(t1, this.get$_handleDone(), t2);
+  }
+};
+
+$$._SkipStream = {"": "_ForwardingStream;_remaining,_source",
+  _handleData$2: function(inputEvent, sink) {
+    var t1 = this._remaining;
+    if (t1 > 0) {
+      this._remaining = t1 - 1;
+      return;
+    }
+    return sink._sendData$1(inputEvent);
+  },
+  _SkipStream$2: function(source, count) {
+    if (typeof count !== "number" || Math.floor(count) !== count || count < 0)
+      throw $.wrapException($.ArgumentError$(count));
+  }
+};
+
+$$.Timer_run_anon = {"": "Closure;",
+  call$0: function() {
+    var runCallbacks, i, callback, newCallbacks, exception;
+    runCallbacks = $.get$Timer__runCallbacks();
+    $.Timer__runCallbacks = [];
+    for (i = 0; $.$lt$n(i, $.get$length$asx(runCallbacks)); i = $.$add$ns(i, 1)) {
+      callback = $.$index$asx(runCallbacks, i);
+      try {
+        callback.call$0();
+      } catch (exception) {
+        $.unwrapException(exception);
+        newCallbacks = $.get$Timer__runCallbacks();
+        $.Timer__runCallbacks = [];
+        i = $.$add$ns(i, 1);
+        $.addAll$1$ax($.get$Timer__runCallbacks(), $.sublist$1$ax(runCallbacks, i));
+        $.addAll$1$ax($.get$Timer__runCallbacks(), newCallbacks);
+        throw exception;
+      }
+
+    }
+  }
+};
+
+$$.HashMap = {"": "Object;_liblib0$_length,_strings,_nums,_rest,_keys",
+  get$length: function(_) {
+    return this._liblib0$_length;
+  },
+  get$isEmpty: function(_) {
+    return this._liblib0$_length === 0;
+  },
+  get$keys: function() {
+    return $.HashMapKeyIterable$(this);
+  },
+  get$values: function(_) {
+    var t1 = this.get$keys();
+    return t1.map$1(t1, new $.HashMap_values_anon(this));
+  },
+  containsKey$1: function(key) {
+    var strings, nums, rest;
+    if (typeof key === "string" && key !== "__proto__") {
+      strings = this._strings;
+      return strings == null ? false : strings[key] != null;
+    } else if (typeof key === "number" && (key & 0x3ffffff) === key) {
+      nums = this._nums;
+      return nums == null ? false : nums[key] != null;
+    } else {
+      rest = this._rest;
+      if (rest == null)
+        return false;
+      return $.HashMap__findBucketIndex(rest[$.get$hashCode$(key) & 0x3ffffff], key) >= 0;
+    }
+  },
+  addAll$1: function(_, other) {
+    $.forEach$1$ax(other, new $.HashMap_addAll_anon(this));
+  },
+  $index: function(_, key) {
+    var strings, t1, entry, nums, rest, bucket, index;
+    if (typeof key === "string" && key !== "__proto__") {
+      strings = this._strings;
+      if (strings == null)
+        t1 = null;
+      else {
+        entry = strings[key];
+        t1 = entry === strings ? null : entry;
+      }
+      return t1;
+    } else if (typeof key === "number" && (key & 0x3ffffff) === key) {
+      nums = this._nums;
+      if (nums == null)
+        t1 = null;
+      else {
+        entry = nums[key];
+        t1 = entry === nums ? null : entry;
+      }
+      return t1;
+    } else {
+      rest = this._rest;
+      if (rest == null)
+        return;
+      bucket = rest[$.get$hashCode$(key) & 0x3ffffff];
+      index = $.HashMap__findBucketIndex(bucket, key);
+      return index < 0 ? null : bucket[index + 1];
+    }
+  },
+  $indexSet: function(_, key, value) {
+    var strings, table, nums, rest, hash, bucket, index;
+    if (typeof key === "string" && key !== "__proto__") {
+      strings = this._strings;
+      if (strings == null) {
+        table = Object.create(null);
+        if (table == null)
+          ;
+        table["<non-identifier-key>"] = table;
+        delete table["<non-identifier-key>"];
+        this._strings = table;
+        strings = table;
+      }
+      if (strings[key] == null) {
+        this._liblib0$_length = this._liblib0$_length + 1;
+        this._keys = null;
+      }
+      if (value == null)
+        value = strings;
+      strings[key] = value;
+    } else if (typeof key === "number" && (key & 0x3ffffff) === key) {
+      nums = this._nums;
+      if (nums == null) {
+        table = Object.create(null);
+        if (table == null)
+          ;
+        table["<non-identifier-key>"] = table;
+        delete table["<non-identifier-key>"];
+        this._nums = table;
+        nums = table;
+      }
+      if (nums[key] == null) {
+        this._liblib0$_length = this._liblib0$_length + 1;
+        this._keys = null;
+      }
+      if (value == null)
+        value = nums;
+      nums[key] = value;
+    } else {
+      rest = this._rest;
+      if (rest == null) {
+        table = Object.create(null);
+        if (table == null)
+          ;
+        table["<non-identifier-key>"] = table;
+        delete table["<non-identifier-key>"];
+        this._rest = table;
+        rest = table;
+      }
+      hash = $.get$hashCode$(key) & 0x3ffffff;
+      bucket = rest[hash];
+      if (bucket == null) {
+        value = [key, value];
+        if (value == null)
+          value = rest;
+        rest[hash] = value;
+        this._liblib0$_length = this._liblib0$_length + 1;
+        this._keys = null;
+      } else {
+        index = $.HashMap__findBucketIndex(bucket, key);
+        if (index >= 0)
+          bucket[index + 1] = value;
+        else {
+          bucket.push(key, value);
+          this._liblib0$_length = this._liblib0$_length + 1;
+          this._keys = null;
+        }
+      }
+    }
+  },
+  remove$1: function(_, key) {
+    var rest, bucket, index;
+    if (typeof key === "string" && key !== "__proto__")
+      return this._removeHashTableEntry$2(this._strings, key);
+    else if (typeof key === "number" && (key & 0x3ffffff) === key)
+      return this._removeHashTableEntry$2(this._nums, key);
+    else {
+      rest = this._rest;
+      if (rest == null)
+        return;
+      bucket = rest[$.get$hashCode$(key) & 0x3ffffff];
+      index = $.HashMap__findBucketIndex(bucket, key);
+      if (index < 0)
+        return;
+      this._liblib0$_length = this._liblib0$_length - 1;
+      this._keys = null;
+      return bucket.splice(index, 2)[1];
+    }
+  },
+  forEach$1: function(_, action) {
+    var keys, $length, i, key;
+    keys = this._computeKeys$0();
+    for ($length = $.get$length$asx(keys), i = 0; i < $length; ++i) {
+      key = keys[i];
+      action.call$2(key, this.$index(this, key));
+      if (keys !== this._keys)
+        throw $.wrapException($.ConcurrentModificationError$(this));
+    }
+  },
+  toString$0: function(_) {
+    var result = $.StringBuffer$("");
+    $.ToString__emitPair(this, result, $.List_List($));
+    return result.toString$0(result);
+  },
+  _computeKeys$0: function() {
+    var t1, result, strings, names, entries, index, i, nums, rest, bucket, $length, i0;
+    t1 = this._keys;
+    if (t1 != null)
+      return t1;
+    result = $.List_List(this._liblib0$_length);
+    strings = this._strings;
+    if (strings != null) {
+      names = Object.getOwnPropertyNames(strings);
+      entries = names.length;
+      for (index = 0, i = 0; i < entries; ++i) {
+        result[index] = names[i];
+        ++index;
+      }
+    } else
+      index = 0;
+    nums = this._nums;
+    if (nums != null) {
+      names = Object.getOwnPropertyNames(nums);
+      entries = names.length;
+      for (i = 0; i < entries; ++i) {
+        result[index] = +names[i];
+        ++index;
+      }
+    }
+    rest = this._rest;
+    if (rest != null) {
+      names = Object.getOwnPropertyNames(rest);
+      entries = names.length;
+      for (i = 0; i < entries; ++i) {
+        bucket = rest[names[i]];
+        $length = bucket.length;
+        for (i0 = 0; i0 < $length; i0 += 2) {
+          result[index] = bucket[i0];
+          ++index;
+        }
+      }
+    }
+    this._keys = result;
+    return result;
+  },
+  _removeHashTableEntry$2: function(table, key) {
+    var entry, value;
+    if (table != null && table[key] != null) {
+      entry = table[key];
+      value = entry === table ? null : entry;
+      delete table[key];
+      this._liblib0$_length = this._liblib0$_length - 1;
+      this._keys = null;
+      return value;
+    } else
+      return;
+  },
+  $isMap: true
+};
+
+$$._HashSetBase = {"": "IterableBase;",
+  toString$0: function(_) {
+    var result = $.StringBuffer$("");
+    $.ToString__emitValue(this, result, $.List_List($));
+    return result.toString$0(result);
+  },
+  $asIterable: function() {
+    return null;
+  },
+  $isIterable: function() {
+    return true;
+  }
+};
+
+$$.IterableBase = {"": "Object;",
+  map$1: function(_, f) {
+    return $.MappedIterable$(this, f);
+  },
+  forEach$1: function(_, f) {
+    var t1;
+    for (t1 = this.get$iterator(this); t1.moveNext$0() === true;)
+      f.call$1(t1.get$current());
+  },
+  join$1: function(_, separator) {
+    var iterator, buffer;
+    if (typeof separator !== "string")
+      return this.join$1$bailout(1, separator);
+    iterator = this.get$iterator(this);
+    if (iterator.moveNext$0() !== true)
+      return "";
+    buffer = $.StringBuffer$("");
+    if (separator === "")
+      do
+        buffer.write$1($.S(iterator.get$current()));
+      while (iterator.moveNext$0() === true);
+    else {
+      buffer.write$1($.S(iterator.get$current()));
+      for (; iterator.moveNext$0() === true;) {
+        buffer.write$1(separator);
+        buffer.write$1($.S(iterator.get$current()));
+      }
+    }
+    return buffer.toString$0(buffer);
+  },
+  join$1$bailout: function(state0, separator) {
+    var iterator, buffer;
+    iterator = this.get$iterator(this);
+    if (iterator.moveNext$0() !== true)
+      return "";
+    buffer = $.StringBuffer$("");
+    if (separator == null || $.$eq(separator, "") === true)
+      do
+        buffer.write$1($.S(iterator.get$current()));
+      while (iterator.moveNext$0() === true);
+    else {
+      buffer.write$1($.S(iterator.get$current()));
+      for (; iterator.moveNext$0() === true;) {
+        buffer.write$1(separator);
+        buffer.write$1($.S(iterator.get$current()));
+      }
+    }
+    return buffer.toString$0(buffer);
+  },
+  toList$1$growable: function(_, growable) {
+    return $.List_List$from(this, growable);
+  },
+  toList$0: function($receiver) {
+    return this.toList$1$growable($receiver, true);
+  },
+  get$length: function(_) {
+    var it, count;
+    it = this.get$iterator(this);
+    for (count = 0; it.moveNext$0() === true;)
+      ++count;
+    return count;
+  },
+  get$isEmpty: function(_) {
+    return this.get$iterator(this).moveNext$0() !== true;
+  },
+  skip$1: function(_, n) {
+    return $.SkipIterable$(this, n);
+  },
+  elementAt$1: function(_, index) {
+    var t1, remaining, t2;
+    if (typeof index !== "number")
+      return this.elementAt$1$bailout(1, index);
+    if (typeof index !== "number" || Math.floor(index) !== index || index < 0)
+      throw $.wrapException($.RangeError$value(index));
+    for (t1 = this.get$iterator(this), remaining = index; t1.moveNext$0() === true;) {
+      t2 = t1.get$current();
+      if (remaining === 0)
+        return t2;
+      --remaining;
+    }
+    throw $.wrapException($.RangeError$value(index));
+  },
+  elementAt$1$bailout: function(state0, index) {
+    var t1, remaining, t2, t3;
+    if (typeof index !== "number" || Math.floor(index) !== index || index < 0)
+      throw $.wrapException($.RangeError$value(index));
+    for (t1 = this.get$iterator(this), remaining = index; t1.moveNext$0() === true;) {
+      t2 = t1.get$current();
+      t3 = $.getInterceptor(remaining);
+      if (t3.$eq(remaining, 0))
+        return t2;
+      remaining = t3.$sub(remaining, 1);
+    }
+    throw $.wrapException($.RangeError$value(index));
+  },
+  $isIterable: function() {
+    return true;
+  },
+  $asIterable: function() {
+    return null;
+  }
+};
+
+$$.LinkedHashMap = {"": "Object;_liblib0$_length,_strings,_nums,_rest,_first,_last,_modifications",
+  addAll$1: function(_, other) {
+    $.forEach$1$ax(other, new $.LinkedHashMap_addAll_anon(this));
+  },
+  $index: function(_, key) {
+    var strings, cell, nums, rest, bucket, index;
+    if (typeof key === "string" && key !== "__proto__") {
+      strings = this._strings;
+      if (strings == null)
+        return;
+      cell = strings[key];
+      return cell == null ? null : cell.get$_value();
+    } else if (typeof key === "number" && (key & 0x3ffffff) === key) {
+      nums = this._nums;
+      if (nums == null)
+        return;
+      cell = nums[key];
+      return cell == null ? null : cell.get$_value();
+    } else {
+      rest = this._rest;
+      if (rest == null)
+        return;
+      bucket = rest[$.get$hashCode$(key) & 0x3ffffff];
+      index = $.LinkedHashMap__findBucketIndex(bucket, key);
+      if (index < 0)
+        return;
+      return bucket[index].get$_value();
+    }
+  },
+  $indexSet: function(_, key, value) {
+    var strings, table, nums, rest, hash, bucket, index;
+    if (typeof key === "string" && key !== "__proto__") {
+      strings = this._strings;
+      if (strings == null) {
+        table = Object.create(null);
+        table["<non-identifier-key>"] = table;
+        delete table["<non-identifier-key>"];
+        this._strings = table;
+        strings = table;
+      }
+      this._addHashTableEntry$3(strings, key, value);
+    } else if (typeof key === "number" && (key & 0x3ffffff) === key) {
+      nums = this._nums;
+      if (nums == null) {
+        table = Object.create(null);
+        table["<non-identifier-key>"] = table;
+        delete table["<non-identifier-key>"];
+        this._nums = table;
+        nums = table;
+      }
+      this._addHashTableEntry$3(nums, key, value);
+    } else {
+      rest = this._rest;
+      if (rest == null) {
+        table = Object.create(null);
+        table["<non-identifier-key>"] = table;
+        delete table["<non-identifier-key>"];
+        this._rest = table;
+        rest = table;
+      }
+      hash = $.get$hashCode$(key) & 0x3ffffff;
+      bucket = rest[hash];
+      if (bucket == null)
+        rest[hash] = [this._newLinkedCell$2(key, value)];
+      else {
+        index = $.LinkedHashMap__findBucketIndex(bucket, key);
+        if (index >= 0)
+          bucket[index].set$_value(value);
+        else
+          bucket.push(this._newLinkedCell$2(key, value));
+      }
+    }
+  },
+  forEach$1: function(_, action) {
+    var cell, modifications;
+    cell = this._first;
+    modifications = this._modifications;
+    for (; cell != null;) {
+      action.call$2(cell.get$_key(), cell.get$_value());
+      if (modifications !== this._modifications)
+        throw $.wrapException($.ConcurrentModificationError$(this));
+      cell = cell.get$_next();
+    }
+  },
+  get$keys: function() {
+    return $.LinkedHashMapKeyIterable$(this);
+  },
+  get$values: function(_) {
+    var t1 = this.get$keys();
+    return t1.map$1(t1, new $.LinkedHashMap_values_anon(this));
+  },
+  get$length: function(_) {
+    return this._liblib0$_length;
+  },
+  get$isEmpty: function(_) {
+    return this._liblib0$_length === 0;
+  },
+  toString$0: function(_) {
+    var result = $.StringBuffer$("");
+    $.ToString__emitPair(this, result, $.List_List($));
+    return result.toString$0(result);
+  },
+  _addHashTableEntry$3: function(table, key, value) {
+    var cell = table[key];
+    if (cell == null)
+      table[key] = this._newLinkedCell$2(key, value);
+    else
+      cell.set$_value(value);
+  },
+  _newLinkedCell$2: function(key, value) {
+    var cell, last;
+    cell = $.LinkedHashMapCell$(key, value);
+    if (this._first == null) {
+      this._last = cell;
+      this._first = cell;
+    } else {
+      last = this._last;
+      cell._previous = last;
+      last._next = cell;
+      this._last = cell;
+    }
+    this._liblib0$_length = this._liblib0$_length + 1;
+    this._modifications = this._modifications + 1 & 67108863;
+    return cell;
+  },
+  $isMap: true
+};
+
+$$.LinkedHashSet = {"": "_HashSetBase;_liblib0$_length,_strings,_nums,_rest,_first,_last,_modifications",
+  get$iterator: function(_) {
+    return $.LinkedHashSetIterator$(this, this._modifications);
+  },
+  get$length: function(_) {
+    return this._liblib0$_length;
+  },
+  get$isEmpty: function(_) {
+    return this._liblib0$_length === 0;
+  },
+  contains$1: function(_, object) {
+    var strings, nums, rest;
+    if (object !== "__proto__") {
+      strings = this._strings;
+      if (strings == null)
+        return false;
+      return strings[object] != null;
+    } else if (false) {
+      nums = this._nums;
+      if (nums == null)
+        return false;
+      return nums[object] != null;
+    } else {
+      rest = this._rest;
+      if (rest == null)
+        return false;
+      return $.LinkedHashSet__findBucketIndex(rest[$.JSString_methods.get$hashCode(object) & 0x3ffffff], object) >= 0;
+    }
+  },
+  forEach$1: function(_, action) {
+    var cell, modifications;
+    cell = this._first;
+    modifications = this._modifications;
+    for (; cell != null;) {
+      action.call$1(cell.get$_element());
+      if (modifications !== this._modifications)
+        throw $.wrapException($.ConcurrentModificationError$(this));
+      cell = cell.get$_next();
+    }
+  },
+  add$1: function(_, element) {
+    var strings, table, nums, rest, hash, bucket;
+    if (typeof element === "string" && element !== "__proto__") {
+      strings = this._strings;
+      if (strings == null) {
+        table = Object.create(null);
+        table["<non-identifier-key>"] = table;
+        delete table["<non-identifier-key>"];
+        this._strings = table;
+        strings = table;
+      }
+      this._addHashTableEntry$2(strings, element);
+    } else if (typeof element === "number" && (element & 0x3ffffff) === element) {
+      nums = this._nums;
+      if (nums == null) {
+        table = Object.create(null);
+        table["<non-identifier-key>"] = table;
+        delete table["<non-identifier-key>"];
+        this._nums = table;
+        nums = table;
+      }
+      this._addHashTableEntry$2(nums, element);
+    } else {
+      rest = this._rest;
+      if (rest == null) {
+        table = Object.create(null);
+        table["<non-identifier-key>"] = table;
+        delete table["<non-identifier-key>"];
+        this._rest = table;
+        rest = table;
+      }
+      hash = $.get$hashCode$(element) & 0x3ffffff;
+      bucket = rest[hash];
+      if (bucket == null)
+        rest[hash] = [this._newLinkedCell$1(element)];
+      else {
+        if ($.LinkedHashSet__findBucketIndex(bucket, element) >= 0)
+          return;
+        bucket.push(this._newLinkedCell$1(element));
+      }
+    }
+  },
+  addAll$1: function(_, objects) {
+    var t1;
+    for (t1 = $.get$iterator$ax(objects); t1.moveNext$0() === true;)
+      this.add$1(this, t1.get$current());
+  },
+  remove$1: function(_, object) {
+    var rest, bucket, index;
+    if (object !== "__proto__")
+      return this._removeHashTableEntry$2(this._strings, object);
+    else if (false)
+      return this._removeHashTableEntry$2(this._nums, object);
+    else {
+      rest = this._rest;
+      if (rest == null)
+        return false;
+      bucket = rest[$.JSString_methods.get$hashCode(object) & 0x3ffffff];
+      index = $.LinkedHashSet__findBucketIndex(bucket, object);
+      if (index < 0)
+        return false;
+      this._unlinkCell$1(bucket.splice(index, 1)[0]);
+      return true;
+    }
+  },
+  _addHashTableEntry$2: function(table, element) {
+    if (table[element] != null)
+      return;
+    table[element] = this._newLinkedCell$1(element);
+  },
+  _removeHashTableEntry$2: function(table, element) {
+    var cell;
+    if (table == null)
+      return false;
+    cell = table[element];
+    if (cell == null)
+      return false;
+    this._unlinkCell$1(cell);
+    delete table[element];
+    return true;
+  },
+  _newLinkedCell$1: function(element) {
+    var cell, last;
+    cell = $.LinkedHashSetCell$(element);
+    if (this._first == null) {
+      this._last = cell;
+      this._first = cell;
+    } else {
+      last = this._last;
+      cell._previous = last;
+      last.set$_next(cell);
+      this._last = cell;
+    }
+    this._liblib0$_length = this._liblib0$_length + 1;
+    this._modifications = this._modifications + 1 & 67108863;
+    return cell;
+  },
+  _unlinkCell$1: function(cell) {
+    var previous, next;
+    previous = cell.get$_previous();
+    next = cell.get$_next();
+    if (previous == null)
+      this._first = next;
+    else
+      previous.set$_next(next);
+    if (next == null)
+      this._last = previous;
+    else
+      next.set$_previous(previous);
+    this._liblib0$_length = this._liblib0$_length - 1;
+    this._modifications = this._modifications + 1 & 67108863;
+  },
+  $asIterable: function() {
+    return null;
+  }
+};
+
+$$.ListBase = {"": "Object;",
+  get$iterator: function(_) {
+    return $.ListIterator$(this);
+  },
+  elementAt$1: function(_, index) {
+    return this.$index(this, index);
+  },
+  forEach$1: function(_, action) {
+    var $length, i;
+    $length = this.get$length(this);
+    if (typeof $length !== "number")
+      return this.forEach$1$bailout(1, action, $length);
+    for (i = 0; i < $length; ++i) {
+      action.call$1(this.$index(this, i));
+      if ($length !== this.get$length(this))
+        throw $.wrapException($.ConcurrentModificationError$(this));
+    }
+  },
+  forEach$1$bailout: function(state0, action, $length) {
+    var t1, i;
+    for (t1 = $.getInterceptor($length), i = 0; $.JSNumber_methods.$lt(i, $length); ++i) {
+      action.call$1(this.$index(this, i));
+      if (t1.$eq($length, this.get$length(this)) !== true)
+        throw $.wrapException($.ConcurrentModificationError$(this));
+    }
+  },
+  get$isEmpty: function(_) {
+    return $.$eq(this.get$length(this), 0);
+  },
+  where$1: function(_, test) {
+    return $.WhereIterable$(this, test);
+  },
+  skip$1: function(_, count) {
+    return $.SubListIterable$(this, count, null);
+  },
+  toList$1$growable: function(_, growable) {
+    var result, i, t1;
+    if (growable === true) {
+      result = $.List_List($);
+      $.JSArray_methods.set$length(result, this.get$length(this));
+    } else
+      result = $.List_List(this.get$length(this));
+    for (i = 0; $.JSNumber_methods.$lt(i, this.get$length(this)); ++i) {
+      t1 = this.$index(this, i);
+      if (i >= result.length)
+        throw $.ioore(i);
+      result[i] = t1;
+    }
+    return result;
+  },
+  toList$0: function($receiver) {
+    return this.toList$1$growable($receiver, true);
+  },
+  add$1: function(_, element) {
+    var t1 = this.get$length(this);
+    if (typeof t1 !== "number")
+      return this.add$1$bailout(1, element, t1);
+    this.set$length(this, t1 + 1);
+    this.$indexSet(this, t1, element);
+  },
+  add$1$bailout: function(state0, element, t1) {
+    this.set$length(this, $.$add$ns(t1, 1));
+    this.$indexSet(this, t1, element);
+  },
+  addAll$1: function(_, iterable) {
+    var t1, t2, t3;
+    for (t1 = $.get$iterator$ax(iterable); t1.moveNext$0() === true;) {
+      t2 = t1.get$current();
+      t3 = this.get$length(this);
+      this.set$length(this, $.$add$ns(t3, 1));
+      this.$indexSet(this, t3, t2);
+    }
+  },
+  clear$0: function(_) {
+    this.set$length(this, 0);
+  },
+  removeLast$0: function(_) {
+    var result;
+    if ($.$eq(this.get$length(this), 0) === true)
+      throw $.wrapException($.StateError$("No elements"));
+    result = this.$index(this, $.$sub$n(this.get$length(this), 1));
+    this.set$length(this, $.$sub$n(this.get$length(this), 1));
+    return result;
+  },
+  sublist$2: function(_, start, end) {
+    var t1, $length, result, i;
+    if (typeof start !== "number")
+      return this.sublist$2$bailout(1, start, end);
+    if (end == null)
+      end = this.get$length(this);
+    if (start < 0 || $.JSNumber_methods.$gt(start, this.get$length(this)))
+      $.throwExpression($.RangeError$range(start, 0, this.get$length(this)));
+    t1 = $.getInterceptor$n(end);
+    if (t1.$lt(end, start) || t1.$gt(end, this.get$length(this)))
+      $.throwExpression($.RangeError$range(end, start, this.get$length(this)));
+    $length = t1.$sub(end, start);
+    if (typeof $length !== "number")
+      return this.sublist$2$bailout(2, start, 0, $.JSNumber_methods, $length);
+    result = $.List_List($);
+    $.JSArray_methods.set$length(result, $length);
+    for (i = 0; i < $length; ++i) {
+      t1 = this.$index(this, start + i);
+      if (i >= result.length)
+        throw $.ioore(i);
+      result[i] = t1;
+    }
+    return result;
+  },
+  sublist$2$bailout: function(state0, start, end, t1, $length) {
+    switch (state0) {
+      case 0:
+      case 1:
+        state0 = 0;
+        if (end == null)
+          end = this.get$length(this);
+        t1 = $.getInterceptor$n(start);
+        if (t1.$lt(start, 0) || t1.$gt(start, this.get$length(this)))
+          $.throwExpression($.RangeError$range(start, 0, this.get$length(this)));
+        t2 = $.getInterceptor$n(end);
+        if (t2.$lt(end, start) || t2.$gt(end, this.get$length(this)))
+          $.throwExpression($.RangeError$range(end, start, this.get$length(this)));
+        $length = t2.$sub(end, start);
+      case 2:
+        var t2, result, i;
+        state0 = 0;
+        result = $.List_List($);
+        $.JSArray_methods.set$length(result, $length);
+        for (i = 0; $.JSNumber_methods.$lt(i, $length); ++i) {
+          t2 = this.$index(this, t1.$add(start, i));
+          if (i >= result.length)
+            throw $.ioore(i);
+          result[i] = t2;
+        }
+        return result;
+    }
+  },
+  sublist$1: function($receiver, start) {
+    return this.sublist$2($receiver, start, null);
+  },
+  toString$0: function(_) {
+    var result = $.StringBuffer$("");
+    $.ToString__emitValue(this, result, $.List_List($));
+    return result.toString$0(result);
+  },
+  $isList: function() {
+    return true;
+  },
+  $asList: function() {
+    return null;
+  },
+  $isIterable: function() {
+    return true;
+  },
+  $asIterable: function() {
+    return null;
+  }
+};
+
+$$.ListQueue = {"": "IterableBase;_table,_head,_tail,_modificationCount",
+  get$iterator: function(_) {
+    return $._ListQueueIterator$(this);
+  },
+  forEach$1: function(_, action) {
+    var modificationCount, i, t1;
+    modificationCount = this._modificationCount;
+    for (i = this._head; i !== this._tail; i = (i + 1 & this._table.length - 1) >>> 0) {
+      t1 = this._table;
+      if (i < 0 || i >= t1.length)
+        throw $.ioore(i);
+      action.call$1(t1[i]);
+      if (modificationCount !== this._modificationCount)
+        $.throwExpression($.ConcurrentModificationError$(this));
+    }
+  },
+  get$isEmpty: function(_) {
+    return this._head === this._tail;
+  },
+  get$length: function(_) {
+    return $.$and$n($.$sub$n(this._tail, this._head), this._table.length - 1);
+  },
+  elementAt$1: function(_, index) {
+    var t1, t2, t3;
+    t1 = $.getInterceptor$n(index);
+    if (t1.$lt(index, 0) || t1.$gt(index, this.get$length(this)))
+      throw $.wrapException($.RangeError$range(index, 0, this.get$length(this)));
+    t1 = this._table;
+    t2 = this._head;
+    if (typeof index !== "number")
+      throw $.iae(index);
+    t3 = t1.length;
+    t2 = (t2 + index & t3 - 1) >>> 0;
+    if (t2 < 0 || t2 >= t3)
+      throw $.ioore(t2);
+    return t1[t2];
+  },
+  toList$1$growable: function(_, growable) {
+    var list;
+    if (growable === true) {
+      list = $.List_List($);
+      $.JSArray_methods.set$length(list, this.get$length(this));
+    } else
+      list = $.List_List(this.get$length(this));
+    this._writeToList$1(list);
+    return list;
+  },
+  toList$0: function($receiver) {
+    return this.toList$1$growable($receiver, true);
+  },
+  add$1: function(_, element) {
+    this._add$1(element);
+  },
+  addAll$1: function(_, elements) {
+    var addCount, $length, t1, t2, t3, endSpace, preSpace;
+    if (typeof elements === "object" && elements !== null && (elements.constructor === Array || $.getInterceptor(elements).$isList())) {
+      addCount = $.get$length$asx(elements);
+      $length = this.get$length(this);
+      if (typeof addCount !== "number")
+        throw $.iae(addCount);
+      t1 = $length + addCount;
+      t2 = this._table;
+      t3 = t2.length;
+      if (t1 >= t3) {
+        this._preGrow$1(t1);
+        $.JSArray_methods.setRange$4(this._table, $length, t1, elements, 0);
+        this._tail = $.$add$ns(this._tail, addCount);
+      } else {
+        t1 = this._tail;
+        if (typeof t1 !== "number")
+          throw $.iae(t1);
+        endSpace = t3 - t1;
+        if (addCount < endSpace) {
+          $.JSArray_methods.setRange$4(t2, t1, t1 + addCount, elements, 0);
+          this._tail = $.$add$ns(this._tail, addCount);
+        } else {
+          preSpace = addCount - endSpace;
+          $.JSArray_methods.setRange$4(t2, t1, t1 + endSpace, elements, 0);
+          $.JSArray_methods.setRange$4(this._table, 0, preSpace, elements, endSpace);
+          this._tail = preSpace;
+        }
+      }
+      this._modificationCount = this._modificationCount + 1;
+    } else
+      for (t1 = $.get$iterator$ax(elements); t1.moveNext$0() === true;)
+        this._add$1(t1.get$current());
+  },
+  toString$0: function(_) {
+    var result = $.StringBuffer$("");
+    $.ToString__emitValue(this, result, $.List_List($));
+    return result.toString$0(result);
+  },
+  addLast$1: function(element) {
+    this._add$1(element);
+  },
+  removeFirst$0: function() {
+    var t1, t2, t3, result;
+    if (this._head === this._tail)
+      throw $.wrapException($.StateError$("No elements"));
+    this._modificationCount = this._modificationCount + 1;
+    t1 = this._table;
+    t2 = this._head;
+    t3 = t1.length;
+    if (t2 < 0 || t2 >= t3)
+      throw $.ioore(t2);
+    result = t1[t2];
+    this._head = (t2 + 1 & t3 - 1) >>> 0;
+    return result;
+  },
+  removeLast$0: function(_) {
+    var t1, t2;
+    if (this._head === this._tail)
+      throw $.wrapException($.StateError$("No elements"));
+    this._modificationCount = this._modificationCount + 1;
+    this._tail = $.$and$n($.$sub$n(this._tail, 1), this._table.length - 1);
+    t1 = this._table;
+    t2 = this._tail;
+    if (t2 !== (t2 | 0))
+      throw $.iae(t2);
+    if (t2 < 0 || t2 >= t1.length)
+      throw $.ioore(t2);
+    return t1[t2];
+  },
+  _checkModification$1: function(expectedModificationCount) {
+    if (typeof expectedModificationCount !== "number")
+      return this._checkModification$1$bailout(1, expectedModificationCount);
+    if (expectedModificationCount !== this._modificationCount)
+      throw $.wrapException($.ConcurrentModificationError$(this));
+  },
+  _checkModification$1$bailout: function(state0, expectedModificationCount) {
+    if ($.$eq(expectedModificationCount, this._modificationCount) !== true)
+      throw $.wrapException($.ConcurrentModificationError$(this));
+  },
+  _add$1: function(element) {
+    var t1, t2;
+    t1 = this._table;
+    t2 = this._tail;
+    if (t2 !== (t2 | 0))
+      throw $.iae(t2);
+    if (t2 < 0 || t2 >= t1.length)
+      throw $.ioore(t2);
+    t1[t2] = element;
+    this._tail = $.$and$n(t2 + 1, this._table.length - 1);
+    if (this._head === this._tail)
+      this._grow$0();
+    this._modificationCount = this._modificationCount + 1;
+  },
+  _grow$0: function() {
+    var newTable, t1, t2, split;
+    newTable = $.List_List(this._table.length * 2);
+    t1 = this._table;
+    t2 = this._head;
+    split = t1.length - t2;
+    $.JSArray_methods.setRange$4(newTable, 0, split, t1, t2);
+    $.JSArray_methods.setRange$4(newTable, split, split + this._head, this._table, 0);
+    this._head = 0;
+    this._tail = this._table.length;
+    this._table = newTable;
+  },
+  _writeToList$1: function(target) {
+    var t1, t2, $length, firstPartSize;
+    t1 = $.JSInt_methods.$le(this._head, this._tail);
+    t2 = this._head;
+    if (t1) {
+      $length = $.$sub$n(this._tail, t2);
+      $.JSArray_methods.setRange$4(target, 0, $length, this._table, this._head);
+      return $length;
+    } else {
+      t1 = this._table;
+      firstPartSize = t1.length - t2;
+      $.JSArray_methods.setRange$4(target, 0, firstPartSize, t1, t2);
+      t2 = this._tail;
+      if (typeof t2 !== "number")
+        throw $.iae(t2);
+      $.JSArray_methods.setRange$4(target, firstPartSize, firstPartSize + t2, this._table, 0);
+      return $.$add$ns(this._tail, firstPartSize);
+    }
+  },
+  _preGrow$1: function(newElementCount) {
+    var newTable = $.List_List($.ListQueue__nextPowerOf2(newElementCount));
+    this._tail = this._writeToList$1(newTable);
+    this._table = newTable;
+    this._head = 0;
+  },
+  ListQueue$1: function(initialCapacity) {
+    if (initialCapacity == null || $.JSNull_methods.$lt(initialCapacity, 8))
+      initialCapacity = 8;
+    else if (!$.ListQueue__isPowerOf2(initialCapacity))
+      initialCapacity = $.ListQueue__nextPowerOf2(initialCapacity);
+    this._table = $.List_List(initialCapacity);
+  },
+  $asIterable: function() {
+    return null;
+  },
+  $isIterable: function() {
+    return true;
+  }
+};
+
+$$._ListQueueIterator = {"": "Object;_queue,_end,_modificationCount,_liblib0$_position,_liblib0$_current",
+  get$current: function() {
+    return this._liblib0$_current;
+  },
+  moveNext$0: function() {
+    var t1, t2, t3;
+    t1 = this._queue;
+    t1._checkModification$1(this._modificationCount);
+    t2 = this._liblib0$_position;
+    if (t2 === this._end) {
+      this._liblib0$_current = null;
+      return false;
+    }
+    t3 = t1._table;
+    if (t2 < 0 || t2 >= t3.length)
+      throw $.ioore(t2);
+    this._liblib0$_current = t3[t2];
+    this._liblib0$_position = (this._liblib0$_position + 1 & t1._table.length - 1) >>> 0;
+    return true;
+  }
+};
+
+$$.Duration = {"": "Object;_duration<",
+  $add: function(_, other) {
+    return $.Duration$(0, 0, this._duration + other.get$_duration(), 0, 0, 0);
+  },
+  $sub: function(_, other) {
+    return $.Duration$(0, 0, this._duration - other.get$_duration(), 0, 0, 0);
+  },
+  $mul: function(_, factor) {
+    return $.Duration$(0, 0, this._duration * factor, 0, 0, 0);
+  },
+  $tdiv: function(_, quotient) {
+    if (quotient === 0)
+      throw $.wrapException($.IntegerDivisionByZeroException$());
+    return $.Duration$(0, 0, $.JSNumber_methods.$tdiv(this._duration, quotient), 0, 0, 0);
+  },
+  $lt: function(_, other) {
+    return this._duration < other.get$_duration();
+  },
+  $gt: function(_, other) {
+    return this._duration > other.get$_duration();
+  },
+  $ge: function(_, other) {
+    return this._duration >= other.get$_duration();
+  },
+  get$inHours: function() {
+    return $.JSNumber_methods.$tdiv(this._duration, 3600000000);
+  },
+  get$inMinutes: function() {
+    return $.JSNumber_methods.$tdiv(this._duration, 60000000);
+  },
+  get$inSeconds: function() {
+    return $.JSNumber_methods.$tdiv(this._duration, 1000000);
+  },
+  get$inMilliseconds: function() {
+    return $.JSNumber_methods.$tdiv(this._duration, 1000);
+  },
+  get$inMicroseconds: function() {
+    return this._duration;
+  },
+  $eq: function(_, other) {
+    if (other == null)
+      return false;
+    if (typeof other !== "object" || other === null || !$.getInterceptor(other).$isDuration)
+      return false;
+    return this._duration === other._duration;
+  },
+  get$hashCode: function(_) {
+    return $.JSNumber_methods.get$hashCode(this._duration);
+  },
+  toString$0: function(_) {
+    var t1, t2, twoDigitMinutes, twoDigitSeconds, sixDigitUs;
+    t1 = new $.Duration_toString_sixDigits();
+    t2 = new $.Duration_toString_twoDigits();
+    if (this.get$inMicroseconds() < 0)
+      return "-" + $.S($.Duration$(0, 0, -this.get$inMicroseconds(), 0, 0, 0));
+    twoDigitMinutes = t2.call$1($.JSNumber_methods.remainder$1(this.get$inMinutes(), 60));
+    twoDigitSeconds = t2.call$1($.JSNumber_methods.remainder$1(this.get$inSeconds(), 60));
+    sixDigitUs = t1.call$1($.JSNumber_methods.remainder$1(this.get$inMicroseconds(), 1000000));
+    return $.S(this.get$inHours()) + ":" + $.S(twoDigitMinutes) + ":" + $.S(twoDigitSeconds) + "." + $.S(sixDigitUs);
+  },
+  $isDuration: true
+};
+
+$$.Duration_toString_sixDigits = {"": "Closure;",
+  call$1: function(n) {
+    var t1 = $.getInterceptor$n(n);
+    if (t1.$ge(n, 100000))
+      return $.S(n);
+    if (t1.$ge(n, 10000))
+      return "0" + $.S(n);
+    if (t1.$ge(n, 1000))
+      return "00" + $.S(n);
+    if (t1.$ge(n, 100))
+      return "000" + $.S(n);
+    if (t1.$gt(n, 10))
+      return "0000" + $.S(n);
+    return "00000" + $.S(n);
+  }
+};
+
+$$.Duration_toString_twoDigits = {"": "Closure;",
+  call$1: function(n) {
+    if ($.$ge$n(n, 10))
+      return $.S(n);
+    return "0" + $.S(n);
+  }
+};
+
+$$.NullThrownError = {"": "Object;",
+  toString$0: function(_) {
+    return "Throw of null.";
+  }
+};
+
+$$.ArgumentError = {"": "Object;message",
+  toString$0: function(_) {
+    var t1 = this.message;
+    if (t1 != null)
+      return "Illegal argument(s): " + $.S(t1);
+    return "Illegal argument(s)";
+  }
+};
+
+$$.RangeError = {"": "ArgumentError;message",
+  toString$0: function(_) {
+    return "RangeError: " + $.S(this.message);
+  }
+};
+
+$$.NoSuchMethodError = {"": "Object;_receiver,_memberName,_arguments,_namedArguments,_existingArgumentNames",
+  toString$0: function(_) {
+    var t1, t2, t3, t4, actualParameters, i, formalParameters;
+    t1 = {};
+    t1.sb_0 = $.StringBuffer$("");
+    t1.i_1 = 0;
+    t2 = this._arguments;
+    for (; $.$lt$n(t1.i_1, t2.length); t1.i_1 = $.$add$ns(t1.i_1, 1)) {
+      if ($.$gt$n(t1.i_1, 0))
+        t1.sb_0.write$1(", ");
+      t3 = t1.sb_0;
+      t4 = t1.i_1;
+      if (t4 !== (t4 | 0))
+        throw $.iae(t4);
+      if (t4 < 0 || t4 >= t2.length)
+        throw $.ioore(t4);
+      t3.write$1($.Error_safeToString(t2[t4]));
+    }
+    t2 = this._namedArguments;
+    t2.forEach$1(t2, new $.NoSuchMethodError_toString_anon(t1));
+    t2 = this._existingArgumentNames;
+    if (t2 == null)
+      return "NoSuchMethodError : method not found: '" + $.S(this._memberName) + "'\nReceiver: " + $.S($.Error_safeToString(this._receiver)) + "\nArguments: [" + $.S(t1.sb_0) + "]";
+    else {
+      t3 = t1.sb_0;
+      actualParameters = t3.toString$0(t3);
+      t1.sb_0 = $.StringBuffer$("");
+      for (i = 0; $.JSNumber_methods.$lt(i, $.JSNull_methods.get$length(t2)); ++i) {
+        if (i > 0)
+          t1.sb_0.write$1(", ");
+        t1.sb_0.write$1($.JSNull_methods.$index(t2, i));
+      }
+      t1 = t1.sb_0;
+      formalParameters = t1.toString$0(t1);
+      t1 = this._memberName;
+      return "NoSuchMethodError: incorrect number of arguments passed to method named '" + $.S(t1) + "'\nReceiver: " + $.S($.Error_safeToString(this._receiver)) + "\nTried calling: " + $.S(t1) + "(" + actualParameters + ")\nFound: " + $.S(t1) + "(" + formalParameters + ")";
+    }
+  }
+};
+
+$$.UnsupportedError = {"": "Object;message",
+  toString$0: function(_) {
+    return "Unsupported operation: " + this.message;
+  }
+};
+
+$$.UnimplementedError = {"": "Object;message",
+  toString$0: function(_) {
+    var t1 = this.message;
+    return t1 != null ? "UnimplementedError: " + $.S(t1) : "UnimplementedError";
+  }
+};
+
+$$.StateError = {"": "Object;message",
+  toString$0: function(_) {
+    return "Bad state: " + this.message;
+  }
+};
+
+$$.ConcurrentModificationError = {"": "Object;modifiedObject",
+  toString$0: function(_) {
+    var t1 = this.modifiedObject;
+    if (t1 == null)
+      return "Concurrent modification during iteration.";
+    return "Concurrent modification during iteration: " + $.S($.Error_safeToString(t1)) + ".";
+  }
+};
+
+$$.StackOverflowError = {"": "Object;",
+  toString$0: function(_) {
+    return "Stack Overflow";
+  }
+};
+
+$$.RuntimeError = {"": "Object;message",
+  toString$0: function(_) {
+    return "RuntimeError: " + this.message;
+  }
+};
+
+$$._ExceptionImplementation = {"": "Object;message",
+  toString$0: function(_) {
+    var t1 = this.message;
+    if (t1 == null)
+      return "Exception";
+    return "Exception: " + $.S(t1);
+  },
+  $isException: true
+};
+
+$$.FormatException = {"": "Object;message",
+  toString$0: function(_) {
+    return "FormatException: " + this.message;
+  },
+  $isException: true
+};
+
+$$.IntegerDivisionByZeroException = {"": "Object;",
+  toString$0: function(_) {
+    return "IntegerDivisionByZeroException";
+  },
+  $isException: true
+};
+
+$$.Expando = {"": "Object;name>",
+  toString$0: function(_) {
+    return "Expando:" + this.name;
+  },
+  $index: function(_, object) {
+    var values = $.Primitives_getProperty(object, "expando$values");
+    return values == null ? null : $.Primitives_getProperty(values, this._getKey$0());
+  },
+  $indexSet: function(_, object, value) {
+    var values = $.Primitives_getProperty(object, "expando$values");
+    if (values == null) {
+      values = $.Object$();
+      $.Primitives_setProperty(object, "expando$values", values);
+    }
+    $.Primitives_setProperty(values, this._getKey$0(), value);
+  },
+  _getKey$0: function() {
+    var key, t1;
+    key = $.Primitives_getProperty(this, "expando$key");
+    if (key == null) {
+      t1 = $.Expando__keyCount;
+      $.Expando__keyCount = $.$add$ns(t1, 1);
+      key = "expando$key$" + $.S(t1);
+      $.Primitives_setProperty(this, "expando$key", key);
+    }
+    return key;
+  }
+};
+
+$$.Iterator = {"": "Object;"};
+
+$$.Object = {"": ";",
+  $eq: function(_, other) {
+    return this === other;
+  },
+  get$hashCode: function(_) {
+    return $.Primitives_objectHashCode(this);
+  },
+  toString$0: function(_) {
+    return "Instance of '" + $.S($.Primitives_objectTypeName(this)) + "'";
+  }
+};
+
+$$.StringBuffer = {"": "Object;_contents",
+  get$length: function(_) {
+    return this._contents.length;
+  },
+  get$isEmpty: function(_) {
+    return this.get$length(this) === 0;
+  },
+  write$1: function(obj) {
+    if (typeof obj !== "string")
+      return this.write$1$bailout(1, obj);
+    this._contents = this._contents + obj;
+  },
+  write$1$bailout: function(state0, obj) {
+    var str = typeof obj === "string" ? obj : $.S(obj);
+    this._contents = this._contents + str;
+  },
+  writeAll$2: function(objects, separator) {
+    var iterator, str;
+    if (typeof separator !== "string")
+      return this.writeAll$2$bailout(1, objects, separator);
+    iterator = $.get$iterator$ax(objects);
+    if (iterator.moveNext$0() !== true)
+      return;
+    if ($.JSString_methods.get$isEmpty(separator))
+      do {
+        str = iterator.get$current();
+        str = typeof str === "string" ? str : $.S(str);
+        this._contents = this._contents + str;
+      } while (iterator.moveNext$0() === true);
+    else {
+      str = iterator.get$current();
+      str = typeof str === "string" ? str : $.S(str);
+      this._contents = this._contents + str;
+      for (; iterator.moveNext$0() === true;) {
+        this._contents = this._contents + separator;
+        str = iterator.get$current();
+        str = typeof str === "string" ? str : $.S(str);
+        this._contents = this._contents + str;
+      }
+    }
+  },
+  writeAll$2$bailout: function(state0, objects, separator) {
+    var iterator, str, t1;
+    iterator = $.get$iterator$ax(objects);
+    if (iterator.moveNext$0() !== true)
+      return;
+    if ($.get$isEmpty$asx(separator) === true)
+      do {
+        str = iterator.get$current();
+        str = typeof str === "string" ? str : $.S(str);
+        this._contents = this._contents + str;
+      } while (iterator.moveNext$0() === true);
+    else {
+      str = iterator.get$current();
+      str = typeof str === "string" ? str : $.S(str);
+      this._contents = this._contents + str;
+      for (t1 = typeof separator === "string"; iterator.moveNext$0() === true;) {
+        str = t1 ? separator : $.S(separator);
+        this._contents = this._contents + str;
+        str = iterator.get$current();
+        str = typeof str === "string" ? str : $.S(str);
+        this._contents = this._contents + str;
+      }
+    }
+  },
+  toString$0: function(_) {
+    return this._contents;
+  },
+  StringBuffer$1: function($content) {
+    this._contents = $content;
+  }
+};
+
+$$._ChildrenElementList = {"": "ListBase;_liblib1$_element,_childElements",
+  toList$1$growable: function(_, growable) {
+    var t1, output, len, t2, i, t3;
+    t1 = this._childElements;
+    if (growable === true) {
+      output = [];
+      $.JSArray_methods.set$length(output, $.get$length$asx(t1));
+    } else
+      output = $.List_List($.get$length$asx(t1));
+    for (t1 = this._childElements, len = $.get$length$asx(t1), t2 = $.getInterceptor$asx(t1), i = 0; i < len; ++i) {
+      t3 = t2.$index(t1, i);
+      if (i >= output.length)
+        throw $.ioore(i);
+      output[i] = t3;
+    }
+    return output;
+  },
+  toList$0: function($receiver) {
+    return this.toList$1$growable($receiver, true);
+  },
+  forEach$1: function(_, f) {
+    var t1;
+    for (t1 = $.get$iterator$ax(this._childElements); t1.moveNext$0();)
+      f.call$1(t1.get$current());
+  },
+  get$isEmpty: function(_) {
+    return this._liblib1$_element.firstElementChild == null;
+  },
+  skip$1: function(_, n) {
+    return $.skip$1$ax(this._childElements, n);
+  },
+  elementAt$1: function(_, index) {
+    return $.$index$asx(this._childElements, index);
+  },
+  get$length: function(_) {
+    return $.get$length$asx(this._childElements);
+  },
+  $index: function(_, index) {
+    return $.$index$asx(this._childElements, index);
+  },
+  $indexSet: function(_, index, value) {
+    this._liblib1$_element.replaceChild(value, $.$index$asx(this._childElements, index));
+  },
+  set$length: function(_, newLength) {
+    throw $.wrapException($.UnsupportedError$(""));
+  },
+  add$1: function(_, value) {
+    this._liblib1$_element.appendChild(value);
+    return value;
+  },
+  get$iterator: function(_) {
+    return $.JSArray_methods.get$iterator(this.toList$0(this));
+  },
+  addAll$1: function(_, iterable) {
+    var t1, t2;
+    if (typeof iterable === "object" && iterable !== null && !!$.getInterceptor(iterable).$is_ChildNodeListLazy)
+      iterable = $.List_List$from(iterable, true);
+    for (t1 = $.get$iterator$ax(iterable), t2 = this._liblib1$_element; t1.moveNext$0() === true;)
+      t2.appendChild(t1.get$current());
+  },
+  sublist$2: function(_, start, end) {
+    if (end == null)
+      end = this.get$length(this);
+    return $._FrozenElementList$_wrap($.Lists_getRange(this, start, end, []));
+  },
+  sublist$1: function($receiver, start) {
+    return this.sublist$2($receiver, start, null);
+  },
+  clear$0: function(_) {
+    this._liblib1$_element.textContent = "";
+  },
+  removeLast$0: function(_) {
+    var result = this.get$last(this);
+    if (result != null)
+      this._liblib1$_element.removeChild(result);
+    return result;
+  },
+  get$last: function(_) {
+    var result = this._liblib1$_element.lastElementChild;
+    if (result == null)
+      throw $.wrapException($.StateError$("No elements"));
+    return result;
+  },
+  toString$0: function(_) {
+    var buffer = $.StringBuffer$("[");
+    buffer.writeAll$2(this, ", ");
+    buffer.write$1("]");
+    return buffer.toString$0(buffer);
+  },
+  $asList: function() {
+    return function () { return [$.Element]; };
+  },
+  $asIterable: function() {
+    return function () { return [$.Element]; };
+  }
+};
+
+$$._FrozenElementList = {"": "ListBase;_nodeList",
+  get$length: function(_) {
+    return $.get$length$asx(this._nodeList);
+  },
+  $index: function(_, index) {
+    var t1 = this._nodeList;
+    if (typeof t1 !== "string" && (typeof t1 !== "object" || t1 === null || t1.constructor !== Array && !$.getInterceptor(t1).$isJavaScriptIndexingBehavior()))
+      return this.$$index$bailout(1, index, t1);
+    if (index !== (index | 0))
+      throw $.iae(index);
+    if (index < 0 || index >= t1.length)
+      throw $.ioore(index);
+    return t1[index];
+  },
+  $$index$bailout: function(state0, index, t1) {
+    return $.$index$asx(t1, index);
+  },
+  $indexSet: function(_, index, value) {
+    throw $.wrapException($.UnsupportedError$(""));
+  },
+  set$length: function(_, newLength) {
+    $.set$length$asx(this._nodeList, newLength);
+  },
+  add$1: function(_, value) {
+    throw $.wrapException($.UnsupportedError$(""));
+  },
+  addAll$1: function(_, iterable) {
+    throw $.wrapException($.UnsupportedError$(""));
+  },
+  sublist$2: function(_, start, end) {
+    return $._FrozenElementList$_wrap($.sublist$2$ax(this._nodeList, start, end));
+  },
+  sublist$1: function($receiver, start) {
+    return this.sublist$2($receiver, start, null);
+  },
+  clear$0: function(_) {
+    throw $.wrapException($.UnsupportedError$(""));
+  },
+  removeLast$0: function(_) {
+    throw $.wrapException($.UnsupportedError$(""));
+  },
+  toString$0: function(_) {
+    var buffer = $.StringBuffer$("[");
+    buffer.writeAll$2(this, ", ");
+    buffer.write$1("]");
+    return buffer.toString$0(buffer);
+  },
+  $asList: function() {
+    return function () { return [null]; };
+  },
+  $asIterable: function() {
+    return function () { return [null]; };
+  }
+};
+
+$$._ElementCssClassSet = {"": "CssClassSet;_liblib1$_element",
+  readClasses$0: function() {
+    var s, t1, trimmed;
+    s = $.LinkedHashSet$();
+    for (t1 = $.JSArray_methods.get$iterator($.split$1$s(this._liblib1$_element.className, " ")); t1.moveNext$0();) {
+      trimmed = $.trim$0$s(t1.get$current());
+      if (!$.JSString_methods.get$isEmpty(trimmed))
+        s.add$1(s, trimmed);
+    }
+    return s;
+  },
+  writeClasses$1: function(s) {
+    $.List_List$from(s, true);
+    this._liblib1$_element.className = s.join$1(s, " ");
+  }
+};
+
+$$.HttpRequest_getString_anon = {"": "Closure;",
+  call$1: function(xhr) {
+    return $.get$responseText$x(xhr);
+  }
+};
+
+$$.HttpRequest_request_anon = {"": "Closure;completer_0,xhr_1",
+  call$1: function(e) {
+    var t1, t2, t3;
+    t1 = this.xhr_1;
+    if (!($.$ge$n(t1.status, 200) && $.$lt$n(t1.status, 300))) {
+      t2 = t1.status;
+      t2 = t2 === 0 || t2 === 304;
+    } else
+      t2 = true;
+    t3 = this.completer_0;
+    if (t2)
+      t3.complete$1(t3, t1);
+    else
+      t3.completeError$1(e);
+  }
+};
+
+$$.HttpRequest_request_anon0 = {"": "Closure;completer_2",
+  call$1: function(e) {
+    this.completer_2.completeError$1(e);
+  }
+};
+
+$$._ChildNodeListLazy = {"": "ListBase;_this",
+  get$last: function(_) {
+    var result = this._this.lastChild;
+    if (result == null)
+      throw $.wrapException($.StateError$("No elements"));
+    return result;
+  },
+  add$1: function(_, value) {
+    this._this.appendChild(value);
+  },
+  addAll$1: function(_, iterable) {
+    var t1, len, i, t2;
+    if (typeof iterable === "object" && iterable !== null && !!$.getInterceptor(iterable).$is_ChildNodeListLazy) {
+      t1 = this._this;
+      if (iterable._this !== t1) {
+        len = iterable.get$length(iterable);
+        if (typeof len !== "number")
+          return this.addAll$1$bailout1(1, iterable, len, t1);
+        i = 0;
+        for (; i < len; ++i)
+          t1.appendChild(iterable.$index(iterable, 0));
+      }
+      return;
+    }
+    for (t1 = $.get$iterator$ax(iterable), t2 = this._this; t1.moveNext$0() === true;)
+      t2.appendChild(t1.get$current());
+  },
+  addAll$1$bailout1: function(state0, iterable, len, t1) {
+    switch (state0) {
+      case 0:
+      case 1:
+        var i, t2;
+        if (state0 === 1 || state0 === 0 && typeof iterable === "object" && iterable !== null && !!$.getInterceptor(iterable).$is_ChildNodeListLazy)
+          switch (state0) {
+            case 0:
+              t1 = this._this;
+            case 1:
+              if (state0 === 1 || state0 === 0 && iterable._this !== t1)
+                switch (state0) {
+                  case 0:
+                    len = iterable.get$length(iterable);
+                  case 1:
+                    state0 = 0;
+                    i = 0;
+                    for (; $.JSNumber_methods.$lt(i, len); ++i)
+                      t1.appendChild(iterable.$index(iterable, 0));
+                }
+              return;
+          }
+        for (t1 = $.get$iterator$ax(iterable), t2 = this._this; t1.moveNext$0() === true;)
+          t2.appendChild(t1.get$current());
+    }
+  },
+  removeLast$0: function(_) {
+    var result = this.get$last(this);
+    if (result != null)
+      this._this.removeChild(result);
+    return result;
+  },
+  clear$0: function(_) {
+    this._this.textContent = "";
+  },
+  $indexSet: function(_, index, value) {
+    var t1, t2;
+    t1 = this._this;
+    t2 = t1.childNodes;
+    if (typeof t2 !== "string" && (typeof t2 !== "object" || t2 === null || t2.constructor !== Array && !$.getInterceptor(t2).$isJavaScriptIndexingBehavior()))
+      return this.$$indexSet$bailout(1, t1, value, t2, index);
+    if (index !== (index | 0))
+      throw $.iae(index);
+    if (index < 0 || index >= t2.length)
+      throw $.ioore(index);
+    t1.replaceChild(value, t2[index]);
+  },
+  $$indexSet$bailout: function(state0, t1, value, t2, index) {
+    t1.replaceChild(value, $.$index$asx(t2, index));
+  },
+  get$iterator: function(_) {
+    return $.get$iterator$ax(this._this.childNodes);
+  },
+  toList$1$growable: function(_, growable) {
+    return $.List_List$from(this, growable);
+  },
+  toList$0: function($receiver) {
+    return this.toList$1$growable($receiver, true);
+  },
+  get$isEmpty: function(_) {
+    return $.$eq(this.get$length(this), 0);
+  },
+  sublist$2: function(_, start, end) {
+    if (end == null)
+      $.$eq(end, this.get$length(this));
+    return $.Lists_getRange(this, start, end, []);
+  },
+  sublist$1: function($receiver, start) {
+    return this.sublist$2($receiver, start, null);
+  },
+  toString$0: function(_) {
+    var buffer = $.StringBuffer$("[");
+    buffer.writeAll$2(this, ", ");
+    buffer.write$1("]");
+    return buffer.toString$0(buffer);
+  },
+  get$length: function(_) {
+    return $.get$length$asx(this._this.childNodes);
+  },
+  set$length: function(_, value) {
+    throw $.wrapException($.UnsupportedError$("Cannot set length on immutable List."));
+  },
+  $index: function(_, index) {
+    var t1 = this._this.childNodes;
+    if (typeof t1 !== "string" && (typeof t1 !== "object" || t1 === null || t1.constructor !== Array && !$.getInterceptor(t1).$isJavaScriptIndexingBehavior()))
+      return this.$$index$bailout(1, index, t1);
+    if (index !== (index | 0))
+      throw $.iae(index);
+    if (index < 0 || index >= t1.length)
+      throw $.ioore(index);
+    return t1[index];
+  },
+  $$index$bailout: function(state0, index, t1) {
+    return $.$index$asx(t1, index);
+  },
+  $is_ChildNodeListLazy: true,
+  $asList: function() {
+    return function () { return [$.Node]; };
+  },
+  $asIterable: function() {
+    return function () { return [$.Node]; };
+  }
+};
+
+$$._AttributeMap = {"": "Object;",
+  forEach$1: function(_, f) {
+    var t1, t2;
+    for (t1 = $.JSArray_methods.get$iterator(this.get$keys()); t1.moveNext$0();) {
+      t2 = t1.get$current();
+      f.call$2(t2, this.$index(this, t2));
+    }
+  },
+  get$keys: function() {
+    var attributes, keys, t1, len, i;
+    attributes = this._liblib1$_element.attributes;
+    keys = $.List_List($);
+    for (t1 = $.getInterceptor$asx(attributes), len = t1.get$length(attributes), i = 0; i < len; ++i)
+      if (this._matches$1(t1.$index(attributes, i)))
+        keys.push(t1.$index(attributes, i).localName);
+    return keys;
+  },
+  get$values: function(_) {
+    var attributes, values, t1, len, i;
+    attributes = this._liblib1$_element.attributes;
+    values = $.List_List($);
+    for (t1 = $.getInterceptor$asx(attributes), len = t1.get$length(attributes), i = 0; i < len; ++i)
+      if (this._matches$1(t1.$index(attributes, i)))
+        values.push($.get$value$x(t1.$index(attributes, i)));
+    return values;
+  },
+  get$isEmpty: function(_) {
+    return this.get$length(this) === 0;
+  },
+  $isMap: true,
+  $asMap: function () { return [$.String, $.String]; }
+};
+
+$$._ElementAttributeMap = {"": "_AttributeMap;_liblib1$_element",
+  $index: function(_, key) {
+    return this._liblib1$_element.getAttribute(key);
+  },
+  $indexSet: function(_, key, value) {
+    this._liblib1$_element.setAttribute(key, value);
+  },
+  get$length: function(_) {
+    return this.get$keys().length;
+  },
+  _matches$1: function(node) {
+    return node.namespaceURI == null;
+  }
+};
+
+$$.CssClassSet = {"": "Object;",
+  toString$0: function(_) {
+    var t1 = this.readClasses$0();
+    return t1.join$1(t1, " ");
+  },
+  toggle$1: function(value) {
+    var s, result;
+    s = this.readClasses$0();
+    if (s.contains$1(s, value) === true) {
+      s.remove$1(s, value);
+      result = false;
+    } else {
+      s.add$1(s, value);
+      result = true;
+    }
+    this.writeClasses$1(s);
+    return result;
+  },
+  get$iterator: function(_) {
+    var t1 = this.readClasses$0();
+    return t1.get$iterator(t1);
+  },
+  forEach$1: function(_, f) {
+    var t1 = this.readClasses$0();
+    t1.forEach$1(t1, f);
+  },
+  get$isEmpty: function(_) {
+    var t1 = this.readClasses$0();
+    return t1.get$isEmpty(t1);
+  },
+  get$length: function(_) {
+    var t1 = this.readClasses$0();
+    return t1.get$length(t1);
+  },
+  add$1: function(_, value) {
+    var t1, s;
+    t1 = new $.CssClassSet_add_anon(value);
+    s = this.readClasses$0();
+    t1.call$1(s);
+    this.writeClasses$1(s);
+  },
+  addAll$1: function(_, iterable) {
+    var t1, s;
+    t1 = new $.CssClassSet_addAll_anon(iterable);
+    s = this.readClasses$0();
+    t1.call$1(s);
+    this.writeClasses$1(s);
+  },
+  toList$1$growable: function(_, growable) {
+    var t1 = this.readClasses$0();
+    return t1.toList$1$growable(t1, growable);
+  },
+  toList$0: function($receiver) {
+    return this.toList$1$growable($receiver, true);
+  },
+  skip$1: function(_, n) {
+    var t1 = this.readClasses$0();
+    return t1.skip$1(t1, n);
+  },
+  elementAt$1: function(_, index) {
+    var t1 = this.readClasses$0();
+    return t1.elementAt$1(t1, index);
+  },
+  $isIterable: function() {
+    return true;
+  },
+  $asIterable: function() {
+    return function () { return [$.String]; };
+  }
+};
+
+$$.CssClassSet_add_anon = {"": "Closure;value_0",
+  call$1: function(s) {
+    return $.add$1$ax(s, this.value_0);
+  }
+};
+
+$$.CssClassSet_addAll_anon = {"": "Closure;iterable_0",
+  call$1: function(s) {
+    return $.addAll$1$ax(s, this.iterable_0);
+  }
+};
+
+$$._EventStream = {"": "Stream;_target,_eventType,_useCapture",
+  listen$4$cancelOnError$onDone$onError: function(onData, cancelOnError, onDone, onError) {
+    return $._EventStreamSubscription$(this._target, this._eventType, onData, this._useCapture);
+  },
+  listen$1: function(onData) {
+    return this.listen$4$cancelOnError$onDone$onError(onData, null, null, null);
+  },
+  listen$3$onDone$onError: function(onData, onDone, onError) {
+    return this.listen$4$cancelOnError$onDone$onError(onData, null, onDone, onError);
+  }
+};
+
+$$._EventStreamSubscription = {"": "StreamSubscription;_pauseCount,_target,_eventType,_liblib1$_onData,_useCapture",
+  cancel$0: function() {
+    if (this.get$_canceled())
+      return;
+    var t1 = this._liblib1$_onData;
+    if (t1 != null)
+      $.$$dom_removeEventListener$3$x(this._target, this._eventType, t1, this._useCapture);
+    this._target = null;
+    this._liblib1$_onData = null;
+  },
+  get$_canceled: function() {
+    return this._target == null;
+  },
+  get$_paused: function() {
+    return this._pauseCount > 0;
+  },
+  _tryResume$0: function() {
+    if (this._liblib1$_onData != null && !this.get$_paused())
+      $.$$dom_addEventListener$3$x(this._target, this._eventType, this._liblib1$_onData, this._useCapture);
+  },
+  _EventStreamSubscription$4: function(_target, _eventType, _onData, _useCapture) {
+    this._tryResume$0();
+  }
+};
+
+$$.EventStreamProvider = {"": "Object;_eventType",
+  forTarget$2$useCapture: function(e, useCapture) {
+    return $._EventStream$(e, this._eventType, useCapture);
+  },
+  forTarget$1: function(e) {
+    return this.forTarget$2$useCapture(e, false);
+  }
+};
+
+$$.FixedSizeListIterator = {"": "Object;_array,_length,_position,_current",
+  moveNext$0: function() {
+    var t1, nextPosition;
+    t1 = this._position;
+    if (typeof t1 !== "number")
+      return this.moveNext$0$bailout(1, t1);
+    nextPosition = t1 + 1;
+    t1 = this._length;
+    if (nextPosition < t1) {
+      this._current = $.$index$asx(this._array, nextPosition);
+      this._position = nextPosition;
+      return true;
+    }
+    this._current = null;
+    this._position = t1;
+    return false;
+  },
+  moveNext$0$bailout: function(state0, t1) {
+    var nextPosition = $.$add$ns(t1, 1);
+    t1 = this._length;
+    if ($.$lt$n(nextPosition, t1)) {
+      this._current = $.$index$asx(this._array, nextPosition);
+      this._position = nextPosition;
+      return true;
+    }
+    this._current = null;
+    this._position = t1;
+    return false;
+  },
+  get$current: function() {
+    return this._current;
+  }
+};
+
+$$.convertDartToNative_Dictionary_anon = {"": "Closure;object_0",
+  call$2: function(key, value) {
+    this.object_0[key] = value;
+  }
+};
+
+$$.FilteredElementList = {"": "ListBase;_node,_childNodes",
+  get$_filtered: function() {
+    var t1 = this._childNodes;
+    return $.List_List$from(t1.where$1(t1, new $.FilteredElementList__filtered_anon()), true);
+  },
+  forEach$1: function(_, f) {
+    $.JSArray_methods.forEach$1(this.get$_filtered(), f);
+  },
+  $indexSet: function(_, index, value) {
+    var t1 = this.get$_filtered();
+    if (index !== (index | 0))
+      throw $.iae(index);
+    if (index < 0 || index >= t1.length)
+      throw $.ioore(index);
+    $.replaceWith$1$x(t1[index], value);
+  },
+  set$length: function(_, newLength) {
+    var len;
+    if (typeof newLength !== "number")
+      return this.set$length$bailout(1, newLength);
+    len = this.get$length(this);
+    if (newLength >= len)
+      return;
+    else if (newLength < 0)
+      throw $.wrapException($.ArgumentError$("Invalid list length"));
+    this.removeRange$2(this, newLength, len);
+  },
+  set$length$bailout: function(state0, newLength) {
+    var len, t1;
+    len = this.get$length(this);
+    t1 = $.getInterceptor$n(newLength);
+    if (t1.$ge(newLength, len))
+      return;
+    else if (t1.$lt(newLength, 0))
+      throw $.wrapException($.ArgumentError$("Invalid list length"));
+    this.removeRange$2(this, newLength, len);
+  },
+  add$1: function(_, value) {
+    var t1 = this._childNodes;
+    t1.add$1(t1, value);
+  },
+  addAll$1: function(_, iterable) {
+    var t1, t2;
+    for (t1 = $.get$iterator$ax(iterable), t2 = this._childNodes; t1.moveNext$0() === true;)
+      t2.add$1(t2, t1.get$current());
+  },
+  removeRange$2: function(_, start, end) {
+    $.JSArray_methods.forEach$1($.JSArray_methods.sublist$2(this.get$_filtered(), start, end), new $.FilteredElementList_removeRange_anon());
+  },
+  clear$0: function(_) {
+    var t1 = this._childNodes;
+    t1.clear$0(t1);
+  },
+  removeLast$0: function(_) {
+    var result = this.get$last(this);
+    if (result != null)
+      $.remove$0$ax(result);
+    return result;
+  },
+  toList$1$growable: function(_, growable) {
+    return $.List_List$from(this, growable);
+  },
+  toList$0: function($receiver) {
+    return this.toList$1$growable($receiver, true);
+  },
+  elementAt$1: function(_, index) {
+    var t1 = this.get$_filtered();
+    if (index !== (index | 0))
+      throw $.iae(index);
+    if (index < 0 || index >= t1.length)
+      throw $.ioore(index);
+    return t1[index];
+  },
+  get$isEmpty: function(_) {
+    return $.JSArray_methods.get$isEmpty(this.get$_filtered());
+  },
+  get$length: function(_) {
+    return this.get$_filtered().length;
+  },
+  $index: function(_, index) {
+    var t1 = this.get$_filtered();
+    if (index !== (index | 0))
+      throw $.iae(index);
+    if (index < 0 || index >= t1.length)
+      throw $.ioore(index);
+    return t1[index];
+  },
+  get$iterator: function(_) {
+    return $.JSArray_methods.get$iterator(this.get$_filtered());
+  },
+  sublist$2: function(_, start, end) {
+    return $.JSArray_methods.sublist$2(this.get$_filtered(), start, end);
+  },
+  sublist$1: function($receiver, start) {
+    return this.sublist$2($receiver, start, null);
+  },
+  skip$1: function(_, n) {
+    return this.get$IterableMixinWorkaround().skipList$2(this, n);
+  },
+  get$last: function(_) {
+    return $.JSArray_methods.get$last(this.get$_filtered());
+  },
+  $asList: function() {
+    return function () { return [$.Element]; };
+  },
+  $asIterable: function() {
+    return function () { return [$.Element]; };
+  }
+};
+
+$$.FilteredElementList__filtered_anon = {"": "Closure;",
+  call$1: function(n) {
+    return typeof n === "object" && n !== null && $.getInterceptor(n).$isElement();
+  }
+};
+
+$$.FilteredElementList_removeRange_anon = {"": "Closure;",
+  call$1: function(el) {
+    return $.remove$0$ax(el);
+  }
+};
+
+$$._AttributeClassSet = {"": "CssClassSet;_liblib2$_element",
+  readClasses$0: function() {
+    var t1, classname, s, trimmed;
+    t1 = $.get$attributes$x(this._liblib2$_element);
+    classname = t1.$index(t1, "class");
+    s = $.LinkedHashSet$();
+    if (classname == null)
+      return s;
+    for (t1 = $.JSArray_methods.get$iterator($.split$1$s(classname, " ")); t1.moveNext$0();) {
+      trimmed = $.trim$0$s(t1.get$current());
+      if (!$.JSString_methods.get$isEmpty(trimmed))
+        s.add$1(s, trimmed);
+    }
+    return s;
+  },
+  writeClasses$1: function(s) {
+    var t1 = $.get$attributes$x(this._liblib2$_element);
+    t1.$indexSet(t1, "class", s.join$1(s, " "));
+  }
+};
+
+$$.BarGraph = {"": "Object;_canvas,_model,_elements,scaleHeight",
+  addSample$1: function(segments) {
+    if (segments.length !== this._elements.length)
+      throw $.wrapException($.RuntimeError$("invalid sample size for graph"));
+    this._model.addSample$1(segments);
+  },
+  drawBarGraph$0: function() {
+    var t1, context, t2, x, i, y;
+    t1 = this._canvas;
+    $.Primitives_printString("drawBarGraph: _canvas=" + $.S(t1));
+    context = $.get$context2D$x(t1);
+    context.beginPath();
+    context.strokeStyle = "black";
+    t2 = $.getInterceptor$x(t1);
+    context.strokeRect(48, 1, $.$add$ns($.$sub$n($.$sub$n(t2.get$width(t1), 50), 150), 2), $.$sub$n(t2.get$height(t1), 2), 1);
+    x = $.$sub$n(t2.get$width(t1), 130);
+    if (typeof x !== "number")
+      return this.drawBarGraph$0$bailout(1, context, x);
+    context.font = "14px sans-serif";
+    for (t1 = this._elements, i = t1.length - 1, t2 = x + 30, y = 20; i >= 0; --i) {
+      if (i >= t1.length)
+        throw $.ioore(i);
+      context.fillStyle = $.get$color$x(t1[i]);
+      context.fillRect(x, y, 20, 20);
+      context.fillStyle = "black";
+      if (i >= t1.length)
+        throw $.ioore(i);
+      context.fillText($.get$name$x(t1[i]), t2, y + 15);
+      y += 30;
+    }
+  },
+  drawBarGraph$0$bailout: function(state0, context, x) {
+    var t1, i, t2, y;
+    context.font = "14px sans-serif";
+    for (t1 = this._elements, i = t1.length - 1, t2 = $.getInterceptor$ns(x), y = 20; i >= 0; --i) {
+      if (i >= t1.length)
+        throw $.ioore(i);
+      context.fillStyle = $.get$color$x(t1[i]);
+      context.fillRect(x, y, 20, 20);
+      context.fillStyle = "black";
+      if (i >= t1.length)
+        throw $.ioore(i);
+      context.fillText($.get$name$x(t1[i]), t2.$add(x, 30), y + 15);
+      y += 30;
+    }
+  },
+  drawGraph$1: function(model) {
+    var graphHeight, t1, height, scale;
+    graphHeight = model.get$maxTotal();
+    t1 = this._canvas;
+    t1.clientWidth;
+    height = t1.clientHeight;
+    t1 = $.getInterceptor$n(graphHeight);
+    if (t1.$ge(graphHeight, this.scaleHeight)) {
+      this.scaleHeight = t1.$mul(graphHeight, 1.2);
+      this.scaleHeight = $.JSNumber_methods.ceil$0($.$div$n(this.scaleHeight, 100)) * 100;
+    }
+    scale = $.$div$n(height, this.scaleHeight);
+    this.drawValues$2(this.scaleHeight, scale);
+    this.drawChart$2(this.scaleHeight, scale);
+  },
+  get$drawGraph: function() {
+    return new $.BoundClosure$1(this, "drawGraph$1");
+  },
+  drawChart$2: function(maxHeight, scale) {
+    var t1, dividerHeight, t3, context, height, scaledY, t2, scaledY0, i;
+    t1 = $.getInterceptor$n(maxHeight);
+    dividerHeight = t1.$tdiv(maxHeight, 5);
+    if (typeof dividerHeight !== "number")
+      return this.drawChart$2$bailout(1, maxHeight, scale, t1, dividerHeight);
+    t3 = this._canvas;
+    context = $.get$context2D$x(t3);
+    context.beginPath();
+    height = t1.toInt$0(maxHeight);
+    scaledY = dividerHeight * scale;
+    context.clearRect(0, 0, 48, maxHeight);
+    for (t1 = $.getInterceptor$x(t3), t2 = $.JSNumber_methods.$tdiv(dividerHeight, 100) * 100, scaledY0 = scaledY, i = 1; i < 5; ++i) {
+      height -= t2;
+      context.font = "14px sans-serif";
+      context.fillStyle = "black";
+      context.textAlign = "right";
+      context.textBaseline = "middle";
+      context.fillText($.JSNumber_methods.toString$0(height), 40, scaledY0);
+      context.moveTo(48, scaledY0);
+      context.strokeStyle = "grey";
+      context.lineWidth = 0.5;
+      context.lineTo($.$sub$n(t1.get$width(t3), 150), scaledY0);
+      context.stroke();
+      scaledY0 += scaledY;
+    }
+  },
+  drawChart$2$bailout: function(state0, maxHeight, scale, t1, dividerHeight) {
+    var t3, context, height, scaledY, t2, i, t4;
+    t3 = this._canvas;
+    context = $.get$context2D$x(t3);
+    context.beginPath();
+    height = t1.toInt$0(maxHeight);
+    t1 = $.getInterceptor$n(dividerHeight);
+    scaledY = t1.$mul(dividerHeight, scale);
+    context.clearRect(0, 0, 48, maxHeight);
+    for (t2 = $.getInterceptor$x(t3), i = 1; i < 5; ++i) {
+      t4 = $.$mul$n(t1.$tdiv(dividerHeight, 100), 100);
+      if (typeof t4 !== "number")
+        throw $.iae(t4);
+      height -= t4;
+      context.font = "14px sans-serif";
+      context.fillStyle = "black";
+      context.textAlign = "right";
+      context.textBaseline = "middle";
+      context.fillText($.JSNumber_methods.toString$0(height), 40, scaledY);
+      context.moveTo(48, scaledY);
+      context.strokeStyle = "grey";
+      context.lineWidth = 0.5;
+      context.lineTo($.$sub$n(t2.get$width(t3), 150), scaledY);
+      context.stroke();
+      scaledY = $.$add$ns(scaledY, t1.$mul(dividerHeight, scale));
+    }
+  },
+  drawValues$2: function(maxHeight, scale) {
+    var t1, iterator, w, t2, x, s, blankHeight, y, i, h, t3;
+    if (typeof maxHeight !== "number")
+      return this.drawValues$2$bailout(1, maxHeight, scale);
+    t1 = this._model;
+    iterator = t1.get$iterator(t1);
+    t1 = this._canvas;
+    w = $.$sub$n($.$sub$n($.$sub$n($.get$width$x(t1), 50), 150), 2);
+    t2 = $.JSNumber_methods.ceil$0(maxHeight * scale);
+    $.get$context2D$x(t1).clearRect(52, 2, w, t2 - 4);
+    for (t1 = this._elements, x = 52; iterator.moveNext$0();) {
+      s = iterator.get$current();
+      t2 = $.getInterceptor(s);
+      if (s != null) {
+        blankHeight = $.$sub$n(this.scaleHeight, t2.total$0(s));
+        this.drawVerticalSegment$6(x, 2, 5, blankHeight, "white", scale);
+        if (typeof blankHeight !== "number")
+          throw $.iae(blankHeight);
+        y = 2 + blankHeight;
+        i = $.$sub$n(t2.get$length(s), 1);
+        if (i !== (i | 0))
+          return this.drawValues$2$bailout(2, maxHeight, scale, t2, t1, iterator, x, y, i, s);
+        for (; i >= 0; --i) {
+          h = t2.$index(s, i);
+          if (i >= t1.length)
+            throw $.ioore(i);
+          this.drawVerticalSegment$6(x, y, 5, h, $.get$color$x(t1[i]), scale);
+          t3 = t2.$index(s, i);
+          if (typeof t3 !== "number")
+            throw $.iae(t3);
+          y += t3;
+        }
+      } else
+        this.drawVerticalSegment$6(x, 2, 5, maxHeight, "white", scale);
+      x += 5;
+    }
+  },
+  drawValues$2$bailout: function(state0, maxHeight, scale, t2, t1, iterator, x, y, i, s) {
+    switch (state0) {
+      case 0:
+      case 1:
+        state0 = 0;
+        t1 = this._model;
+        iterator = t1.get$iterator(t1);
+        t1 = this._canvas;
+        w = $.$sub$n($.$sub$n($.$sub$n($.get$width$x(t1), 50), 150), 2);
+        t2 = $.ceil$0$n($.$mul$n(maxHeight, scale));
+        $.get$context2D$x(t1).clearRect(52, 2, w, t2 - 4);
+        t1 = this._elements;
+        x = 52;
+      case 2:
+        var w, blankHeight, h, t3;
+        L0:
+          while (true)
+            switch (state0) {
+              case 0:
+                if (!iterator.moveNext$0())
+                  break L0;
+                s = iterator.get$current();
+                t2 = $.getInterceptor(s);
+              case 2:
+                if (state0 === 2 || state0 === 0 && s != null)
+                  switch (state0) {
+                    case 0:
+                      blankHeight = $.$sub$n(this.scaleHeight, t2.total$0(s));
+                      this.drawVerticalSegment$6(x, 2, 5, blankHeight, "white", scale);
+                      if (typeof blankHeight !== "number")
+                        throw $.iae(blankHeight);
+                      y = 2 + blankHeight;
+                      i = $.$sub$n(t2.get$length(s), 1);
+                    case 2:
+                      state0 = 0;
+                      for (; $.$ge$n(i, 0); --i) {
+                        h = t2.$index(s, i);
+                        if (i !== (i | 0))
+                          throw $.iae(i);
+                        if (i < 0 || i >= t1.length)
+                          throw $.ioore(i);
+                        this.drawVerticalSegment$6(x, y, 5, h, $.get$color$x(t1[i]), scale);
+                        t3 = t2.$index(s, i);
+                        if (typeof t3 !== "number")
+                          throw $.iae(t3);
+                        y += t3;
+                      }
+                  }
+                else
+                  this.drawVerticalSegment$6(x, 2, 5, maxHeight, "white", scale);
+                x += 5;
+            }
+    }
+  },
+  drawVerticalSegment$6: function(x, y, w, h, color, scale) {
+    var t1, context, max;
+    if (typeof h !== "number")
+      return this.drawVerticalSegment$6$bailout(1, x, y, w, h, color, scale);
+    t1 = this._canvas;
+    context = $.get$context2D$x(t1);
+    y = $.JSNumber_methods.floor$0(y * scale);
+    h = $.JSNumber_methods.ceil$0(h * scale);
+    context.beginPath();
+    context.lineWidth = w;
+    context.fillStyle = color;
+    context.strokeStyle = color;
+    if (x < 2)
+      x = 2;
+    if (y < 2)
+      y = 2;
+    t1 = $.get$height$x(t1);
+    if (typeof t1 !== "number")
+      return this.drawVerticalSegment$6$bailout(2, x, y, 0, h, 0, 0, context, t1);
+    max = t1 - 2;
+    if (y + h > max)
+      h = max - y;
+    context.moveTo(x, y);
+    context.lineTo(x, y + h);
+    context.stroke();
+  },
+  drawVerticalSegment$6$bailout: function(state0, x, y, w, h, color, scale, context, t1) {
+    switch (state0) {
+      case 0:
+      case 1:
+        state0 = 0;
+        t1 = this._canvas;
+        context = $.get$context2D$x(t1);
+        y = $.JSNumber_methods.floor$0(y * scale);
+        h = $.ceil$0$n($.$mul$n(h, scale));
+        context.beginPath();
+        context.lineWidth = w;
+        context.fillStyle = color;
+        context.strokeStyle = color;
+        if (x < 2)
+          x = 2;
+        if (y < 2)
+          y = 2;
+        t1 = $.get$height$x(t1);
+      case 2:
+        var max;
+        state0 = 0;
+        max = $.$sub$n(t1, 2);
+        if ($.JSNumber_methods.$gt(y + h, max))
+          h = $.$sub$n(max, y);
+        context.moveTo(x, y);
+        if (typeof h !== "number")
+          throw $.iae(h);
+        context.lineTo(x, y + h);
+        context.stroke();
+    }
+  },
+  BarGraph$2: function(_canvas, _elements) {
+    this._model = $.GraphModel$($.$tdiv$n($.$sub$n($.$sub$n($.get$width$x(this._canvas), 50), 150), 5));
+    this._model.addListener$2(this.get$drawGraph(), null);
+    this.drawBarGraph$0();
+  }
+};
+
+$$.GraphModel = {"": "ObservableModel;_samples,_maxSize,_listeners",
+  addSample$1: function(segments) {
+    var t1 = this._samples;
+    if ($.JSInt_methods.$ge(t1.length, this._maxSize))
+      $.JSArray_methods.remove$1(t1, $.JSArray_methods.get$first(t1));
+    t1.push($.Sample$(segments));
+    this.notifySuccess$0();
+  },
+  get$iterator: function(_) {
+    return $.JSArray_methods.get$iterator(this._samples);
+  },
+  $index: function(_, i) {
+    var t1 = this._samples;
+    if (i !== (i | 0))
+      throw $.iae(i);
+    if (i < 0 || i >= t1.length)
+      throw $.ioore(i);
+    return t1[i];
+  },
+  get$maxTotal: function() {
+    var t1 = {};
+    t1.max_0 = 1;
+    $.JSArray_methods.forEach$1(this._samples, new $.GraphModel_maxTotal_anon(t1));
+    return t1.max_0;
+  }
+};
+
+$$.GraphModel_maxTotal_anon = {"": "Closure;box_0",
+  call$1: function(s) {
+    var t1, t2, t3, max;
+    t1 = $.getInterceptor$x(s);
+    t2 = t1.total$0(s);
+    t3 = this.box_0;
+    max = $.$gt$n(t2, t3.max_0) ? t1.total$0(s) : t3.max_0;
+    t3.max_0 = max;
+    return max;
+  }
+};
+
+$$.Element0 = {"": "Object;name>,color>"};
+
+$$.Sample = {"": "Object;_segments",
+  get$length: function(_) {
+    return this._segments.length;
+  },
+  $index: function(_, i) {
+    var t1 = this._segments;
+    if (i !== (i | 0))
+      throw $.iae(i);
+    if (i < 0 || i >= t1.length)
+      throw $.ioore(i);
+    return t1[i];
+  },
+  get$iterator: function(_) {
+    return $.JSArray_methods.get$iterator(this._segments);
+  },
+  total$0: function(_) {
+    return $.JSArray_methods.fold$2(this._segments, 0, new $.Sample_total_anon());
+  }
+};
+
+$$.Sample_total_anon = {"": "Closure;",
+  call$2: function(prev, element) {
+    return $.$add$ns(prev, element);
+  }
+};
+
+$$.IsolateList = {"": "Object;_isolateTable",
+  updateList$1: function(model) {
+    var iterator, t1, t2, t3, isolate, t4, isolateId, t5, detailsCell, basicData, details, stacktraceCell, stacktrace;
+    iterator = $.get$iterator$ax(model);
+    for (t1 = this._isolateTable, t2 = $.getInterceptor$x(t1); iterator.moveNext$0() === true;) {
+      t3 = {};
+      isolate = iterator.get$current();
+      t4 = $.getInterceptor$x(isolate);
+      isolateId = "isolate-" + $.S(t4.get$port(isolate));
+      t3.isolateRow_0 = t1.querySelector("#" + isolateId);
+      t5 = t3.isolateRow_0;
+      if (t5 != null)
+        this.updateIsolateDetails$2(isolate, t5);
+      else {
+        t3.isolateRow_0 = document.createElement("tr");
+        $.set$$$dom_className$x(t3.isolateRow_0, "isolate_row");
+        $.set$id$x(t3.isolateRow_0, isolateId);
+        t5 = t2.get$children(t1);
+        t5.add$1(t5, t3.isolateRow_0);
+        detailsCell = document.createElement("td");
+        t5 = $.getInterceptor$x(detailsCell);
+        detailsCell.className = "isolate_details_column";
+        $.add$1$ax($.get$children$x(t3.isolateRow_0), detailsCell);
+        basicData = document.createElement("div");
+        basicData.textContent = $.JSString_methods.replaceAll$2($.replaceAll$2$s(t4.get$name(isolate), "$", ": "), "-", " ");
+        t4 = t5.get$children(detailsCell);
+        t4.add$1(t4, basicData);
+        details = document.createElement("div");
+        t4 = $.get$classes$x(details);
+        t4.addAll$1(t4, ["isolate_details", "hidden"]);
+        t5 = t5.get$children(detailsCell);
+        t5.add$1(t5, details);
+        stacktraceCell = document.createElement("td");
+        t5 = $.getInterceptor$x(stacktraceCell);
+        t4 = t5.get$classes(stacktraceCell);
+        t4.addAll$1(t4, ["isolate_stacktrace_column", "hidden"]);
+        $.add$1$ax($.get$children$x(t3.isolateRow_0), stacktraceCell);
+        stacktrace = document.createElement("div");
+        t4 = $.get$classes$x(stacktrace);
+        t4.addAll$1(t4, ["stack_trace", "hidden"]);
+        t5 = t5.get$children(stacktraceCell);
+        t5.add$1(t5, stacktrace);
+        $.get$onClick$x(t3.isolateRow_0).listen$1(new $.IsolateList_updateList_anon(t3, this));
+        this.updateIsolateDetails$2(isolate, t3.isolateRow_0);
+      }
+    }
+  },
+  setStacktrace$2: function(element, json) {
+    var t1, t2, response, title, t3, stackIterator, i, frame, $frameElement, text, noStack;
+    t1 = $.getInterceptor$x(element);
+    t2 = t1.get$children(element);
+    t2.clear$0(t2);
+    response = $.parse(json, null);
+    t2 = $.getInterceptor$asx(response);
+    t1.set$id(element, t2.$index(response, "handle"));
+    title = document.createElement("div");
+    title.className = "stack_trace_title";
+    title.textContent = "Stack Trace";
+    t3 = t1.get$children(element);
+    t3.add$1(t3, title);
+    if ($.$gt$n($.get$length$asx(t2.$index(response, "stacktrace")), 0)) {
+      stackIterator = $.get$iterator$ax(t2.$index(response, "stacktrace"));
+      for (i = 0; stackIterator.moveNext$0() === true;) {
+        ++i;
+        frame = stackIterator.get$current();
+        $frameElement = document.createElement("div");
+        t2 = $.getInterceptor$asx(frame);
+        text = "" + i + ": " + $.S(t2.$index(frame, "url")) + ":" + $.S(t2.$index(frame, "line")) + ": " + $.S(t2.$index(frame, "function"));
+        $frameElement.textContent = $.$index$asx(t2.$index(frame, "code"), "optimized") === true ? text + " (optimized)" : text;
+        $frameElement.className = "stack_frame";
+        t2 = t1.get$children(element);
+        t2.add$1(t2, $frameElement);
+      }
+    } else {
+      noStack = document.createElement("div");
+      noStack.className = "empty_stack_frame";
+      noStack.textContent = "<no stack>";
+      t1 = t1.get$children(element);
+      t1.add$1(t1, noStack);
+    }
+  },
+  findOrAddChild$2: function($parent, className) {
+    var child, t1;
+    child = $parent.querySelector("." + className);
+    if (child == null) {
+      child = document.createElement("div");
+      child.className = className;
+      t1 = $.get$children$x($parent);
+      t1.add$1(t1, child);
+    }
+    return child;
+  },
+  updateIsolateDetails$2: function(isolate, row) {
+    var details, stackTrace;
+    details = row.querySelector(".isolate_details");
+    this.findOrAddChild$2(details, "new_space").textContent = "New space: " + $.S(isolate.get$newSpace().used) + "K";
+    this.findOrAddChild$2(details, "old_space").textContent = "Old space: " + $.S(isolate.get$oldSpace().used) + "K";
+    this.findOrAddChild$2(details, "stack_limit").textContent = "Stack limit: " + $.S($.JSDouble_methods.round$0($.abs$0$n(isolate.get$stackLimit()) / 1000000)) + "M";
+    stackTrace = this.findOrAddChild$2(row, "isolate_stacktrace_column");
+    $.HttpRequest_getString("/isolate/" + $.S(isolate.get$handle()) + "/stacktrace", null, null).then$1(new $.IsolateList_updateIsolateDetails_anon(this, stackTrace));
+  }
+};
+
+$$.IsolateList_updateList_anon = {"": "Closure;box_0,this_1",
+  call$1: function(e) {
+    var t1, t2, t3, t4;
+    t1 = this.box_0.isolateRow_0;
+    t2 = $.getInterceptor$x(t1);
+    t3 = t2.query$1(t1, ".isolate_details");
+    t4 = $.getInterceptor$x(t3);
+    t4.get$classes(t3).toggle$1("visible");
+    t4.get$classes(t3).toggle$1("hidden");
+    t1 = t2.query$1(t1, ".isolate_stacktrace_column");
+    t2 = $.getInterceptor$x(t1);
+    t2.get$classes(t1).toggle$1("visible");
+    t2.get$classes(t1).toggle$1("hidden");
+    return;
+  }
+};
+
+$$.IsolateList_updateIsolateDetails_anon = {"": "Closure;this_0,stackTrace_1",
+  call$1: function(response) {
+    return this.this_0.setStacktrace$2(this.stackTrace_1, response);
+  }
+};
+
+$$.ObservableModel = {"": "Object;",
+  addListener$2: function(onUpdate, onFailure) {
+    this._listeners.push($.ModelListener$(onUpdate, onFailure));
+  },
+  removeListener$1: function(onUpdate) {
+    var t1, iterator;
+    t1 = this._listeners;
+    iterator = $.JSArray_methods.get$iterator(t1);
+    for (; iterator.moveNext$0();)
+      if (iterator.get$current().get$_onUpdate() === onUpdate) {
+        $.JSArray_methods.remove$1(t1, iterator.get$current());
+        return;
+      }
+  },
+  notifySuccess$0: function() {
+    $.JSArray_methods.forEach$1(this._listeners, new $.ObservableModel_notifySuccess_anon(this));
+  },
+  notifyFailure$0: function() {
+    $.JSArray_methods.forEach$1(this._listeners, new $.ObservableModel_notifyFailure_anon());
+  }
+};
+
+$$.ObservableModel_notifySuccess_anon = {"": "Closure;this_0",
+  call$1: function(listener) {
+    return listener.changed$1(this.this_0);
+  }
+};
+
+$$.ObservableModel_notifyFailure_anon = {"": "Closure;",
+  call$1: function(listener) {
+    return listener.failed$0();
+  }
+};
+
+$$.ModelListener = {"": "Object;_onUpdate<,_onFailure",
+  _onUpdate$1: function(arg0) {
+    return this._onUpdate.call$1(arg0);
+  },
+  changed$1: function(model) {
+    return $.Primitives_applyFunction(this._onUpdate, [model], $.Function__toMangledNames(null));
+  },
+  failed$0: function() {
+    return $.Primitives_applyFunction(this._onFailure, [], $.Function__toMangledNames(null));
+  }
+};
+
+$$.IsolateListModel = {"": "ObservableModel;_isolates,_listeners",
+  update$0: function() {
+    $.HttpRequest_getString("/isolates", null, null).then$2$onError(new $.IsolateListModel_update_anon(this), new $.IsolateListModel_update_anon0(this));
+  },
+  _onUpdate$1: function(isolateMap) {
+    var list, i;
+    this._isolates = [];
+    list = $.$index$asx(isolateMap, "isolates");
+    if (typeof list !== "string" && (typeof list !== "object" || list === null || list.constructor !== Array && !$.getInterceptor(list).$isJavaScriptIndexingBehavior()))
+      return this._onUpdate$1$bailout(1, list);
+    for (i = 0; i < list.length; ++i)
+      this._isolates.push($.Isolate$(list[i]));
+    this.notifySuccess$0();
+  },
+  _onUpdate$1$bailout: function(state0, list) {
+    var t1, i;
+    for (t1 = $.getInterceptor$asx(list), i = 0; $.JSNumber_methods.$lt(i, t1.get$length(list)); ++i)
+      this._isolates.push($.Isolate$(t1.$index(list, i)));
+    this.notifySuccess$0();
+  },
+  get$_onUpdate: function() {
+    return new $.BoundClosure$1(this, "_onUpdate$1");
+  },
+  toString$0: function(_) {
+    return $.JSArray_methods.join$1(this._isolates, ", ");
+  },
+  forEach$1: function(_, f) {
+    return $.JSArray_methods.forEach$1(this._isolates, f);
+  },
+  isEmpty$0: function(_) {
+    return $.JSArray_methods.get$isEmpty(this._isolates);
+  },
+  get$isEmpty: function(receiver) {
+    return new $.BoundClosure$i0(this, "isEmpty$0", receiver);
+  },
+  get$iterator: function(_) {
+    return $.JSArray_methods.get$iterator(this._isolates);
+  },
+  get$length: function(_) {
+    return this._isolates.length;
+  },
+  $index: function(_, index) {
+    var t1 = this._isolates;
+    if (index !== (index | 0))
+      throw $.iae(index);
+    if (index < 0 || index >= t1.length)
+      throw $.ioore(index);
+    return t1[index];
+  }
+};
+
+$$.IsolateListModel_update_anon = {"": "Closure;this_0",
+  call$1: function(response) {
+    return this.this_0._onUpdate$1($.parse(response, null));
+  }
+};
+
+$$.IsolateListModel_update_anon0 = {"": "Closure;this_1",
+  call$1: function(e) {
+    return this.this_1.notifyFailure$0();
+  }
+};
+
+$$.Isolate = {"": "Object;handle<,name>,port>,startTime,stackLimit<,newSpace<,oldSpace<",
+  toString$0: function(_) {
+    return $.S(this.name) + ": " + $.S($.$add$ns(this.newSpace.used, this.oldSpace.used)) + "K";
+  }
+};
+
+$$.Space = {"": "Object;used,capacity",
+  toString$0: function(_) {
+    return "used: " + $.S(this.used) + " capacity: " + $.S(this.capacity);
+  }
+};
+
+$$.main_anon = {"": "Closure;",
+  call$1: function(timer) {
+    return $._isolates.update$0();
+  }
+};
+
+$$.onUpdateStatus_anon = {"": "Closure;box_0",
+  call$1: function(element) {
+    var t1 = this.box_0;
+    t1.oldSpace_0 = $.$add$ns(t1.oldSpace_0, element.get$oldSpace().used);
+    t1.newSpace_1 = $.$add$ns(t1.newSpace_1, element.get$newSpace().used);
+  }
+};
+
+// Native classes
+$$._WorkerStub = {"": "Interceptor;",
+  get$id: function(receiver) {
+    return receiver.id;
+  },
+  set$id: function(receiver, i) {
+    receiver.id = i;
+  },
+  set$onmessage: function(receiver, f) {
+    receiver.onmessage = f;
+  },
+  postMessage$1: function(receiver, msg) {
+    receiver.postMessage(msg);
+  },
+  terminate$0: function(receiver) {
+    receiver.terminate();
+  }
+};
+
+$$._HTMLElement = {"": "Element;"};
+
+$$.AnchorElement = {"": "Element;name=,port=",
+  toString$0: function(receiver) {
+    return receiver.toString();
+  }
+};
+
+$$.AnimationEvent = {"": "Event;"};
+
+$$.AreaElement = {"": "Element;port="};
+
+$$.ArrayBuffer = {"": "Interceptor;"};
+
+$$.ArrayBufferView = {"": "Interceptor;"};
+
+$$.Attr = {"": "Node;"};
+
+$$.AudioElement = {"": "MediaElement;"};
+
+$$.AutocompleteErrorEvent = {"": "Event;"};
+
+$$.BRElement = {"": "Element;"};
+
+$$.BaseElement = {"": "Element;"};
+
+$$.BeforeLoadEvent = {"": "Event;"};
+
+$$.Blob = {"": "Interceptor;"};
+
+$$.BodyElement = {"": "Element;"};
+
+$$.ButtonElement = {"": "Element;name=,value="};
+
+$$.CDataSection = {"": "Text;"};
+
+$$.CanvasElement = {"": "Element;height=,width=",
+  get$context2D: function(receiver) {
+    return receiver.getContext("2d");
+  }
+};
+
+$$.CanvasGradient = {"": "Interceptor;"};
+
+$$.CanvasPattern = {"": "Interceptor;"};
+
+$$.CanvasRenderingContext = {"": "Interceptor;"};
+
+$$.CanvasRenderingContext2D = {"": "CanvasRenderingContext;"};
+
+$$.CharacterData = {"": "Node;length="};
+
+$$.CloseEvent = {"": "Event;"};
+
+$$.Comment = {"": "CharacterData;"};
+
+$$.CompositionEvent = {"": "UIEvent;"};
+
+$$.ContentElement = {"": "Element;"};
+
+$$.CssFontFaceLoadEvent = {"": "Event;"};
+
+$$.CssStyleDeclaration = {"": "Interceptor;length=",
+  getPropertyValue$1: function(receiver, propertyName) {
+    var propValue = receiver.getPropertyValue(propertyName);
+    return propValue != null ? propValue : "";
+  },
+  get$color: function(receiver) {
+    return this.getPropertyValue$1(receiver, "color");
+  }
+};
+
+$$.CustomElementConstructor = {"": "Interceptor;"};
+
+$$.CustomEvent = {"": "Event;"};
+
+$$.DListElement = {"": "Element;"};
+
+$$.DataListElement = {"": "Element;"};
+
+$$.DetailsElement = {"": "Element;"};
+
+$$.DeviceMotionEvent = {"": "Event;"};
+
+$$.DeviceOrientationEvent = {"": "Event;"};
+
+$$.DialogElement = {"": "Element;"};
+
+$$.DivElement = {"": "Element;"};
+
+$$.Document = {"": "Node;",
+  query$1: function(receiver, selectors) {
+    return receiver.querySelector(selectors);
+  },
+  register$2: function(receiver, $name, options) {
+    var t1 = $ === options;
+    if (t1)
+      options = null;
+    if (!t1)
+      return receiver.webkitRegister($name, $.convertDartToNative_Dictionary(options));
+    return receiver.webkitRegister($name);
+  },
+  get$onClick: function(receiver) {
+    return $.EventStreamProvider_click.forTarget$1(receiver);
+  }
+};
+
+$$.DocumentFragment = {"": "Node;",
+  get$children: function(receiver) {
+    if (receiver._children == null)
+      receiver._children = $.FilteredElementList$(receiver);
+    return receiver._children;
+  },
+  query$1: function(receiver, selectors) {
+    return receiver.querySelector(selectors);
+  }
+};
+
+$$.DocumentType = {"": "Node;"};
+
+$$.DomError = {"": "Interceptor;name="};
+
+$$.DomException = {"": "Interceptor;",
+  get$name: function(receiver) {
+    var errorName = receiver.name;
+    if ($.Device_isWebKit() === true && errorName === "SECURITY_ERR")
+      return "SecurityError";
+    if ($.Device_isWebKit() === true && errorName === "SYNTAX_ERR")
+      return "SyntaxError";
+    return errorName;
+  },
+  toString$0: function(receiver) {
+    return receiver.toString();
+  }
+};
+
+$$.Element = {"": "Node;$$dom_children:children=,id%,$$dom_className:className}",
+  get$attributes: function(receiver) {
+    return $._ElementAttributeMap$(receiver);
+  },
+  get$children: function(receiver) {
+    return $._ChildrenElementList$_wrap(receiver);
+  },
+  get$classes: function(receiver) {
+    return $._ElementCssClassSet$(receiver);
+  },
+  query$1: function(receiver, selectors) {
+    return receiver.querySelector(selectors);
+  },
+  get$onClick: function(receiver) {
+    return $.EventStreamProvider_click.forTarget$1(receiver);
+  },
+  $isElement: function() {
+    return true;
+  },
+  $asElement: function() {
+    return null;
+  }
+};
+
+$$.EmbedElement = {"": "Element;height=,name=,width="};
+
+$$.EntityReference = {"": "Node;"};
+
+$$.ErrorEvent = {"": "Event;"};
+
+$$.Event = {"": "Interceptor;"};
+
+$$.EventException = {"": "Interceptor;name=",
+  toString$0: function(receiver) {
+    return receiver.toString();
+  }
+};
+
+$$.EventTarget = {"": "Interceptor;",
+  $$dom_addEventListener$3: function(receiver, type, listener, useCapture) {
+    return receiver.addEventListener(type, $.convertDartClosureToJS(listener, 1), useCapture);
+  },
+  $$dom_removeEventListener$3: function(receiver, type, listener, useCapture) {
+    return receiver.removeEventListener(type, $.convertDartClosureToJS(listener, 1), useCapture);
+  }
+};
+
+$$.FieldSetElement = {"": "Element;name="};
+
+$$.File = {"": "Blob;name="};
+
+$$.FileError = {"": "Interceptor;"};
+
+$$.FileException = {"": "Interceptor;name=",
+  toString$0: function(receiver) {
+    return receiver.toString();
+  }
+};
+
+$$.FocusEvent = {"": "UIEvent;"};
+
+$$.FormElement = {"": "Element;length=,name="};
+
+$$.HRElement = {"": "Element;"};
+
+$$.HashChangeEvent = {"": "Event;"};
+
+$$.HeadElement = {"": "Element;"};
+
+$$.HeadingElement = {"": "Element;"};
+
+$$.HtmlCollection = {"": "Interceptor;",
+  get$length: function(receiver) {
+    return receiver.length;
+  },
+  $index: function(receiver, index) {
+    return receiver[index];
+  },
+  $indexSet: function(receiver, index, value) {
+    throw $.wrapException($.UnsupportedError$("Cannot assign element of immutable List."));
+  },
+  get$iterator: function(receiver) {
+    return $.FixedSizeListIterator$(receiver);
+  },
+  forEach$1: function(receiver, f) {
+    var t1;
+    for (t1 = this.get$iterator(receiver); t1.moveNext$0();)
+      f.call$1(t1.get$current());
+    return;
+  },
+  toList$1$growable: function(receiver, growable) {
+    return $.List_List$from(receiver, growable);
+  },
+  toList$0: function($receiver) {
+    return this.toList$1$growable($receiver, true);
+  },
+  get$isEmpty: function(receiver) {
+    return this.get$length(receiver) === 0;
+  },
+  skip$1: function(receiver, n) {
+    return $.SubListIterable$(receiver, n, null);
+  },
+  elementAt$1: function(receiver, index) {
+    return receiver[index];
+  },
+  add$1: function(receiver, value) {
+    throw $.wrapException($.UnsupportedError$("Cannot add to immutable List."));
+  },
+  addAll$1: function(receiver, iterable) {
+    throw $.wrapException($.UnsupportedError$("Cannot add to immutable List."));
+  },
+  set$length: function(receiver, value) {
+    throw $.wrapException($.UnsupportedError$("Cannot resize immutable List."));
+  },
+  removeLast$0: function(receiver) {
+    throw $.wrapException($.UnsupportedError$("Cannot remove from immutable List."));
+  },
+  sublist$2: function(receiver, start, end) {
+    if (end == null)
+      end = this.get$length(receiver);
+    return $.Lists_getRange(receiver, start, end, []);
+  },
+  sublist$1: function($receiver, start) {
+    return this.sublist$2($receiver, start, null);
+  },
+  toString$0: function(receiver) {
+    var buffer = $.StringBuffer$("[");
+    buffer.writeAll$2(receiver, ", ");
+    buffer.write$1("]");
+    return buffer.toString$0(buffer);
+  },
+  $isList: function() {
+    return true;
+  },
+  $asList: function() {
+    return function () { return [$.Node]; };
+  },
+  $isIterable: function() {
+    return true;
+  },
+  $asIterable: function() {
+    return function () { return [$.Node]; };
+  },
+  $isJavaScriptIndexingBehavior: function() {
+    return true;
+  },
+  $asJavaScriptIndexingBehavior: function() {
+    return null;
+  }
+};
+
+$$.HtmlDocument = {"": "Document;"};
+
+$$.HtmlElement = {"": "Element;"};
+
+$$.HtmlFormControlsCollection = {"": "HtmlCollection;"};
+
+$$.HtmlOptionsCollection = {"": "HtmlCollection;"};
+
+$$.HttpRequest = {"": "EventTarget;responseText=",
+  $$dom_addEventListener$3: function(receiver, type, listener, useCapture) {
+    return receiver.addEventListener(type, $.convertDartClosureToJS(listener, 1), useCapture);
+  },
+  open$5$async$password$user: function(receiver, method, url, async, password, user) {
+    return receiver.open(method, url, async, user, password);
+  },
+  open$3$async: function($receiver, method, url, async) {
+    return $receiver.open(method, url, async);
+  },
+  $$dom_removeEventListener$3: function(receiver, type, listener, useCapture) {
+    return receiver.removeEventListener(type, $.convertDartClosureToJS(listener, 1), useCapture);
+  },
+  send$1: function(receiver, data) {
+    return receiver.send(data);
+  },
+  get$onError: function(receiver) {
+    return $.EventStreamProvider_error.forTarget$1(receiver);
+  },
+  get$onLoad: function(receiver) {
+    return $.EventStreamProvider_load.forTarget$1(receiver);
+  },
+  get$onProgress: function(receiver) {
+    return $.EventStreamProvider_progress.forTarget$1(receiver);
+  }
+};
+
+$$.HttpRequestException = {"": "Interceptor;name=",
+  toString$0: function(receiver) {
+    return receiver.toString();
+  }
+};
+
+$$.HttpRequestProgressEvent = {"": "ProgressEvent;"};
+
+$$.HttpRequestUpload = {"": "EventTarget;",
+  $$dom_addEventListener$3: function(receiver, type, listener, useCapture) {
+    return receiver.addEventListener(type, $.convertDartClosureToJS(listener, 1), useCapture);
+  },
+  $$dom_removeEventListener$3: function(receiver, type, listener, useCapture) {
+    return receiver.removeEventListener(type, $.convertDartClosureToJS(listener, 1), useCapture);
+  }
+};
+
+$$.IFrameElement = {"": "Element;height=,name=,width="};
+
+$$.ImageElement = {"": "Element;height=,width="};
+
+$$.InputElement = {"": "Element;height=,name=,value=,width=",
+  $isElement: function() {
+    return true;
+  },
+  $asElement: function() {
+    return null;
+  }
+};
+
+$$.KeyboardEvent = {"": "UIEvent;"};
+
+$$.KeygenElement = {"": "Element;name="};
+
+$$.LIElement = {"": "Element;value="};
+
+$$.LabelElement = {"": "Element;"};
+
+$$.LegendElement = {"": "Element;"};
+
+$$.LinkElement = {"": "Element;"};
+
+$$.MapElement = {"": "Element;name="};
+
+$$.MediaElement = {"": "Element;"};
+
+$$.MediaError = {"": "Interceptor;"};
+
+$$.MediaKeyError = {"": "Interceptor;"};
+
+$$.MediaKeyEvent = {"": "Event;"};
+
+$$.MediaStreamEvent = {"": "Event;"};
+
+$$.MediaStreamTrackEvent = {"": "Event;"};
+
+$$.MenuElement = {"": "Element;"};
+
+$$.MessageEvent = {"": "Event;"};
+
+$$.MetaElement = {"": "Element;name="};
+
+$$.MeterElement = {"": "Element;value="};
+
+$$.ModElement = {"": "Element;"};
+
+$$.MouseEvent = {"": "UIEvent;"};
+
+$$.MutationEvent = {"": "Event;"};
+
+$$.Navigator = {"": "Interceptor;"};
+
+$$.NavigatorUserMediaError = {"": "Interceptor;"};
+
+$$.Node = {"": "EventTarget;text:textContent}",
+  get$nodes: function(receiver) {
+    return $._ChildNodeListLazy$(receiver);
+  },
+  remove$0: function(receiver) {
+    var t1 = receiver.parentNode;
+    if (t1 != null)
+      t1.removeChild(receiver);
+  },
+  replaceWith$1: function(receiver, otherNode) {
+    var $parent, exception;
+    try {
+      $parent = receiver.parentNode;
+      $.$$dom_replaceChild$2$x($parent, otherNode, receiver);
+    } catch (exception) {
+      $.unwrapException(exception);
+    }
+
+    return receiver;
+  },
+  toString$0: function(receiver) {
+    var t1 = receiver.localName;
+    if (t1 == null) {
+      t1 = receiver.nodeValue;
+      if (t1 == null)
+        t1 = $.Object.prototype.toString$0.call(receiver, receiver);
+    }
+    return t1;
+  },
+  $$dom_addEventListener$3: function(receiver, type, listener, useCapture) {
+    return receiver.addEventListener(type, $.convertDartClosureToJS(listener, 1), useCapture);
+  },
+  $$dom_removeEventListener$3: function(receiver, type, listener, useCapture) {
+    return receiver.removeEventListener(type, $.convertDartClosureToJS(listener, 1), useCapture);
+  },
+  $$dom_replaceChild$2: function(receiver, newChild, oldChild) {
+    return receiver.replaceChild(newChild, oldChild);
+  }
+};
+
+$$.NodeList = {"": "Interceptor;",
+  get$length: function(receiver) {
+    return receiver.length;
+  },
+  $index: function(receiver, index) {
+    return receiver[index];
+  },
+  $indexSet: function(receiver, index, value) {
+    throw $.wrapException($.UnsupportedError$("Cannot assign element of immutable List."));
+  },
+  get$iterator: function(receiver) {
+    return $.FixedSizeListIterator$(receiver);
+  },
+  forEach$1: function(receiver, f) {
+    var t1;
+    for (t1 = this.get$iterator(receiver); t1.moveNext$0();)
+      f.call$1(t1.get$current());
+    return;
+  },
+  toList$1$growable: function(receiver, growable) {
+    return $.List_List$from(receiver, growable);
+  },
+  toList$0: function($receiver) {
+    return this.toList$1$growable($receiver, true);
+  },
+  get$isEmpty: function(receiver) {
+    return this.get$length(receiver) === 0;
+  },
+  skip$1: function(receiver, n) {
+    return $.SubListIterable$(receiver, n, null);
+  },
+  elementAt$1: function(receiver, index) {
+    return receiver[index];
+  },
+  add$1: function(receiver, value) {
+    throw $.wrapException($.UnsupportedError$("Cannot add to immutable List."));
+  },
+  addAll$1: function(receiver, iterable) {
+    throw $.wrapException($.UnsupportedError$("Cannot add to immutable List."));
+  },
+  set$length: function(receiver, value) {
+    throw $.wrapException($.UnsupportedError$("Cannot resize immutable List."));
+  },
+  removeLast$0: function(receiver) {
+    throw $.wrapException($.UnsupportedError$("Cannot remove from immutable List."));
+  },
+  sublist$2: function(receiver, start, end) {
+    if (end == null)
+      end = this.get$length(receiver);
+    return $.Lists_getRange(receiver, start, end, []);
+  },
+  sublist$1: function($receiver, start) {
+    return this.sublist$2($receiver, start, null);
+  },
+  toString$0: function(receiver) {
+    var buffer = $.StringBuffer$("[");
+    buffer.writeAll$2(receiver, ", ");
+    buffer.write$1("]");
+    return buffer.toString$0(buffer);
+  },
+  $isList: function() {
+    return true;
+  },
+  $asList: function() {
+    return function () { return [$.Node]; };
+  },
+  $isIterable: function() {
+    return true;
+  },
+  $asIterable: function() {
+    return function () { return [$.Node]; };
+  },
+  $isJavaScriptIndexingBehavior: function() {
+    return true;
+  },
+  $asJavaScriptIndexingBehavior: function() {
+    return null;
+  }
+};
+
+$$.Notation = {"": "Node;"};
+
+$$.OListElement = {"": "Element;"};
+
+$$.ObjectElement = {"": "Element;height=,name=,width="};
+
+$$.OptGroupElement = {"": "Element;"};
+
+$$.OptionElement = {"": "Element;value="};
+
+$$.OutputElement = {"": "Element;name=,value="};
+
+$$.OverflowEvent = {"": "Event;"};
+
+$$.PageTransitionEvent = {"": "Event;"};
+
+$$.ParagraphElement = {"": "Element;"};
+
+$$.ParamElement = {"": "Element;name=,value="};
+
+$$.PopStateEvent = {"": "Event;"};
+
+$$.PositionError = {"": "Interceptor;"};
+
+$$.PreElement = {"": "Element;"};
+
+$$.ProcessingInstruction = {"": "Node;"};
+
+$$.ProgressElement = {"": "Element;value="};
+
+$$.ProgressEvent = {"": "Event;",
+  total$0: function($receiver) {
+    return this.total.call$0();
+  }
+};
+
+$$.QuoteElement = {"": "Element;"};
+
+$$.RadioNodeList = {"": "NodeList;"};
+
+$$.RangeException = {"": "Interceptor;name=",
+  toString$0: function(receiver) {
+    return receiver.toString();
+  }
+};
+
+$$.RtcDataChannelEvent = {"": "Event;"};
+
+$$.RtcDtmfToneChangeEvent = {"": "Event;"};
+
+$$.RtcIceCandidateEvent = {"": "Event;"};
+
+$$.ScriptElement = {"": "Element;"};
+
+$$.SecurityPolicyViolationEvent = {"": "Event;"};
+
+$$.SelectElement = {"": "Element;length%,name=,value="};
+
+$$.ShadowElement = {"": "Element;"};
+
+$$.ShadowRoot = {"": "DocumentFragment;"};
+
+$$.SourceElement = {"": "Element;"};
+
+$$.SpanElement = {"": "Element;"};
+
+$$.SpeechInputEvent = {"": "Event;"};
+
+$$.SpeechRecognitionError = {"": "Event;"};
+
+$$.SpeechRecognitionEvent = {"": "Event;"};
+
+$$.StorageEvent = {"": "Event;"};
+
+$$.StyleElement = {"": "Element;"};
+
+$$.TableCaptionElement = {"": "Element;"};
+
+$$.TableCellElement = {"": "Element;"};
+
+$$.TableColElement = {"": "Element;"};
+
+$$.TableElement = {"": "Element;"};
+
+$$.TableRowElement = {"": "Element;"};
+
+$$.TableSectionElement = {"": "Element;"};
+
+$$.TemplateElement = {"": "Element;"};
+
+$$.Text = {"": "CharacterData;"};
+
+$$.TextAreaElement = {"": "Element;name=,value="};
+
+$$.TextEvent = {"": "UIEvent;"};
+
+$$.TitleElement = {"": "Element;"};
+
+$$.TouchEvent = {"": "UIEvent;"};
+
+$$.TrackElement = {"": "Element;"};
+
+$$.TrackEvent = {"": "Event;"};
+
+$$.TransitionEvent = {"": "Event;"};
+
+$$.UIEvent = {"": "Event;"};
+
+$$.UListElement = {"": "Element;"};
+
+$$.Uint8Array = {"": "ArrayBufferView;",
+  get$length: function(receiver) {
+    return receiver.length;
+  },
+  $index: function(receiver, index) {
+    return receiver[index];
+  },
+  $indexSet: function(receiver, index, value) {
+    receiver[index] = value;
+  },
+  get$iterator: function(receiver) {
+    return $.FixedSizeListIterator$(receiver);
+  },
+  forEach$1: function(receiver, f) {
+    var t1;
+    for (t1 = this.get$iterator(receiver); t1.moveNext$0();)
+      f.call$1(t1.get$current());
+    return;
+  },
+  toList$1$growable: function(receiver, growable) {
+    return $.List_List$from(receiver, growable);
+  },
+  toList$0: function($receiver) {
+    return this.toList$1$growable($receiver, true);
+  },
+  get$isEmpty: function(receiver) {
+    return this.get$length(receiver) === 0;
+  },
+  skip$1: function(receiver, n) {
+    return $.SubListIterable$(receiver, n, null);
+  },
+  elementAt$1: function(receiver, index) {
+    return this.$index(receiver, index);
+  },
+  add$1: function(receiver, value) {
+    throw $.wrapException($.UnsupportedError$("Cannot add to immutable List."));
+  },
+  addAll$1: function(receiver, iterable) {
+    throw $.wrapException($.UnsupportedError$("Cannot add to immutable List."));
+  },
+  set$length: function(receiver, value) {
+    throw $.wrapException($.UnsupportedError$("Cannot resize immutable List."));
+  },
+  removeLast$0: function(receiver) {
+    throw $.wrapException($.UnsupportedError$("Cannot remove from immutable List."));
+  },
+  sublist$2: function(receiver, start, end) {
+    if (end == null)
+      end = this.get$length(receiver);
+    return $.Lists_getRange(receiver, start, end, []);
+  },
+  sublist$1: function($receiver, start) {
+    return this.sublist$2($receiver, start, null);
+  },
+  toString$0: function(receiver) {
+    var buffer = $.StringBuffer$("[");
+    buffer.writeAll$2(receiver, ", ");
+    buffer.write$1("]");
+    return buffer.toString$0(buffer);
+  },
+  $isList: function() {
+    return true;
+  },
+  $asList: function() {
+    return function () { return [$.$int]; };
+  },
+  $isIterable: function() {
+    return true;
+  },
+  $asIterable: function() {
+    return function () { return [$.$int]; };
+  },
+  $isJavaScriptIndexingBehavior: function() {
+    return true;
+  },
+  $asJavaScriptIndexingBehavior: function() {
+    return null;
+  }
+};
+
+$$.Uint8ClampedArray = {"": "Uint8Array;",
+  $index: function(receiver, index) {
+    return receiver[index];
+  },
+  $indexSet: function(receiver, index, value) {
+    receiver[index] = value;
+  },
+  get$iterator: function(receiver) {
+    return $.FixedSizeListIterator$(receiver);
+  },
+  forEach$1: function(receiver, f) {
+    var t1;
+    for (t1 = this.get$iterator(receiver); t1.moveNext$0();)
+      f.call$1(t1.get$current());
+    return;
+  },
+  toList$1$growable: function(receiver, growable) {
+    return $.List_List$from(receiver, growable);
+  },
+  toList$0: function($receiver) {
+    return this.toList$1$growable($receiver, true);
+  },
+  get$isEmpty: function(receiver) {
+    return this.get$length(receiver) === 0;
+  },
+  skip$1: function(receiver, n) {
+    return $.SubListIterable$(receiver, n, null);
+  },
+  elementAt$1: function(receiver, index) {
+    return receiver[index];
+  },
+  add$1: function(receiver, value) {
+    throw $.wrapException($.UnsupportedError$("Cannot add to immutable List."));
+  },
+  addAll$1: function(receiver, iterable) {
+    throw $.wrapException($.UnsupportedError$("Cannot add to immutable List."));
+  },
+  set$length: function(receiver, value) {
+    throw $.wrapException($.UnsupportedError$("Cannot resize immutable List."));
+  },
+  removeLast$0: function(receiver) {
+    throw $.wrapException($.UnsupportedError$("Cannot remove from immutable List."));
+  },
+  sublist$2: function(receiver, start, end) {
+    if (end == null)
+      end = this.get$length(receiver);
+    return $.Lists_getRange(receiver, start, end, []);
+  },
+  sublist$1: function($receiver, start) {
+    return this.sublist$2($receiver, start, null);
+  },
+  toString$0: function(receiver) {
+    var buffer = $.StringBuffer$("[");
+    buffer.writeAll$2(receiver, ", ");
+    buffer.write$1("]");
+    return buffer.toString$0(buffer);
+  },
+  $isList: function() {
+    return true;
+  },
+  $asList: function() {
+    return function () { return [$.$int]; };
+  },
+  $isIterable: function() {
+    return true;
+  },
+  $asIterable: function() {
+    return function () { return [$.$int]; };
+  },
+  $isJavaScriptIndexingBehavior: function() {
+    return true;
+  },
+  $asJavaScriptIndexingBehavior: function() {
+    return null;
+  }
+};
+
+$$.UnknownElement = {"": "Element;"};
+
+$$.VideoElement = {"": "MediaElement;height=,width="};
+
+$$.WheelEvent = {"": "MouseEvent;"};
+
+$$.Window = {"": "EventTarget;name=,navigator=",
+  $$dom_addEventListener$3: function(receiver, type, listener, useCapture) {
+    return receiver.addEventListener(type, $.convertDartClosureToJS(listener, 1), useCapture);
+  },
+  $$dom_removeEventListener$3: function(receiver, type, listener, useCapture) {
+    return receiver.removeEventListener(type, $.convertDartClosureToJS(listener, 1), useCapture);
+  },
+  get$onClick: function(receiver) {
+    return $.EventStreamProvider_click.forTarget$1(receiver);
+  }
+};
+
+$$.XPathException = {"": "Interceptor;name=",
+  toString$0: function(receiver) {
+    return receiver.toString();
+  }
+};
+
+$$._NamedNodeMap = {"": "Interceptor;",
+  get$length: function(receiver) {
+    return receiver.length;
+  },
+  $index: function(receiver, index) {
+    return receiver[index];
+  },
+  $indexSet: function(receiver, index, value) {
+    throw $.wrapException($.UnsupportedError$("Cannot assign element of immutable List."));
+  },
+  get$iterator: function(receiver) {
+    return $.FixedSizeListIterator$(receiver);
+  },
+  forEach$1: function(receiver, f) {
+    var t1;
+    for (t1 = this.get$iterator(receiver); t1.moveNext$0();)
+      f.call$1(t1.get$current());
+    return;
+  },
+  toList$1$growable: function(receiver, growable) {
+    return $.List_List$from(receiver, growable);
+  },
+  toList$0: function($receiver) {
+    return this.toList$1$growable($receiver, true);
+  },
+  get$isEmpty: function(receiver) {
+    return this.get$length(receiver) === 0;
+  },
+  skip$1: function(receiver, n) {
+    return $.SubListIterable$(receiver, n, null);
+  },
+  elementAt$1: function(receiver, index) {
+    return receiver[index];
+  },
+  add$1: function(receiver, value) {
+    throw $.wrapException($.UnsupportedError$("Cannot add to immutable List."));
+  },
+  addAll$1: function(receiver, iterable) {
+    throw $.wrapException($.UnsupportedError$("Cannot add to immutable List."));
+  },
+  set$length: function(receiver, value) {
+    throw $.wrapException($.UnsupportedError$("Cannot resize immutable List."));
+  },
+  removeLast$0: function(receiver) {
+    throw $.wrapException($.UnsupportedError$("Cannot remove from immutable List."));
+  },
+  sublist$2: function(receiver, start, end) {
+    if (end == null)
+      end = this.get$length(receiver);
+    return $.Lists_getRange(receiver, start, end, []);
+  },
+  sublist$1: function($receiver, start) {
+    return this.sublist$2($receiver, start, null);
+  },
+  toString$0: function(receiver) {
+    var buffer = $.StringBuffer$("[");
+    buffer.writeAll$2(receiver, ", ");
+    buffer.write$1("]");
+    return buffer.toString$0(buffer);
+  },
+  $isList: function() {
+    return true;
+  },
+  $asList: function() {
+    return function () { return [$.Node]; };
+  },
+  $isIterable: function() {
+    return true;
+  },
+  $asIterable: function() {
+    return function () { return [$.Node]; };
+  },
+  $isJavaScriptIndexingBehavior: function() {
+    return true;
+  },
+  $asJavaScriptIndexingBehavior: function() {
+    return null;
+  }
+};
+
+$$._WebKitTransitionEvent = {"": "Event;"};
+
+$$.VersionChangeEvent = {"": "Event;"};
+
+$$.AElement = {"": "StyledElement;"};
+
+$$.AltGlyphElement = {"": "TextPositioningElement;"};
+
+$$.AnimateElement = {"": "AnimationElement;"};
+
+$$.AnimateMotionElement = {"": "AnimationElement;"};
+
+$$.AnimateTransformElement = {"": "AnimationElement;"};
+
+$$.AnimatedLength = {"": "Interceptor;"};
+
+$$.AnimatedNumberList = {"": "Interceptor;"};
+
+$$.AnimationElement = {"": "SvgElement;"};
+
+$$.CircleElement = {"": "StyledElement;"};
+
+$$.ClipPathElement = {"": "StyledElement;"};
+
+$$.DefsElement = {"": "StyledElement;"};
+
+$$.DescElement = {"": "StyledElement;"};
+
+$$.EllipseElement = {"": "StyledElement;"};
+
+$$.FEBlendElement = {"": "StyledElement;height=,width="};
+
+$$.FEColorMatrixElement = {"": "StyledElement;height=,width="};
+
+$$.FEComponentTransferElement = {"": "StyledElement;height=,width="};
+
+$$.FECompositeElement = {"": "StyledElement;height=,width="};
+
+$$.FEConvolveMatrixElement = {"": "StyledElement;height=,width="};
+
+$$.FEDiffuseLightingElement = {"": "StyledElement;height=,width="};
+
+$$.FEDisplacementMapElement = {"": "StyledElement;height=,width="};
+
+$$.FEDistantLightElement = {"": "SvgElement;"};
+
+$$.FEFloodElement = {"": "StyledElement;height=,width="};
+
+$$.FEFuncAElement = {"": "_SVGComponentTransferFunctionElement;"};
+
+$$.FEFuncBElement = {"": "_SVGComponentTransferFunctionElement;"};
+
+$$.FEFuncGElement = {"": "_SVGComponentTransferFunctionElement;"};
+
+$$.FEFuncRElement = {"": "_SVGComponentTransferFunctionElement;"};
+
+$$.FEGaussianBlurElement = {"": "StyledElement;height=,width="};
+
+$$.FEImageElement = {"": "StyledElement;height=,width="};
+
+$$.FEMergeElement = {"": "StyledElement;height=,width="};
+
+$$.FEMergeNodeElement = {"": "SvgElement;"};
+
+$$.FEMorphologyElement = {"": "StyledElement;height=,width="};
+
+$$.FEOffsetElement = {"": "StyledElement;height=,width="};
+
+$$.FEPointLightElement = {"": "SvgElement;"};
+
+$$.FESpecularLightingElement = {"": "StyledElement;height=,width="};
+
+$$.FESpotLightElement = {"": "SvgElement;"};
+
+$$.FETileElement = {"": "StyledElement;height=,width="};
+
+$$.FETurbulenceElement = {"": "StyledElement;height=,width="};
+
+$$.FilterElement = {"": "StyledElement;height=,width="};
+
+$$.ForeignObjectElement = {"": "StyledElement;height=,width="};
+
+$$.GElement = {"": "StyledElement;"};
+
+$$.ImageElement0 = {"": "StyledElement;height=,width="};
+
+$$.LineElement = {"": "StyledElement;"};
+
+$$.LinearGradientElement = {"": "_GradientElement;"};
+
+$$.MarkerElement = {"": "StyledElement;"};
+
+$$.MaskElement = {"": "StyledElement;height=,width="};
+
+$$.MetadataElement = {"": "SvgElement;"};
+
+$$.PathElement = {"": "StyledElement;"};
+
+$$.PatternElement = {"": "StyledElement;height=,width="};
+
+$$.PolygonElement = {"": "StyledElement;"};
+
+$$.PolylineElement = {"": "StyledElement;"};
+
+$$.RadialGradientElement = {"": "_GradientElement;"};
+
+$$.RectElement = {"": "StyledElement;height=,width="};
+
+$$.ScriptElement0 = {"": "SvgElement;"};
+
+$$.SetElement = {"": "AnimationElement;"};
+
+$$.StopElement = {"": "StyledElement;"};
+
+$$.StyleElement0 = {"": "SvgElement;"};
+
+$$.StyledElement = {"": "SvgElement;"};
+
+$$.SvgDocument = {"": "Document;"};
+
+$$.SvgElement = {"": "Element;",
+  get$classes: function(receiver) {
+    if (receiver._cssClassSet == null)
+      receiver._cssClassSet = $._AttributeClassSet$(receiver);
+    return receiver._cssClassSet;
+  },
+  get$children: function(receiver) {
+    return $.FilteredElementList$(receiver);
+  },
+  get$$$dom_children: function(receiver) {
+    throw $.wrapException($.UnsupportedError$("Cannot get dom_children on SVG."));
+  },
+  get$id: function(receiver) {
+    return receiver.id;
+  },
+  set$id: function(receiver, value) {
+    receiver.id = value;
+  }
+};
+
+$$.SvgException = {"": "Interceptor;name=",
+  toString$0: function(receiver) {
+    return receiver.toString();
+  }
+};
+
+$$.SvgSvgElement = {"": "StyledElement;height=,width="};
+
+$$.SwitchElement = {"": "StyledElement;"};
+
+$$.SymbolElement = {"": "StyledElement;"};
+
+$$.TSpanElement = {"": "TextPositioningElement;"};
+
+$$.TextContentElement = {"": "StyledElement;"};
+
+$$.TextElement = {"": "TextPositioningElement;"};
+
+$$.TextPathElement = {"": "TextContentElement;"};
+
+$$.TextPositioningElement = {"": "TextContentElement;"};
+
+$$.TitleElement0 = {"": "StyledElement;"};
+
+$$.UseElement = {"": "StyledElement;height=,width="};
+
+$$.ViewElement = {"": "SvgElement;"};
+
+$$.ZoomEvent = {"": "UIEvent;"};
+
+$$._GradientElement = {"": "StyledElement;"};
+
+$$._SVGComponentTransferFunctionElement = {"": "SvgElement;"};
+
+$$.AudioProcessingEvent = {"": "Event;"};
+
+$$.OfflineAudioCompletionEvent = {"": "Event;"};
+
+$$.ContextEvent = {"": "Event;"};
+
+$$.SqlError = {"": "Interceptor;"};
+
+$$.SqlException = {"": "Interceptor;"};
+
+$$.Closure = {"": "Object;",
+  toString$0: function(_) {
+    return "Closure";
+  }
+};
+
+// Bound closures
+$$.BoundClosure$1 = {"": "Closure;self,target",
+  call$1: function(p0) {
+    return this.self[this.target](p0);
+  }
+};
+
+$$.BoundClosure$0 = {"": "Closure;self,target",
+  call$0: function() {
+    return this.self[this.target]();
+  }
+};
+
+$$.BoundClosure$i0 = {"": "Closure;self,target,receiver",
+  call$0: function() {
+    return this.self[this.target](this.receiver);
+  }
+};
+
+Isolate.$finishClasses($$, $, null);
+$$ = null;
+
+$.Arrays_copy = function(src, srcStart, dst, dstStart, count) {
+  var i, j, t1, t2, t3;
+  if (typeof src !== "string" && (typeof src !== "object" || src === null || src.constructor !== Array && !$.getInterceptor(src).$isJavaScriptIndexingBehavior()))
+    return $.Arrays_copy$bailout(1, src, srcStart, dst, dstStart, count);
+  if (typeof dst !== "object" || dst === null || (dst.constructor !== Array || !!dst.immutable$list) && !$.getInterceptor(dst).$isJavaScriptIndexingBehavior())
+    return $.Arrays_copy$bailout(1, src, srcStart, dst, dstStart, count);
+  if (typeof dstStart !== "number")
+    return $.Arrays_copy$bailout(1, src, srcStart, dst, dstStart, count);
+  if (srcStart < dstStart)
+    for (i = srcStart + count - 1, j = dstStart + count - 1, t1 = src.length, t2 = dst.length; i >= srcStart; --i, --j) {
+      if (i !== (i | 0))
+        throw $.iae(i);
+      if (i < 0 || i >= t1)
+        throw $.ioore(i);
+      t3 = src[i];
+      if (j !== (j | 0))
+        throw $.iae(j);
+      if (j < 0 || j >= t2)
+        throw $.ioore(j);
+      dst[j] = t3;
+    }
+  else
+    for (t1 = src.length, t2 = dst.length, j = dstStart, i = srcStart; i < srcStart + count; ++i, ++j) {
+      if (i !== (i | 0))
+        throw $.iae(i);
+      if (i < 0 || i >= t1)
+        throw $.ioore(i);
+      t3 = src[i];
+      if (j !== (j | 0))
+        throw $.iae(j);
+      if (j < 0 || j >= t2)
+        throw $.ioore(j);
+      dst[j] = t3;
+    }
+};
+
+$.Arrays_copy$bailout = function(state0, src, srcStart, dst, dstStart, count) {
+  var i, j, t1;
+  if ($.JSNumber_methods.$lt(srcStart, dstStart))
+    for (i = srcStart + count - 1, j = $.$sub$n($.$add$ns(dstStart, count), 1), t1 = $.getInterceptor$asx(src); i >= srcStart; --i, j = $.$sub$n(j, 1))
+      $.JSArray_methods.$indexSet(dst, j, t1.$index(src, i));
+  else
+    for (t1 = $.getInterceptor$asx(src), j = dstStart, i = srcStart; i < srcStart + count; ++i, j = $.$add$ns(j, 1))
+      $.JSArray_methods.$indexSet(dst, j, t1.$index(src, i));
+};
+
+$.SubListIterable$ = function(_iterable, _start, _endOrLength) {
+  return new $.SubListIterable(_iterable, _start, _endOrLength);
+};
+
+$.ListIterator$ = function(iterable) {
+  return new $.ListIterator(iterable, $.get$length$asx(iterable), 0, null);
+};
+
+$.MappedIterable$ = function(_iterable, _f) {
+  return new $.MappedIterable(_iterable, _f);
+};
+
+$.MappedIterator$ = function(_iterator, _f) {
+  return new $.MappedIterator(null, _iterator, _f);
+};
+
+$.WhereIterable$ = function(_iterable, _f) {
+  return new $.WhereIterable(_iterable, _f);
+};
+
+$.WhereIterator$ = function(_iterator, _f) {
+  return new $.WhereIterator(_iterator, _f);
+};
+
+$.SkipIterable$ = function(_iterable, _skipCount) {
+  var t1 = new $.SkipIterable(_iterable, _skipCount);
+  t1.SkipIterable$2(_iterable, _skipCount);
+  return t1;
+};
+
+$.SkipIterator$ = function(_iterator, _skipCount) {
+  var t1 = new $.SkipIterator(_iterator, _skipCount);
+  t1.SkipIterator$2(_iterator, _skipCount);
+  return t1;
+};
+
+$.IterableMixinWorkaround__rangeCheck = function(list, start, end) {
+  var t1 = $.getInterceptor$n(start);
+  if (t1.$lt(start, 0) || t1.$gt(start, list.length))
+    throw $.wrapException($.RangeError$range(start, 0, list.length));
+  t1 = $.getInterceptor$n(end);
+  if (t1.$lt(end, start) || t1.$gt(end, list.length))
+    throw $.wrapException($.RangeError$range(end, start, list.length));
+};
+
+$.IterableMixinWorkaround_setRangeList = function(list, start, end, from, skipCount) {
+  var $length, otherStart, otherList;
+  $.IterableMixinWorkaround__rangeCheck(list, start, end);
+  $length = $.$sub$n(end, start);
+  if ($.$eq($length, 0))
+    return;
+  if (skipCount < 0)
+    throw $.wrapException($.ArgumentError$(skipCount));
+  if (typeof from === "object" && from !== null && (from.constructor === Array || $.getInterceptor(from).$isList())) {
+    otherStart = skipCount;
+    otherList = from;
+  } else {
+    otherList = $.toList$1$growable$ax($.skip$1$ax(from, skipCount), false);
+    otherStart = 0;
+  }
+  if (typeof $length !== "number")
+    throw $.iae($length);
+  if ($.JSNumber_methods.$gt(otherStart + $length, $.get$length$asx(otherList)))
+    throw $.wrapException($.StateError$("Not enough elements"));
+  $.Arrays_copy(otherList, otherStart, list, start, $length);
+};
+
+$.ToString__emitValue = function(i, result, visiting) {
+  var t1, isList, t2, first, t3;
+  t1 = $.getInterceptor$ax(visiting);
+  t1.add$1(visiting, i);
+  isList = typeof i === "object" && i !== null && (i.constructor === Array || $.getInterceptor(i).$isList());
+  result.write$1(isList ? "[" : "{");
+  for (t2 = $.get$iterator$ax(i), first = true; t2.moveNext$0() === true; first = false) {
+    t3 = t2.get$current();
+    if (!first)
+      result.write$1(", ");
+    $.ToString__emitObject(t3, result, visiting);
+  }
+  result.write$1(isList ? "]" : "}");
+  t1.removeLast$0(visiting);
+};
+
+$.ToString__emitObject = function(o, result, visiting) {
+  if (typeof o === "object" && o !== null && (o.constructor === Array || $.getInterceptor(o).$isIterable()))
+    if ($.ToString__containsRef(visiting, o))
+      result.write$1(typeof o === "object" && o !== null && (o.constructor === Array || $.getInterceptor(o).$isList()) ? "[...]" : "{...}");
+    else
+      $.ToString__emitValue(o, result, visiting);
+  else if (typeof o === "object" && o !== null && !!$.getInterceptor(o).$isMap)
+    if ($.ToString__containsRef(visiting, o))
+      result.write$1("{...}");
+    else
+      $.ToString__emitPair(o, result, visiting);
+  else
+    result.write$1(o);
+};
+
+$.ToString__containsRef = function(i, ref) {
+  var t1;
+  for (t1 = $.get$iterator$ax(i); t1.moveNext$0() === true;)
+    if (t1.get$current() === ref)
+      return true;
+  return false;
+};
+
+$.ToString__emitPair = function(m, result, visiting) {
+  var t1, t2;
+  t1 = {};
+  t2 = $.getInterceptor$ax(visiting);
+  t2.add$1(visiting, m);
+  result.write$1("{");
+  t1.first_0 = true;
+  m.forEach$1(m, new $.ToString__emitPair_anon(t1, result, visiting));
+  result.write$1("}");
+  t2.removeLast$0(visiting);
+};
+
+$.HashMap__findBucketIndex = function(bucket, key) {
+  var $length, i;
+  if (bucket == null)
+    return -1;
+  $length = bucket.length;
+  for (i = 0; i < $length; i += 2)
+    if ($.$eq(bucket[i], key) === true)
+      return i;
+  return -1;
+};
+
+$.HashMapKeyIterable$ = function(_map) {
+  return new $.HashMapKeyIterable(_map);
+};
+
+$.HashMapKeyIterator$ = function(_map, _keys) {
+  return new $.HashMapKeyIterator(_map, _keys, 0, null);
+};
+
+$.LinkedHashMap__findBucketIndex = function(bucket, key) {
+  var $length, i;
+  if (bucket == null)
+    return -1;
+  $length = bucket.length;
+  for (i = 0; i < $length; ++i)
+    if ($.$eq(bucket[i].get$_key(), key) === true)
+      return i;
+  return -1;
+};
+
+$.LinkedHashMapCell$ = function(_key, _value) {
+  return new $.LinkedHashMapCell(_key, _value, null, null);
+};
+
+$.LinkedHashMapKeyIterable$ = function(_map) {
+  return new $.LinkedHashMapKeyIterable(_map);
+};
+
+$.LinkedHashMapKeyIterator$ = function(_map, _modifications) {
+  var t1 = new $.LinkedHashMapKeyIterator(_map, _modifications, null, null);
+  t1.LinkedHashMapKeyIterator$2(_map, _modifications);
+  return t1;
+};
+
+$.LinkedHashSet__findBucketIndex = function(bucket, element) {
+  var $length, i;
+  if (bucket == null)
+    return -1;
+  $length = bucket.length;
+  for (i = 0; i < $length; ++i)
+    if ($.$eq(bucket[i].get$_element(), element) === true)
+      return i;
+  return -1;
+};
+
+$.LinkedHashSetCell$ = function(_element) {
+  return new $.LinkedHashSetCell(_element, null, null);
+};
+
+$.LinkedHashSetIterator$ = function(_set, _modifications) {
+  var t1 = new $.LinkedHashSetIterator(_set, _modifications, null, null);
+  t1.LinkedHashSetIterator$2(_set, _modifications);
+  return t1;
+};
+
+$.Function__toMangledNames = function(namedArguments) {
+  var result;
+  if (namedArguments == null)
+    return;
+  result = $.makeLiteralMap([]);
+  $.JSNull_methods.forEach$1(namedArguments, new $.Function__toMangledNames_anon(result));
+  return result;
+};
+
+$.getDispatchProperty = function(object) {
+  return object[$.dispatchPropertyName];
+};
+
+$.setDispatchProperty = function(object, value) {
+  object[$.dispatchPropertyName] = value;
+};
+
+$.getNativeInterceptor = function(object) {
+  var record, proto, objectProto;
+  record = $.getDispatchProperty(object);
+  if (record != null) {
+    proto = record.p;
+    if (false === proto)
+      return record.i;
+    if (true === proto)
+      return object;
+    objectProto = Object.getPrototypeOf(object);
+    if (proto === objectProto)
+      return record.i;
+    if (record.e === objectProto)
+      return proto(object, record);
+  }
+  record = $.lookupDispatchRecord(object);
+  $.setDispatchProperty(Object.getPrototypeOf(object), record);
+  return $.getNativeInterceptor(object);
+};
+
+$.JsIsolateSink$fromPort = function(_port) {
+  return new $.JsIsolateSink(false, _port);
+};
+
+$._callInIsolate = function(isolate, $function) {
+  var result = isolate.eval$1($function);
+  $globalState.topEventLoop.run$0();
+  return result;
+};
+
+$._currentIsolate = function() {
+  return $globalState.currentContext;
+};
+
+$.startRootIsolate = function(entry) {
+  var t1, rootContext;
+  t1 = $._Manager$();
+  $._globalState0(t1);
+  if ($globalState.isWorker === true)
+    return;
+  rootContext = $._IsolateContext$();
+  $globalState.rootContext = rootContext;
+  $globalState.currentContext = rootContext;
+  rootContext.eval$1(entry);
+  $globalState.topEventLoop.run$0();
+};
+
+$._globalState = function() {
+  return $globalState;
+};
+
+$._globalState0 = function(val) {
+  $globalState = val;
+};
+
+$._Manager$ = function() {
+  var t1 = new $._Manager(0, 0, 1, null, null, null, null, null, null, null, null, null);
+  t1._Manager$0();
+  return t1;
+};
+
+$._IsolateContext$ = function() {
+  var t1 = new $._IsolateContext(null, null, null);
+  t1._IsolateContext$0();
+  return t1;
+};
+
+$._EventLoop$ = function() {
+  return new $._EventLoop($.Queue_Queue(), 0);
+};
+
+$._IsolateEvent$ = function(isolate, fn, message) {
+  return new $._IsolateEvent(isolate, fn, message);
+};
+
+$._MainManagerStub$ = function() {
+  return new $._MainManagerStub();
+};
+
+$.IsolateNatives_computeThisScript = function() {
+  var currentScript, stack, matches;
+  currentScript = $.$currentScript;
+  if (currentScript != null)
+    return String(currentScript.src);
+  stack = new Error().stack;
+  if (stack == null)
+    stack = (function() {try { throw new Error() } catch(e) { return e.stack }})();
+  matches = stack.match(new RegExp("^ *at [^(]*\\((.*):[0-9]*:[0-9]*\\)$", "m"));
+  if (matches != null)
+    return matches[1];
+  matches = stack.match(new RegExp("^[^@]*@(.*):[0-9]*$", "m"));
+  if (matches != null)
+    return matches[1];
+  throw $.wrapException($.UnsupportedError$("Cannot extract URI from \"" + $.S(stack) + "\""));
+};
+
+$.IsolateNatives_computeGlobalThis = function() {
+  return function() { return this; }();
+};
+
+$.IsolateNatives__processWorkerMessage = function(sender, e) {
+  var msg, t1, entryPoint, replyTo, context, t2;
+  msg = $._deserializeMessage(e.data);
+  t1 = $.getInterceptor$asx(msg);
+  switch (t1.$index(msg, "command")) {
+    case "start":
+      $globalState.currentManagerId = t1.$index(msg, "id");
+      entryPoint = $[t1.$index(msg, "functionName")];
+      replyTo = $._deserializeMessage(t1.$index(msg, "replyTo"));
+      context = $._IsolateContext$();
+      $globalState.topEventLoop.enqueue$3(context, new $.IsolateNatives__processWorkerMessage_anon(entryPoint, replyTo), "worker-start");
+      $globalState.currentContext = context;
+      $globalState.topEventLoop.run$0();
+      break;
+    case "spawn-worker":
+      $.IsolateNatives__spawnWorker(t1.$index(msg, "functionName"), t1.$index(msg, "uri"), t1.$index(msg, "replyPort"));
+      break;
+    case "message":
+      if (t1.$index(msg, "port") != null)
+        $.send$2$x(t1.$index(msg, "port"), t1.$index(msg, "msg"), t1.$index(msg, "replyTo"));
+      $globalState.topEventLoop.run$0();
+      break;
+    case "close":
+      $.IsolateNatives__log("Closing Worker");
+      t1 = $globalState.managers;
+      t2 = $.getInterceptor$x(sender);
+      t1.remove$1(t1, t2.get$id(sender));
+      t2.terminate$0(sender);
+      $globalState.topEventLoop.run$0();
+      break;
+    case "log":
+      $.IsolateNatives__log(t1.$index(msg, "msg"));
+      break;
+    case "print":
+      if ($globalState.isWorker === true) {
+        t1 = $globalState.mainManager;
+        t1.postMessage$1(t1, $._serializeMessage($.makeLiteralMap(["command", "print", "msg", msg])));
+      } else
+        $.Primitives_printString($.toString$0(t1.$index(msg, "msg")));
+      break;
+    case "error":
+      throw $.wrapException(t1.$index(msg, "msg"));
+  }
+};
+
+$.IsolateNatives__log = function(msg) {
+  var trace, t1, exception;
+  if ($globalState.isWorker === true) {
+    t1 = $globalState.mainManager;
+    t1.postMessage$1(t1, $._serializeMessage($.makeLiteralMap(["command", "log", "msg", msg])));
+  } else
+    try {
+      $.get$globalThis().console.log(msg);
+    } catch (exception) {
+      $.unwrapException(exception);
+      trace = $.getTraceFromException(exception);
+      throw $.wrapException($._ExceptionImplementation$(trace));
+    }
+
+};
+
+$.IsolateNatives__spawnWorker = function(functionName, uri, replyPort) {
+  var worker, t1, t2, workerId;
+  if (functionName == null)
+    functionName = "main";
+  if (uri == null)
+    uri = $.get$IsolateNatives_thisScript();
+  worker = new Worker(uri);
+  t1 = $.getInterceptor$x(worker);
+  t1.set$onmessage(worker, function(e) { $.IsolateNatives__processWorkerMessage.call$2(worker, e); });
+  t2 = $globalState;
+  workerId = t2.nextManagerId;
+  t2.nextManagerId = workerId + 1;
+  t1.set$id(worker, workerId);
+  t2 = $globalState.managers;
+  t2.$indexSet(t2, workerId, worker);
+  t1.postMessage$1(worker, $._serializeMessage($.makeLiteralMap(["command", "start", "id", workerId, "replyTo", $._serializeMessage(replyPort), "functionName", functionName])));
+};
+
+$._NativeJsSendPort$ = function(_receivePort, isolateId) {
+  return new $._NativeJsSendPort(_receivePort, isolateId);
+};
+
+$._WorkerSendPort$ = function(_workerId, isolateId, _receivePortId) {
+  return new $._WorkerSendPort(_workerId, _receivePortId, isolateId);
+};
+
+$.ReceivePortImpl$ = function() {
+  var t1 = $.ReceivePortImpl__nextFreeId;
+  $.ReceivePortImpl__nextFreeId = $.$add$ns(t1, 1);
+  t1 = new $.ReceivePortImpl(t1, null);
+  t1.ReceivePortImpl$0();
+  return t1;
+};
+
+$._waitForPendingPorts = function(message, callback) {
+  var finder = $._PendingSendPortFinder$();
+  finder.traverse$1(message);
+  $._FutureImpl__FutureImpl$wait(finder.ports).then$1(new $._waitForPendingPorts_anon(callback));
+};
+
+$._PendingSendPortFinder$ = function() {
+  var t1 = new $._PendingSendPortFinder([], $._MessageTraverserVisitedMap$());
+  t1._PendingSendPortFinder$0();
+  return t1;
+};
+
+$._serializeMessage = function(message) {
+  if ($globalState.get$needSerialization() === true)
+    return $._JsSerializer$().traverse$1(message);
+  else
+    return $._JsCopier$().traverse$1(message);
+};
+
+$._deserializeMessage = function(message) {
+  if ($globalState.get$needSerialization() === true)
+    return $._JsDeserializer$().deserialize$1(message);
+  else
+    return message;
+};
+
+$._JsSerializer$ = function() {
+  var t1 = new $._JsSerializer(0, $._MessageTraverserVisitedMap$());
+  t1._JsSerializer$0();
+  return t1;
+};
+
+$._JsCopier$ = function() {
+  var t1 = new $._JsCopier($._MessageTraverserVisitedMap$());
+  t1._JsCopier$0();
+  return t1;
+};
+
+$._JsDeserializer$ = function() {
+  return new $._JsDeserializer(null);
+};
+
+$._JsVisitedMap$ = function() {
+  return new $._JsVisitedMap(null);
+};
+
+$._MessageTraverserVisitedMap$ = function() {
+  return new $._MessageTraverserVisitedMap();
+};
+
+$.TimerImpl$ = function(milliseconds, callback) {
+  var t1 = new $.TimerImpl(true, false, null);
+  t1.TimerImpl$2(milliseconds, callback);
+  return t1;
+};
+
+$.TimerImpl$periodic = function(milliseconds, callback) {
+  var t1 = new $.TimerImpl(false, false, null);
+  t1.TimerImpl$periodic$2(milliseconds, callback);
+  return t1;
+};
+
+$.hasTimer = function() {
+  return $.get$globalThis().setTimeout != null;
+};
+
+$.checkGrowable = function(list, reason) {
+  if (!!list.fixed$length)
+    throw $.wrapException($.UnsupportedError$(reason));
+};
+
+$.S = function(value) {
+  var res;
+  if (typeof value === "string")
+    return value;
+  if (typeof value === "number") {
+    if (value !== 0)
+      return "" + value;
+  } else if (true === value)
+    return "true";
+  else if (false === value)
+    return "false";
+  else if (value == null)
+    return "null";
+  res = $.toString$0(value);
+  if (typeof res !== "string")
+    throw $.wrapException($.ArgumentError$(value));
+  return res;
+};
+
+$.Primitives_objectHashCode = function(object) {
+  var hash = object.$identityHash;
+  if (hash == null) {
+    hash = $.$add$ns($.Primitives_hashCodeSeed, 1);
+    $.Primitives_hashCodeSeed = hash;
+    object.$identityHash = hash;
+  }
+  return hash;
+};
+
+$.Primitives_printString = function(string) {
+  if (typeof dartPrint == "function") {
+    dartPrint(string);
+    return;
+  }
+  if (typeof window == "object") {
+    if (typeof console == "object")
+      console.log(string);
+    return;
+  }
+  if (typeof print == "function") {
+    print(string);
+    return;
+  }
+  throw "Unable to print message: " + String(string);
+};
+
+$.Primitives_objectTypeName = function(object) {
+  var $name, decompiled, t1;
+  $name = $.constructorNameFallback(object);
+  if ($.$eq($name, "Object") === true) {
+    decompiled = String(object.constructor).match(/^\s*function\s*(\S*)\s*\(/)[1];
+    if (typeof decompiled === "string")
+      $name = decompiled;
+  }
+  t1 = $.getInterceptor$s($name);
+  return t1.codeUnitAt$1($name, 0) === 36 ? t1.substring$1($name, 1) : $name;
+};
+
+$.Primitives_getProperty = function(object, key) {
+  if (object == null || typeof object === "boolean" || typeof object === "number" || typeof object === "string")
+    throw $.wrapException($.ArgumentError$(object));
+  return object[key];
+};
+
+$.Primitives_setProperty = function(object, key, value) {
+  if (object == null || typeof object === "boolean" || typeof object === "number" || typeof object === "string")
+    throw $.wrapException($.ArgumentError$(object));
+  object[key] = value;
+};
+
+$.Primitives_applyFunction = function($function, positionalArguments, namedArguments) {
+  var buffer, $arguments, argumentCount, listOfNamedArguments, selectorName, jsFunction;
+  buffer = $.StringBuffer$("");
+  $arguments = [];
+  argumentCount = 0 + positionalArguments.length;
+  $.JSArray_methods.addAll$1($arguments, positionalArguments);
+  if (namedArguments != null && !namedArguments.get$isEmpty(namedArguments)) {
+    listOfNamedArguments = $.List_List$from(namedArguments.get$keys(), true);
+    argumentCount += namedArguments.get$length(namedArguments);
+    listOfNamedArguments.sort();
+    $.forEach$1$ax(listOfNamedArguments, new $.Primitives_applyFunction_anon(namedArguments, buffer, $arguments));
+  }
+  selectorName = "call$" + $.S(argumentCount) + $.S(buffer);
+  jsFunction = $function[selectorName];
+  if (jsFunction == null)
+    throw $.wrapException($.NoSuchMethodError$($function, selectorName, $arguments, $.makeLiteralMap([]), null));
+  return jsFunction.apply($function, $arguments);
+};
+
+$.iae = function(argument) {
+  throw $.wrapException($.ArgumentError$(argument));
+};
+
+$.ioore = function(index) {
+  throw $.wrapException($.RangeError$value(index));
+};
+
+$.wrapException = function(ex) {
+  var wrapper;
+  if (ex == null)
+    ex = $.C_NullThrownError;
+  wrapper = $.DartError$(ex);
+  if (!!Error.captureStackTrace)
+    Error.captureStackTrace(wrapper, $.wrapException);
+  else
+    wrapper.stack = new Error().stack;
+  return wrapper;
+};
+
+$.throwExpression = function(ex) {
+  throw $.wrapException(ex);
+};
+
+$.DartError$ = function(dartException) {
+  var t1 = new $.DartError();
+  t1.DartError$1(dartException);
+  return t1;
+};
+
+$.DartError_toStringWrapper = function() {
+  return $.toString$0(this);
+};
+
+$.unwrapException = function(ex) {
+  var message, type, $name, t1, ieErrorCode, ieFacilityNumber, t2;
+  if ("dartException" in ex)
+    return ex.dartException;
+  message = ex.message;
+  if (ex instanceof TypeError) {
+    type = ex.type;
+    $name = ex.arguments ? ex.arguments[0] : "";
+    if (message.indexOf("JSNull") === -1) {
+      t1 = $.getInterceptor(type);
+      t1 = t1.$eq(type, "property_not_function") === true || t1.$eq(type, "called_non_callable") === true || t1.$eq(type, "non_object_property_call") === true || t1.$eq(type, "non_object_property_load") === true;
+    } else
+      t1 = true;
+    if (t1)
+      return $.NoSuchMethodError$(null, $name, [], $.makeLiteralMap([]), null);
+    else if ($.$eq(type, "undefined_method") === true)
+      return $.NoSuchMethodError$("", $name, [], $.makeLiteralMap([]), null);
+    ieErrorCode = ex.number & 0xffff;
+    ieFacilityNumber = ex.number >> 16 & 0x1FFF;
+    t1 = typeof message === "string";
+    if (t1)
+      if (message === "null has no properties" || message === "'null' is not an object" || message === "'undefined' is not an object" || $.JSString_methods.endsWith$1(message, "is null") || $.JSString_methods.endsWith$1(message, "is undefined") || $.JSString_methods.endsWith$1(message, "is null or undefined") || $.JSString_methods.endsWith$1(message, "of undefined") || $.JSString_methods.endsWith$1(message, "of null"))
+        return $.NoSuchMethodError$(null, "<unknown>", [], $.makeLiteralMap([]), null);
+      else {
+        if (message.indexOf(" has no method ") === -1)
+          if (message.indexOf(" is not a function") === -1)
+            t2 = ieErrorCode === 438 && ieFacilityNumber === 10;
+          else
+            t2 = true;
+        else
+          t2 = true;
+        if (t2)
+          return $.NoSuchMethodError$("", "<unknown>", [], $.makeLiteralMap([]), null);
+      }
+    t1 = t1 ? message : "";
+    return $._ExceptionImplementation$(t1);
+  }
+  if (ex instanceof RangeError) {
+    if (typeof message === "string" && message.indexOf("call stack") !== -1)
+      return $.StackOverflowError$();
+    return $.ArgumentError$(null);
+  }
+  if (typeof InternalError == "function" && ex instanceof InternalError)
+    if (typeof message === "string" && message === "too much recursion")
+      return $.StackOverflowError$();
+  return ex;
+};
+
+$.getTraceFromException = function(exception) {
+  return $._StackTrace$(exception.stack);
+};
+
+$._StackTrace$ = function(_stack) {
+  return new $._StackTrace(_stack);
+};
+
+$.makeLiteralMap = function(keyValuePairs) {
+  var iterator, result, key;
+  iterator = $.JSArray_methods.get$iterator(keyValuePairs);
+  result = $.LinkedHashMap$();
+  for (; iterator.moveNext$0();) {
+    key = iterator.get$current();
+    iterator.moveNext$0();
+    result.$indexSet(result, key, iterator.get$current());
+  }
+  return result;
+};
+
+$.invokeClosure = function(closure, isolate, numberOfArguments, arg1, arg2) {
+  var t1 = $.getInterceptor(numberOfArguments);
+  if (t1.$eq(numberOfArguments, 0) === true)
+    return $._callInIsolate(isolate, new $.invokeClosure_anon(closure));
+  else if (t1.$eq(numberOfArguments, 1) === true)
+    return $._callInIsolate(isolate, new $.invokeClosure_anon0(closure, arg1));
+  else if (t1.$eq(numberOfArguments, 2) === true)
+    return $._callInIsolate(isolate, new $.invokeClosure_anon1(closure, arg1, arg2));
+  else
+    throw $.wrapException($._ExceptionImplementation$("Unsupported number of arguments for wrapped closure"));
+};
+
+$.convertDartClosureToJS = function(closure, arity) {
+  var $function;
+  if (closure == null)
+    return;
+  $function = closure.$identity;
+  if (!!$function)
+    return $function;
+  $function = (function ($2, $3) { return function($0, $1) { return $3(closure, $2, arity, $0, $1) }})($._currentIsolate(), $.invokeClosure.call$5);
+  closure.$identity = $function;
+  return $function;
+};
+
+$.throwCyclicInit = function(staticName) {
+  throw $.wrapException($.RuntimeError$("Cyclic initialization for static " + $.S(staticName)));
+};
+
+$._convertJsonToDart = function(json, reviver) {
+  var revive = reviver == null ? new $._convertJsonToDart_anon() : reviver;
+  return revive.call$2("", new $._convertJsonToDart_walk(revive).call$1(json));
+};
+
+$.typeNameInChrome = function(obj) {
+  return $.typeNameInWebKitCommon(obj.constructor.name);
+};
+
+$.typeNameInSafari = function(obj) {
+  return $.typeNameInWebKitCommon($.constructorNameFallback(obj));
+};
+
+$.typeNameInWebKitCommon = function(tag) {
+  var $name = tag;
+  if ($name === "Window")
+    return "DOMWindow";
+  if ($name === "CanvasPixelArray")
+    return "Uint8ClampedArray";
+  if ($name === "WebKitMutationObserver")
+    return "MutationObserver";
+  if ($name === "AudioChannelMerger")
+    return "ChannelMergerNode";
+  if ($name === "AudioChannelSplitter")
+    return "ChannelSplitterNode";
+  if ($name === "AudioGainNode")
+    return "GainNode";
+  if ($name === "AudioPannerNode")
+    return "PannerNode";
+  if ($name === "JavaScriptAudioNode")
+    return "ScriptProcessorNode";
+  if ($name === "Oscillator")
+    return "OscillatorNode";
+  if ($name === "RealtimeAnalyserNode")
+    return "AnalyserNode";
+  if ($name === "IDBVersionChangeRequest")
+    return "IDBOpenDBRequest";
+  return $name;
+};
+
+$.typeNameInOpera = function(obj) {
+  var $name = $.constructorNameFallback(obj);
+  if ($name === "Window")
+    return "DOMWindow";
+  if ($name === "ApplicationCache")
+    return "DOMApplicationCache";
+  return $name;
+};
+
+$.typeNameInFirefox = function(obj) {
+  var $name = $.constructorNameFallback(obj);
+  if ($name === "Window")
+    return "DOMWindow";
+  if ($name === "BeforeUnloadEvent")
+    return "Event";
+  if ($name === "CSS2Properties")
+    return "CSSStyleDeclaration";
+  if ($name === "DataTransfer")
+    return "Clipboard";
+  if ($name === "DragEvent")
+    return "MouseEvent";
+  if ($name === "GeoGeolocation")
+    return "Geolocation";
+  if ($name === "MouseScrollEvent")
+    return "WheelEvent";
+  if ($name === "OfflineResourceList")
+    return "DOMApplicationCache";
+  if ($name === "WorkerMessageEvent")
+    return "MessageEvent";
+  if ($name === "XMLDocument")
+    return "Document";
+  return $name;
+};
+
+$.typeNameInIE = function(obj) {
+  var $name = $.constructorNameFallback(obj);
+  if ($name === "Window")
+    return "DOMWindow";
+  if ($name === "Document") {
+    if (!!obj.xmlVersion)
+      return "Document";
+    return "HTMLDocument";
+  }
+  if ($name === "ApplicationCache")
+    return "DOMApplicationCache";
+  if ($name === "BeforeUnloadEvent")
+    return "Event";
+  if ($name === "CanvasPixelArray")
+    return "Uint8ClampedArray";
+  if ($name === "DataTransfer")
+    return "Clipboard";
+  if ($name === "DragEvent")
+    return "MouseEvent";
+  if ($name === "HTMLDDElement")
+    return "HTMLElement";
+  if ($name === "HTMLDTElement")
+    return "HTMLElement";
+  if ($name === "HTMLTableDataCellElement")
+    return "HTMLTableCellElement";
+  if ($name === "HTMLTableHeaderCellElement")
+    return "HTMLTableCellElement";
+  if ($name === "HTMLPhraseElement")
+    return "HTMLElement";
+  if ($name === "MSStyleCSSProperties")
+    return "CSSStyleDeclaration";
+  if ($name === "MouseWheelEvent")
+    return "WheelEvent";
+  if ($name === "Position")
+    return "Geoposition";
+  if ($name === "Object")
+    if (window.DataView && obj instanceof window.DataView)
+      return "DataView";
+  return $name;
+};
+
+$.constructorNameFallback = function(object) {
+  var $constructor, $name, t1, string;
+  if (object == null)
+    return "Null";
+  $constructor = object.constructor;
+  if (typeof $constructor === "function") {
+    $name = $constructor.name;
+    if (typeof $name === "string")
+      t1 = $name !== "" && $name !== "Object" && $name !== "Function.prototype";
+    else
+      t1 = false;
+    if (t1)
+      return $name;
+  }
+  string = Object.prototype.toString.call(object);
+  return string.substring(8, string.length - 1);
+};
+
+$.alternateTag = function(object, tag) {
+  if (!!/^HTML[A-Z].*Element$/.test(tag)) {
+    if (Object.prototype.toString.call(object) === "[object Object]")
+      return;
+    return "HTMLElement";
+  }
+  return;
+};
+
+$.getFunctionForTypeNameOf = function() {
+  if (typeof navigator !== "object")
+    return $.typeNameInChrome;
+  var userAgent = navigator.userAgent;
+  if (userAgent.indexOf("Chrome") !== -1 || userAgent.indexOf("DumpRenderTree") !== -1)
+    return $.typeNameInChrome;
+  else if (userAgent.indexOf("Firefox") !== -1)
+    return $.typeNameInFirefox;
+  else if (userAgent.indexOf("MSIE") !== -1)
+    return $.typeNameInIE;
+  else if (userAgent.indexOf("Opera") !== -1)
+    return $.typeNameInOpera;
+  else if (userAgent.indexOf("AppleWebKit") !== -1)
+    return $.typeNameInSafari;
+  else
+    return $.constructorNameFallback;
+};
+
+$.toStringForNativeObject = function(obj) {
+  if ($._getTypeNameOf == null)
+    $._getTypeNameOf = $.getFunctionForTypeNameOf();
+  return "Instance of " + $._getTypeNameOf.call$1(obj);
+};
+
+$.hashCodeForNativeObject = function(object) {
+  return $.Primitives_objectHashCode(object);
+};
+
+$.defineProperty = function(obj, property, value) {
+  Object.defineProperty(obj, property, {value: value, enumerable: false, writable: true, configurable: true});
+};
+
+$.defineNativeMethods = function(tags, interceptorClass) {
+  $.defineNativeMethodsCommon(tags, interceptorClass, true);
+};
+
+$.defineNativeMethodsNonleaf = function(tags, interceptorClass) {
+  $.defineNativeMethodsCommon(tags, interceptorClass, false);
+};
+
+$.defineNativeMethodsCommon = function(tags, interceptorClass, isLeaf) {
+  var methods, tagsList, i, tag;
+  methods = interceptorClass.prototype;
+  if ($.interceptorsByTag == null)
+    $.interceptorsByTag = {};
+  if ($.leafTags == null)
+    $.leafTags = {};
+  tagsList = tags.split("|");
+  for (i = 0; i < tagsList.length; ++i) {
+    tag = tagsList[i];
+    $.interceptorsByTag[tag] = methods;
+    $.leafTags[tag] = isLeaf;
+  }
+};
+
+$.defineNativeMethodsFinish = function() {
+};
+
+$.lookupDispatchRecord = function(obj) {
+  var hasOwnPropertyFunction, tag, map, interceptor, secondTag;
+  hasOwnPropertyFunction = Object.prototype.hasOwnProperty;
+  if ($._getTypeNameOf == null)
+    $._getTypeNameOf = $.getFunctionForTypeNameOf();
+  tag = $._getTypeNameOf.call$1(obj);
+  map = $.interceptorsByTag;
+  interceptor = hasOwnPropertyFunction.call(map, tag) ? map[tag] : null;
+  if (interceptor == null) {
+    secondTag = $.alternateTag(obj, tag);
+    if (secondTag != null) {
+      map = $.interceptorsByTag;
+      interceptor = hasOwnPropertyFunction.call(map, secondTag) ? map[secondTag] : null;
+    }
+  }
+  if (interceptor == null)
+    interceptor = {__what: "interceptor not found", __tag: tag};
+  if (true === $.leafTags[tag])
+    return {i: interceptor, p: false, e: null};
+  else
+    return {i: interceptor, p: Object.getPrototypeOf(obj), e: null};
+};
+
+$.StringMatch$ = function(start, str, pattern) {
+  return new $.StringMatch(start, str, pattern);
+};
+
+$.allMatchesInStringUnchecked = function(needle, haystack) {
+  var result, $length, patternLength, startIndex, position, endIndex;
+  result = $.List_List($);
+  $length = haystack.length;
+  patternLength = needle.length;
+  for (startIndex = 0; true;) {
+    position = $.JSString_methods.indexOf$2(haystack, needle, startIndex);
+    if (position === -1)
+      break;
+    result.push($.StringMatch$(position, haystack, needle));
+    endIndex = position + patternLength;
+    if (endIndex === $length)
+      break;
+    else
+      startIndex = position === endIndex ? startIndex + 1 : endIndex;
+  }
+  return result;
+};
+
+$.stringContainsUnchecked = function(receiver, other, startIndex) {
+  if (typeof other === "string")
+    return $.JSString_methods.indexOf$2(receiver, other, startIndex) !== -1;
+  else if (typeof other === "object" && other !== null && !!$.getInterceptor(other).$isJSSyntaxRegExp)
+    return other.hasMatch$1($.JSString_methods.substring$1(receiver, startIndex));
+  else
+    return $.get$iterator$ax($.allMatches$1$s(other, $.JSString_methods.substring$1(receiver, startIndex))).moveNext$0();
+};
+
+$.stringReplaceAllUnchecked = function(receiver, from, to) {
+  var result, $length, i;
+  if (from === "")
+    if (receiver === "")
+      return to;
+    else {
+      result = $.StringBuffer$("");
+      $length = receiver.length;
+      result.write$1(to);
+      for (i = 0; i < $length; ++i) {
+        result.write$1(receiver[i]);
+        result.write$1(to);
+      }
+      return result.toString$0(result);
+    }
+  else
+    return receiver.replace(new RegExp(from.replace(new RegExp("[-[\\]{}()*+?.,\\\\^$|#\\s]", 'g'), "\\$&"), 'g'), to.replace("$", "$$$$"));
+};
+
+$._attachStackTrace = function(o, st) {
+  if (o == null || typeof o === "boolean" || typeof o === "number" || typeof o === "string")
+    return;
+  $.$indexSet$ax($.get$_stackTraceExpando(), o, st);
+};
+
+$.getAttachedStackTrace = function(o) {
+  if (o == null || typeof o === "boolean" || typeof o === "number" || typeof o === "string")
+    return;
+  return $.$index$asx($.get$_stackTraceExpando(), o);
+};
+
+$._asyncRunCallback = function() {
+  var callbacks, i, callback, remainingCallbacks, newCallbacks, exception;
+  for (; $.get$isEmpty$asx($.get$_asyncCallbacks()) !== true;) {
+    callbacks = $.get$_asyncCallbacks();
+    $._asyncCallbacks = [];
+    for (i = 0; $.$lt$n(i, $.get$length$asx(callbacks)); i = $.$add$ns(i, 1)) {
+      callback = $.$index$asx(callbacks, i);
+      $.$indexSet$ax(callbacks, i, null);
+      try {
+        callback.call$0();
+      } catch (exception) {
+        $.unwrapException(exception);
+        i = $.$add$ns(i, 1);
+        remainingCallbacks = $.sublist$1$ax(callbacks, i);
+        newCallbacks = $.get$_asyncCallbacks();
+        $._asyncCallbacks = [];
+        $.addAll$1$ax($.get$_asyncCallbacks(), remainingCallbacks);
+        $.addAll$1$ax($.get$_asyncCallbacks(), newCallbacks);
+        $.Timer_run($._asyncRunCallback);
+        throw exception;
+      }
+
+    }
+  }
+  $._callbacksAreEnqueued = false;
+};
+
+$._CompleterImpl$ = function() {
+  return new $._CompleterImpl($._FutureImpl$(), false);
+};
+
+$._FutureListenerWrapper$ = function(future) {
+  return new $._FutureListenerWrapper(future, null);
+};
+
+$._FutureImpl$ = function() {
+  return new $._FutureImpl(0, null);
+};
+
+$._FutureImpl$immediate = function(value) {
+  var t1 = new $._FutureImpl(0, null);
+  t1._FutureImpl$immediate$1(value);
+  return t1;
+};
+
+$._FutureImpl__FutureImpl$wait = function(futures) {
+  var t1, t2, t3, t4, pos;
+  t1 = {};
+  t1.completer_0 = null;
+  t1.values_1 = null;
+  t2 = new $._FutureImpl__FutureImpl$wait_handleError(t1);
+  t1.remaining_2 = 0;
+  for (t3 = $.JSArray_methods.get$iterator(futures); t3.moveNext$0();) {
+    t4 = t3.get$current();
+    pos = t1.remaining_2;
+    t1.remaining_2 = $.$add$ns(pos, 1);
+    t4.catchError$1(t2).then$1(new $._FutureImpl__FutureImpl$wait_anon(t1, pos));
+  }
+  if ($.$eq(t1.remaining_2, 0))
+    return $._FutureImpl$immediate($.List_empty);
+  t1.values_1 = $.List_List(t1.remaining_2);
+  t1.completer_0 = $._CompleterImpl$();
+  return t1.completer_0.future;
+};
+
+$._ThenFuture$ = function(_onValue) {
+  return new $._ThenFuture(_onValue, null, 0, null);
+};
+
+$._CatchErrorFuture$ = function(_onError, _test) {
+  return new $._CatchErrorFuture(_test, _onError, null, 0, null);
+};
+
+$._SubscribeFuture$ = function(onValue, _onError) {
+  return new $._SubscribeFuture(_onError, onValue, null, 0, null);
+};
+
+$._FutureWrapper$ = function(_future) {
+  return new $._FutureWrapper(_future);
+};
+
+$._throwDelayed = function(error, stackTrace) {
+  var t1 = new $._throwDelayed_anon(error, stackTrace);
+  $.add$1$ax($.get$_asyncCallbacks(), t1);
+  if ($._callbacksAreEnqueued !== true) {
+    $.Timer_run($._asyncRunCallback);
+    $._callbacksAreEnqueued = true;
+  }
+};
+
+$._nullDataHandler = function(value) {
+};
+
+$._nullErrorHandler = function(error) {
+  $._throwDelayed(error, null);
+};
+
+$._nullDoneHandler = function() {
+};
+
+$._asyncError = function(error, stackTrace) {
+  if (stackTrace == null)
+    return error;
+  if ($.getAttachedStackTrace(error) != null)
+    return error;
+  $._attachStackTrace(error, stackTrace);
+  return error;
+};
+
+$._ForwardingStreamSubscription$ = function(_stream, onData, onError, onDone, _cancelOnError) {
+  var t1 = new $._ForwardingStreamSubscription(_stream, _cancelOnError, null, onData, onError, onDone);
+  t1._BaseStreamSubscription$3(onData, onError, onDone);
+  t1._ForwardingStreamSubscription$5(_stream, onData, onError, onDone, _cancelOnError);
+  return t1;
+};
+
+$._SkipStream$ = function(source, count) {
+  var t1 = new $._SkipStream(count, source);
+  t1._SkipStream$2(source, count);
+  return t1;
+};
+
+$.Timer_run = function(callback) {
+  var t1, milliseconds;
+  $.add$1$ax($.get$Timer__runCallbacks(), callback);
+  if ($.$eq($.get$length$asx($.get$Timer__runCallbacks()), 1) === true) {
+    t1 = new $.Timer_run_anon();
+    milliseconds = $.Duration_0.get$inMilliseconds();
+    if (milliseconds < 0)
+      milliseconds = 0;
+    $.TimerImpl$(milliseconds, t1);
+  }
+};
+
+$.HashMap$ = function() {
+  return new $.HashMap(0, null, null, null, null);
+};
+
+$.LinkedHashMap$ = function() {
+  return new $.LinkedHashMap(0, null, null, null, null, null, 0);
+};
+
+$.LinkedHashSet$ = function() {
+  return new $.LinkedHashSet(0, null, null, null, null, null, 0);
+};
+
+$.Queue_Queue = function() {
+  return $.ListQueue$(null);
+};
+
+$.ListQueue$ = function(initialCapacity) {
+  var t1 = new $.ListQueue(null, 0, 0, 0);
+  t1.ListQueue$1(initialCapacity);
+  return t1;
+};
+
+$.ListQueue__isPowerOf2 = function(number) {
+  return $.JSNull_methods.$and(number, $.JSNull_methods.$sub(number, 1)) === 0;
+};
+
+$.ListQueue__nextPowerOf2 = function(number) {
+  var nextNumber;
+  number = $.$shl$n(number, 2) - 1;
+  for (; true; number = nextNumber) {
+    nextNumber = (number & number - 1) >>> 0;
+    if (nextNumber === 0)
+      return number;
+  }
+};
+
+$._ListQueueIterator$ = function(queue) {
+  return new $._ListQueueIterator(queue, queue._tail, queue._modificationCount, queue._head, null);
+};
+
+$.Duration$ = function(days, hours, microseconds, milliseconds, minutes, seconds) {
+  if (typeof microseconds !== "number")
+    throw $.iae(microseconds);
+  return new $.Duration(days * 86400000000 + hours * 3600000000 + minutes * 60000000 + seconds * 1000000 + milliseconds * 1000 + microseconds);
+};
+
+$.Error_safeToString = function(object) {
+  if (typeof object === "number" && Math.floor(object) === object || typeof object === "number" || typeof object === "boolean" || null == object)
+    return $.toString$0(object);
+  if (typeof object === "string")
+    return "\"" + $.JSString_methods.replaceAll$2($.JSString_methods.replaceAll$2($.JSString_methods.replaceAll$2($.JSString_methods.replaceAll$2(object, "\\", "\\\\"), "\n", "\\n"), "\r", "\\r"), "\"", "\\\"") + "\"";
+  return "Instance of '" + $.S($.Primitives_objectTypeName(object)) + "'";
+};
+
+$.ArgumentError$ = function(message) {
+  return new $.ArgumentError(message);
+};
+
+$.RangeError$value = function(value) {
+  return new $.RangeError("value " + $.S(value));
+};
+
+$.RangeError$range = function(value, start, end) {
+  return new $.RangeError("value " + $.S(value) + " not in range " + $.S(start) + ".." + $.S(end));
+};
+
+$.NoSuchMethodError$ = function(_receiver, _memberName, _arguments, _namedArguments, existingArgumentNames) {
+  return new $.NoSuchMethodError(_receiver, _memberName, _arguments, _namedArguments, existingArgumentNames);
+};
+
+$.UnsupportedError$ = function(message) {
+  return new $.UnsupportedError(message);
+};
+
+$.UnimplementedError$ = function(message) {
+  return new $.UnimplementedError(message);
+};
+
+$.StateError$ = function(message) {
+  return new $.StateError(message);
+};
+
+$.ConcurrentModificationError$ = function(modifiedObject) {
+  return new $.ConcurrentModificationError(modifiedObject);
+};
+
+$.StackOverflowError$ = function() {
+  return new $.StackOverflowError();
+};
+
+$.RuntimeError$ = function(message) {
+  return new $.RuntimeError(message);
+};
+
+$._ExceptionImplementation$ = function(message) {
+  return new $._ExceptionImplementation(message);
+};
+
+$.FormatException$ = function(message) {
+  return new $.FormatException(message);
+};
+
+$.IntegerDivisionByZeroException$ = function() {
+  return new $.IntegerDivisionByZeroException();
+};
+
+$.Expando$ = function($name) {
+  return new $.Expando($name);
+};
+
+$.List_List = function($length) {
+  var t1, result;
+  t1 = $ === $length;
+  if (t1)
+    $length = null;
+  if (t1)
+    return new Array(0);
+  if (typeof $length !== "number" || Math.floor($length) !== $length || $length < 0)
+    throw $.wrapException($.ArgumentError$("Length must be a positive integer: " + $.S($length) + "."));
+  result = new Array($length);
+  result.fixed$length = true;
+  return result;
+};
+
+$.List_List$from = function(other, growable) {
+  var list, t1, $length, fixedList, i;
+  list = $.List_List($);
+  for (t1 = $.get$iterator$ax(other); t1.moveNext$0() === true;)
+    list.push(t1.get$current());
+  if (growable === true)
+    return list;
+  $length = list.length;
+  fixedList = $.List_List($length);
+  for (t1 = list.length, i = 0; i < $length; ++i) {
+    if (i >= t1)
+      throw $.ioore(i);
+    fixedList[i] = list[i];
+  }
+  return fixedList;
+};
+
+$.Map_Map = function() {
+  return $.HashMap$();
+};
+
+$.Object$ = function() {
+  return new $.Object();
+};
+
+$.StringBuffer$ = function($content) {
+  var t1 = new $.StringBuffer("");
+  t1.StringBuffer$1($content);
+  return t1;
+};
+
+$.window = function() {
+  return window;
+};
+
+$._ChildrenElementList$_wrap = function(element) {
+  return new $._ChildrenElementList(element, $.get$$$dom_children$x(element));
+};
+
+$._FrozenElementList$_wrap = function(_nodeList) {
+  return new $._FrozenElementList(_nodeList);
+};
+
+$._ElementCssClassSet$ = function(_element) {
+  return new $._ElementCssClassSet(_element);
+};
+
+$.HttpRequest_getString = function(url, onProgress, withCredentials) {
+  return $.HttpRequest_request(url, null, onProgress, null, null, withCredentials).then$1(new $.HttpRequest_getString_anon());
+};
+
+$.HttpRequest_request = function(url, method, onProgress, responseType, sendData, withCredentials) {
+  var completer, xhr, t1;
+  completer = $._CompleterImpl$();
+  xhr = new XMLHttpRequest();
+  if (method == null)
+    method = "GET";
+  t1 = $.getInterceptor$x(xhr);
+  t1.open$3$async(xhr, method, url, true);
+  if (withCredentials != null)
+    xhr.withCredentials = withCredentials;
+  if (responseType != null)
+    xhr.responseType = responseType;
+  if (onProgress != null)
+    t1.get$onProgress(xhr).listen$1(onProgress);
+  t1.get$onLoad(xhr).listen$1(new $.HttpRequest_request_anon(completer, xhr));
+  t1.get$onError(xhr).listen$1(new $.HttpRequest_request_anon0(completer));
+  if (sendData != null)
+    xhr.send(sendData);
+  else
+    xhr.send();
+  return completer.future;
+};
+
+$._ChildNodeListLazy$ = function(_this) {
+  return new $._ChildNodeListLazy(_this);
+};
+
+$._ElementAttributeMap$ = function(element) {
+  return new $._ElementAttributeMap(element);
+};
+
+$._EventStream$ = function(_target, _eventType, _useCapture) {
+  return new $._EventStream(_target, _eventType, _useCapture);
+};
+
+$._EventStreamSubscription$ = function(_target, _eventType, _onData, _useCapture) {
+  var t1 = new $._EventStreamSubscription(0, _target, _eventType, _onData, _useCapture);
+  t1._EventStreamSubscription$4(_target, _eventType, _onData, _useCapture);
+  return t1;
+};
+
+$.FixedSizeListIterator$ = function(array) {
+  return new $.FixedSizeListIterator(array, $.get$length$asx(array), -1, null);
+};
+
+$.convertDartToNative_Dictionary = function(dict) {
+  var object;
+  if (dict == null)
+    return;
+  object = {};
+  dict.forEach$1(dict, new $.convertDartToNative_Dictionary_anon(object));
+  return object;
+};
+
+$.Device_userAgent = function() {
+  return $.get$navigator$x($.window()).userAgent;
+};
+
+$.Device_isOpera = function() {
+  if ($.Device__isOpera == null)
+    $.Device__isOpera = $.contains$2$asx($.Device_userAgent(), "Opera", 0);
+  return $.Device__isOpera;
+};
+
+$.Device_isWebKit = function() {
+  if ($.Device__isWebKit == null)
+    $.Device__isWebKit = $.Device_isOpera() !== true && $.contains$2$asx($.Device_userAgent(), "WebKit", 0) === true;
+  return $.Device__isWebKit;
+};
+
+$.FilteredElementList$ = function(node) {
+  return new $.FilteredElementList(node, $.get$nodes$x(node));
+};
+
+$.Lists_getRange = function(a, start, end, accumulator) {
+  var i;
+  if (typeof a !== "string" && (typeof a !== "object" || a === null || a.constructor !== Array && !$.getInterceptor(a).$isJavaScriptIndexingBehavior()))
+    return $.Lists_getRange$bailout(1, a, start, end, accumulator);
+  if (typeof start !== "number")
+    return $.Lists_getRange$bailout(1, a, start, end, accumulator);
+  if (typeof end !== "number")
+    return $.Lists_getRange$bailout(1, a, start, end, accumulator);
+  if (start < 0)
+    throw $.wrapException($.RangeError$value(start));
+  if (end < start)
+    throw $.wrapException($.RangeError$value(end));
+  if (end > a.length)
+    throw $.wrapException($.RangeError$value(end));
+  for (i = start; i < end; ++i) {
+    if (i !== (i | 0))
+      throw $.iae(i);
+    if (i < 0 || i >= a.length)
+      throw $.ioore(i);
+    accumulator.push(a[i]);
+  }
+  return accumulator;
+};
+
+$.Lists_getRange$bailout = function(state0, a, start, end, accumulator) {
+  var t1, t2, i;
+  if ($.$lt$n(start, 0))
+    throw $.wrapException($.RangeError$value(start));
+  t1 = $.getInterceptor$n(end);
+  if (t1.$lt(end, start))
+    throw $.wrapException($.RangeError$value(end));
+  t2 = $.getInterceptor$asx(a);
+  if (t1.$gt(end, t2.get$length(a)))
+    throw $.wrapException($.RangeError$value(end));
+  for (i = start; t1 = $.getInterceptor$n(i), t1.$lt(i, end); i = t1.$add(i, 1))
+    accumulator.push(t2.$index(a, i));
+  return accumulator;
+};
+
+$.ReceivePort_ReceivePort = function() {
+  return $.ReceivePortImpl$();
+};
+
+$._Isolate_port = function() {
+  if ($.lazyPort == null)
+    $.lazyPort = $.ReceivePort_ReceivePort();
+  return $.lazyPort;
+};
+
+$.parse = function(json, reviver) {
+  var parsed, e, t1, exception;
+  t1 = json;
+  if (typeof t1 !== "string")
+    throw $.wrapException($.ArgumentError$(json));
+  parsed = null;
+  try {
+    parsed = JSON.parse(json);
+  } catch (exception) {
+    t1 = $.unwrapException(exception);
+    e = t1;
+    throw $.wrapException($.FormatException$(String(e)));
+  }
+
+  return $._convertJsonToDart(parsed, reviver);
+};
+
+$._AttributeClassSet$ = function(_element) {
+  return new $._AttributeClassSet(_element);
+};
+
+$.BarGraph$ = function(_canvas, _elements) {
+  var t1 = new $.BarGraph(_canvas, null, _elements, 0);
+  t1.BarGraph$2(_canvas, _elements);
+  return t1;
+};
+
+$.GraphModel$ = function(_maxSize) {
+  return new $.GraphModel($.List_List($), _maxSize, []);
+};
+
+$.Element$ = function($name, color) {
+  return new $.Element0($name, color);
+};
+
+$.Sample$ = function(_segments) {
+  return new $.Sample(_segments);
+};
+
+$.IsolateList$ = function(_isolateTable) {
+  return new $.IsolateList(_isolateTable);
+};
+
+$.ModelListener$ = function(_onUpdate, _onFailure) {
+  return new $.ModelListener(_onUpdate, _onFailure);
+};
+
+$.IsolateListModel$ = function() {
+  return new $.IsolateListModel([], []);
+};
+
+$.Isolate$ = function(raw) {
+  var t1 = $.getInterceptor$asx(raw);
+  return new $.Isolate(t1.$index(raw, "handle"), t1.$index(raw, "name"), t1.$index(raw, "port"), t1.$index(raw, "starttime"), t1.$index(raw, "stacklimit"), $.Space$(t1.$index(raw, "newspace")), $.Space$(t1.$index(raw, "oldspace")));
+};
+
+$.Space$ = function(raw) {
+  var t1 = $.getInterceptor$asx(raw);
+  return new $.Space(t1.$index(raw, "used"), t1.$index(raw, "capacity"));
+};
+
+$.main = function() {
+  var t1, milliseconds;
+  document.querySelector("#dashboard");
+  $._graph = $.BarGraph$(document.querySelector("#graph"), [$.Element$("Old Space", "#97FFFF"), $.Element$("New Space", "#00EE76")]);
+  $._isolateList = $.IsolateList$(document.querySelector("#isolateList"));
+  $._statusText = document.querySelector("#statusText");
+  $._isolates = $.IsolateListModel$();
+  $._isolates.addListener$2($.onUpdateStatus, $.onRequestFailed);
+  $._isolates.update$0();
+  t1 = new $.main_anon();
+  milliseconds = $.Duration_3000000.get$inMilliseconds();
+  if (milliseconds < 0)
+    milliseconds = 0;
+  $._updater = $.TimerImpl$periodic(milliseconds, t1);
+};
+
+$.onUpdateStatus = function(model) {
+  var t1 = {};
+  t1.oldSpace_0 = 0;
+  t1.newSpace_1 = 0;
+  $.forEach$1$ax(model, new $.onUpdateStatus_anon(t1));
+  $._graph.addSample$1([t1.oldSpace_0, t1.newSpace_1]);
+  $._isolateList.updateList$1(model);
+  $.set$text$x($._statusText, "Running ...");
+};
+
+$.onRequestFailed = function() {
+  $._updater.cancel$0();
+  $._isolates.removeListener$1($.onUpdateStatus);
+  $.set$text$x($._statusText, "Server closed");
+};
+
+$.IsolateNatives__processWorkerMessage.call$2 = $.IsolateNatives__processWorkerMessage;
+$.IsolateNatives__processWorkerMessage.$name = "IsolateNatives__processWorkerMessage";
+$.wrapException.call$1 = $.wrapException;
+$.wrapException.$name = "wrapException";
+$.DartError_toStringWrapper.call$0 = $.DartError_toStringWrapper;
+$.DartError_toStringWrapper.$name = "DartError_toStringWrapper";
+$.invokeClosure.call$5 = $.invokeClosure;
+$.invokeClosure.$name = "invokeClosure";
+$.typeNameInChrome.call$1 = $.typeNameInChrome;
+$.typeNameInChrome.$name = "typeNameInChrome";
+$.typeNameInSafari.call$1 = $.typeNameInSafari;
+$.typeNameInSafari.$name = "typeNameInSafari";
+$.typeNameInOpera.call$1 = $.typeNameInOpera;
+$.typeNameInOpera.$name = "typeNameInOpera";
+$.typeNameInFirefox.call$1 = $.typeNameInFirefox;
+$.typeNameInFirefox.$name = "typeNameInFirefox";
+$.typeNameInIE.call$1 = $.typeNameInIE;
+$.typeNameInIE.$name = "typeNameInIE";
+$.constructorNameFallback.call$1 = $.constructorNameFallback;
+$.constructorNameFallback.$name = "constructorNameFallback";
+$._asyncRunCallback.call$0 = $._asyncRunCallback;
+$._asyncRunCallback.$name = "_asyncRunCallback";
+$._nullDataHandler.call$1 = $._nullDataHandler;
+$._nullDataHandler.$name = "_nullDataHandler";
+$._nullErrorHandler.call$1 = $._nullErrorHandler;
+$._nullErrorHandler.$name = "_nullErrorHandler";
+$._nullDoneHandler.call$0 = $._nullDoneHandler;
+$._nullDoneHandler.$name = "_nullDoneHandler";
+$.onUpdateStatus.call$1 = $.onUpdateStatus;
+$.onUpdateStatus.$name = "onUpdateStatus";
+$.onRequestFailed.call$0 = $.onRequestFailed;
+$.onRequestFailed.$name = "onRequestFailed";
+$.String = {builtin$cls: "String"};
+$.ReceivePort = {builtin$cls: "ReceivePort"};
+$.$int = {builtin$cls: "int"};
+$.bool = {builtin$cls: "bool"};
+$._ManagerStub = {builtin$cls: "_ManagerStub"};
+$.List = {builtin$cls: "List"};
+$.num = {builtin$cls: "num"};
+$.Match = {builtin$cls: "Match"};
+$.C_NullThrownError = new $.NullThrownError();
+Isolate.makeConstantList = function(list) {
+  list.immutable$list = true;
+  list.fixed$length = true;
+  return list;
+};
+$.List_empty = Isolate.makeConstantList([]);
+$.JSDouble_methods = $.JSDouble.prototype;
+$.EventStreamProvider_click = new $.EventStreamProvider("click");
+$.JSNull_methods = $.JSNull.prototype;
+$.JSNumber_methods = $.JSNumber.prototype;
+$.JSString_methods = $.JSString.prototype;
+$.EventStreamProvider_progress = new $.EventStreamProvider("progress");
+$.JSArray_methods = $.JSArray.prototype;
+$.EventStreamProvider_error = new $.EventStreamProvider("error");
+$.C_CloseToken = new $.CloseToken();
+$.EventStreamProvider_load = new $.EventStreamProvider("load");
+$.JSInt_methods = $.JSInt.prototype;
+$.Duration_0 = new $.Duration(0);
+$.Duration_3000000 = new $.Duration(3000000);
+$.Expando__keyCount = 0;
+$.dispatchPropertyName = "_zzyzx";
+$.lazyPort = null;
+$.ReceivePortImpl__nextFreeId = 1;
+$.Primitives_hashCodeSeed = 0;
+$._getTypeNameOf = null;
+$.interceptorsByTag = null;
+$.leafTags = null;
+$._callbacksAreEnqueued = false;
+$.Device__isOpera = null;
+$.Device__isWebKit = null;
+$._graph = null;
+$._isolateList = null;
+$._statusText = null;
+$._isolates = null;
+$._updater = null;
+$.$$dom_addEventListener$3$x = function(receiver, a0, a1, a2) {
+  return $.getInterceptor$x(receiver).$$dom_addEventListener$3(receiver, a0, a1, a2);
+};
+$.$$dom_removeEventListener$3$x = function(receiver, a0, a1, a2) {
+  return $.getInterceptor$x(receiver).$$dom_removeEventListener$3(receiver, a0, a1, a2);
+};
+$.$$dom_replaceChild$2$x = function(receiver, a0, a1) {
+  return $.getInterceptor$x(receiver).$$dom_replaceChild$2(receiver, a0, a1);
+};
+$.$add$ns = function(receiver, a0) {
+  if (typeof receiver == "number" && typeof a0 == "number")
+    return receiver + a0;
+  return $.getInterceptor$ns(receiver).$add(receiver, a0);
+};
+$.$and$n = function(receiver, a0) {
+  if (typeof receiver == "number" && typeof a0 == "number")
+    return (receiver & a0) >>> 0;
+  return $.getInterceptor$n(receiver).$and(receiver, a0);
+};
+$.$div$n = function(receiver, a0) {
+  if (typeof receiver == "number" && typeof a0 == "number")
+    return receiver / a0;
+  return $.getInterceptor$n(receiver).$div(receiver, a0);
+};
+$.$eq = function(receiver, a0) {
+  if (receiver == null)
+    return a0 == null;
+  if (typeof receiver != "object")
+    return a0 != null && receiver === a0;
+  return $.getInterceptor(receiver).$eq(receiver, a0);
+};
+$.$ge$n = function(receiver, a0) {
+  if (typeof receiver == "number" && typeof a0 == "number")
+    return receiver >= a0;
+  return $.getInterceptor$n(receiver).$ge(receiver, a0);
+};
+$.$gt$n = function(receiver, a0) {
+  if (typeof receiver == "number" && typeof a0 == "number")
+    return receiver > a0;
+  return $.getInterceptor$n(receiver).$gt(receiver, a0);
+};
+$.$index$asx = function(receiver, a0) {
+  if (receiver.constructor == Array || typeof receiver == "string")
+    if (a0 >>> 0 === a0 && a0 < receiver.length)
+      return receiver[a0];
+  return $.getInterceptor$asx(receiver).$index(receiver, a0);
+};
+$.$indexSet$ax = function(receiver, a0, a1) {
+  if (receiver.constructor == Array && !receiver.immutable$list && a0 >>> 0 === a0 && a0 < receiver.length)
+    return receiver[a0] = a1;
+  return $.getInterceptor$ax(receiver).$indexSet(receiver, a0, a1);
+};
+$.$lt$n = function(receiver, a0) {
+  if (typeof receiver == "number" && typeof a0 == "number")
+    return receiver < a0;
+  return $.getInterceptor$n(receiver).$lt(receiver, a0);
+};
+$.$mul$n = function(receiver, a0) {
+  if (typeof receiver == "number" && typeof a0 == "number")
+    return receiver * a0;
+  return $.getInterceptor$n(receiver).$mul(receiver, a0);
+};
+$.$shl$n = function(receiver, a0) {
+  return $.getInterceptor$n(receiver).$shl(receiver, a0);
+};
+$.$sub$n = function(receiver, a0) {
+  if (typeof receiver == "number" && typeof a0 == "number")
+    return receiver - a0;
+  return $.getInterceptor$n(receiver).$sub(receiver, a0);
+};
+$.$tdiv$n = function(receiver, a0) {
+  return $.getInterceptor$n(receiver).$tdiv(receiver, a0);
+};
+$.abs$0$n = function(receiver) {
+  return $.getInterceptor$n(receiver).abs$0(receiver);
+};
+$.add$1$ax = function(receiver, a0) {
+  return $.getInterceptor$ax(receiver).add$1(receiver, a0);
+};
+$.addAll$1$ax = function(receiver, a0) {
+  return $.getInterceptor$ax(receiver).addAll$1(receiver, a0);
+};
+$.allMatches$1$s = function(receiver, a0) {
+  return $.getInterceptor$s(receiver).allMatches$1(receiver, a0);
+};
+$.ceil$0$n = function(receiver) {
+  return $.getInterceptor$n(receiver).ceil$0(receiver);
+};
+$.contains$2$asx = function(receiver, a0, a1) {
+  return $.getInterceptor$asx(receiver).contains$2(receiver, a0, a1);
+};
+$.elementAt$1$ax = function(receiver, a0) {
+  return $.getInterceptor$ax(receiver).elementAt$1(receiver, a0);
+};
+$.forEach$1$ax = function(receiver, a0) {
+  return $.getInterceptor$ax(receiver).forEach$1(receiver, a0);
+};
+$.get$$$dom_children$x = function(receiver) {
+  return $.getInterceptor$x(receiver).get$$$dom_children(receiver);
+};
+$.get$attributes$x = function(receiver) {
+  return $.getInterceptor$x(receiver).get$attributes(receiver);
+};
+$.get$children$x = function(receiver) {
+  return $.getInterceptor$x(receiver).get$children(receiver);
+};
+$.get$classes$x = function(receiver) {
+  return $.getInterceptor$x(receiver).get$classes(receiver);
+};
+$.get$color$x = function(receiver) {
+  return $.getInterceptor$x(receiver).get$color(receiver);
+};
+$.get$context2D$x = function(receiver) {
+  return $.getInterceptor$x(receiver).get$context2D(receiver);
+};
+$.get$hashCode$ = function(receiver) {
+  return $.getInterceptor(receiver).get$hashCode(receiver);
+};
+$.get$height$x = function(receiver) {
+  return $.getInterceptor$x(receiver).get$height(receiver);
+};
+$.get$id$x = function(receiver) {
+  return $.getInterceptor$x(receiver).get$id(receiver);
+};
+$.get$isEmpty$asx = function(receiver) {
+  return $.getInterceptor$asx(receiver).get$isEmpty(receiver);
+};
+$.get$iterator$ax = function(receiver) {
+  return $.getInterceptor$ax(receiver).get$iterator(receiver);
+};
+$.get$length$asx = function(receiver) {
+  return $.getInterceptor$asx(receiver).get$length(receiver);
+};
+$.get$name$x = function(receiver) {
+  return $.getInterceptor$x(receiver).get$name(receiver);
+};
+$.get$navigator$x = function(receiver) {
+  return $.getInterceptor$x(receiver).get$navigator(receiver);
+};
+$.get$nodes$x = function(receiver) {
+  return $.getInterceptor$x(receiver).get$nodes(receiver);
+};
+$.get$onClick$x = function(receiver) {
+  return $.getInterceptor$x(receiver).get$onClick(receiver);
+};
+$.get$responseText$x = function(receiver) {
+  return $.getInterceptor$x(receiver).get$responseText(receiver);
+};
+$.get$value$x = function(receiver) {
+  return $.getInterceptor$x(receiver).get$value(receiver);
+};
+$.get$width$x = function(receiver) {
+  return $.getInterceptor$x(receiver).get$width(receiver);
+};
+$.postMessage$1$x = function(receiver, a0) {
+  return $.getInterceptor$x(receiver).postMessage$1(receiver, a0);
+};
+$.register$2$x = function(receiver, a0, a1) {
+  return $.getInterceptor$x(receiver).register$2(receiver, a0, a1);
+};
+$.remove$0$ax = function(receiver) {
+  return $.getInterceptor$ax(receiver).remove$0(receiver);
+};
+$.replaceAll$2$s = function(receiver, a0, a1) {
+  return $.getInterceptor$s(receiver).replaceAll$2(receiver, a0, a1);
+};
+$.replaceWith$1$x = function(receiver, a0) {
+  return $.getInterceptor$x(receiver).replaceWith$1(receiver, a0);
+};
+$.send$1$x = function(receiver, a0) {
+  return $.getInterceptor$x(receiver).send$1(receiver, a0);
+};
+$.send$2$x = function(receiver, a0, a1) {
+  return $.getInterceptor$x(receiver).send$2(receiver, a0, a1);
+};
+$.set$$$dom_className$x = function(receiver, value) {
+  return $.getInterceptor$x(receiver).set$$$dom_className(receiver, value);
+};
+$.set$id$x = function(receiver, value) {
+  return $.getInterceptor$x(receiver).set$id(receiver, value);
+};
+$.set$length$asx = function(receiver, value) {
+  return $.getInterceptor$asx(receiver).set$length(receiver, value);
+};
+$.set$text$x = function(receiver, value) {
+  return $.getInterceptor$x(receiver).set$text(receiver, value);
+};
+$.skip$1$ax = function(receiver, a0) {
+  return $.getInterceptor$ax(receiver).skip$1(receiver, a0);
+};
+$.split$1$s = function(receiver, a0) {
+  return $.getInterceptor$s(receiver).split$1(receiver, a0);
+};
+$.sublist$1$ax = function(receiver, a0) {
+  return $.getInterceptor$ax(receiver).sublist$1(receiver, a0);
+};
+$.sublist$2$ax = function(receiver, a0, a1) {
+  return $.getInterceptor$ax(receiver).sublist$2(receiver, a0, a1);
+};
+$.toList$0$ax = function(receiver) {
+  return $.getInterceptor$ax(receiver).toList$0(receiver);
+};
+$.toList$1$growable$ax = function(receiver, a0) {
+  return $.getInterceptor$ax(receiver).toList$1$growable(receiver, a0);
+};
+$.toString$0 = function(receiver) {
+  return $.getInterceptor(receiver).toString$0(receiver);
+};
+$.trim$0$s = function(receiver) {
+  return $.getInterceptor$s(receiver).trim$0(receiver);
+};
+$.getInterceptor = function(receiver) {
+  if (typeof receiver == "number") {
+    if (Math.floor(receiver) == receiver)
+      return $.JSInt.prototype;
+    return $.JSDouble.prototype;
+  }
+  if (typeof receiver == "string")
+    return $.JSString.prototype;
+  if (receiver == null)
+    return $.JSNull.prototype;
+  if (typeof receiver == "function")
+    return $.JSFunction.prototype;
+  if (typeof receiver == "boolean")
+    return $.JSBool.prototype;
+  if (receiver.constructor == Array)
+    return $.JSArray.prototype;
+  if (typeof receiver != "object")
+    return receiver;
+  if (receiver instanceof $.Object)
+    return receiver;
+  if (Object.getPrototypeOf(receiver) === Object.prototype)
+    return $.Interceptor.prototype;
+  return $.getNativeInterceptor(receiver);
+};
+$.getInterceptor$asx = function(receiver) {
+  if (typeof receiver == "string")
+    return $.JSString.prototype;
+  if (receiver == null)
+    return receiver;
+  if (receiver.constructor == Array)
+    return $.JSArray.prototype;
+  if (typeof receiver != "object")
+    return receiver;
+  if (receiver instanceof $.Object)
+    return receiver;
+  if (Object.getPrototypeOf(receiver) === Object.prototype)
+    return $.Interceptor.prototype;
+  return $.getNativeInterceptor(receiver);
+};
+$.getInterceptor$ax = function(receiver) {
+  if (receiver == null)
+    return receiver;
+  if (receiver.constructor == Array)
+    return $.JSArray.prototype;
+  if (typeof receiver != "object")
+    return receiver;
+  if (receiver instanceof $.Object)
+    return receiver;
+  if (Object.getPrototypeOf(receiver) === Object.prototype)
+    return $.Interceptor.prototype;
+  return $.getNativeInterceptor(receiver);
+};
+$.getInterceptor$n = function(receiver) {
+  if (typeof receiver == "number")
+    return $.JSNumber.prototype;
+  if (receiver == null)
+    return receiver;
+  return receiver;
+};
+$.getInterceptor$ns = function(receiver) {
+  if (typeof receiver == "number")
+    return $.JSNumber.prototype;
+  if (typeof receiver == "string")
+    return $.JSString.prototype;
+  if (receiver == null)
+    return receiver;
+  return receiver;
+};
+$.getInterceptor$s = function(receiver) {
+  if (typeof receiver == "string")
+    return $.JSString.prototype;
+  if (receiver == null)
+    return receiver;
+  return receiver;
+};
+$.getInterceptor$x = function(receiver) {
+  if (receiver == null)
+    return receiver;
+  if (typeof receiver != "object")
+    return receiver;
+  if (receiver instanceof $.Object)
+    return receiver;
+  if (Object.getPrototypeOf(receiver) === Object.prototype)
+    return $.Interceptor.prototype;
+  return $.getNativeInterceptor(receiver);
+};
+Isolate.$lazy($, "globalThis", "globalThis", "get$globalThis", function() {
+  return $.IsolateNatives_computeGlobalThis();
+});
+Isolate.$lazy($, "globalWindow", "globalWindow", "get$globalWindow", function() {
+  return $.get$globalThis().window;
+});
+Isolate.$lazy($, "globalWorker", "globalWorker", "get$globalWorker", function() {
+  return $.get$globalThis().Worker;
+});
+Isolate.$lazy($, "globalPostMessageDefined", "globalPostMessageDefined", "get$globalPostMessageDefined", function() {
+  return $.get$globalThis().postMessage !== void 0;
+});
+Isolate.$lazy($, "thisScript", "IsolateNatives_thisScript", "get$IsolateNatives_thisScript", function() {
+  return $.IsolateNatives_computeThisScript();
+});
+Isolate.$lazy($, "_stackTraceExpando", "_stackTraceExpando", "get$_stackTraceExpando", function() {
+  return $.Expando$("asynchronous error");
+});
+Isolate.$lazy($, "_asyncCallbacks", "_asyncCallbacks", "get$_asyncCallbacks", function() {
+  return [];
+});
+Isolate.$lazy($, "_runCallbacks", "Timer__runCallbacks", "get$Timer__runCallbacks", function() {
+  return [];
+});
+// Native classes
+(function(table) {
+  for (var key in table)
+    $.defineProperty(Object.prototype, key, table[key]);
+})({
+  $isJavaScriptIndexingBehavior: function() {
+    return false;
+  },
+  $asJavaScriptIndexingBehavior: function() {
+    return null;
+  },
+  $isIterable: function() {
+    return false;
+  },
+  $asIterable: function() {
+    return null;
+  },
+  $isList: function() {
+    return false;
+  },
+  $asList: function() {
+    return null;
+  },
+  $isElement: function() {
+    return false;
+  },
+  $asElement: function() {
+    return null;
+  }
+});
+
+$.defineNativeMethods("Worker", $._WorkerStub);
+
+$.defineNativeMethodsNonleaf("HTMLElement", $._HTMLElement);
+
+$.defineNativeMethods("HTMLAnchorElement", $.AnchorElement);
+
+$.defineNativeMethods("WebKitAnimationEvent", $.AnimationEvent);
+
+$.defineNativeMethods("HTMLAreaElement", $.AreaElement);
+
+$.defineNativeMethods("ArrayBuffer", $.ArrayBuffer);
+
+$.defineNativeMethodsNonleaf("ArrayBufferView", $.ArrayBufferView);
+
+$.defineNativeMethods("Attr", $.Attr);
+
+$.defineNativeMethods("HTMLAudioElement", $.AudioElement);
+
+$.defineNativeMethods("AutocompleteErrorEvent", $.AutocompleteErrorEvent);
+
+$.defineNativeMethods("HTMLBRElement", $.BRElement);
+
+$.defineNativeMethods("HTMLBaseElement", $.BaseElement);
+
+$.defineNativeMethods("BeforeLoadEvent", $.BeforeLoadEvent);
+
+$.defineNativeMethodsNonleaf("Blob", $.Blob);
+
+$.defineNativeMethods("HTMLBodyElement", $.BodyElement);
+
+$.defineNativeMethods("HTMLButtonElement", $.ButtonElement);
+
+$.defineNativeMethods("CDATASection", $.CDataSection);
+
+$.defineNativeMethods("HTMLCanvasElement", $.CanvasElement);
+
+$.defineNativeMethods("CanvasGradient", $.CanvasGradient);
+
+$.defineNativeMethods("CanvasPattern", $.CanvasPattern);
+
+$.defineNativeMethodsNonleaf("CanvasRenderingContext", $.CanvasRenderingContext);
+
+$.defineNativeMethods("CanvasRenderingContext2D", $.CanvasRenderingContext2D);
+
+$.defineNativeMethodsNonleaf("CharacterData", $.CharacterData);
+
+$.defineNativeMethods("CloseEvent", $.CloseEvent);
+
+$.defineNativeMethods("Comment", $.Comment);
+
+$.defineNativeMethods("CompositionEvent", $.CompositionEvent);
+
+$.defineNativeMethods("HTMLContentElement", $.ContentElement);
+
+$.defineNativeMethods("CSSFontFaceLoadEvent", $.CssFontFaceLoadEvent);
+
+$.defineNativeMethods("CSSStyleDeclaration", $.CssStyleDeclaration);
+
+$.defineNativeMethods("CustomElementConstructor", $.CustomElementConstructor);
+
+$.defineNativeMethods("CustomEvent", $.CustomEvent);
+
+$.defineNativeMethods("HTMLDListElement", $.DListElement);
+
+$.defineNativeMethods("HTMLDataListElement", $.DataListElement);
+
+$.defineNativeMethods("HTMLDetailsElement", $.DetailsElement);
+
+$.defineNativeMethods("DeviceMotionEvent", $.DeviceMotionEvent);
+
+$.defineNativeMethods("DeviceOrientationEvent", $.DeviceOrientationEvent);
+
+$.defineNativeMethods("HTMLDialogElement", $.DialogElement);
+
+$.defineNativeMethods("HTMLDivElement", $.DivElement);
+
+$.defineNativeMethodsNonleaf("Document", $.Document);
+
+$.defineNativeMethodsNonleaf("DocumentFragment", $.DocumentFragment);
+
+$.defineNativeMethods("DocumentType", $.DocumentType);
+
+$.defineNativeMethods("DOMError", $.DomError);
+
+$.defineNativeMethods("DOMException", $.DomException);
+
+$.defineNativeMethodsNonleaf("Element", $.Element);
+
+$.defineNativeMethods("HTMLEmbedElement", $.EmbedElement);
+
+$.defineNativeMethods("EntityReference", $.EntityReference);
+
+$.defineNativeMethods("ErrorEvent", $.ErrorEvent);
+
+$.defineNativeMethodsNonleaf("Event", $.Event);
+
+$.defineNativeMethods("EventException", $.EventException);
+
+$.defineNativeMethodsNonleaf("EventTarget", $.EventTarget);
+
+$.defineNativeMethods("HTMLFieldSetElement", $.FieldSetElement);
+
+$.defineNativeMethods("File", $.File);
+
+$.defineNativeMethods("FileError", $.FileError);
+
+$.defineNativeMethods("FileException", $.FileException);
+
+$.defineNativeMethods("FocusEvent", $.FocusEvent);
+
+$.defineNativeMethods("HTMLFormElement", $.FormElement);
+
+$.defineNativeMethods("HTMLHRElement", $.HRElement);
+
+$.defineNativeMethods("HashChangeEvent", $.HashChangeEvent);
+
+$.defineNativeMethods("HTMLHeadElement", $.HeadElement);
+
+$.defineNativeMethods("HTMLHeadingElement", $.HeadingElement);
+
+$.defineNativeMethodsNonleaf("HTMLCollection", $.HtmlCollection);
+
+$.defineNativeMethods("HTMLDocument", $.HtmlDocument);
+
+$.defineNativeMethods("HTMLHtmlElement", $.HtmlElement);
+
+$.defineNativeMethods("HTMLFormControlsCollection", $.HtmlFormControlsCollection);
+
+$.defineNativeMethods("HTMLOptionsCollection", $.HtmlOptionsCollection);
+
+$.defineNativeMethods("XMLHttpRequest", $.HttpRequest);
+
+$.defineNativeMethods("XMLHttpRequestException", $.HttpRequestException);
+
+$.defineNativeMethods("XMLHttpRequestProgressEvent", $.HttpRequestProgressEvent);
+
+$.defineNativeMethods("XMLHttpRequestUpload", $.HttpRequestUpload);
+
+$.defineNativeMethods("HTMLIFrameElement", $.IFrameElement);
+
+$.defineNativeMethods("HTMLImageElement", $.ImageElement);
+
+$.defineNativeMethods("HTMLInputElement", $.InputElement);
+
+$.defineNativeMethods("KeyboardEvent", $.KeyboardEvent);
+
+$.defineNativeMethods("HTMLKeygenElement", $.KeygenElement);
+
+$.defineNativeMethods("HTMLLIElement", $.LIElement);
+
+$.defineNativeMethods("HTMLLabelElement", $.LabelElement);
+
+$.defineNativeMethods("HTMLLegendElement", $.LegendElement);
+
+$.defineNativeMethods("HTMLLinkElement", $.LinkElement);
+
+$.defineNativeMethods("HTMLMapElement", $.MapElement);
+
+$.defineNativeMethodsNonleaf("HTMLMediaElement", $.MediaElement);
+
+$.defineNativeMethods("MediaError", $.MediaError);
+
+$.defineNativeMethods("MediaKeyError", $.MediaKeyError);
+
+$.defineNativeMethods("MediaKeyEvent", $.MediaKeyEvent);
+
+$.defineNativeMethods("MediaStreamEvent", $.MediaStreamEvent);
+
+$.defineNativeMethods("MediaStreamTrackEvent", $.MediaStreamTrackEvent);
+
+$.defineNativeMethods("HTMLMenuElement", $.MenuElement);
+
+$.defineNativeMethods("MessageEvent", $.MessageEvent);
+
+$.defineNativeMethods("HTMLMetaElement", $.MetaElement);
+
+$.defineNativeMethods("HTMLMeterElement", $.MeterElement);
+
+$.defineNativeMethods("HTMLModElement", $.ModElement);
+
+$.defineNativeMethodsNonleaf("MouseEvent", $.MouseEvent);
+
+$.defineNativeMethods("MutationEvent", $.MutationEvent);
+
+$.defineNativeMethods("Navigator", $.Navigator);
+
+$.defineNativeMethods("NavigatorUserMediaError", $.NavigatorUserMediaError);
+
+$.defineNativeMethodsNonleaf("Node", $.Node);
+
+$.defineNativeMethodsNonleaf("NodeList", $.NodeList);
+
+$.defineNativeMethods("Notation", $.Notation);
+
+$.defineNativeMethods("HTMLOListElement", $.OListElement);
+
+$.defineNativeMethods("HTMLObjectElement", $.ObjectElement);
+
+$.defineNativeMethods("HTMLOptGroupElement", $.OptGroupElement);
+
+$.defineNativeMethods("HTMLOptionElement", $.OptionElement);
+
+$.defineNativeMethods("HTMLOutputElement", $.OutputElement);
+
+$.defineNativeMethods("OverflowEvent", $.OverflowEvent);
+
+$.defineNativeMethods("PageTransitionEvent", $.PageTransitionEvent);
+
+$.defineNativeMethods("HTMLParagraphElement", $.ParagraphElement);
+
+$.defineNativeMethods("HTMLParamElement", $.ParamElement);
+
+$.defineNativeMethods("PopStateEvent", $.PopStateEvent);
+
+$.defineNativeMethods("PositionError", $.PositionError);
+
+$.defineNativeMethods("HTMLPreElement", $.PreElement);
+
+$.defineNativeMethods("ProcessingInstruction", $.ProcessingInstruction);
+
+$.defineNativeMethods("HTMLProgressElement", $.ProgressElement);
+
+$.defineNativeMethodsNonleaf("ProgressEvent", $.ProgressEvent);
+
+$.defineNativeMethods("HTMLQuoteElement", $.QuoteElement);
+
+$.defineNativeMethods("RadioNodeList", $.RadioNodeList);
+
+$.defineNativeMethods("RangeException", $.RangeException);
+
+$.defineNativeMethods("RTCDataChannelEvent", $.RtcDataChannelEvent);
+
+$.defineNativeMethods("RTCDTMFToneChangeEvent", $.RtcDtmfToneChangeEvent);
+
+$.defineNativeMethods("RTCIceCandidateEvent", $.RtcIceCandidateEvent);
+
+$.defineNativeMethods("HTMLScriptElement", $.ScriptElement);
+
+$.defineNativeMethods("SecurityPolicyViolationEvent", $.SecurityPolicyViolationEvent);
+
+$.defineNativeMethods("HTMLSelectElement", $.SelectElement);
+
+$.defineNativeMethods("HTMLShadowElement", $.ShadowElement);
+
+$.defineNativeMethods("ShadowRoot", $.ShadowRoot);
+
+$.defineNativeMethods("HTMLSourceElement", $.SourceElement);
+
+$.defineNativeMethods("HTMLSpanElement", $.SpanElement);
+
+$.defineNativeMethods("SpeechInputEvent", $.SpeechInputEvent);
+
+$.defineNativeMethods("SpeechRecognitionError", $.SpeechRecognitionError);
+
+$.defineNativeMethods("SpeechRecognitionEvent", $.SpeechRecognitionEvent);
+
+$.defineNativeMethods("StorageEvent", $.StorageEvent);
+
+$.defineNativeMethods("HTMLStyleElement", $.StyleElement);
+
+$.defineNativeMethods("HTMLTableCaptionElement", $.TableCaptionElement);
+
+$.defineNativeMethods("HTMLTableCellElement", $.TableCellElement);
+
+$.defineNativeMethods("HTMLTableColElement", $.TableColElement);
+
+$.defineNativeMethods("HTMLTableElement", $.TableElement);
+
+$.defineNativeMethods("HTMLTableRowElement", $.TableRowElement);
+
+$.defineNativeMethods("HTMLTableSectionElement", $.TableSectionElement);
+
+$.defineNativeMethods("HTMLTemplateElement", $.TemplateElement);
+
+$.defineNativeMethodsNonleaf("Text", $.Text);
+
+$.defineNativeMethods("HTMLTextAreaElement", $.TextAreaElement);
+
+$.defineNativeMethods("TextEvent", $.TextEvent);
+
+$.defineNativeMethods("HTMLTitleElement", $.TitleElement);
+
+$.defineNativeMethods("TouchEvent", $.TouchEvent);
+
+$.defineNativeMethods("HTMLTrackElement", $.TrackElement);
+
+$.defineNativeMethods("TrackEvent", $.TrackEvent);
+
+$.defineNativeMethods("TransitionEvent", $.TransitionEvent);
+
+$.defineNativeMethodsNonleaf("UIEvent", $.UIEvent);
+
+$.defineNativeMethods("HTMLUListElement", $.UListElement);
+
+$.defineNativeMethodsNonleaf("Uint8Array", $.Uint8Array);
+
+$.defineNativeMethods("Uint8ClampedArray", $.Uint8ClampedArray);
+
+$.defineNativeMethods("HTMLUnknownElement", $.UnknownElement);
+
+$.defineNativeMethods("HTMLVideoElement", $.VideoElement);
+
+$.defineNativeMethods("WheelEvent", $.WheelEvent);
+
+$.defineNativeMethods("DOMWindow", $.Window);
+
+$.defineNativeMethods("XPathException", $.XPathException);
+
+$.defineNativeMethods("NamedNodeMap", $._NamedNodeMap);
+
+$.defineNativeMethods("WebKitTransitionEvent", $._WebKitTransitionEvent);
+
+$.defineNativeMethods("IDBVersionChangeEvent", $.VersionChangeEvent);
+
+$.defineNativeMethods("SVGAElement", $.AElement);
+
+$.defineNativeMethods("SVGAltGlyphElement", $.AltGlyphElement);
+
+$.defineNativeMethods("SVGAnimateElement", $.AnimateElement);
+
+$.defineNativeMethods("SVGAnimateMotionElement", $.AnimateMotionElement);
+
+$.defineNativeMethods("SVGAnimateTransformElement", $.AnimateTransformElement);
+
+$.defineNativeMethods("SVGAnimatedLength", $.AnimatedLength);
+
+$.defineNativeMethods("SVGAnimatedNumberList", $.AnimatedNumberList);
+
+$.defineNativeMethodsNonleaf("SVGAnimationElement", $.AnimationElement);
+
+$.defineNativeMethods("SVGCircleElement", $.CircleElement);
+
+$.defineNativeMethods("SVGClipPathElement", $.ClipPathElement);
+
+$.defineNativeMethods("SVGDefsElement", $.DefsElement);
+
+$.defineNativeMethods("SVGDescElement", $.DescElement);
+
+$.defineNativeMethods("SVGEllipseElement", $.EllipseElement);
+
+$.defineNativeMethods("SVGFEBlendElement", $.FEBlendElement);
+
+$.defineNativeMethods("SVGFEColorMatrixElement", $.FEColorMatrixElement);
+
+$.defineNativeMethods("SVGFEComponentTransferElement", $.FEComponentTransferElement);
+
+$.defineNativeMethods("SVGFECompositeElement", $.FECompositeElement);
+
+$.defineNativeMethods("SVGFEConvolveMatrixElement", $.FEConvolveMatrixElement);
+
+$.defineNativeMethods("SVGFEDiffuseLightingElement", $.FEDiffuseLightingElement);
+
+$.defineNativeMethods("SVGFEDisplacementMapElement", $.FEDisplacementMapElement);
+
+$.defineNativeMethods("SVGFEDistantLightElement", $.FEDistantLightElement);
+
+$.defineNativeMethods("SVGFEFloodElement", $.FEFloodElement);
+
+$.defineNativeMethods("SVGFEFuncAElement", $.FEFuncAElement);
+
+$.defineNativeMethods("SVGFEFuncBElement", $.FEFuncBElement);
+
+$.defineNativeMethods("SVGFEFuncGElement", $.FEFuncGElement);
+
+$.defineNativeMethods("SVGFEFuncRElement", $.FEFuncRElement);
+
+$.defineNativeMethods("SVGFEGaussianBlurElement", $.FEGaussianBlurElement);
+
+$.defineNativeMethods("SVGFEImageElement", $.FEImageElement);
+
+$.defineNativeMethods("SVGFEMergeElement", $.FEMergeElement);
+
+$.defineNativeMethods("SVGFEMergeNodeElement", $.FEMergeNodeElement);
+
+$.defineNativeMethods("SVGFEMorphologyElement", $.FEMorphologyElement);
+
+$.defineNativeMethods("SVGFEOffsetElement", $.FEOffsetElement);
+
+$.defineNativeMethods("SVGFEPointLightElement", $.FEPointLightElement);
+
+$.defineNativeMethods("SVGFESpecularLightingElement", $.FESpecularLightingElement);
+
+$.defineNativeMethods("SVGFESpotLightElement", $.FESpotLightElement);
+
+$.defineNativeMethods("SVGFETileElement", $.FETileElement);
+
+$.defineNativeMethods("SVGFETurbulenceElement", $.FETurbulenceElement);
+
+$.defineNativeMethods("SVGFilterElement", $.FilterElement);
+
+$.defineNativeMethods("SVGForeignObjectElement", $.ForeignObjectElement);
+
+$.defineNativeMethods("SVGGElement", $.GElement);
+
+$.defineNativeMethods("SVGImageElement", $.ImageElement0);
+
+$.defineNativeMethods("SVGLineElement", $.LineElement);
+
+$.defineNativeMethods("SVGLinearGradientElement", $.LinearGradientElement);
+
+$.defineNativeMethods("SVGMarkerElement", $.MarkerElement);
+
+$.defineNativeMethods("SVGMaskElement", $.MaskElement);
+
+$.defineNativeMethods("SVGMetadataElement", $.MetadataElement);
+
+$.defineNativeMethods("SVGPathElement", $.PathElement);
+
+$.defineNativeMethods("SVGPatternElement", $.PatternElement);
+
+$.defineNativeMethods("SVGPolygonElement", $.PolygonElement);
+
+$.defineNativeMethods("SVGPolylineElement", $.PolylineElement);
+
+$.defineNativeMethods("SVGRadialGradientElement", $.RadialGradientElement);
+
+$.defineNativeMethods("SVGRectElement", $.RectElement);
+
+$.defineNativeMethods("SVGScriptElement", $.ScriptElement0);
+
+$.defineNativeMethods("SVGSetElement", $.SetElement);
+
+$.defineNativeMethods("SVGStopElement", $.StopElement);
+
+$.defineNativeMethods("SVGStyleElement", $.StyleElement0);
+
+$.defineNativeMethodsNonleaf("SVGStyledElement", $.StyledElement);
+
+$.defineNativeMethods("SVGDocument", $.SvgDocument);
+
+$.defineNativeMethodsNonleaf("SVGElement", $.SvgElement);
+
+$.defineNativeMethods("SVGException", $.SvgException);
+
+$.defineNativeMethods("SVGSVGElement", $.SvgSvgElement);
+
+$.defineNativeMethods("SVGSwitchElement", $.SwitchElement);
+
+$.defineNativeMethods("SVGSymbolElement", $.SymbolElement);
+
+$.defineNativeMethods("SVGTSpanElement", $.TSpanElement);
+
+$.defineNativeMethodsNonleaf("SVGTextContentElement", $.TextContentElement);
+
+$.defineNativeMethods("SVGTextElement", $.TextElement);
+
+$.defineNativeMethods("SVGTextPathElement", $.TextPathElement);
+
+$.defineNativeMethodsNonleaf("SVGTextPositioningElement", $.TextPositioningElement);
+
+$.defineNativeMethods("SVGTitleElement", $.TitleElement0);
+
+$.defineNativeMethods("SVGUseElement", $.UseElement);
+
+$.defineNativeMethods("SVGViewElement", $.ViewElement);
+
+$.defineNativeMethods("SVGZoomEvent", $.ZoomEvent);
+
+$.defineNativeMethodsNonleaf("SVGGradientElement", $._GradientElement);
+
+$.defineNativeMethodsNonleaf("SVGComponentTransferFunctionElement", $._SVGComponentTransferFunctionElement);
+
+$.defineNativeMethods("AudioProcessingEvent", $.AudioProcessingEvent);
+
+$.defineNativeMethods("OfflineAudioCompletionEvent", $.OfflineAudioCompletionEvent);
+
+$.defineNativeMethods("WebGLContextEvent", $.ContextEvent);
+
+$.defineNativeMethods("SQLError", $.SqlError);
+
+$.defineNativeMethods("SQLException", $.SqlException);
+
+
+var $ = null;
+Isolate = Isolate.$finishIsolateConstructor(Isolate);
+var $ = new Isolate();
+$.main.call$0 = $.main;
+// BEGIN invoke [main].
+if (typeof document !== "undefined" && document.readyState !== "complete") {
+  document.addEventListener("readystatechange", function () {
+    if (document.readyState == "complete") {
+      if (typeof dartMainRunner === "function") {
+        dartMainRunner(function() { $.startRootIsolate($.main); });
+      } else {
+        $.startRootIsolate($.main);
+      }
+    }
+  }, false);
+} else {
+  if (typeof dartMainRunner === "function") {
+    dartMainRunner(function() { $.startRootIsolate($.main); });
+  } else {
+    $.startRootIsolate($.main);
+  }
+}
+// END invoke [main].
+function init() {
+  Isolate.$isolateProperties = {};
+  function generateAccessor(field, prototype) {
+    var len = field.length;
+    var code = field.charCodeAt(len - 1);
+    code = code >= 60 && code <= 64 ? code - 59 : code >= 123 && code <= 126 ? code - 117 : code >= 37 && code <= 43 ? code - 27 : 0;
+    if (code) {
+      var getterCode = code & 3;
+      var setterCode = code >> 2;
+      var accessorName = field = field.substring(0, len - 1);
+      var divider = field.indexOf(":");
+      if (divider > 0) {
+        accessorName = field.substring(0, divider);
+        field = field.substring(divider + 1);
+      }
+      if (getterCode) {
+        var args = getterCode & 2 ? "receiver" : "";
+        var receiver = getterCode & 1 ? "this" : "receiver";
+        var body = "return " + receiver + "." + field;
+        prototype["get$" + accessorName] = new Function(args, body);
+      }
+      if (setterCode) {
+        var args = setterCode & 2 ? "receiver, value" : "value";
+        var receiver = setterCode & 1 ? "this" : "receiver";
+        var body = receiver + "." + field + " = value";
+        prototype["set$" + accessorName] = new Function(args, body);
+      }
+    }
+    return field;
+  }
+  Isolate.$isolateProperties.$generateAccessor = generateAccessor;
+  function defineClass(cls, fields, prototype) {
+    var constructor;
+    if (typeof fields == "function") {
+      constructor = fields;
+    } else {
+      var str = "function " + cls + "(";
+      var body = "";
+      for (var i = 0; i < fields.length; i++) {
+        if (i != 0)
+          str += ", ";
+        var field = fields[i];
+        field = generateAccessor(field, prototype);
+        str += field;
+        body += "this." + field + " = " + field + ";\n";
+      }
+      str += ") {" + body + "}\nreturn " + cls;
+      constructor = new Function(str)();
+    }
+    constructor.prototype = prototype;
+    constructor.builtin$cls = cls;
+    return constructor;
+  }
+  var supportsProto = false;
+  var tmp = defineClass("c", ["f?"], {}).prototype;
+  if (tmp.__proto__) {
+    tmp.__proto__ = {};
+    if (typeof tmp.get$f != "undefined")
+      supportsProto = true;
+  }
+  Isolate.$finishClasses = function(collectedClasses, isolateProperties, existingIsolateProperties) {
+    var pendingClasses = {};
+    var hasOwnProperty = Object.prototype.hasOwnProperty;
+    for (var cls in collectedClasses) {
+      if (hasOwnProperty.call(collectedClasses, cls)) {
+        var desc = collectedClasses[cls];
+        var fields = desc[""], supr;
+        if (typeof fields == "string") {
+          var s = fields.split(";");
+          supr = s[0];
+          fields = s[1] == "" ? [] : s[1].split(",");
+        } else {
+          supr = desc.super;
+        }
+        isolateProperties[cls] = defineClass(cls, fields, desc);
+        if (supr)
+          pendingClasses[cls] = supr;
+      }
+    }
+    var finishedClasses = {};
+    function finishClass(cls) {
+      var hasOwnProperty = Object.prototype.hasOwnProperty;
+      if (hasOwnProperty.call(finishedClasses, cls))
+        return;
+      finishedClasses[cls] = true;
+      var superclass = pendingClasses[cls];
+      if (!superclass || typeof superclass != "string")
+        return;
+      finishClass(superclass);
+      var constructor = isolateProperties[cls];
+      var superConstructor = isolateProperties[superclass];
+      if (!superConstructor)
+        superConstructor = existingIsolateProperties[superclass];
+      var prototype = constructor.prototype;
+      if (supportsProto) {
+        prototype.__proto__ = superConstructor.prototype;
+        prototype.constructor = constructor;
+      } else {
+        function tmp() {
+        }
+        tmp.prototype = superConstructor.prototype;
+        var newPrototype = new tmp();
+        constructor.prototype = newPrototype;
+        newPrototype.constructor = constructor;
+        for (var member in prototype) {
+          if (!member)
+            continue;
+          if (hasOwnProperty.call(prototype, member)) {
+            newPrototype[member] = prototype[member];
+          }
+        }
+      }
+    }
+    for (var cls in pendingClasses)
+      finishClass(cls);
+  };
+  Isolate.$lazy = function(prototype, staticName, fieldName, getterName, lazyValue) {
+    var getter = new Function("{ return $." + fieldName + ";}");
+    var sentinelUndefined = {};
+    var sentinelInProgress = {};
+    prototype[fieldName] = sentinelUndefined;
+    prototype[getterName] = function() {
+      var result = $[fieldName];
+      try {
+        if (result === sentinelUndefined) {
+          $[fieldName] = sentinelInProgress;
+          try {
+            result = $[fieldName] = lazyValue();
+          } finally {
+            if (result === sentinelUndefined) {
+              if ($[fieldName] === sentinelInProgress) {
+                $[fieldName] = null;
+              }
+            }
+          }
+        } else {
+          if (result === sentinelInProgress)
+            $.throwCyclicInit(staticName);
+        }
+        return result;
+      } finally {
+        $[getterName] = getter;
+      }
+    };
+  };
+  Isolate.$finishIsolateConstructor = function(oldIsolate) {
+    var isolateProperties = oldIsolate.$isolateProperties;
+    isolateProperties.$currentScript = typeof document == "object" ? document.currentScript || document.scripts[document.scripts.length - 1] : null;
+    var isolatePrototype = oldIsolate.prototype;
+    var str = "{\n";
+    str += "var properties = Isolate.$isolateProperties;\n";
+    var hasOwnProperty = Object.prototype.hasOwnProperty;
+    for (var staticName in isolateProperties) {
+      if (hasOwnProperty.call(isolateProperties, staticName)) {
+        str += "this." + staticName + "= properties." + staticName + ";\n";
+      }
+    }
+    str += "}\n";
+    var newIsolate = new Function(str);
+    newIsolate.prototype = isolatePrototype;
+    isolatePrototype.constructor = newIsolate;
+    newIsolate.$isolateProperties = isolateProperties;
+    newIsolate.$finishClasses = oldIsolate.$finishClasses;
+    return newIsolate;
+  };
+}
+//@ sourceMappingURL=vmstats.dart.js.map
diff --git a/runtime/bin/vmstats_impl.cc b/runtime/bin/vmstats_impl.cc
index b05614e..d2e0af6 100644
--- a/runtime/bin/vmstats_impl.cc
+++ b/runtime/bin/vmstats_impl.cc
@@ -27,13 +27,25 @@
 dart::Mutex* VmStatusService::mutex_;
 
 
-void VmStats::Start(int port, const char* root_dir) {
+void VmStats::Start(int port, const char* root_dir, bool verbose) {
   if (instance_ != NULL) {
     FATAL("VmStats already started.");
   }
-  instance_ = new VmStats();
+  instance_ = new VmStats(verbose);
   instance_monitor_ = new dart::Monitor();
+  Initialize();
   VmStatusService::InitOnce();
+
+  if (port >= 0) {
+    StartServer(port, root_dir);
+  }
+}
+
+
+void VmStats::StartServer(int port, const char* root_dir) {
+  ASSERT(port >= 0);
+  ASSERT(instance_ != NULL);
+  ASSERT(instance_monitor_ != NULL);
   Socket::Initialize();
 
   if (root_dir != NULL) {
@@ -68,7 +80,6 @@
   }
 }
 
-
 void VmStats::Stop() {
   ASSERT(instance_ != NULL);
   MonitorLocker ml(instance_monitor_);
@@ -87,18 +98,14 @@
 
 void VmStats::AddIsolate(IsolateData* isolate_data,
                          Dart_Isolate isolate) {
-  if (instance_ != NULL) {
-    MonitorLocker ml(instance_monitor_);
-    instance_->isolate_table_[isolate_data] = isolate;
-  }
+  MonitorLocker ml(instance_monitor_);
+  instance_->isolate_table_[isolate_data] = isolate;
 }
 
 
 void VmStats::RemoveIsolate(IsolateData* isolate_data) {
-  if (instance_ != NULL) {
-    MonitorLocker ml(instance_monitor_);
-    instance_->isolate_table_.erase(isolate_data);
-  }
+  MonitorLocker ml(instance_monitor_);
+  instance_->isolate_table_.erase(isolate_data);
 }
 
 
@@ -234,7 +241,9 @@
     }
     char* url = strdup(&buffer[4]);
 
-    Log::Print("vmstats: %s requested\n", url);
+    if (instance_->verbose_) {
+      Log::Print("vmstats: %s requested\n", url);
+    }
     char* content = NULL;
 
     // Check for VmStats-specific URLs.
@@ -314,10 +323,10 @@
              reinterpret_cast<intptr_t>(isolate));
     char* status = VmStatusService::GetVmStatus(request);
     if (status != NULL) {
-      text.AddString(status);
       if (!first) {
         text.AddString(",\n");
       }
+      text.AddString(status);
       first = false;
       free(status);
     }
@@ -327,6 +336,94 @@
 }
 
 
+// Advance the scanner to the value token of a specified name-value pair.
+void SeekNamedValue(const char* name, dart::JSONScanner* scanner) {
+  while (!scanner->EOM()) {
+    scanner->Scan();
+    if (scanner->IsStringLiteral(name)) {
+      scanner->Scan();
+      ASSERT(scanner->CurrentToken() == dart::JSONScanner::TokenColon);
+      scanner->Scan();
+     return;
+    }
+  }
+}
+
+
+// Windows doesn't have strndup(), so this is a simple, private version.
+static char* StrNDup(const char* s, uword len) {
+  if (strlen(s) < len) {
+    len = strlen(s);
+  }
+  char* result = reinterpret_cast<char*>(malloc(len + 1));
+  memmove(result, s, len);
+  result[len + 1] = '\0';
+  return result;
+}
+
+
+void VmStats::DumpStackThread(uword unused) {
+  Log::Print("Isolate dump:\n");
+  IsolateTable::iterator itr;
+  MonitorLocker ml(instance_monitor_);
+  for (itr = instance_->isolate_table_.begin();
+       itr != instance_->isolate_table_.end(); ++itr) {
+    Dart_Isolate isolate = itr->second;
+
+    // Print isolate name and details.
+    static char buffer[512];
+    snprintf(buffer, sizeof(buffer),
+             "/isolate/0x%"Px, reinterpret_cast<intptr_t>(isolate));
+    char* isolate_details = VmStatusService::GetVmStatus(buffer);
+    if (isolate_details != NULL) {
+      dart::JSONScanner scanner(isolate_details);
+      SeekNamedValue("name", &scanner);
+      char* name = StrNDup(scanner.TokenChars(), scanner.TokenLen());
+      SeekNamedValue("port", &scanner);
+      char* port = StrNDup(scanner.TokenChars(), scanner.TokenLen());
+      Log::Print("\"%s\" port=%s\n", name, port);
+      free(isolate_details);
+      free(port);
+      free(name);
+    }
+
+    // Print stack trace.
+    snprintf(buffer, sizeof(buffer),
+             "/isolate/0x%"Px"/stacktrace",
+             reinterpret_cast<intptr_t>(isolate));
+    char* trace = VmStatusService::GetVmStatus(buffer);
+    if (trace != NULL) {
+      dart::JSONScanner scanner(trace);
+      while (true) {
+        SeekNamedValue("url", &scanner);
+        if (scanner.CurrentToken() == dart::JSONScanner::TokenEOM) {
+          break;
+        }
+        char* url = StrNDup(scanner.TokenChars(), scanner.TokenLen());
+        SeekNamedValue("line", &scanner);
+        char* line = StrNDup(scanner.TokenChars(), scanner.TokenLen());
+        SeekNamedValue("function", &scanner);
+        char* function = StrNDup(scanner.TokenChars(), scanner.TokenLen());
+        Log::Print("  at %s(%s:%s)\n", function, url, line);
+        free(url);
+        free(line);
+        free(function);
+      }
+      free(trace);
+    }
+  }
+}
+
+
+void VmStats::DumpStack() {
+  int err = dart::Thread::Start(DumpStackThread, 0);
+  if (err != 0) {
+    Log::PrintErr("Failed starting VmStats stackdump thread: %d\n", err);
+    Shutdown();
+  }
+}
+
+
 // Global static pointer used to ensure a single instance of the class.
 VmStatusService* VmStatusService::instance_ = NULL;
 
@@ -346,6 +443,8 @@
 
 
 int VmStatusService::RegisterPlugin(Dart_VmStatusCallback callback) {
+  ASSERT(VmStatusService::instance_ != NULL);
+  ASSERT(VmStatusService::mutex_ != NULL);
   MutexLocker ml(mutex_);
   if (callback == NULL) {
     return -1;
@@ -362,6 +461,7 @@
 
 
 char* VmStatusService::GetVmStatus(const char* request) {
+  ASSERT(VmStatusService::instance_ != NULL);
   VmStatusPlugin* plugin = instance_->registered_plugin_list_;
   while (plugin != NULL) {
     char* result = (plugin->callback())(request);
diff --git a/runtime/bin/vmstats_impl.h b/runtime/bin/vmstats_impl.h
index b39f2ce..a348a7a 100644
--- a/runtime/bin/vmstats_impl.h
+++ b/runtime/bin/vmstats_impl.h
@@ -17,18 +17,28 @@
 
 class VmStats {
  public:
-  static void Start(int port, const char* root_dir);
+  static void Initialize();
+
+  static void Start(int port, const char* root_dir, bool verbose);
   static void Stop();
 
   // Add and remove functions for the isolate_table, called by main.cc.
   static void AddIsolate(IsolateData* isolate_data, Dart_Isolate isolate);
   static void RemoveIsolate(IsolateData* isolate_data);
 
- private:
-  VmStats() : root_directory_(NULL), running_(false), bind_address_(0) {}
+  // Print stack traces of current isolates to stdout.
+  static void DumpStack();
 
+ private:
+  explicit VmStats(bool verbose) :
+      root_directory_(NULL), running_(false), bind_address_(0) {
+    verbose_ = verbose;
+  }
+
+  static void StartServer(int port, const char* root_dir);
   static void WebServer(uword bind_address);
   static void Shutdown();
+  static void DumpStackThread(uword unused);
 
   // Status text generators.
   char* IsolatesStatus();
@@ -39,6 +49,7 @@
   IsolateTable isolate_table_;
   bool running_;
   int64_t bind_address_;
+  bool verbose_;
 
   static VmStats* instance_;
   static dart::Monitor* instance_monitor_;
diff --git a/runtime/bin/vmstats_impl_android.cc b/runtime/bin/vmstats_impl_android.cc
new file mode 100644
index 0000000..e460e70
--- /dev/null
+++ b/runtime/bin/vmstats_impl_android.cc
@@ -0,0 +1,33 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#include "platform/globals.h"
+#if defined(TARGET_OS_ANDROID)
+
+#include "bin/vmstats_impl.h"
+
+#include <signal.h>  // NOLINT
+
+
+static void sig_handler(int sig, siginfo_t* siginfo, void*) {
+  if (sig == SIGQUIT) {
+    VmStats::DumpStack();
+  } else {
+    FATAL1("unrequested signal %d received\n", sig);
+  }
+}
+
+void VmStats::Initialize() {
+  // Enable SIGQUIT (ctrl-\) stack dumps.
+  struct sigaction sigact;
+  memset(&sigact, '\0', sizeof(sigact));
+  sigact.sa_sigaction = sig_handler;
+  sigact.sa_flags = SA_SIGINFO;
+  if (sigaction(SIGQUIT, &sigact, NULL) < 0) {
+    perror("sigaction");
+  }
+}
+
+#endif  // defined(TARGET_OS_ANDROID)
+
diff --git a/runtime/bin/vmstats_impl_linux.cc b/runtime/bin/vmstats_impl_linux.cc
new file mode 100644
index 0000000..ae2277a
--- /dev/null
+++ b/runtime/bin/vmstats_impl_linux.cc
@@ -0,0 +1,33 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#include "platform/globals.h"
+#if defined(TARGET_OS_LINUX)
+
+#include "bin/vmstats_impl.h"
+
+#include <signal.h>  // NOLINT
+
+
+static void sig_handler(int sig, siginfo_t* siginfo, void*) {
+  if (sig == SIGQUIT) {
+    VmStats::DumpStack();
+  } else {
+    FATAL1("unrequested signal %d received\n", sig);
+  }
+}
+
+void VmStats::Initialize() {
+  // Enable SIGQUIT (ctrl-\) stack dumps.
+  struct sigaction sigact;
+  memset(&sigact, '\0', sizeof(sigact));
+  sigact.sa_sigaction = sig_handler;
+  sigact.sa_flags = SA_SIGINFO;
+  if (sigaction(SIGQUIT, &sigact, NULL) < 0) {
+    perror("sigaction");
+  }
+}
+
+#endif  // defined(TARGET_OS_LINUX)
+
diff --git a/runtime/bin/vmstats_impl_macos.cc b/runtime/bin/vmstats_impl_macos.cc
new file mode 100644
index 0000000..29686a1
--- /dev/null
+++ b/runtime/bin/vmstats_impl_macos.cc
@@ -0,0 +1,33 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#include "platform/globals.h"
+#if defined(TARGET_OS_MACOS)
+
+#include "bin/vmstats_impl.h"
+
+#include <signal.h>  // NOLINT
+
+
+static void sig_handler(int sig, siginfo_t* siginfo, void*) {
+  if (sig == SIGQUIT) {
+    VmStats::DumpStack();
+  } else {
+    FATAL1("unrequested signal %d received\n", sig);
+  }
+}
+
+void VmStats::Initialize() {
+  // Enable SIGQUIT (ctrl-\) stack dumps.
+  struct sigaction sigact;
+  memset(&sigact, '\0', sizeof(sigact));
+  sigact.sa_sigaction = sig_handler;
+  sigact.sa_flags = SA_SIGINFO;
+  if (sigaction(SIGQUIT, &sigact, NULL) < 0) {
+    perror("sigaction");
+  }
+}
+
+#endif  // defined(TARGET_OS_MACOS)
+
diff --git a/runtime/bin/vmstats_impl_win.cc b/runtime/bin/vmstats_impl_win.cc
new file mode 100644
index 0000000..7ff384c
--- /dev/null
+++ b/runtime/bin/vmstats_impl_win.cc
@@ -0,0 +1,26 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#include "platform/globals.h"
+#if defined(TARGET_OS_WINDOWS)
+
+#include "bin/vmstats_impl.h"
+
+#include <signal.h>  // NOLINT
+
+
+static void sig_handler(int sig) {
+  if (sig == SIGBREAK) {
+    VmStats::DumpStack();
+  }
+}
+
+void VmStats::Initialize() {
+  // Enable SIGBREAK (ctrl-break) stack dumps.
+  if (signal(SIGBREAK, sig_handler) == SIG_ERR) {
+    perror("Adding SIGBREAK signal handler failed");
+  }
+}
+
+#endif  // defined(TARGET_OS_WINDOWS)
diff --git a/runtime/bin/vmstats_sources.gypi b/runtime/bin/vmstats_sources.gypi
index 5344f5e..2c64dd3 100644
--- a/runtime/bin/vmstats_sources.gypi
+++ b/runtime/bin/vmstats_sources.gypi
@@ -12,6 +12,7 @@
     'vmstats/packages/browser/dart.js',
     'vmstats/vmstats.css',
     'vmstats/vmstats.dart',
+    'vmstats/vmstats.dart.js',
     'vmstats/vmstats.html',
   ],
 }
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h
index 121e49d..5da6c6a 100755
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -2446,6 +2446,12 @@
 DART_EXPORT Dart_Handle Dart_CompileAll();
 
 /**
+ * Check that all function fingerprints are OK.
+ *
+ */
+DART_EXPORT Dart_Handle Dart_CheckFunctionFingerprints();
+
+/**
  * Is this object a Library?
  */
 DART_EXPORT bool Dart_IsLibrary(Dart_Handle object);
diff --git a/runtime/include/dart_debugger_api.h b/runtime/include/dart_debugger_api.h
index 5694f8e..e411b3e 100755
--- a/runtime/include/dart_debugger_api.h
+++ b/runtime/include/dart_debugger_api.h
@@ -25,15 +25,11 @@
  */
 #define ILLEGAL_ISOLATE_ID ILLEGAL_PORT
 
+// DEPRECATED -- use Dart_PausedEventHandler
 typedef void Dart_BreakpointHandler(Dart_IsolateId isolate_id,
                                     Dart_Breakpoint breakpoint,
                                     Dart_StackTrace stack_trace);
 
-typedef void Dart_BreakpointResolvedHandler(Dart_IsolateId isolate_id,
-                                            intptr_t bp_id,
-                                            Dart_Handle url,
-                                            intptr_t line_number);
-
 typedef void Dart_ExceptionThrownHandler(Dart_IsolateId isolate_id,
                                          Dart_Handle exception_object,
                                          Dart_StackTrace stack_trace);
@@ -58,6 +54,14 @@
 typedef void Dart_IsolateEventHandler(Dart_IsolateId isolate_id,
                                       Dart_IsolateEvent kind);
 
+typedef void Dart_PausedEventHandler(Dart_IsolateId isolate_id,
+                                     const Dart_CodeLocation& location);
+
+typedef void Dart_BreakpointResolvedHandler(Dart_IsolateId isolate_id,
+                                            intptr_t bp_id,
+                                            const Dart_CodeLocation& location);
+
+
 /**
  * Caches a given \object and returns an object id. The object id is only
  * valid while the VM is paused. The cache is invalidated when the VM
@@ -276,6 +280,8 @@
 
 
 /**
+ * DEPRECATED -- use Dart_SetPausedEventHandler
+ *
  * Installs a handler callback function that gets called by the VM
  * when a breakpoint has been reached.
  *
@@ -284,6 +290,17 @@
 DART_EXPORT void Dart_SetBreakpointHandler(
                             Dart_BreakpointHandler bp_handler);
 
+
+/**
+ * Installs a handler callback function that gets called by the VM
+ * when a breakpoint location has been reached or when stepping.
+ *
+ * Requires there to be a current isolate.
+ */
+DART_EXPORT void Dart_SetPausedEventHandler(
+                            Dart_PausedEventHandler handler);
+
+
 /**
  * Installs a callback function that gets called by the VM when
  * a breakpoint has been resolved to an actual url and line number.
diff --git a/runtime/lib/array_patch.dart b/runtime/lib/array_patch.dart
index 386e8ac..6a2ba29 100644
--- a/runtime/lib/array_patch.dart
+++ b/runtime/lib/array_patch.dart
@@ -32,6 +32,44 @@
     return result;
   }
 
+  /* patch */ factory List.from(Iterable other, { bool growable: true }) {
+    // TODO(iposva): Avoid the iterators for the known lists and do the copy in
+    // the VM directly.
+    var len = null;
+    // TODO(iposva): Remove this dance once dart2js does not implement
+    // an Iterable that throws on calling length.
+    try {
+      len = other.length;
+    } catch (e) {
+      // Ensure that we try again below. 
+      len = null;
+    }
+    if (len == null) {
+      len = 0;
+      try {
+        var iter = other.iterator;
+        while (iter.moveNext()) {
+          len++;
+        }
+      } catch (e) {
+        rethrow;  // Giving up and throwing to the caller.
+      }
+    }
+    var result;
+    if (growable) {
+      result = new _GrowableObjectArray<E>.withCapacity(len);
+      result.length = len;
+    } else {
+      result = new _ObjectArray<E>(len);
+    }
+    var iter = other.iterator;
+    for (var i = 0; i < len; i++) {
+      iter.moveNext();
+      result[i] = iter.current;
+    }
+    return result;
+  }
+
   // Factory constructing a mutable List from a parser generated List literal.
   // [elements] contains elements that are already type checked.
   factory List._fromLiteral(List elements) {
diff --git a/runtime/lib/growable_array.dart b/runtime/lib/growable_array.dart
index f24da18..1ebe8c2 100644
--- a/runtime/lib/growable_array.dart
+++ b/runtime/lib/growable_array.dart
@@ -128,7 +128,9 @@
   factory _GrowableObjectArray(int length) {
     var data = new _ObjectArray((length == 0) ? 4 : length);
     var result = new _GrowableObjectArray<T>.withData(data);
-    result._setLength(length);
+    if (length > 0) {
+      result._setLength(length);
+    }
     return result;
   }
 
diff --git a/runtime/lib/invocation_mirror_patch.dart b/runtime/lib/invocation_mirror_patch.dart
index 0b438c7..cce75f4 100644
--- a/runtime/lib/invocation_mirror_patch.dart
+++ b/runtime/lib/invocation_mirror_patch.dart
@@ -29,25 +29,28 @@
   final List _arguments;
 
   // External representation of the invocation mirror; populated on demand.
-  String _memberName;
+  Symbol _memberName;
   int _type;
   List _positionalArguments;
-  Map<String, dynamic> _namedArguments;
+  Map<Symbol, dynamic> _namedArguments;
 
   void _setMemberNameAndType() {
     if (_functionName.startsWith("get:")) {
       _type = _GETTER;
-      _memberName = _functionName.substring(4);
+      _memberName =
+          new _collection_dev.Symbol.unvalidated(_functionName.substring(4));
     } else if (_functionName.startsWith("set:")) {
       _type = _SETTER;
-      _memberName = _functionName.substring(4) + "=";
+      _memberName =
+          new _collection_dev.Symbol.unvalidated(
+              _functionName.substring(4) + "=");
     } else {
       _type = _METHOD;
-      _memberName = _functionName;
+      _memberName = new _collection_dev.Symbol.unvalidated(_functionName);
     }
   }
 
-  String get memberName {
+  Symbol get memberName {
     if (_memberName == null) {
       _setMemberNameAndType();
     }
@@ -63,16 +66,17 @@
     return _positionalArguments;
   }
 
-  Map<String, dynamic> get namedArguments {
+  Map<Symbol, dynamic> get namedArguments {
     if (_namedArguments == null) {
-      _namedArguments = new Map<String, dynamic>();
+      _namedArguments = new Map<Symbol, dynamic>();
       int numArguments = _argumentsDescriptor[0] - 1;  // Exclude receiver.
       int numPositionalArguments = _argumentsDescriptor[1] - 1;
       int numNamedArguments = numArguments - numPositionalArguments;
       for (int i = 0; i < numNamedArguments; i++) {
         String arg_name = _argumentsDescriptor[2 + 2*i];
         var arg_value = _arguments[_argumentsDescriptor[3 + 2*i]];
-        _namedArguments[arg_name] = arg_value;
+        _namedArguments[new _collection_dev.Symbol.unvalidated(arg_name)] =
+            arg_value;
       }
     }
     return _namedArguments;
@@ -122,8 +126,11 @@
                  List arguments)
       native "InvocationMirror_invoke";
 
-  invokeOn(Object receiver) {
+  _invokeOn(Object receiver) {
     return _invoke(receiver, _functionName, _argumentsDescriptor, _arguments);
   }
-}
 
+  // TODO(ahe): This is a hack.  See _LocalInstanceMirrorImpl.delegate
+  // in mirrors_impl.dart
+  static final _invokeOnClosure = (x, y) => y._invokeOn(x);
+}
diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc
index c76e5e3..31c1f4e 100644
--- a/runtime/lib/mirrors.cc
+++ b/runtime/lib/mirrors.cc
@@ -5,6 +5,7 @@
 #include "include/dart_api.h"
 #include "include/dart_debugger_api.h"
 #include "platform/json.h"
+#include "vm/dart_api_impl.h"
 #include "vm/bootstrap_natives.h"
 #include "vm/dart_entry.h"
 #include "vm/exceptions.h"
@@ -198,6 +199,22 @@
   return Dart_True();
 }
 
+static Dart_Handle UnpackLocalArgList(Dart_Handle arg_list,
+                                      GrowableArray<Dart_Handle>* arg_array) {
+  intptr_t len = 0;
+  Dart_Handle result = Dart_ListLength(arg_list, &len);
+  if (Dart_IsError(result)) {
+    return result;
+  }
+  for (intptr_t i = 0; i < len; i++) {
+    Dart_Handle arg = Dart_ListGetAt(arg_list, i);
+    if (Dart_IsError(arg)) {
+      return arg;
+    }
+    arg_array->Add(arg);
+  }
+  return Dart_True();
+}
 
 static Dart_Handle CreateLazyMirror(Dart_Handle target);
 
@@ -1057,22 +1074,67 @@
 }
 
 
+void NATIVE_ENTRY_FUNCTION(Mirrors_makeLocalClassMirror)(
+    Dart_NativeArguments args) {
+  Dart_EnterScope();
+  Isolate* isolate = Isolate::Current();
+  Dart_Handle key = Dart_GetNativeArgument(args, 0);
+  if (Dart_IsError(key)) {
+    Dart_PropagateError(key);
+  }
+  const Type& type = Api::UnwrapTypeHandle(isolate, key);
+  const Class& cls = Class::Handle(type.type_class());
+  Dart_Handle cls_handle = Api::NewHandle(isolate, cls.raw());
+  if (Dart_IsError(cls_handle)) {
+    Dart_PropagateError(cls_handle);
+  }
+  Dart_Handle name_handle = Api::NewHandle(isolate, cls.Name());
+  if (Dart_IsError(name_handle)) {
+    Dart_PropagateError(name_handle);
+  }
+  Dart_Handle lib_handle = Api::NewHandle(isolate, cls.library());
+  if (Dart_IsError(lib_handle)) {
+    Dart_PropagateError(lib_handle);
+  }
+  Dart_Handle lib_mirror = CreateLibraryMirror(lib_handle);
+  if (Dart_IsError(lib_mirror)) {
+    Dart_PropagateError(lib_mirror);
+  }
+  Dart_Handle result = CreateClassMirror(cls_handle,
+                                         name_handle,
+                                         lib_handle,
+                                         lib_mirror);
+  if (Dart_IsError(result)) {
+    Dart_PropagateError(result);
+  }
+  Dart_SetReturnValue(args, result);
+  Dart_ExitScope();
+}
+
 void NATIVE_ENTRY_FUNCTION(LocalObjectMirrorImpl_invoke)(
     Dart_NativeArguments args) {
   Dart_EnterScope();
   Dart_Handle mirror = Dart_GetNativeArgument(args, 0);
-  Dart_Handle member = Dart_GetNativeArgument(args, 1);
-  // The wrapped arguments are either simple values or instance mirrors.
-  Dart_Handle wrapped_invoke_args = Dart_GetNativeArgument(args, 2);
+  Dart_Handle member_name = Dart_GetNativeArgument(args, 1);
+  // The arguments are either simple values or instance mirrors.
+  Dart_Handle positional_arguments = Dart_GetNativeArgument(args, 2);
+  Dart_Handle async = Dart_GetNativeArgument(args, 3);
 
   Dart_Handle reflectee = UnwrapMirror(mirror);
+  Dart_Handle result;
   GrowableArray<Dart_Handle> invoke_args;
-  Dart_Handle result = UnwrapArgList(wrapped_invoke_args, &invoke_args);
+  if (Dart_IdentityEquals(async, Dart_True())) {
+    result = UnwrapArgList(positional_arguments, &invoke_args);
+  } else {
+    result = UnpackLocalArgList(positional_arguments, &invoke_args);
+  }
   if (Dart_IsError(result)) {
     Dart_PropagateError(result);
   }
-  result =
-      Dart_Invoke(reflectee, member, invoke_args.length(), invoke_args.data());
+  result = Dart_Invoke(reflectee,
+                       member_name,
+                       invoke_args.length(),
+                       invoke_args.data());
   if (Dart_IsError(result)) {
     // Instead of propagating the error from an invoke directly, we
     // provide reflective access to the error.
@@ -1116,11 +1178,16 @@
   Dart_EnterScope();
   Dart_Handle mirror = Dart_GetNativeArgument(args, 0);
   Dart_Handle fieldName = Dart_GetNativeArgument(args, 1);
-  // The wrapped argument is either a simple value or instance mirror.
-  Dart_Handle wrapped_arg = Dart_GetNativeArgument(args, 2);
+  Dart_Handle value = Dart_GetNativeArgument(args, 2);
+  Dart_Handle async = Dart_GetNativeArgument(args, 3);
 
   Dart_Handle reflectee = UnwrapMirror(mirror);
-  Dart_Handle set_arg = UnwrapArg(wrapped_arg);
+  Dart_Handle set_arg;
+  if (Dart_IdentityEquals(async, Dart_True())) {
+    set_arg = UnwrapArg(value);
+  } else {
+    set_arg = value;
+  }
   if (Dart_IsError(set_arg)) {
     Dart_PropagateError(set_arg);
   }
@@ -1144,12 +1211,18 @@
     Dart_NativeArguments args) {
   Dart_EnterScope();
   Dart_Handle mirror = Dart_GetNativeArgument(args, 0);
-  // The wrapped arguments are either simple values or instance mirrors.
-  Dart_Handle wrapped_invoke_args = Dart_GetNativeArgument(args, 1);
+  // The arguments are either simple values or instance mirrors.
+  Dart_Handle positional_arguments = Dart_GetNativeArgument(args, 1);
+  Dart_Handle async = Dart_GetNativeArgument(args, 2);
 
   Dart_Handle reflectee = UnwrapMirror(mirror);
   GrowableArray<Dart_Handle> invoke_args;
-  Dart_Handle result = UnwrapArgList(wrapped_invoke_args, &invoke_args);
+  Dart_Handle result;
+  if (Dart_IdentityEquals(async, Dart_True())) {
+    result = UnwrapArgList(positional_arguments, &invoke_args);
+  } else {
+    result = UnpackLocalArgList(positional_arguments, &invoke_args);
+  }
   if (Dart_IsError(result)) {
     Dart_PropagateError(result);
   }
@@ -1175,12 +1248,18 @@
   Dart_EnterScope();
   Dart_Handle klass_mirror = Dart_GetNativeArgument(args, 0);
   Dart_Handle constructor_name = Dart_GetNativeArgument(args, 1);
-  // The wrapped arguments are either simple values or instance mirrors.
-  Dart_Handle wrapped_invoke_args = Dart_GetNativeArgument(args, 2);
+  // The arguments are either simple values or instance mirrors.
+  Dart_Handle positional_arguments = Dart_GetNativeArgument(args, 2);
+  Dart_Handle async = Dart_GetNativeArgument(args, 3);
 
   Dart_Handle klass = UnwrapMirror(klass_mirror);
   GrowableArray<Dart_Handle> invoke_args;
-  Dart_Handle result = UnwrapArgList(wrapped_invoke_args, &invoke_args);
+  Dart_Handle result;
+  if (Dart_IdentityEquals(async, Dart_True())) {
+    result = UnwrapArgList(positional_arguments, &invoke_args);
+  } else {
+    result = UnpackLocalArgList(positional_arguments, &invoke_args);
+  }
   if (Dart_IsError(result)) {
     Dart_PropagateError(result);
   }
diff --git a/runtime/lib/mirrors_impl.dart b/runtime/lib/mirrors_impl.dart
index 8aa5abd..4546ab0 100644
--- a/runtime/lib/mirrors_impl.dart
+++ b/runtime/lib/mirrors_impl.dart
@@ -162,6 +162,24 @@
     implements ObjectMirror {
   _LocalObjectMirrorImpl(ref) : super(ref) {}
 
+  InstanceMirror invoke(Symbol memberName,
+                        List positionalArguments,
+                        [Map<Symbol, dynamic> namedArguments]) {
+    if (namedArguments != null) {
+      throw new UnimplementedError(
+          'named argument support is not implemented');
+    }
+    return _invoke(this, _n(memberName), positionalArguments, false); 
+  }
+
+  InstanceMirror getField(Symbol fieldName) {
+    return _getField(this, _n(fieldName)); 
+  }
+
+  InstanceMirror setField(Symbol fieldName, Object arg) {
+    return _setField(this, _n(fieldName), arg, false); 
+  }
+
   Future<InstanceMirror> invokeAsync(Symbol memberName,
                                      List positionalArguments,
                                      [Map<Symbol, dynamic> namedArguments]) {
@@ -177,7 +195,7 @@
     Completer<InstanceMirror> completer = new Completer<InstanceMirror>();
     try {
       completer.complete(
-          _invoke(this, _n(memberName), positionalArguments));
+          _invoke(this, _n(memberName), positionalArguments, true));
     } catch (exception, s) {
       completer.completeError(exception, s);
     }
@@ -199,7 +217,7 @@
 
     Completer<InstanceMirror> completer = new Completer<InstanceMirror>();
     try {
-      completer.complete(_setField(this, _n(fieldName), arg));
+      completer.complete(_setField(this, _n(fieldName), arg, true));
     } catch (exception, s) {
       completer.completeError(exception, s);
     }
@@ -219,13 +237,13 @@
       }
   }
 
-  static _invoke(ref, memberName, positionalArguments)
+  static _invoke(ref, memberName, positionalArguments, async)
       native 'LocalObjectMirrorImpl_invoke';
 
-  static _getField(ref, fieldName)
+  static _getField(ref, fieldName) // same for sync and async versions
       native 'LocalObjectMirrorImpl_getField';
 
-  static _setField(ref, fieldName, value)
+  static _setField(ref, fieldName, value, async)
       native 'LocalObjectMirrorImpl_setField';
 }
 
@@ -280,6 +298,9 @@
 
 class _LocalInstanceMirrorImpl extends _LocalObjectMirrorImpl
     implements InstanceMirror {
+  // TODO(ahe): This is a hack, see delegate below.
+  static Function _invokeOnClosure;
+
   _LocalInstanceMirrorImpl(ref,
                            this._type,
                            this._reflectee) : super(ref) {}
@@ -298,6 +319,21 @@
   var _reflectee;
   get reflectee => _reflectee;
 
+  delegate(Invocation invocation) {
+    if (_invokeOnClosure == null) {
+      // TODO(ahe): This is a total hack.  We're using the mirror
+      // system to access a private field in a different library.  For
+      // some reason, that works.  On the other hand, calling a
+      // private method does not work.
+      _LocalInstanceMirrorImpl mirror =
+          _Mirrors.makeLocalInstanceMirror(invocation);
+      _invokeOnClosure =
+          _LocalObjectMirrorImpl._getField(mirror.type, '_invokeOnClosure')
+          .reflectee;
+    }
+    return _invokeOnClosure(reflectee, invocation);
+  }
+
   String toString() {
     if (_isSimpleValue(_reflectee)) {
       if (_reflectee is String) {
@@ -325,6 +361,15 @@
         'ClosureMirror.source is not implemented');
   }
 
+  InstanceMirror apply(List<Object> positionalArguments,
+                       [Map<Symbol, Object> namedArguments]) {
+    if (namedArguments != null) {
+      throw new UnimplementedError(
+          'named argument support is not implemented');
+    }
+    return _apply(this, positionalArguments, false);
+  }
+
   Future<InstanceMirror> applyAsync(List<Object> positionalArguments,
                                     [Map<Symbol, Object> namedArguments]) {
     if (namedArguments != null) {
@@ -339,7 +384,7 @@
     Completer<InstanceMirror> completer = new Completer<InstanceMirror>();
     try {
       completer.complete(
-          _apply(this, positionalArguments));
+          _apply(this, positionalArguments, true));
     } catch (exception) {
       completer.completeError(exception);
     }
@@ -351,7 +396,7 @@
         'ClosureMirror.findInContext() is not implemented');
   }
 
-  static _apply(ref, positionalArguments)
+  static _apply(ref, positionalArguments, async)
       native 'LocalClosureMirrorImpl_apply';
 }
 
@@ -522,6 +567,19 @@
 
   String toString() => "ClassMirror on '$simpleName'";
 
+  InstanceMirror newInstance(Symbol constructorName,
+                             List positionalArguments,
+                             [Map<Symbol, dynamic> namedArguments]) {
+    if (namedArguments != null) {
+      throw new UnimplementedError(
+          'named argument support is not implemented');
+    }
+    return _invokeConstructor(this,
+                              _n(constructorName),
+                              positionalArguments,
+                              false);
+  }
+
   Future<InstanceMirror> newInstanceAsync(Symbol constructorName,
                                           List positionalArguments,
                                           [Map<Symbol, dynamic> namedArguments]) {
@@ -537,14 +595,17 @@
     Completer<InstanceMirror> completer = new Completer<InstanceMirror>();
     try {
       completer.complete(
-          _invokeConstructor(this, _n(constructorName), positionalArguments));
+          _invokeConstructor(this,
+                             _n(constructorName),
+                             positionalArguments,
+                             true));
     } catch (exception) {
       completer.completeError(exception);
     }
     return completer.future;
   }
 
-  static _invokeConstructor(ref, constructorName, positionalArguments)
+  static _invokeConstructor(ref, constructorName, positionalArguments, async)
       native 'LocalClassMirrorImpl_invokeConstructor';
 }
 
@@ -1004,7 +1065,11 @@
     return makeLocalInstanceMirror(reflectee);
   }
 
-  static ClassMirror reflectClass(Type reflectee) {
-    throw new UnimplementedError('reflectClass is not implemented');
+  // Creates a new local ClassMirror.
+  static ClassMirror makeLocalClassMirror(Type key)
+      native "Mirrors_makeLocalClassMirror";
+
+  static ClassMirror reflectClass(Type key) {
+    return makeLocalClassMirror(key);
   }
 }
diff --git a/runtime/lib/mirrors_patch.dart b/runtime/lib/mirrors_patch.dart
index 1c2e015..5b7539b6 100644
--- a/runtime/lib/mirrors_patch.dart
+++ b/runtime/lib/mirrors_patch.dart
@@ -31,6 +31,16 @@
   return _Mirrors.reflect(reflectee);
 }
 
+/**
+ * Returns a [ClassMirror] for the class represented by a Dart
+ * Type object.
+ *
+ * This only works with objects local to the current isolate.
+ */
+patch ClassMirror reflectClass(Type key) {
+  return _Mirrors.reflectClass(key);
+}
+
 patch class MirrorSystem {
   /* patch */ static String getName(Symbol symbol) {
     return _symbol_dev.Symbol.getName(symbol);
diff --git a/runtime/lib/object_patch.dart b/runtime/lib/object_patch.dart
index 6c14f3e..fba43fb 100644
--- a/runtime/lib/object_patch.dart
+++ b/runtime/lib/object_patch.dart
@@ -35,10 +35,10 @@
 
   /* patch */ noSuchMethod(Invocation invocation) {
     return _noSuchMethod(invocation.isMethod,
-                         invocation.memberName,
+                         _collection_dev.Symbol.getName(invocation.memberName),
                          invocation._type,
                          invocation.positionalArguments,
-                         invocation.namedArguments);
+                         _symbolMapToStringMap(invocation.namedArguments));
   }
 
   /* patch */ Type get runtimeType native "Object_runtimeType";
@@ -54,4 +54,12 @@
   // Call this function instead of inlining 'as', thus collecting type
   // feedback. Returns receiver.
   _as(instantiator, instantiator_type_arguments, type) native "Object_as";
+
+  static _symbolMapToStringMap(Map<Symbol, dynamic> map) {
+    var result = new Map<String, dynamic>();
+    map.forEach((Symbol key, value) {
+      result[_collection_dev.Symbol.getName(key)] = value;
+    });
+    return result;
+  }
 }
diff --git a/runtime/lib/symbol_patch.dart b/runtime/lib/symbol_patch.dart
index 4359019..79cdec7 100644
--- a/runtime/lib/symbol_patch.dart
+++ b/runtime/lib/symbol_patch.dart
@@ -4,42 +4,5 @@
 
 patch class Symbol {
   /* patch */ const Symbol(String name)
-      : this._name = _validate(name);
-
-  static final RegExp _validationPattern =
-      new RegExp(r'^(?:[a-zA-Z$][a-zA-Z$0-9_]*\.)*(?:[a-zA-Z$][a-zA-Z$0-9_]*=?|'
-                 r'-|'
-                 r'unary-|'
-                 r'\[\]=|'
-                 r'~|'
-                 r'==|'
-                 r'\[\]|'
-                 r'\*|'
-                 r'/|'
-                 r'%|'
-                 r'~/|'
-                 r'\+|'
-                 r'<<|'
-                 r'>>|'
-                 r'>=|'
-                 r'>|'
-                 r'<=|'
-                 r'<|'
-                 r'&|'
-                 r'\^|'
-                 r'\|'
-                 r')$');
-
-  static _validate(String name) {
-    if (name is! String) throw new ArgumentError('name must be a String');
-    if (name.isEmpty) return name;
-    if (name.startsWith('_')) {
-      throw new ArgumentError('"$name" is a private identifier');
-    }
-    if (!_validationPattern.hasMatch(name)) {
-      throw new ArgumentError(
-          '"$name" is not an identifier or an empty String');
-    }
-    return name;
-  }
+      : this._name = validate(name);
 }
diff --git a/runtime/lib/typeddata.cc b/runtime/lib/typeddata.cc
index d985975..29e7af3 100644
--- a/runtime/lib/typeddata.cc
+++ b/runtime/lib/typeddata.cc
@@ -285,26 +285,147 @@
 }
 
 
-#define TYPED_DATA_NATIVES(name, getter, setter, object, get_object_value)     \
+#define TYPED_DATA_NATIVES(getter, setter, object, get_object_value)           \
   TYPED_DATA_GETTER(getter, object)                                            \
   TYPED_DATA_SETTER(setter, object, get_object_value)                          \
 
 
-#define TYPED_DATA_UINT64_NATIVES(name, getter, setter, object)                \
+#define TYPED_DATA_UINT64_NATIVES(getter, setter, object)                      \
   TYPED_DATA_UINT64_GETTER(getter, object)                                     \
   TYPED_DATA_UINT64_SETTER(setter, object)                                     \
 
 
-TYPED_DATA_NATIVES(Int8Array, GetInt8, SetInt8, Smi, Value)
-TYPED_DATA_NATIVES(Uint8Array, GetUint8, SetUint8, Smi, Value)
-TYPED_DATA_NATIVES(Int16Array, GetInt16, SetInt16, Smi, Value)
-TYPED_DATA_NATIVES(Uint16Array, GetUint16, SetUint16, Smi, Value)
-TYPED_DATA_NATIVES(Int32Array, GetInt32, SetInt32, Integer, AsInt64Value)
-TYPED_DATA_NATIVES(Uint32Array, GetUint32, SetUint32, Integer, AsInt64Value)
-TYPED_DATA_NATIVES(Int64Array, GetInt64, SetInt64, Integer, AsInt64Value)
-TYPED_DATA_UINT64_NATIVES(Uint64Array, GetUint64, SetUint64, Integer)
-TYPED_DATA_NATIVES(Float32Array, GetFloat32, SetFloat32, Double, value)
-TYPED_DATA_NATIVES(Float64Array, GetFloat64, SetFloat64, Double, value)
-TYPED_DATA_NATIVES(Float32x4Array, GetFloat32x4, SetFloat32x4, Float32x4, value)
+TYPED_DATA_NATIVES(GetInt8, SetInt8, Smi, Value)
+TYPED_DATA_NATIVES(GetUint8, SetUint8, Smi, Value)
+TYPED_DATA_NATIVES(GetInt16, SetInt16, Smi, Value)
+TYPED_DATA_NATIVES(GetUint16, SetUint16, Smi, Value)
+TYPED_DATA_NATIVES(GetInt32, SetInt32, Integer, AsInt64Value)
+TYPED_DATA_NATIVES(GetUint32, SetUint32, Integer, AsInt64Value)
+TYPED_DATA_NATIVES(GetInt64, SetInt64, Integer, AsInt64Value)
+TYPED_DATA_UINT64_NATIVES(GetUint64, SetUint64, Integer)
+TYPED_DATA_NATIVES(GetFloat32, SetFloat32, Double, value)
+TYPED_DATA_NATIVES(GetFloat64, SetFloat64, Double, value)
+TYPED_DATA_NATIVES(GetFloat32x4, SetFloat32x4, Float32x4, value)
+
+
+DEFINE_NATIVE_ENTRY(ByteData_ToEndianInt16, 2) {
+  GET_NON_NULL_NATIVE_ARGUMENT(Smi, host_value, arguments->NativeArgAt(0));
+  GET_NON_NULL_NATIVE_ARGUMENT(Bool, little_endian, arguments->NativeArgAt(1));
+  int16_t value = host_value.Value();
+  if (little_endian.value()) {
+    value = Utils::HostToLittleEndian16(value);
+  } else {
+    value = Utils::HostToBigEndian16(value);
+  }
+  return Smi::New(value);
+}
+
+
+DEFINE_NATIVE_ENTRY(ByteData_ToEndianUint16, 2) {
+  GET_NON_NULL_NATIVE_ARGUMENT(Smi, host_value, arguments->NativeArgAt(0));
+  GET_NON_NULL_NATIVE_ARGUMENT(Bool, little_endian, arguments->NativeArgAt(1));
+  uint16_t value = host_value.Value();
+  if (little_endian.value()) {
+    return Smi::New(Utils::HostToLittleEndian16(value));
+  }
+  return Smi::New(Utils::HostToBigEndian16(value));
+}
+
+
+DEFINE_NATIVE_ENTRY(ByteData_ToEndianInt32, 2) {
+  GET_NON_NULL_NATIVE_ARGUMENT(Integer, host_value, arguments->NativeArgAt(0));
+  GET_NON_NULL_NATIVE_ARGUMENT(Bool, little_endian, arguments->NativeArgAt(1));
+  ASSERT(host_value.AsInt64Value() <= kMaxInt32);
+  int32_t value = host_value.AsInt64Value();
+  if (little_endian.value()) {
+    value = Utils::HostToLittleEndian32(value);
+  } else {
+    value = Utils::HostToBigEndian32(value);
+  }
+  return Integer::New(value);
+}
+
+
+DEFINE_NATIVE_ENTRY(ByteData_ToEndianUint32, 2) {
+  GET_NON_NULL_NATIVE_ARGUMENT(Integer, host_value, arguments->NativeArgAt(0));
+  GET_NON_NULL_NATIVE_ARGUMENT(Bool, little_endian, arguments->NativeArgAt(1));
+  ASSERT(host_value.AsInt64Value() <= kMaxUint32);
+  uint32_t value = host_value.AsInt64Value();
+  if (little_endian.value()) {
+    value = Utils::HostToLittleEndian32(value);
+  } else {
+    value = Utils::HostToBigEndian32(value);
+  }
+  return Integer::New(value);
+}
+
+
+DEFINE_NATIVE_ENTRY(ByteData_ToEndianInt64, 2) {
+  GET_NON_NULL_NATIVE_ARGUMENT(Integer, host_value, arguments->NativeArgAt(0));
+  GET_NON_NULL_NATIVE_ARGUMENT(Bool, little_endian, arguments->NativeArgAt(1));
+  int64_t value = host_value.AsInt64Value();
+  if (little_endian.value()) {
+    value = Utils::HostToLittleEndian64(value);
+  } else {
+    value = Utils::HostToBigEndian64(value);
+  }
+  return Integer::New(value);
+}
+
+
+DEFINE_NATIVE_ENTRY(ByteData_ToEndianUint64, 2) {
+  GET_NON_NULL_NATIVE_ARGUMENT(Integer, host_value, arguments->NativeArgAt(0));
+  GET_NON_NULL_NATIVE_ARGUMENT(Bool, little_endian, arguments->NativeArgAt(1));
+  uint64_t value;
+  if (host_value.IsBigint()) {
+    const Bigint& bigint = Bigint::Cast(host_value);
+    ASSERT(BigintOperations::FitsIntoUint64(bigint));
+    value = BigintOperations::AbsToUint64(bigint);
+  } else {
+    ASSERT(host_value.IsMint() || host_value.IsSmi());
+    value = host_value.AsInt64Value();
+  }
+  if (little_endian.value()) {
+    value = Utils::HostToLittleEndian64(value);
+  } else {
+    value = Utils::HostToBigEndian64(value);
+  }
+  if (value > static_cast<uint64_t>(Mint::kMaxValue)) {
+    return BigintOperations::NewFromUint64(value);
+  } else if (value > static_cast<uint64_t>(Smi::kMaxValue)) {
+    return Mint::New(value);
+  }
+  return Smi::New(value);
+}
+
+
+DEFINE_NATIVE_ENTRY(ByteData_ToEndianFloat32, 2) {
+  GET_NON_NULL_NATIVE_ARGUMENT(Double, host_value, arguments->NativeArgAt(0));
+  GET_NON_NULL_NATIVE_ARGUMENT(Bool, little_endian, arguments->NativeArgAt(1));
+  float value = host_value.value();
+  if (little_endian.value()) {
+    value = bit_cast<float>(
+        Utils::HostToLittleEndian32(bit_cast<uint32_t>(value)));
+  } else {
+    value = bit_cast<float>(
+        Utils::HostToBigEndian32(bit_cast<uint32_t>(value)));
+  }
+  return Double::New(value);
+}
+
+
+DEFINE_NATIVE_ENTRY(ByteData_ToEndianFloat64, 2) {
+  GET_NON_NULL_NATIVE_ARGUMENT(Double, host_value, arguments->NativeArgAt(0));
+  GET_NON_NULL_NATIVE_ARGUMENT(Bool, little_endian, arguments->NativeArgAt(1));
+  double value = host_value.value();
+  if (little_endian.value()) {
+    value = bit_cast<double>(
+        Utils::HostToLittleEndian64(bit_cast<uint64_t>(value)));
+  } else {
+    value = bit_cast<double>(
+        Utils::HostToBigEndian64(bit_cast<uint64_t>(value)));
+  }
+  return Double::New(value);
+}
 
 }  // namespace dart
diff --git a/runtime/lib/typeddata.dart b/runtime/lib/typeddata.dart
index 2cf2873..ddf79f4 100644
--- a/runtime/lib/typeddata.dart
+++ b/runtime/lib/typeddata.dart
@@ -9,10 +9,6 @@
     return new _Int8Array(length);
   }
 
-  /* patch */ factory Int8List.transferable(int length) {
-    return _newTransferable(length);
-  }
-
   /* patch */ factory Int8List.fromList(List<int> elements) {
     var result = new _Int8Array(elements.length);
     for (int i = 0; i < elements.length; i++) {
@@ -25,10 +21,6 @@
                                     [int offsetInBytes = 0, int length]) {
     return new _Int8ArrayView(buffer, offsetInBytes, length);
   }
-
-  static _ExternalInt8Array _newTransferable(int length) {
-    return new _ExternalInt8Array(length);
-  }
 }
 
 
@@ -37,10 +29,6 @@
     return new _Uint8Array(length);
   }
 
-  /* patch */ factory Uint8List.transferable(int length) {
-    return _newTransferable(length);
-  }
-
   /* patch */ factory Uint8List.fromList(List<int> elements) {
     var result = new _Uint8Array(elements.length);
     for (int i = 0; i < elements.length; i++) {
@@ -53,10 +41,6 @@
                                      [int offsetInBytes = 0, int length]) {
     return new _Uint8ArrayView(buffer, offsetInBytes, length);
   }
-
-  static _ExternalUint8Array _newTransferable(int length) {
-    return new _ExternalUint8Array(length);
-  }
 }
 
 
@@ -65,10 +49,6 @@
     return new _Uint8ClampedArray(length);
   }
 
-  /* patch */ factory Uint8ClampedList.transferable(int length) {
-    return _newTransferable(length);
-  }
-
   /* patch */ factory Uint8ClampedList.fromList(List<int> elements) {
     var result = new _Uint8ClampedArray(elements.length);
     for (int i = 0; i < elements.length; i++) {
@@ -82,10 +62,6 @@
                                              int length]) {
     return new _Uint8ClampedArrayView(buffer, offsetInBytes, length);
   }
-
-  static _ExternalUint8ClampedArray _newTransferable(int length) {
-    return new _ExternalUint8ClampedArray(length);
-  }
 }
 
 
@@ -94,10 +70,6 @@
     return new _Int16Array(length);
   }
 
-  /* patch */ factory Int16List.transferable(int length) {
-    return _newTransferable(length);
-  }
-
   /* patch */ factory Int16List.fromList(List<int> elements) {
     var result = new _Int16Array(elements.length);
     for (int i = 0; i < elements.length; i++) {
@@ -110,10 +82,6 @@
                                      [int offsetInBytes = 0, int length]) {
     return new _Int16ArrayView(buffer, offsetInBytes, length);
   }
-
-  static _ExternalInt16Array _newTransferable(int length) {
-    return new _ExternalInt16Array(length);
-  }
 }
 
 
@@ -122,10 +90,6 @@
     return new _Uint16Array(length);
   }
 
-  /* patch */ factory Uint16List.transferable(int length) {
-    return _newTransferable(length);
-  }
-
   /* patch */ factory Uint16List.fromList(List<int> elements) {
     var result = new _Uint16Array(elements.length);
     for (int i = 0; i < elements.length; i++) {
@@ -138,10 +102,6 @@
                                       [int offsetInBytes = 0, int length]) {
     return new _Uint16ArrayView(buffer, offsetInBytes, length);
   }
-
-  static _ExternalUint16Array _newTransferable(int length) {
-    return new _ExternalUint16Array(length);
-  }
 }
 
 
@@ -150,10 +110,6 @@
     return new _Int32Array(length);
   }
 
-  /* patch */ factory Int32List.transferable(int length) {
-    return _newTransferable(length);
-  }
-
   /* patch */ factory Int32List.fromList(List<int> elements) {
     var result = new _Int32Array(elements.length);
     for (int i = 0; i < elements.length; i++) {
@@ -166,10 +122,6 @@
                                      [int offsetInBytes = 0, int length]) {
     return new _Int32ArrayView(buffer, offsetInBytes, length);
   }
-
-  static _ExternalInt32Array _newTransferable(int length) {
-    return new _ExternalInt32Array(length);
-  }
 }
 
 
@@ -178,10 +130,6 @@
     return new _Uint32Array(length);
   }
 
-  /* patch */ factory Uint32List.transferable(int length) {
-    return _newTransferable(length);
-  }
-
   /* patch */ factory Uint32List.fromList(List<int> elements) {
     var result = new _Uint32Array(elements.length);
     for (int i = 0; i < elements.length; i++) {
@@ -194,10 +142,6 @@
                                       [int offsetInBytes = 0, int length]) {
     return new _Uint32ArrayView(buffer, offsetInBytes, length);
   }
-
-  static _ExternalUint32Array _newTransferable(int length) {
-    return new _ExternalUint32Array(length);
-  }
 }
 
 
@@ -206,10 +150,6 @@
     return new _Int64Array(length);
   }
 
-  /* patch */ factory Int64List.transferable(int length) {
-    return _newTransferable(length);
-  }
-
   /* patch */ factory Int64List.fromList(List<int> elements) {
     var result = new _Int64Array(elements.length);
     for (int i = 0; i < elements.length; i++) {
@@ -222,10 +162,6 @@
                                      [int offsetInBytes = 0, int length]) {
     return new _Int64ArrayView(buffer, offsetInBytes, length);
   }
-
-  static _ExternalInt64Array _newTransferable(int length) {
-    return new _ExternalInt64Array(length);
-  }
 }
 
 
@@ -234,10 +170,6 @@
     return new _Uint64Array(length);
   }
 
-  /* patch */ factory Uint64List.transferable(int length) {
-    return _newTransferable(length);
-  }
-
   /* patch */ factory Uint64List.fromList(List<int> elements) {
     var result = new _Uint64Array(elements.length);
     for (int i = 0; i < elements.length; i++) {
@@ -250,10 +182,6 @@
                                       [int offsetInBytes = 0, int length]) {
     return new _Uint64ArrayView(buffer, offsetInBytes, length);
   }
-
-  static _ExternalUint64Array _newTransferable(int length) {
-    return new _ExternalUint64Array(length);
-  }
 }
 
 
@@ -262,10 +190,6 @@
     return new _Float32Array(length);
   }
 
-  /* patch */ factory Float32List.transferable(int length) {
-    return _newTransferable(length);
-  }
-
   /* patch */ factory Float32List.fromList(List<double> elements) {
     var result = new _Float32Array(elements.length);
     for (int i = 0; i < elements.length; i++) {
@@ -278,10 +202,6 @@
                                        [int offsetInBytes = 0, int length]) {
     return new _Float32ArrayView(buffer, offsetInBytes, length);
   }
-
-  static _ExternalFloat32Array _newTransferable(int length) {
-    return new _ExternalFloat32Array(length);
-  }
 }
 
 
@@ -290,10 +210,6 @@
     return new _Float64Array(length);
   }
 
-  /* patch */ factory Float64List.transferable(int length) {
-    return _newTransferable(length);
-  }
-
   /* patch */ factory Float64List.fromList(List<double> elements) {
     var result = new _Float64Array(elements.length);
     for (int i = 0; i < elements.length; i++) {
@@ -306,10 +222,6 @@
                                        [int offsetInBytes = 0, int length]) {
     return new _Float64ArrayView(buffer, offsetInBytes, length);
   }
-
-  static _ExternalFloat64Array _newTransferable(int length) {
-    return new _ExternalFloat64Array(length);
-  }
 }
 
 patch class Float32x4List {
@@ -317,18 +229,10 @@
     return new _Float32x4Array(length);
   }
 
-  /* patch */ factory Float32x4List.transferable(int length) {
-    return _newTransferable(length);
-  }
-
   /* patch */ factory Float32x4List.view(ByteBuffer buffer,
                                          [int offsetInBytes = 0, int length]) {
     return new _Float32x4ArrayView(buffer, offsetInBytes, length);
   }
-
-  static _ExternalFloat32x4Array _newTransferable(int length) {
-    return new _ExternalFloat32x4Array(length);
-  }
 }
 
 
@@ -358,11 +262,6 @@
     return new _ByteDataView(list.buffer, 0, length);
   }
 
-  /* patch */ factory ByteData.transferable(int length) {
-    var list = new _Uint8Array.transferable(length);
-    return new _ByteDataView(list.buffer, 0, length);
-  }
-
   /* patch */ factory ByteData.view(ByteBuffer buffer,
                                     [int offsetInBytes = 0, int length]) {
     if (length == null) {
@@ -2975,127 +2874,235 @@
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    _typeddata._setUint8(_offset + byteOffset,_toUint8( value));
+    _typeddata._setUint8(_offset + byteOffset, _toUint8(value));
   }
 
-  int getInt16(int byteOffset) {
+  int getInt16(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    return _typeddata._getInt16(_offset + byteOffset);
+    var result = _typeddata._getInt16(_offset + byteOffset);
+    if (identical(endian, Endianness.HOST_ENDIAN)) {
+      return result;
+    }
+    return _toEndianInt16(result, endian._littleEndian);
   }
-  void setInt16(int byteOffset, int value) {
+  void setInt16(int byteOffset,
+                int value,
+                [Endianness endian = Endianness.BIG_ENDIAN]) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    _typeddata._setInt16(_offset + byteOffset, _toInt16(value));
+    var set_value = _toInt16(value);
+    if (!identical(endian, Endianness.HOST_ENDIAN)) {
+      set_value = _toEndianInt16(set_value, endian._littleEndian);
+    }
+    _typeddata._setInt16(_offset + byteOffset, set_value);
   }
 
-  int getUint16(int byteOffset) {
+  int getUint16(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    return _typeddata._getUint16(_offset + byteOffset);
+    var result = _typeddata._getUint16(_offset + byteOffset);
+    if (identical(endian, Endianness.HOST_ENDIAN)) {
+      return result;
+    }
+    return _toEndianUint16(result, endian._littleEndian);
   }
-  void setUint16(int byteOffset, int value) {
+  void setUint16(int byteOffset,
+                 int value,
+                 [Endianness endian = Endianness.BIG_ENDIAN]) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    _typeddata._setUint16(_offset + byteOffset, _toUint16(value));
+    var set_value = _toUint16(value);
+    if (!identical(endian, Endianness.HOST_ENDIAN)) {
+      set_value = _toEndianUint16(set_value, endian._littleEndian);
+    }
+    _typeddata._setUint16(_offset + byteOffset, set_value);
   }
 
-  int getInt32(int byteOffset) {
+  int getInt32(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    return _typeddata._getInt32(_offset + byteOffset);
+    var result = _typeddata._getInt32(_offset + byteOffset);
+    if (identical(endian, Endianness.HOST_ENDIAN)) {
+      return result;
+    }
+    return _toEndianInt32(result, endian._littleEndian);
   }
-  void setInt32(int byteOffset, int value) {
+  void setInt32(int byteOffset,
+                int value,
+                [Endianness endian = Endianness.BIG_ENDIAN]) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    _typeddata._setInt32(_offset + byteOffset, _toInt32(value));
+    var set_value = _toInt32(value);
+    if (!identical(endian, Endianness.HOST_ENDIAN)) {
+      set_value = _toEndianInt32(set_value, endian._littleEndian);
+    }
+    _typeddata._setInt32(_offset + byteOffset, set_value);
   }
 
-  int getUint32(int byteOffset) {
+  int getUint32(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    return _typeddata._getUint32(_offset + byteOffset);
+    var result = _typeddata._getUint32(_offset + byteOffset);
+    if (identical(endian, Endianness.HOST_ENDIAN)) {
+      return result;
+    }
+    return _toEndianUint32(result, endian._littleEndian);
   }
-  void setUint32(int byteOffset, int value) {
+  void setUint32(int byteOffset,
+                 int value,
+                 [Endianness endian = Endianness.BIG_ENDIAN]) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    _typeddata._setUint32(_offset + byteOffset, _toUint32(value));
+    var set_value = _toUint32(value);
+    if (!identical(endian, Endianness.HOST_ENDIAN)) {
+      set_value = _toEndianUint32(set_value, endian._littleEndian);
+    }
+    _typeddata._setUint32(_offset + byteOffset, set_value);
   }
 
-  int getInt64(int byteOffset) {
+  int getInt64(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    return _typeddata._getInt64(_offset + byteOffset);
+    var result = _typeddata._getInt64(_offset + byteOffset);
+    if (identical(endian, Endianness.HOST_ENDIAN)) {
+      return result;
+    }
+    return _toEndianInt64(result, endian._littleEndian);
   }
-  void setInt64(int byteOffset, int value) {
+  void setInt64(int byteOffset,
+                int value,
+                [Endianness endian = Endianness.BIG_ENDIAN]) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    _typeddata._setInt64(_offset + byteOffset, _toInt64(value));
+    var set_value = _toInt64(value);
+    if (!identical(endian, Endianness.HOST_ENDIAN)) {
+      set_value = _toEndianInt64(set_value, endian._littleEndian);
+    }
+    _typeddata._setInt64(_offset + byteOffset, set_value);
   }
 
-  int getUint64(int byteOffset) {
+  int getUint64(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    return _typeddata._getUint64(_offset + byteOffset);
+    var result = _typeddata._getUint64(_offset + byteOffset);
+    if (identical(endian, Endianness.HOST_ENDIAN)) {
+      return result;
+    }
+    return _toEndianUint64(result, endian._littleEndian);
   }
-  void setUint64(int byteOffset, int value) {
+  void setUint64(int byteOffset,
+                 int value,
+                 [Endianness endian = Endianness.BIG_ENDIAN]) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    _typeddata._setUint64(_offset + byteOffset, _toUint64(value));
+    var set_value = _toUint64(value);
+    if (!identical(endian, Endianness.HOST_ENDIAN)) {
+      set_value = _toEndianUint64(set_value, endian._littleEndian);
+    }
+    _typeddata._setUint64(_offset + byteOffset, set_value);
   }
 
-  double getFloat32(int byteOffset) {
+  double getFloat32(int byteOffset,
+                    [Endianness endian = Endianness.BIG_ENDIAN]) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    return _typeddata._getFloat32(_offset + byteOffset);
+    var result = _typeddata._getFloat32(_offset + byteOffset);
+    if (identical(endian, Endianness.HOST_ENDIAN)) {
+      return result;
+    }
+    return _toEndianFloat32(result, endian._littleEndian);
   }
-  void setFloat32(int byteOffset, double value) {
+  void setFloat32(int byteOffset,
+                  double value,
+                  [Endianness endian = Endianness.BIG_ENDIAN]) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    _typeddata._setFloat32(_offset + byteOffset, value);
+    var set_value = value;
+    if (!identical(endian, Endianness.HOST_ENDIAN)) {
+      set_value = _toEndianFloat32(set_value, endian._littleEndian);
+    }
+    _typeddata._setFloat32(_offset + byteOffset, set_value);
   }
 
-  double getFloat64(int byteOffset) {
+  double getFloat64(int byteOffset,
+                    [Endianness endian = Endianness.BIG_ENDIAN]) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    return _typeddata._getFloat64(_offset + byteOffset);
+    var result = _typeddata._getFloat64(_offset + byteOffset);
+    if (identical(endian, Endianness.HOST_ENDIAN)) {
+      return result;
+    }
+    return _toEndianFloat64(result, endian._littleEndian);
   }
-  void setFloat64(int byteOffset, double value) {
+  void setFloat64(int byteOffset,
+                  double value,
+                  [Endianness endian = Endianness.BIG_ENDIAN]) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    _typeddata._setFloat64(_offset + byteOffset, value);
+    var set_value = value;
+    if (!identical(endian, Endianness.HOST_ENDIAN)) {
+      set_value = _toEndianFloat64(set_value, endian._littleEndian);
+    }
+    _typeddata._setFloat64(_offset + byteOffset, set_value);
   }
 
-  Float32x4 getFloat32x4(int byteOffset) {
+  Float32x4 getFloat32x4(int byteOffset,
+                         [Endianness endian = Endianness.BIG_ENDIAN]) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
+    // TODO(johnmccutchan) : Need to resolve this for endianity.
     return _typeddata._getFloat32x4(_offset + byteOffset);
   }
-  void setFloat32x4(int byteOffset, Float32x4 value) {
+  void setFloat32x4(int byteOffset,
+                    Float32x4 value,
+                    [Endianness endian = Endianness.BIG_ENDIAN]) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
+    // TODO(johnmccutchan) : Need to resolve this for endianity.
     _typeddata._setFloat32x4(_offset + byteOffset, value);
 
   }
 
+
+  // Internal utility methods.
+
+  static int _toEndianInt16(int host_value, bool little_endian)
+      native "ByteData_ToEndianInt16";
+  static int _toEndianUint16(int host_value, bool little_endian)
+      native "ByteData_ToEndianUint16";
+  static int _toEndianInt32(int host_value, bool little_endian)
+      native "ByteData_ToEndianInt32";
+  static int _toEndianUint32(int host_value, bool little_endian)
+      native "ByteData_ToEndianUint32";
+  static int _toEndianInt64(int host_value, bool little_endian)
+      native "ByteData_ToEndianInt64";
+  static int _toEndianUint64(int host_value, bool little_endian)
+      native "ByteData_ToEndianUint64";
+  static double _toEndianFloat32(double host_value, bool little_endian)
+      native "ByteData_ToEndianFloat32";
+  static double _toEndianFloat64(double host_value, bool little_endian)
+      native "ByteData_ToEndianFloat64";
+
+
   final TypedData _typeddata;
   final int _offset;
   final int length;
diff --git a/runtime/platform/utils.h b/runtime/platform/utils.h
index 89ca3b4..b884671 100644
--- a/runtime/platform/utils.h
+++ b/runtime/platform/utils.h
@@ -170,6 +170,15 @@
            length >= 0 &&
            count <= (length - offset);
   }
+
+  // Utility functions for converting values from host endianess to
+  // big or little endian values.
+  static uint16_t HostToBigEndian16(uint16_t host_value);
+  static uint32_t HostToBigEndian32(uint32_t host_value);
+  static uint64_t HostToBigEndian64(uint64_t host_value);
+  static uint16_t HostToLittleEndian16(uint16_t host_value);
+  static uint32_t HostToLittleEndian32(uint32_t host_value);
+  static uint64_t HostToLittleEndian64(uint64_t host_value);
 };
 
 }  // namespace dart
diff --git a/runtime/platform/utils_android.h b/runtime/platform/utils_android.h
index 23c69c4..b315a9b 100644
--- a/runtime/platform/utils_android.h
+++ b/runtime/platform/utils_android.h
@@ -5,6 +5,8 @@
 #ifndef PLATFORM_UTILS_ANDROID_H_
 #define PLATFORM_UTILS_ANDROID_H_
 
+#include <endian.h>  // NOLINT
+
 namespace dart {
 
 inline int Utils::CountTrailingZeros(uword x) {
@@ -17,6 +19,36 @@
 #endif
 };
 
+
+inline uint16_t Utils::HostToBigEndian16(uint16_t value) {
+  return htobe16(value);
+}
+
+
+inline uint32_t Utils::HostToBigEndian32(uint32_t value) {
+  return htobe32(value);
+}
+
+
+inline uint64_t Utils::HostToBigEndian64(uint64_t value) {
+  return htobe64(value);
+}
+
+
+inline uint16_t Utils::HostToLittleEndian16(uint16_t value) {
+  return htole16(value);
+}
+
+
+inline uint32_t Utils::HostToLittleEndian32(uint32_t value) {
+  return htole32(value);
+}
+
+
+inline uint64_t Utils::HostToLittleEndian64(uint64_t value) {
+  return htole64(value);
+}
+
 }  // namespace dart
 
 #endif  // PLATFORM_UTILS_ANDROID_H_
diff --git a/runtime/platform/utils_linux.h b/runtime/platform/utils_linux.h
index 6cfc32f..14e508e 100644
--- a/runtime/platform/utils_linux.h
+++ b/runtime/platform/utils_linux.h
@@ -5,6 +5,8 @@
 #ifndef PLATFORM_UTILS_LINUX_H_
 #define PLATFORM_UTILS_LINUX_H_
 
+#include <endian.h>  // NOLINT
+
 namespace dart {
 
 inline int Utils::CountTrailingZeros(uword x) {
@@ -17,6 +19,36 @@
 #endif
 };
 
+
+inline uint16_t Utils::HostToBigEndian16(uint16_t value) {
+  return htobe16(value);
+}
+
+
+inline uint32_t Utils::HostToBigEndian32(uint32_t value) {
+  return htobe32(value);
+}
+
+
+inline uint64_t Utils::HostToBigEndian64(uint64_t value) {
+  return htobe64(value);
+}
+
+
+inline uint16_t Utils::HostToLittleEndian16(uint16_t value) {
+  return htole16(value);
+}
+
+
+inline uint32_t Utils::HostToLittleEndian32(uint32_t value) {
+  return htole32(value);
+}
+
+
+inline uint64_t Utils::HostToLittleEndian64(uint64_t value) {
+  return htole64(value);
+}
+
 }  // namespace dart
 
 #endif  // PLATFORM_UTILS_LINUX_H_
diff --git a/runtime/platform/utils_macos.h b/runtime/platform/utils_macos.h
index 6d8a4a5..2ce7aa2 100644
--- a/runtime/platform/utils_macos.h
+++ b/runtime/platform/utils_macos.h
@@ -5,6 +5,8 @@
 #ifndef PLATFORM_UTILS_MACOS_H_
 #define PLATFORM_UTILS_MACOS_H_
 
+#include <libkern/OSByteOrder.h>  // NOLINT
+
 namespace dart {
 
 inline int Utils::CountTrailingZeros(uword x) {
@@ -17,6 +19,36 @@
 #endif
 };
 
+
+inline uint16_t Utils::HostToBigEndian16(uint16_t value) {
+  return OSSwapHostToBigInt16(value);
+}
+
+
+inline uint32_t Utils::HostToBigEndian32(uint32_t value) {
+  return OSSwapHostToBigInt32(value);
+}
+
+
+inline uint64_t Utils::HostToBigEndian64(uint64_t value) {
+  return OSSwapHostToBigInt64(value);
+}
+
+
+inline uint16_t Utils::HostToLittleEndian16(uint16_t value) {
+  return OSSwapHostToLittleInt16(value);
+}
+
+
+inline uint32_t Utils::HostToLittleEndian32(uint32_t value) {
+  return OSSwapHostToLittleInt32(value);
+}
+
+
+inline uint64_t Utils::HostToLittleEndian64(uint64_t value) {
+  return OSSwapHostToLittleInt64(value);
+}
+
 }  // namespace dart
 
 #endif  // PLATFORM_UTILS_MACOS_H_
diff --git a/runtime/platform/utils_win.h b/runtime/platform/utils_win.h
index 9a6e2b1..aeba259 100644
--- a/runtime/platform/utils_win.h
+++ b/runtime/platform/utils_win.h
@@ -6,6 +6,7 @@
 #define PLATFORM_UTILS_WIN_H_
 
 #include <intrin.h>
+#include <stdlib.h>
 
 namespace dart {
 
@@ -21,6 +22,36 @@
   return static_cast<int>(result);
 };
 
+
+inline uint16_t Utils::HostToBigEndian16(uint16_t value) {
+  return _byteswap_ushort(value);
+}
+
+
+inline uint32_t Utils::HostToBigEndian32(uint32_t value) {
+  return _byteswap_ulong(value);
+}
+
+
+inline uint64_t Utils::HostToBigEndian64(uint64_t value) {
+  return _byteswap_uint64(value);
+}
+
+
+inline uint16_t Utils::HostToLittleEndian16(uint16_t value) {
+  return value;
+}
+
+
+inline uint32_t Utils::HostToLittleEndian32(uint32_t value) {
+  return value;
+}
+
+
+inline uint64_t Utils::HostToLittleEndian64(uint64_t value) {
+  return value;
+}
+
 }  // namespace dart
 
 #endif  // PLATFORM_UTILS_WIN_H_
diff --git a/runtime/tests/vm/dart/byte_array_optimized_test.dart b/runtime/tests/vm/dart/byte_array_optimized_test.dart
index 45604fde3..80bba34 100644
--- a/runtime/tests/vm/dart/byte_array_optimized_test.dart
+++ b/runtime/tests/vm/dart/byte_array_optimized_test.dart
@@ -73,7 +73,7 @@
       array[i] = i;
     }
     var copy = array.sublist(0, array.length);
-    Expect.isFalse(copy === array);
+    Expect.isFalse(identical(copy, array));
     Expect.isTrue(copy is Int8List);
     Expect.equals(10, copy.length);
     Expect.listEquals(array, copy);
@@ -144,7 +144,7 @@
       array[i] = i;
     }
     var copy = array.sublist(0, array.length);
-    Expect.isFalse(copy === array);
+    Expect.isFalse(identical(copy, array));
     Expect.isTrue(copy is Uint8List);
     Expect.equals(10, copy.length);
     Expect.listEquals(array, copy);
@@ -228,7 +228,7 @@
       array[i] = i;
     }
     var copy = array.sublist(0, array.length);
-    Expect.isFalse(copy === array);
+    Expect.isFalse(identical(copy, array));
     Expect.isTrue(copy is Int16List);
     Expect.equals(10, copy.length);
     Expect.listEquals(array, copy);
@@ -300,7 +300,7 @@
       array[i] = i;
     }
     var copy = array.sublist(0, array.length);
-    Expect.isFalse(copy === array);
+    Expect.isFalse(identical(copy, array));
     Expect.isTrue(copy is Uint16List);
     Expect.equals(10, copy.length);
     Expect.listEquals(array, copy);
@@ -390,7 +390,7 @@
       array[i] = i;
     }
     var copy = array.sublist(0, array.length);
-    Expect.isFalse(copy === array);
+    Expect.isFalse(identical(copy, array));
     Expect.isTrue(copy is Int32List);
     Expect.equals(10, copy.length);
     Expect.listEquals(array, copy);
@@ -465,7 +465,7 @@
       array[i] = i;
     }
     var copy = array.sublist(0, array.length);
-    Expect.isFalse(copy === array);
+    Expect.isFalse(identical(copy, array));
     Expect.isTrue(copy is Uint32List);
     Expect.equals(10, copy.length);
     Expect.listEquals(array, copy);
@@ -558,7 +558,7 @@
       array[i] = i;
     }
     var copy = array.sublist(0, array.length);
-    Expect.isFalse(copy === array);
+    Expect.isFalse(identical(copy, array));
     Expect.isTrue(copy is Int64List);
     Expect.equals(10, copy.length);
     Expect.listEquals(array, copy);
@@ -634,7 +634,7 @@
       array[i] = i;
     }
     var copy = array.sublist(0, array.length);
-    Expect.isFalse(copy === array);
+    Expect.isFalse(identical(copy, array));
     Expect.isTrue(copy is Uint64List);
     Expect.equals(10, copy.length);
     Expect.listEquals(array, copy);
@@ -695,7 +695,7 @@
       array[i] = i * 1.0;
     }
     var copy = array.sublist(0, array.length);
-    Expect.isFalse(copy === array);
+    Expect.isFalse(identical(copy, array));
     Expect.isTrue(copy is Float32List);
     Expect.equals(10, copy.length);
     Expect.listEquals(array, copy);
@@ -757,7 +757,7 @@
       array[i] = i * 1.0;
     }
     var copy = array.sublist(0, array.length);
-    Expect.isFalse(copy === array);
+    Expect.isFalse(identical(copy, array));
     Expect.isTrue(copy is Float64List);
     Expect.equals(10, copy.length);
     Expect.listEquals(array, copy);
@@ -887,7 +887,7 @@
       view[i] = i;
     }
     var copy = view.sublist(0, view.length);
-    Expect.isFalse(copy === view);
+    Expect.isFalse(identical(copy, view));
     Expect.isTrue(copy is Int8List);
     Expect.equals(10, copy.length);
     Expect.listEquals(view, copy);
@@ -996,7 +996,7 @@
       view[i] = i;
     }
     var copy = view.sublist(0, view.length);
-    Expect.isFalse(copy === view);
+    Expect.isFalse(identical(copy, view));
     Expect.isTrue(copy is Uint8List);
     Expect.equals(10, copy.length);
     Expect.listEquals(view, copy);
@@ -1126,7 +1126,7 @@
       view[i] = i;
     }
     var copy = view.sublist(0, view.length);
-    Expect.isFalse(copy === view);
+    Expect.isFalse(identical(copy, view));
     Expect.isTrue(copy is Int16List);
     Expect.equals(10, copy.length);
     Expect.listEquals(view, copy);
@@ -1239,7 +1239,7 @@
       view[i] = i;
     }
     var copy = view.sublist(0, view.length);
-    Expect.isFalse(copy === view);
+    Expect.isFalse(identical(copy, view));
     Expect.isTrue(copy is Uint16List);
     Expect.equals(10, copy.length);
     Expect.listEquals(view, copy);
@@ -1395,7 +1395,7 @@
       view[i] = i;
     }
     var copy = view.sublist(0, view.length);
-    Expect.isFalse(copy === view);
+    Expect.isFalse(identical(copy, view));
     Expect.isTrue(copy is Int32List);
     Expect.equals(10, copy.length);
     Expect.listEquals(view, copy);
@@ -1520,7 +1520,7 @@
       view[i] = i;
     }
     var copy = view.sublist(0, view.length);
-    Expect.isFalse(copy === view);
+    Expect.isFalse(identical(copy, view));
     Expect.isTrue(copy is Uint32List);
     Expect.equals(10, copy.length);
     Expect.listEquals(view, copy);
@@ -1708,7 +1708,7 @@
       view[i] = i;
     }
     var copy = view.sublist(0, view.length);
-    Expect.isFalse(copy === view);
+    Expect.isFalse(identical(copy, view));
     Expect.isTrue(copy is Int64List);
     Expect.equals(10, copy.length);
     Expect.listEquals(view, copy);
@@ -1866,7 +1866,7 @@
       view[i] = i;
     }
     var copy = view.sublist(0, view.length);
-    Expect.isFalse(copy === view);
+    Expect.isFalse(identical(copy, view));
     Expect.isTrue(copy is Uint64List);
     Expect.equals(10, copy.length);
     Expect.listEquals(view, copy);
@@ -1974,7 +1974,7 @@
       view[i] = i * 1.0;
     }
     var copy = view.sublist(0, view.length);
-    Expect.isFalse(copy === view);
+    Expect.isFalse(identical(copy, view));
     Expect.isTrue(copy is Float32List);
     Expect.equals(10, copy.length);
     Expect.listEquals(view, copy);
@@ -2077,7 +2077,7 @@
       view[i] = i * 1.0;
     }
     var copy = view.sublist(0, view.length);
-    Expect.isFalse(copy === view);
+    Expect.isFalse(identical(copy, view));
     Expect.isTrue(copy is Float64List);
     Expect.equals(10, copy.length);
     Expect.listEquals(view, copy);
diff --git a/runtime/tests/vm/dart/byte_array_test.dart b/runtime/tests/vm/dart/byte_array_test.dart
index 876642a..f57f551 100644
--- a/runtime/tests/vm/dart/byte_array_test.dart
+++ b/runtime/tests/vm/dart/byte_array_test.dart
@@ -71,7 +71,7 @@
       array[i] = i;
     }
     var copy = array.sublist(0, array.length);
-    Expect.isFalse(copy === array);
+    Expect.isFalse(identical(copy, array));
     Expect.isTrue(copy is Int8List);
     Expect.equals(10, copy.length);
     Expect.listEquals(array, copy);
@@ -91,12 +91,8 @@
   static testInt8List() {
     Expect.throws(() { new Int8List(-1); },
                   (e) { return e is ArgumentError; });
-    Expect.throws(() { new Int8List.transferable(-1); },
-                  (e) { return e is ArgumentError; });
     var array = new Int8List(10);
     testInt8ListImpl(array);
-    array = new Int8List.transferable(10);
-    testInt8ListImpl(array);
   }
 
   static testUint8ListImpl(Uint8List array) {
@@ -149,7 +145,7 @@
       array[i] = i;
     }
     var copy = array.sublist(0, array.length);
-    Expect.isFalse(copy === array);
+    Expect.isFalse(identical(copy, array));
     Expect.isTrue(copy is Uint8List);
     Expect.equals(10, copy.length);
     Expect.listEquals(array, copy);
@@ -170,12 +166,8 @@
   static testUint8List() {
     Expect.throws(() { new Uint8List(-1); },
                   (e) { return e is ArgumentError; });
-    Expect.throws(() { new Uint8List.transferable(-1); },
-                  (e) { return e is ArgumentError; });
     var array = new Uint8List(10);
     testUint8ListImpl(array);
-    array = new Uint8List.transferable(10);
-    testUint8ListImpl(array);
   }
 
   static testUint8ClampedListImpl(Uint8ClampedList array) {
@@ -225,7 +217,7 @@
       array[i] = i;
     }
     var copy = array.sublist(0, array.length);
-    Expect.isFalse(copy === array);
+    Expect.isFalse(identical(copy, array));
     Expect.isTrue(copy is Uint8ClampedList);
     Expect.equals(10, copy.length);
     Expect.listEquals(array, copy);
@@ -245,12 +237,8 @@
   static testUint8ClampedList() {
     Expect.throws(() { new Uint8ClampedList(-1); },
                   (e) { return e is ArgumentError; });
-    Expect.throws(() { new Uint8ClampedList.transferable(-1); },
-                  (e) { return e is ArgumentError; });
     var array = new Uint8ClampedList(10);
     testUint8ClampedListImpl(array);
-    array = new Uint8ClampedList.transferable(10);
-    testUint8ClampedListImpl(array);
   }
 
   static testInt16ListImpl(Int16List array) {
@@ -315,7 +303,7 @@
       array[i] = i;
     }
     var copy = array.sublist(0, array.length);
-    Expect.isFalse(copy === array);
+    Expect.isFalse(identical(copy, array));
     Expect.isTrue(copy is Int16List);
     Expect.equals(10, copy.length);
     Expect.listEquals(array, copy);
@@ -336,12 +324,8 @@
   static testInt16List() {
     Expect.throws(() { new Int16List(-1); },
                   (e) { return e is ArgumentError; });
-    Expect.throws(() { new Int16List.transferable(-1); },
-                  (e) { return e is ArgumentError; });
     var array = new Int16List(10);
     testInt16ListImpl(array);
-    array = new Int16List.transferable(10);
-    testInt16ListImpl(array);
   }
 
   static testUint16ListImpl(Uint16List array) {
@@ -394,7 +378,7 @@
       array[i] = i;
     }
     var copy = array.sublist(0, array.length);
-    Expect.isFalse(copy === array);
+    Expect.isFalse(identical(copy, array));
     Expect.isTrue(copy is Uint16List);
     Expect.equals(10, copy.length);
     Expect.listEquals(array, copy);
@@ -415,12 +399,8 @@
   static testUint16List() {
     Expect.throws(() { new Uint16List(-1); },
                   (e) { return e is ArgumentError; });
-    Expect.throws(() { new Uint16List.transferable(-1); },
-                  (e) { return e is ArgumentError; });
     var array = new Uint16List(10);
     testUint16ListImpl(array);
-    array = new Uint16List.transferable(10);
-    testUint16ListImpl(array);
   }
 
   static testInt32ListImpl(Int32List array) {
@@ -491,7 +471,7 @@
       array[i] = i;
     }
     var copy = array.sublist(0, array.length);
-    Expect.isFalse(copy === array);
+    Expect.isFalse(identical(copy, array));
     Expect.isTrue(copy is Int32List);
     Expect.equals(10, copy.length);
     Expect.listEquals(array, copy);
@@ -512,12 +492,8 @@
   static testInt32List() {
     Expect.throws(() { new Int32List(-1); },
                   (e) { return e is ArgumentError; });
-    Expect.throws(() { new Int32List.transferable(-1); },
-                  (e) { return e is ArgumentError; });
     var array = new Int32List(10);
     testInt32ListImpl(array);
-    array = new Int32List.transferable(10);
-    testInt32ListImpl(array);
   }
 
   static testUint32ListImpl(Uint32List array) {
@@ -573,7 +549,7 @@
       array[i] = i;
     }
     var copy = array.sublist(0, array.length);
-    Expect.isFalse(copy === array);
+    Expect.isFalse(identical(copy, array));
     Expect.isTrue(copy is Uint32List);
     Expect.equals(10, copy.length);
     Expect.listEquals(array, copy);
@@ -598,8 +574,6 @@
                   (e) { return e is ArgumentError; });
     var array = new Uint32List(10);
     testUint32ListImpl(array);
-    array = new Uint32List.transferable(10);
-    testUint32ListImpl(array);
 
   }
 
@@ -671,7 +645,7 @@
       array[i] = i;
     }
     var copy = array.sublist(0, array.length);
-    Expect.isFalse(copy === array);
+    Expect.isFalse(identical(copy, array));
     Expect.isTrue(copy is Int64List);
     Expect.equals(10, copy.length);
     Expect.listEquals(array, copy);
@@ -693,12 +667,8 @@
   static testInt64List() {
     Expect.throws(() { new Int64List(-1); },
                   (e) { return e is ArgumentError; });
-    Expect.throws(() { new Int64List.transferable(-1); },
-                  (e) { return e is ArgumentError; });
     var array = new Int64List(10);
     testInt64ListImpl(array);
-    array = new Int64List.transferable(10);
-    testInt64ListImpl(array);
   }
 
   static testUint64ListImpl(Uint64List array) {
@@ -754,7 +724,7 @@
       array[i] = i;
     }
     var copy = array.sublist(0, array.length);
-    Expect.isFalse(copy === array);
+    Expect.isFalse(identical(copy, array));
     Expect.isTrue(copy is Uint64List);
     Expect.equals(10, copy.length);
     Expect.listEquals(array, copy);
@@ -775,12 +745,8 @@
   static testUint64List() {
     Expect.throws(() { new Uint64List(-1); },
                   (e) { return e is ArgumentError; });
-    Expect.throws(() { new Uint64List.transferable(-1); },
-                  (e) { return e is ArgumentError; });
     var array = new Uint64List(10);
     testUint64ListImpl(array);
-    array = new Uint64List.transferable(10);
-    testUint64ListImpl(array);
   }
 
   static testFloat32ListImpl(Float32List array) {
@@ -822,7 +788,7 @@
       array[i] = i * 1.0;
     }
     var copy = array.sublist(0, array.length);
-    Expect.isFalse(copy === array);
+    Expect.isFalse(identical(copy, array));
     Expect.isTrue(copy is Float32List);
     Expect.equals(10, copy.length);
     Expect.listEquals(array, copy);
@@ -844,12 +810,8 @@
   static testFloat32List() {
     Expect.throws(() { new Float32List(-1); },
                   (e) { return e is ArgumentError; });
-    Expect.throws(() { new Float32List.transferable(-1); },
-                  (e) { return e is ArgumentError; });
     var array = new Float32List(10);
     testFloat32ListImpl(array);
-    array = new Float32List.transferable(10);
-    testFloat32ListImpl(array);
   }
 
   static testFloat64ListImpl(Float64List array) {
@@ -891,7 +853,7 @@
       array[i] = i * 1.0;
     }
     var copy = array.sublist(0, array.length);
-    Expect.isFalse(copy === array);
+    Expect.isFalse(identical(copy, array));
     Expect.isTrue(copy is Float64List);
     Expect.equals(10, copy.length);
     Expect.listEquals(array, copy);
@@ -915,8 +877,6 @@
                   (e) { return e is ArgumentError; });
     var array = new Float64List(10);
     testFloat64ListImpl(array);
-    array = new Float64List.transferable(10);
-    testFloat64ListImpl(array);
   }
 
   static testByteList() {
@@ -1031,7 +991,7 @@
     for (int i = 0; i < array.length; ++i) {
       array[i] = 0xFF - i;
     }
-    byte_array.setUint32(0, 0xBF800000);
+    byte_array.setUint32(0, 0xBF800000, Endianness.LITTLE_ENDIAN);
     Expect.equals(0, byte_array.getInt8(0));
     Expect.equals(0, byte_array.getInt8(1));
     Expect.equals(-128, byte_array.getInt8(2));
@@ -1049,18 +1009,22 @@
     Expect.equals(0xF9, byte_array.getUint8(6));
     Expect.equals(0xF8, byte_array.getUint8(7));
     Expect.equals(0, byte_array.getInt16(0));
-    Expect.equals(-16512, byte_array.getInt16(2));
-    Expect.equals(-1285, byte_array.getInt16(4));
-    Expect.equals(-1799, byte_array.getInt16(6));
-    Expect.equals(0x0000, byte_array.getUint16(0));
-    Expect.equals(0xBF80, byte_array.getUint16(2));
-    Expect.equals(0xFAFB, byte_array.getUint16(4));
-    Expect.equals(0xF8F9, byte_array.getUint16(6));
-    Expect.equals(-1082130432, byte_array.getInt32(0));
-    Expect.equals(0xBF800000, byte_array.getUint32(0));
-    Expect.equals(-506097523945897984, byte_array.getInt64(0));
-    Expect.equals(0xF8F9FAFBBF800000, byte_array.getUint64(0));
-    Expect.equals(-1.0, byte_array.getFloat32(0));
+    Expect.equals(-16512, byte_array.getInt16(2, Endianness.LITTLE_ENDIAN));
+    Expect.equals(-1285, byte_array.getInt16(4, Endianness.LITTLE_ENDIAN));
+    Expect.equals(-1799, byte_array.getInt16(6, Endianness.LITTLE_ENDIAN));
+    Expect.equals(0x0000, byte_array.getUint16(0, Endianness.LITTLE_ENDIAN));
+    Expect.equals(0xBF80, byte_array.getUint16(2, Endianness.LITTLE_ENDIAN));
+    Expect.equals(0xFAFB, byte_array.getUint16(4, Endianness.LITTLE_ENDIAN));
+    Expect.equals(0xF8F9, byte_array.getUint16(6, Endianness.LITTLE_ENDIAN));
+    Expect.equals(-1082130432,
+                  byte_array.getInt32(0, Endianness.LITTLE_ENDIAN));
+    Expect.equals(0xBF800000,
+                  byte_array.getUint32(0, Endianness.LITTLE_ENDIAN));
+    Expect.equals(-506097523945897984,
+                  byte_array.getInt64(0, Endianness.LITTLE_ENDIAN));
+    Expect.equals(0xF8F9FAFBBF800000,
+                  byte_array.getUint64(0, Endianness.LITTLE_ENDIAN));
+    Expect.equals(-1.0, byte_array.getFloat32(0, Endianness.LITTLE_ENDIAN));
     // TODO: byte_array.getFloat64(0)
   }
 
@@ -1171,7 +1135,7 @@
       view[i] = i;
     }
     var copy = view.sublist(0, view.length);
-    Expect.isFalse(copy === view);
+    Expect.isFalse(identical(copy, view));
     Expect.isTrue(copy is Int8List);
     Expect.equals(10, copy.length);
     Expect.listEquals(view, copy);
@@ -1188,8 +1152,6 @@
   static testInt8ListView() {
     var array = new Uint8List(12);
     testInt8ListViewImpl(array);
-    array = new Uint8List.transferable(12);
-    testInt8ListViewImpl(array);
   }
 
   static testUint8ListViewImpl(var array) {
@@ -1282,7 +1244,7 @@
       view[i] = i;
     }
     var copy = view.sublist(0, view.length);
-    Expect.isFalse(copy === view);
+    Expect.isFalse(identical(copy, view));
     Expect.isTrue(copy is Uint8List);
     Expect.equals(10, copy.length);
     Expect.listEquals(view, copy);
@@ -1298,8 +1260,6 @@
   static testUint8ListView() {
     var array = new Int8List(12);
     testUint8ListViewImpl(array);
-    array = new Int8List.transferable(12);
-    testUint8ListViewImpl(array);
   }
 
   static testInt16ListViewImpl(var array) {
@@ -1414,7 +1374,7 @@
       view[i] = i;
     }
     var copy = view.sublist(0, view.length);
-    Expect.isFalse(copy === view);
+    Expect.isFalse(identical(copy, view));
     Expect.isTrue(copy is Int16List);
     Expect.equals(10, copy.length);
     Expect.listEquals(view, copy);
@@ -1434,8 +1394,6 @@
   static testInt16ListView() {
     var array = new Uint8List(24);
     testInt16ListViewImpl(array);
-    array = new Uint8List.transferable(24);
-    testInt16ListViewImpl(array);
   }
 
   static testUint16ListViewImpl(var array) {
@@ -1529,7 +1487,7 @@
       view[i] = i;
     }
     var copy = view.sublist(0, view.length);
-    Expect.isFalse(copy === view);
+    Expect.isFalse(identical(copy, view));
     Expect.isTrue(copy is Uint16List);
     Expect.equals(10, copy.length);
     Expect.listEquals(view, copy);
@@ -1549,8 +1507,6 @@
   static testUint16ListView() {
     var array = new Int8List(24);
     testUint16ListViewImpl(array);
-    array = new Int8List.transferable(24);
-    testUint16ListViewImpl(array);
   }
 
   static testInt32ListView() {
@@ -1687,7 +1643,7 @@
       view[i] = i;
     }
     var copy = view.sublist(0, view.length);
-    Expect.isFalse(copy === view);
+    Expect.isFalse(identical(copy, view));
     Expect.isTrue(copy is Int32List);
     Expect.equals(10, copy.length);
     Expect.listEquals(view, copy);
@@ -1812,7 +1768,7 @@
       view[i] = i;
     }
     var copy = view.sublist(0, view.length);
-    Expect.isFalse(copy === view);
+    Expect.isFalse(identical(copy, view));
     Expect.isTrue(copy is Uint32List);
     Expect.equals(10, copy.length);
     Expect.listEquals(view, copy);
@@ -1835,8 +1791,6 @@
   static testUint32ListView() {
     var array = new Int8List(48);
     testUint32ListViewImpl(array);
-    array = new Int8List.transferable(48);
-    testUint32ListViewImpl(array);
   }
 
   static testInt64ListViewImpl(var array) {
@@ -2002,7 +1956,7 @@
       view[i] = i;
     }
     var copy = view.sublist(0, view.length);
-    Expect.isFalse(copy === view);
+    Expect.isFalse(identical(copy, view));
     Expect.isTrue(copy is Int64List);
     Expect.equals(10, copy.length);
     Expect.listEquals(view, copy);
@@ -2032,8 +1986,6 @@
   static testInt64ListView() {
     var array = new Uint8List(96);
     testInt64ListViewImpl(array);
-    array = new Uint8List.transferable(96);
-    testInt64ListViewImpl(array);
   }
 
   static testUint64ListViewImpl(var array) {
@@ -2162,7 +2114,7 @@
       view[i] = i;
     }
     var copy = view.sublist(0, view.length);
-    Expect.isFalse(copy === view);
+    Expect.isFalse(identical(copy, view));
     Expect.isTrue(copy is Uint64List);
     Expect.equals(10, copy.length);
     Expect.listEquals(view, copy);
@@ -2191,8 +2143,6 @@
   static testUint64ListView() {
     var array = new Int8List(96);
     testUint64ListViewImpl(array);
-    array = new Int8List.transferable(96);
-    testUint64ListViewImpl(array);
   }
 
   static testFloat32ListViewImpl(var array) {
@@ -2272,7 +2222,7 @@
       view[i] = i * 1.0;
     }
     var copy = view.sublist(0, view.length);
-    Expect.isFalse(copy === view);
+    Expect.isFalse(identical(copy, view));
     Expect.isTrue(copy is Float32List);
     Expect.equals(10, copy.length);
     Expect.listEquals(view, copy);
@@ -2296,8 +2246,6 @@
   static testFloat32ListView() {
     var array = new Uint32List(12);
     testFloat32ListViewImpl(array);
-    array = new Uint32List.transferable(12);
-    testFloat32ListViewImpl(array);
   }
 
   static testFloat64ListViewImpl(var array) {
@@ -2377,7 +2325,7 @@
       view[i] = i * 1.0;
     }
     var copy = view.sublist(0, view.length);
-    Expect.isFalse(copy === view);
+    Expect.isFalse(identical(copy, view));
     Expect.isTrue(copy is Float64List);
     Expect.equals(10, copy.length);
     Expect.listEquals(view, copy);
@@ -2401,8 +2349,6 @@
   static testFloat64ListView() {
     var array = new Uint64List(12);
     testFloat64ListViewImpl(array);
-    array = new Uint64List.transferable(12);
-    testFloat64ListViewImpl(array);
   }
 
   static testMain() {
diff --git a/runtime/tests/vm/vm.status b/runtime/tests/vm/vm.status
index 8d62b96..40077cf 100644
--- a/runtime/tests/vm/vm.status
+++ b/runtime/tests/vm/vm.status
@@ -61,6 +61,7 @@
 [ $arch == simarm ]
 # Tests missing code generation support.
 cc/Dart2JSCompileAll: Skip
+cc/CorelibCompileAll: Skip
 # Tests needing Dart execution.
 dart/*: Skip
 
@@ -68,7 +69,8 @@
 *: Skip
 
 [ $arch == simmips ]
-# Tests needing an assembler.
+# Tests missing code generation support.
+cc/CorelibCompileAll: Skip
 cc/Dart2JSCompileAll: Skip
 # Tests needing Dart execution.
 dart/*: Skip
diff --git a/runtime/vm/assembler_arm.cc b/runtime/vm/assembler_arm.cc
index 3c6f644..f003889 100644
--- a/runtime/vm/assembler_arm.cc
+++ b/runtime/vm/assembler_arm.cc
@@ -1261,8 +1261,16 @@
 }
 
 
+void Assembler::LoadPoolPointer() {
+  const intptr_t object_pool_pc_dist =
+     Instructions::HeaderSize() - Instructions::object_pool_offset() +
+     CodeSize() + Instr::kPCReadOffset;
+  LoadFromOffset(kLoadWord, PP, PC, -object_pool_pc_dist);
+}
+
+
 void Assembler::LoadObject(Register rd, const Object& object) {
-  // Smi's and VM heap objects are never relocated; do not use object pool.
+  // Smis and VM heap objects are never relocated; do not use object pool.
   if (object.IsSmi()) {
     LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw()));
   } else if (object.InVMHeap()) {
@@ -1972,10 +1980,7 @@
   }
 
   // Setup pool pointer for this dart function.
-  const intptr_t object_pool_pc_dist =
-     Instructions::HeaderSize() - Instructions::object_pool_offset() +
-     CodeSize() + Instr::kPCReadOffset;
-  ldr(PP, Address(PC, -object_pool_pc_dist));
+  LoadPoolPointer();
 
   // Reserve space for locals.
   AddImmediate(SP, -frame_size);
@@ -2000,10 +2005,7 @@
   EnterFrame(regs, 0);
   if (uses_pp) {
     // Setup pool pointer for this stub.
-    const intptr_t object_pool_pc_dist =
-       Instructions::HeaderSize() - Instructions::object_pool_offset() +
-       CodeSize() + Instr::kPCReadOffset;
-    ldr(PP, Address(PC, -object_pool_pc_dist));
+    LoadPoolPointer();
   }
 }
 
diff --git a/runtime/vm/assembler_arm.h b/runtime/vm/assembler_arm.h
index 724652b..7875246 100644
--- a/runtime/vm/assembler_arm.h
+++ b/runtime/vm/assembler_arm.h
@@ -550,6 +550,8 @@
 
   void Drop(intptr_t stack_elements);
 
+  void LoadPoolPointer();
+
   void LoadObject(Register rd, const Object& object);
   void PushObject(const Object& object);
   void CompareObject(Register rn, const Object& object);
diff --git a/runtime/vm/assembler_mips.cc b/runtime/vm/assembler_mips.cc
index 8f21b6d..e716dd5 100644
--- a/runtime/vm/assembler_mips.cc
+++ b/runtime/vm/assembler_mips.cc
@@ -157,7 +157,7 @@
 
 
 void Assembler::LoadObject(Register rd, const Object& object) {
-  // Smi's and VM heap objects are never relocated; do not use object pool.
+  // Smis and VM heap objects are never relocated; do not use object pool.
   if (object.IsSmi()) {
     LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw()));
   } else if (object.InVMHeap()) {
@@ -208,6 +208,88 @@
 }
 
 
+// Preserves object and value registers.
+void Assembler::StoreIntoObjectFilterNoSmi(Register object,
+                                           Register value,
+                                           Label* no_update) {
+  COMPILE_ASSERT((kNewObjectAlignmentOffset == kWordSize) &&
+                 (kOldObjectAlignmentOffset == 0), young_alignment);
+
+  // Write-barrier triggers if the value is in the new space (has bit set) and
+  // the object is in the old space (has bit cleared).
+  // To check that, we compute value & ~object and skip the write barrier
+  // if the bit is not set. We can't destroy the object.
+  nor(TMP1, ZR, object);
+  and_(TMP1, value, TMP1);
+  andi(TMP1, TMP1, Immediate(kNewObjectAlignmentOffset));
+  beq(TMP1, ZR, no_update);
+}
+
+
+// Preserves object and value registers.
+void Assembler::StoreIntoObjectFilter(Register object,
+                                      Register value,
+                                      Label* no_update) {
+  // For the value we are only interested in the new/old bit and the tag bit.
+  // And the new bit with the tag bit. The resulting bit will be 0 for a Smi.
+  sll(TMP1, value, kObjectAlignmentLog2 - 1);
+  and_(TMP1, value, TMP1);
+  // And the result with the negated space bit of the object.
+  nor(TMP2, ZR, object);
+  and_(TMP1, TMP1, TMP2);
+  andi(TMP1, TMP1, Immediate(kNewObjectAlignmentOffset));
+  beq(TMP1, ZR, no_update);
+}
+
+
+void Assembler::StoreIntoObject(Register object,
+                                const Address& dest,
+                                Register value,
+                                bool can_value_be_smi) {
+  ASSERT(object != value);
+  sw(value, dest);
+  Label done;
+  if (can_value_be_smi) {
+    StoreIntoObjectFilter(object, value, &done);
+  } else {
+    StoreIntoObjectFilterNoSmi(object, value, &done);
+  }
+  // A store buffer update is required.
+  if (value != T0) Push(T0);  // Preserve T0.
+  if (object != T0) {
+    mov(T0, object);
+  }
+  BranchLink(&StubCode::UpdateStoreBufferLabel());
+  if (value != T0) Pop(T0);  // Restore T0.
+  Bind(&done);
+}
+
+
+void Assembler::StoreIntoObjectNoBarrier(Register object,
+                                         const Address& dest,
+                                         Register value) {
+  sw(value, dest);
+#if defined(DEBUG)
+  Label done;
+  StoreIntoObjectFilter(object, value, &done);
+  Stop("Store buffer update is required");
+  Bind(&done);
+#endif  // defined(DEBUG)
+  // No store buffer update.
+}
+
+
+void Assembler::StoreIntoObjectNoBarrier(Register object,
+                                         const Address& dest,
+                                         const Object& value) {
+  ASSERT(value.IsSmi() || value.InVMHeap() ||
+         (value.IsOld() && value.IsNotTemporaryScopedHandle()));
+  // No store buffer update.
+  LoadObject(TMP1, value);
+  sw(TMP1, dest);
+}
+
+
 void Assembler::LoadClassId(Register result, Register object) {
   ASSERT(RawObject::kClassIdTagBit == 16);
   ASSERT(RawObject::kClassIdTagSize == 16);
@@ -360,6 +442,79 @@
 }
 
 
+void Assembler::EnterCallRuntimeFrame(intptr_t frame_space) {
+  const intptr_t kPushedRegistersSize =
+      kDartVolatileCpuRegCount * kWordSize +
+      2 * kWordSize +  // FP and RA.
+      kDartVolatileFpuRegCount * kWordSize;
+
+  if (prologue_offset_ == -1) {
+    prologue_offset_ = CodeSize();
+  }
+
+  // Save volatile CPU and FPU registers on the stack:
+  // -------------
+  // FPU Registers
+  // CPU Registers
+  // RA
+  // FP
+  // -------------
+  // TODO(zra): It may be a problem for walking the stack that FP is below
+  //            the saved registers. If it turns out to be a problem in the
+  //            future, try pushing RA and FP before the volatile registers.
+  addiu(SP, SP, Immediate(-kPushedRegistersSize));
+  for (int i = kDartFirstVolatileFpuReg; i <= kDartLastVolatileFpuReg; i++) {
+    // These go above the volatile CPU registers.
+    const int slot =
+        (i - kDartFirstVolatileFpuReg) + kDartVolatileCpuRegCount + 2;
+    FRegister reg = static_cast<FRegister>(i);
+    swc1(reg, Address(SP, slot * kWordSize));
+  }
+  for (int i = kDartFirstVolatileCpuReg; i <= kDartLastVolatileCpuReg; i++) {
+    // + 2 because FP goes in slot 0.
+    const int slot = (i - kDartFirstVolatileCpuReg) + 2;
+    Register reg = static_cast<Register>(i);
+    sw(reg, Address(SP, slot * kWordSize));
+  }
+  sw(RA, Address(SP, 1 * kWordSize));
+  sw(FP, Address(SP, 0 * kWordSize));
+  mov(FP, SP);
+
+  ReserveAlignedFrameSpace(frame_space);
+}
+
+
+void Assembler::LeaveCallRuntimeFrame() {
+  const intptr_t kPushedRegistersSize =
+      kDartVolatileCpuRegCount * kWordSize +
+      2 * kWordSize +  // FP and RA.
+      kDartVolatileFpuRegCount * kWordSize;
+
+  // SP might have been modified to reserve space for arguments
+  // and ensure proper alignment of the stack frame.
+  // We need to restore it before restoring registers.
+  mov(SP, FP);
+
+  // Restore volatile CPU and FPU registers from the stack.
+  lw(FP, Address(SP, 0 * kWordSize));
+  lw(RA, Address(SP, 1 * kWordSize));
+  for (int i = kDartFirstVolatileCpuReg; i <= kDartLastVolatileCpuReg; i++) {
+    // + 2 because FP goes in slot 0.
+    const int slot = (i - kDartFirstVolatileCpuReg) + 2;
+    Register reg = static_cast<Register>(i);
+    lw(reg, Address(SP, slot * kWordSize));
+  }
+  for (int i = kDartFirstVolatileFpuReg; i <= kDartLastVolatileFpuReg; i++) {
+    // These go above the volatile CPU registers.
+    const int slot =
+        (i - kDartFirstVolatileFpuReg) + kDartVolatileCpuRegCount + 2;
+    FRegister reg = static_cast<FRegister>(i);
+    lwc1(reg, Address(SP, slot * kWordSize));
+  }
+  addiu(SP, SP, Immediate(kPushedRegistersSize));
+}
+
+
 int32_t Assembler::AddExternalLabel(const ExternalLabel* label) {
   if (object_pool_.IsNull()) {
     // The object pool cannot be used in the vm isolate.
diff --git a/runtime/vm/assembler_mips.h b/runtime/vm/assembler_mips.h
index 770eecd..0eca796 100644
--- a/runtime/vm/assembler_mips.h
+++ b/runtime/vm/assembler_mips.h
@@ -789,6 +789,12 @@
 
   void ReserveAlignedFrameSpace(intptr_t frame_space);
 
+  // Create a frame for calling into runtime that preserves all volatile
+  // registers.  Frame's SP is guaranteed to be correctly aligned and
+  // frame_space bytes are reserved under it.
+  void EnterCallRuntimeFrame(intptr_t frame_space);
+  void LeaveCallRuntimeFrame();
+
   void LoadWordFromPoolOffset(Register rd, int32_t offset);
   void LoadObject(Register rd, const Object& object);
   void PushObject(const Object& object);
@@ -801,6 +807,18 @@
   void LoadClassById(Register result, Register class_id);
   void LoadClass(Register result, Register object);
 
+  void StoreIntoObject(Register object,  // Object we are storing into.
+                       const Address& dest,  // Where we are storing into.
+                       Register value,  // Value we are storing.
+                       bool can_value_be_smi = true);
+
+  void StoreIntoObjectNoBarrier(Register object,
+                                const Address& dest,
+                                Register value);
+  void StoreIntoObjectNoBarrier(Register object,
+                                const Address& dest,
+                                const Object& value);
+
   void CallRuntime(const RuntimeEntry& entry);
 
   // Set up a Dart frame on entry with a frame pointer and PC information to
@@ -956,6 +974,13 @@
     delay_slot_available_ = true;
   }
 
+  void StoreIntoObjectFilter(Register object, Register value, Label* no_update);
+
+  // Shorter filtering sequence that assumes that value is not a smi.
+  void StoreIntoObjectFilterNoSmi(Register object,
+                                  Register value,
+                                  Label* no_update);
+
   DISALLOW_ALLOCATION();
   DISALLOW_COPY_AND_ASSIGN(Assembler);
 };
diff --git a/runtime/vm/assembler_mips_test.cc b/runtime/vm/assembler_mips_test.cc
index f5ff667..be5c939 100644
--- a/runtime/vm/assembler_mips_test.cc
+++ b/runtime/vm/assembler_mips_test.cc
@@ -1326,6 +1326,27 @@
   EXPECT_EQ(isfinite(res), false);
 }
 
+
+// Called from assembler_test.cc.
+// RA: return address.
+// A0: context.
+// A1: value.
+// A2: growable array.
+ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) {
+  __ addiu(SP, SP, Immediate(-2 * kWordSize));
+  __ sw(CTX, Address(SP, 1 * kWordSize));
+  __ sw(RA, Address(SP, 0 * kWordSize));
+
+  __ mov(CTX, A0);
+  __ StoreIntoObject(A2,
+                     FieldAddress(A2, GrowableObjectArray::data_offset()),
+                     A1);
+  __ lw(RA, Address(SP, 0 * kWordSize));
+  __ lw(CTX, Address(SP, 1 * kWordSize));
+  __ addiu(SP, SP, Immediate(2 * kWordSize));
+  __ Ret();
+}
+
 }  // namespace dart
 
 #endif  // defined TARGET_ARCH_MIPS
diff --git a/runtime/vm/assembler_test.cc b/runtime/vm/assembler_test.cc
index 2e026d5..693498f 100644
--- a/runtime/vm/assembler_test.cc
+++ b/runtime/vm/assembler_test.cc
@@ -11,10 +11,6 @@
 
 namespace dart {
 
-#if defined(TARGET_ARCH_IA32) ||                                               \
-    defined(TARGET_ARCH_X64) ||                                                \
-    defined(TARGET_ARCH_ARM)
-
 ASSEMBLER_TEST_EXTERN(StoreIntoObject);
 
 ASSEMBLER_TEST_RUN(StoreIntoObject, test) {
@@ -83,6 +79,4 @@
       reinterpret_cast<uword>(grow_new_array.raw())));
 }
 
-#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM
-
 }  // namespace dart
diff --git a/runtime/vm/benchmark_test.cc b/runtime/vm/benchmark_test.cc
index 84c8c88..ef35ba4 100644
--- a/runtime/vm/benchmark_test.cc
+++ b/runtime/vm/benchmark_test.cc
@@ -28,10 +28,6 @@
 }
 
 
-// Compiler only implemented on IA32 and X64 now.
-#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
-
-
 //
 // Measure compile of all functions in dart core lib classes.
 //
@@ -50,8 +46,6 @@
   benchmark->set_score(elapsed_time);
 }
 
-#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64
-
 
 //
 // Measure creation of core isolate from a snapshot.
diff --git a/runtime/vm/bootstrap_natives.h b/runtime/vm/bootstrap_natives.h
index 4dbc3e8..fe45457 100644
--- a/runtime/vm/bootstrap_natives.h
+++ b/runtime/vm/bootstrap_natives.h
@@ -161,6 +161,14 @@
   V(TypedData_SetFloat64, 3)                                                   \
   V(TypedData_GetFloat32x4, 2)                                                 \
   V(TypedData_SetFloat32x4, 3)                                                 \
+  V(ByteData_ToEndianInt16, 2)                                                 \
+  V(ByteData_ToEndianUint16, 2)                                                \
+  V(ByteData_ToEndianInt32, 2)                                                 \
+  V(ByteData_ToEndianUint32, 2)                                                \
+  V(ByteData_ToEndianInt64, 2)                                                 \
+  V(ByteData_ToEndianUint64, 2)                                                \
+  V(ByteData_ToEndianFloat32, 2)                                               \
+  V(ByteData_ToEndianFloat64, 2)                                               \
   V(Float32x4_fromDoubles, 5)                                                  \
   V(Float32x4_zero, 1)                                                         \
   V(Float32x4_add, 2)                                                          \
@@ -223,12 +231,13 @@
   V(isolate_spawnUri, 1)                                                       \
   V(Mirrors_isLocalPort, 1)                                                    \
   V(Mirrors_makeLocalInstanceMirror, 1)                                        \
+  V(Mirrors_makeLocalClassMirror, 1)                                        \
   V(Mirrors_makeLocalMirrorSystem, 0)                                          \
-  V(LocalObjectMirrorImpl_invoke, 3)                                           \
+  V(LocalObjectMirrorImpl_invoke, 4)                                           \
   V(LocalObjectMirrorImpl_getField, 2)                                         \
-  V(LocalObjectMirrorImpl_setField, 3)                                         \
-  V(LocalClosureMirrorImpl_apply, 2)                                           \
-  V(LocalClassMirrorImpl_invokeConstructor, 3)                                 \
+  V(LocalObjectMirrorImpl_setField, 4)                                         \
+  V(LocalClosureMirrorImpl_apply, 3)                                           \
+  V(LocalClassMirrorImpl_invokeConstructor, 4)                                 \
   V(GrowableObjectArray_allocate, 2)                                           \
   V(GrowableObjectArray_getIndexed, 2)                                         \
   V(GrowableObjectArray_setIndexed, 3)                                         \
diff --git a/runtime/vm/class_finalizer.cc b/runtime/vm/class_finalizer.cc
index 2c8f1c1..283a09b 100644
--- a/runtime/vm/class_finalizer.cc
+++ b/runtime/vm/class_finalizer.cc
@@ -38,8 +38,10 @@
     const GrowableArray<intptr_t>& added_subclasses_to_cids) {
   ASSERT(FLAG_use_cha);
   if (added_subclasses_to_cids.is_empty()) return;
-  // TODO(regis): Reenable this code for arm and mips when possible.
-#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
+  // TODO(regis): Reenable this code for mips when possible.
+#if defined(TARGET_ARCH_IA32) ||                                               \
+    defined(TARGET_ARCH_X64) ||                                                \
+    defined(TARGET_ARCH_ARM)
   // Deoptimize all live frames.
   DeoptimizeIfOwner(added_subclasses_to_cids);
   // Switch all functions' code to unoptimized.
diff --git a/runtime/vm/code_generator_test.cc b/runtime/vm/code_generator_test.cc
index 0f23d54..86b5ff9 100644
--- a/runtime/vm/code_generator_test.cc
+++ b/runtime/vm/code_generator_test.cc
@@ -43,7 +43,9 @@
 CODEGEN_TEST2_RUN(SimpleStaticCallCodegen, SmiReturnCodegen, Smi::New(3))
 
 
-#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
+#if defined(TARGET_ARCH_IA32) ||                                               \
+    defined(TARGET_ARCH_X64) ||                                                \
+    defined(TARGET_ARCH_ARM)
 
 
 // Helper to allocate and return a LocalVariable.
@@ -561,6 +563,6 @@
   EXPECT_EQ(cls.raw(), result.clazz());
 }
 
-#endif  // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
+#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM
 
 }  // namespace dart
diff --git a/runtime/vm/constants_arm.h b/runtime/vm/constants_arm.h
index 75edcfd..2ad1903 100644
--- a/runtime/vm/constants_arm.h
+++ b/runtime/vm/constants_arm.h
@@ -143,10 +143,13 @@
 const Register SPREG = SP;  // Stack pointer register.
 const Register FPREG = FP;  // Frame pointer register.
 
-
 // Exception object is passed in this register to the catch handlers when an
 // exception is thrown.
-const Register kExceptionObjectReg = R0;  // Unimplemented.
+const Register kExceptionObjectReg = R0;
+
+// Stack trace object is passed in this register to the catch handlers when
+// an exception is thrown.
+const Register kStackTraceObjectReg = R1;
 
 
 // List of registers used in load/store multiple.
diff --git a/runtime/vm/constants_mips.h b/runtime/vm/constants_mips.h
index 78866cf..198ab77 100644
--- a/runtime/vm/constants_mips.h
+++ b/runtime/vm/constants_mips.h
@@ -150,6 +150,15 @@
 // CMPRES is used for the result of the comparison.
 const Register CMPRES = T8;
 
+// Exception object is passed in this register to the catch handlers when an
+// exception is thrown.
+const Register kExceptionObjectReg = A0;
+
+// Stack trace object is passed in this register to the catch handlers when
+// an exception is thrown.
+const Register kStackTraceObjectReg = A1;
+
+
 typedef uint32_t RegList;
 const RegList kAllCpuRegistersList = 0xFFFFFFFF;
 
@@ -161,12 +170,24 @@
     (1 << S4) | (1 << S5) | (1 << S6) | (1 << S7);
 const int kAbiPreservedCpuRegCount = 8;
 
-
 // FPU registers 20 - 31 are preserved across calls.
 const FRegister kAbiFirstPreservedFpuReg = F20;
 const FRegister kAbiLastPreservedFpuReg =
     static_cast<FRegister>(kNumberOfFRegisters - 1);
 
+// CPU registers available to Dart allocator.
+const RegList kDartAvailableCpuRegs =
+    (1 << R2) | (1 << R3) | (1 << R4) | (1 << R5) |
+    (1 << R6) | (1 << R7) | (1 << R8) | (1 << R9) |
+    (1 << R10) | (1 << R11) | (1 << R12) | (1 << R13) |
+    (1 << R14) | (1 << R15) | (1 << R16) | (1 << R17) |
+    (1 << R18) | (1 << R19) | (1 << R20) | (1 << R21);
+const RegList kDartVolatileCpuRegs =
+    kDartAvailableCpuRegs & ~kAbiPreservedCpuRegs;
+const int kDartVolatileCpuRegCount = 14;
+const Register kDartFirstVolatileCpuReg = R2;
+const Register kDartLastVolatileCpuReg = R15;
+
 // FPU registers 0 - 19 are not preserved across calls.
 const FRegister kDartFirstVolatileFpuReg = F0;
 const FRegister kDartLastVolatileFpuReg = F19;
diff --git a/runtime/vm/custom_isolate_test.cc b/runtime/vm/custom_isolate_test.cc
index ad6dec6..2064066 100644
--- a/runtime/vm/custom_isolate_test.cc
+++ b/runtime/vm/custom_isolate_test.cc
@@ -15,8 +15,10 @@
 
 namespace dart {
 
-// Only ia32 and x64 can run execution tests.
-#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
+// Only ia32, x64, and arm can run execution tests.
+#if defined(TARGET_ARCH_IA32) ||                                               \
+    defined(TARGET_ARCH_X64) ||                                                \
+    defined(TARGET_ARCH_ARM)
 
 static void native_echo(Dart_NativeArguments args);
 static void CustomIsolateImpl_start(Dart_NativeArguments args);
@@ -342,6 +344,6 @@
   delete event_queue;
 }
 
-#endif  // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64).
+#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM
 
 }  // namespace dart
diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc
index 1045708..5f32e3f 100644
--- a/runtime/vm/dart.cc
+++ b/runtime/vm/dart.cc
@@ -220,8 +220,10 @@
   Object::VerifyBuiltinVtables();
 
   StubCode::Init(isolate);
-  // TODO(regis): Reenable this code for arm and mips when possible.
-#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
+  // TODO(regis): Reenable this code for mips when possible.
+#if defined(TARGET_ARCH_IA32) ||                                               \
+    defined(TARGET_ARCH_X64) ||                                                \
+    defined(TARGET_ARCH_ARM)
   isolate->megamorphic_cache_table()->InitMissHandler();
 #endif
   if (FLAG_heap_trace) {
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index f8d8b96..15958e4 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -4521,6 +4521,19 @@
 }
 
 
+DART_EXPORT Dart_Handle Dart_CheckFunctionFingerprints() {
+  Isolate* isolate = Isolate::Current();
+  DARTSCOPE(isolate);
+  Dart_Handle result = Api::CheckIsolateState(isolate);
+  if (::Dart_IsError(result)) {
+    return result;
+  }
+  CHECK_CALLBACK_STATE(isolate);
+  Library::CheckFunctionFingerprints();
+  return result;
+}
+
+
 DART_EXPORT bool Dart_IsLibrary(Dart_Handle object) {
   return Api::ClassId(object) == kLibraryCid;
 }
diff --git a/runtime/vm/dart_api_impl_test.cc b/runtime/vm/dart_api_impl_test.cc
index a47c70c..a5c682e 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -981,14 +981,14 @@
       "  var a = createExternalByteData();"
       "  Expect.equals(length, a.lengthInBytes);"
       "  for (int i = 0; i < length; i+=2) {"
-      "    Expect.equals(0x4241, a.getInt16(i));"
+      "    Expect.equals(0x4241, a.getInt16(i, Endianness.LITTLE_ENDIAN));"
       "  }"
       "  for (int i = 0; i < length; i+=2) {"
       "    a.setInt8(i, 0x24);"
       "    a.setInt8(i + 1, 0x28);"
       "  }"
       "  for (int i = 0; i < length; i+=2) {"
-      "    Expect.equals(0x2824, a.getInt16(i));"
+      "    Expect.equals(0x2824, a.getInt16(i, Endianness.LITTLE_ENDIAN));"
       "  }"
       "  return a;"
       "}\n";
diff --git a/runtime/vm/dart_api_message.cc b/runtime/vm/dart_api_message.cc
index 34eb977..5df30aa 100644
--- a/runtime/vm/dart_api_message.cc
+++ b/runtime/vm/dart_api_message.cc
@@ -809,10 +809,12 @@
   if (forward_id_ >= forward_list_length_) {
     void* new_list = NULL;
     if (forward_list_length_ == 0) {
-      intptr_t new_size = 4 * sizeof(object);
+      forward_list_length_ = 4;
+      intptr_t new_size = forward_list_length_ * sizeof(object);
       new_list = ::malloc(new_size);
     } else {
-      intptr_t new_size = (forward_list_length_ * sizeof(object)) * 2;
+      forward_list_length_ *= 2;
+      intptr_t new_size = (forward_list_length_ * sizeof(object));
       new_list = ::realloc(forward_list_, new_size);
     }
     ASSERT(new_list != NULL);
diff --git a/runtime/vm/dart_entry.cc b/runtime/vm/dart_entry.cc
index 63fc459..1b9e361 100644
--- a/runtime/vm/dart_entry.cc
+++ b/runtime/vm/dart_entry.cc
@@ -55,6 +55,8 @@
   const Code& code = Code::Handle(function.CurrentCode());
   ASSERT(!code.IsNull());
   ASSERT(Isolate::Current()->no_callback_scope_depth() == 0);
+  IsolateRunStateManager run_state_manager;
+  run_state_manager.SetRunState(Isolate::kIsolateRunning);
 #if defined(USING_SIMULATOR)
     return bit_copy<RawObject*, int64_t>(Simulator::Current()->Call(
         reinterpret_cast<int32_t>(entrypoint),
diff --git a/runtime/vm/dart_entry_test.cc b/runtime/vm/dart_entry_test.cc
index a09b35c..c380b02 100644
--- a/runtime/vm/dart_entry_test.cc
+++ b/runtime/vm/dart_entry_test.cc
@@ -14,11 +14,6 @@
 
 namespace dart {
 
-// Only IA32, X64, and ARM can run execution tests.
-#if defined(TARGET_ARCH_IA32) ||                                               \
-    defined(TARGET_ARCH_X64) ||                                                \
-    defined(TARGET_ARCH_ARM)
-
 TEST_CASE(DartEntry) {
   const char* kScriptChars =
       "class A {\n"
@@ -115,6 +110,4 @@
   EXPECT_SUBSTRING("++++", Error::Cast(retval).ToErrorCString());
 }
 
-#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM
-
 }  // namespace dart
diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc
index 685a8c1..0290e50 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -28,27 +28,6 @@
 DEFINE_FLAG(bool, verbose_debug, false, "Verbose debugger messages");
 
 
-static void DefaultBreakpointHandler(Dart_Port isolate_id,
-                                     SourceBreakpoint* bpt,
-                                     DebuggerStackTrace* stack) {
-  String& var_name = String::Handle();
-  Instance& value = Instance::Handle();
-  for (intptr_t i = 0; i < stack->Length(); i++) {
-    ActivationFrame* frame = stack->ActivationFrameAt(i);
-    OS::Print("   %"Pd". %s\n",
-              i + 1, frame->ToCString());
-    intptr_t num_locals = frame->NumLocalVariables();
-    for (intptr_t i = 0; i < num_locals; i++) {
-      intptr_t token_pos, end_pos;
-      frame->VariableAt(i, &var_name, &token_pos, &end_pos, &value);
-      OS::Print("      var %s (pos %"Pd") = %s\n",
-                var_name.ToCString(), token_pos, value.ToCString());
-    }
-  }
-}
-
-
-BreakpointHandler* Debugger::bp_handler_ = DefaultBreakpointHandler;
 Debugger::EventHandler* Debugger::event_handler_ = NULL;
 
 
@@ -101,6 +80,18 @@
 }
 
 
+void SourceBreakpoint::GetCodeLocation(
+    Library* lib,
+    Script* script,
+    intptr_t* pos) {
+  const Function& func = Function::Handle(function_);
+  const Class& cls = Class::Handle(func.origin());
+  *lib = cls.library();
+  *script = func.script();
+  *pos = token_pos();
+}
+
+
 RawString* SourceBreakpoint::SourceUrl() {
   const Script& script = Script::Handle(SourceCode());
   return script.url();
@@ -1427,13 +1418,6 @@
 }
 
 
-void Debugger::SetBreakpointHandler(BreakpointHandler* handler) {
-  if (bp_handler_ != NULL) {
-    bp_handler_ = handler;
-  }
-}
-
-
 void Debugger::SetEventHandler(EventHandler* handler) {
   event_handler_ = handler;
 }
@@ -1487,13 +1471,16 @@
 
   if (notify_frontend) {
     resume_action_ = kContinue;
-    if (bp_handler_ != NULL) {
-      SourceBreakpoint* src_bpt = bpt->src_bpt();
+    if (event_handler_ != NULL) {
       ASSERT(stack_trace_ == NULL);
       ASSERT(obj_cache_ == NULL);
       obj_cache_ = new RemoteObjectCache(64);
       stack_trace_ = stack_trace;
-      (*bp_handler_)(GetIsolateId(), src_bpt, stack_trace);
+      DebuggerEvent event;
+      event.type = kBreakpointReached;
+      ASSERT(stack_trace->Length() > 0);
+      event.top_frame = stack_trace->ActivationFrameAt(0);
+      (*event_handler_)(&event);
       stack_trace_ = NULL;
       obj_cache_ = NULL;  // Remote object cache is zone allocated.
       last_bpt_line_ = bpt->LineNumber();
diff --git a/runtime/vm/debugger.h b/runtime/vm/debugger.h
index fd5f180..0aa2a9c 100644
--- a/runtime/vm/debugger.h
+++ b/runtime/vm/debugger.h
@@ -34,6 +34,8 @@
   RawString* SourceUrl();
   intptr_t LineNumber();
 
+  void GetCodeLocation(Library* lib, Script* script, intptr_t* token_pos);
+
   void Enable();
   void Disable();
   bool IsEnabled() const { return is_enabled_; }
@@ -232,7 +234,7 @@
   struct DebuggerEvent {
     EventType type;
     union {
-      DebuggerStackTrace* stack_trace;
+      ActivationFrame* top_frame;
       SourceBreakpoint* breakpoint;
       const Object* exception;
       Dart_Port isolate_id;
@@ -291,7 +293,6 @@
   Dart_Port GetIsolateId() { return isolate_id_; }
 
   static void SetEventHandler(EventHandler* handler);
-  static void SetBreakpointHandler(BreakpointHandler* handler);
 
   // Utility functions.
   static const char* QualifiedFunctionName(const Function& func);
diff --git a/runtime/vm/debugger_api_impl.cc b/runtime/vm/debugger_api_impl.cc
index e18ad81..6656ba2 100644
--- a/runtime/vm/debugger_api_impl.cc
+++ b/runtime/vm/debugger_api_impl.cc
@@ -99,32 +99,51 @@
   return Api::True(isolate);
 }
 
-
-DART_EXPORT void Dart_SetBreakpointHandler(Dart_BreakpointHandler bp_handler) {
-  BreakpointHandler* handler =
-      reinterpret_cast<BreakpointHandler*>(bp_handler);
-  Debugger::SetBreakpointHandler(handler);
-}
-
-
+static Dart_PausedEventHandler* paused_event_handler = NULL;
 static Dart_BreakpointResolvedHandler* bp_resolved_handler = NULL;
 static Dart_ExceptionThrownHandler* exc_thrown_handler = NULL;
 static Dart_IsolateEventHandler* isolate_event_handler = NULL;
 
+static Dart_BreakpointHandler* legacy_bp_handler = NULL;
+
 
 static void DebuggerEventHandler(Debugger::DebuggerEvent* event) {
   Isolate* isolate = Isolate::Current();
   ASSERT(isolate != NULL);
   ASSERT(isolate->debugger() != NULL);
   Dart_IsolateId isolate_id = isolate->debugger()->GetIsolateId();
-  if (event->type == Debugger::kBreakpointResolved) {
+  if (event->type == Debugger::kBreakpointReached) {
+    if (legacy_bp_handler != NULL) {
+      Dart_StackTrace stack_trace =
+          reinterpret_cast<Dart_StackTrace>(isolate->debugger()->StackTrace());
+      (*legacy_bp_handler)(isolate_id, NULL, stack_trace);
+      return;
+    }
+    if (paused_event_handler == NULL) {
+      return;
+    }
+    Dart_CodeLocation location;
+    ActivationFrame* top_frame = event->top_frame;
+    location.script_url = Api::NewHandle(isolate, top_frame->SourceUrl());
+    const Library& lib = Library::Handle(top_frame->Library());
+    location.library_id = lib.index();
+    location.token_pos = top_frame->TokenPos();
+    (*paused_event_handler)(isolate_id, location);
+  } else if (event->type == Debugger::kBreakpointResolved) {
     if (bp_resolved_handler == NULL) {
       return;
     }
     SourceBreakpoint* bpt = event->breakpoint;
     ASSERT(bpt != NULL);
-    Dart_Handle url = Api::NewHandle(isolate, bpt->SourceUrl());
-    (*bp_resolved_handler)(isolate_id, bpt->id(), url, bpt->LineNumber());
+    Dart_CodeLocation location;
+    Library& library = Library::Handle(isolate);
+    Script& script = Script::Handle(isolate);
+    intptr_t token_pos;
+    bpt->GetCodeLocation(&library, &script, &token_pos);
+    location.script_url = Api::NewHandle(isolate, script.url());
+    location.library_id = library.index();
+    location.token_pos = token_pos;
+    (*bp_resolved_handler)(isolate_id, bpt->id(), location);
   } else if (event->type == Debugger::kExceptionThrown) {
     if (exc_thrown_handler == NULL) {
       return;
@@ -151,6 +170,18 @@
 }
 
 
+DART_EXPORT void Dart_SetBreakpointHandler(Dart_BreakpointHandler bp_handler) {
+  legacy_bp_handler = bp_handler;
+  Debugger::SetEventHandler(DebuggerEventHandler);
+}
+
+
+DART_EXPORT void Dart_SetPausedEventHandler(Dart_PausedEventHandler handler) {
+  paused_event_handler = handler;
+  Debugger::SetEventHandler(DebuggerEventHandler);
+}
+
+
 DART_EXPORT void Dart_SetBreakpointResolvedHandler(
                             Dart_BreakpointResolvedHandler handler) {
   bp_resolved_handler = handler;
diff --git a/runtime/vm/debugger_api_impl_test.cc b/runtime/vm/debugger_api_impl_test.cc
index a667fd0..ad61b39 100644
--- a/runtime/vm/debugger_api_impl_test.cc
+++ b/runtime/vm/debugger_api_impl_test.cc
@@ -237,6 +237,8 @@
 }
 
 
+// TODO(hausner): Convert this one remaining use of the legacy
+// breakpoint handler once Dart_SetBreakpointHandler goes away.
 void TestBreakpointHandler(Dart_IsolateId isolate_id,
                            Dart_Breakpoint bpt,
                            Dart_StackTrace trace) {
@@ -288,8 +290,9 @@
 
 
 void TestStepOutHandler(Dart_IsolateId isolate_id,
-                        Dart_Breakpoint bpt,
-                        Dart_StackTrace trace) {
+                        const Dart_CodeLocation& location) {
+  Dart_StackTrace trace;
+  Dart_GetStackTrace(&trace);
   const char* expected_bpts[] = {"f1", "foo", "main"};
   const intptr_t expected_bpts_length = ARRAY_SIZE(expected_bpts);
   intptr_t trace_len;
@@ -332,7 +335,7 @@
       "}                        \n";
 
   LoadScript(kScriptChars);
-  Dart_SetBreakpointHandler(&TestStepOutHandler);
+  Dart_SetPausedEventHandler(&TestStepOutHandler);
 
   // Set a breakpoint in function f1, then repeatedly step out until
   // we get to main. We should see one breakpoint each in f1,
@@ -352,8 +355,9 @@
 
 
 void TestStepIntoHandler(Dart_IsolateId isolate_id,
-                         Dart_Breakpoint bpt,
-                         Dart_StackTrace trace) {
+                         const Dart_CodeLocation& location) {
+  Dart_StackTrace trace;
+  Dart_GetStackTrace(&trace);
   const char* expected_bpts[] = {
       "main",
         "foo",
@@ -415,7 +419,7 @@
       "}                        \n";
 
   LoadScript(kScriptChars);
-  Dart_SetBreakpointHandler(&TestStepIntoHandler);
+  Dart_SetPausedEventHandler(&TestStepIntoHandler);
 
   // Set a breakpoint in function f1, then repeatedly step out until
   // we get to main. We should see one breakpoint each in f1,
@@ -435,8 +439,9 @@
 
 
 static void StepIntoHandler(Dart_IsolateId isolate_id,
-                            Dart_Breakpoint bpt,
-                            Dart_StackTrace trace) {
+                            const Dart_CodeLocation& location) {
+  Dart_StackTrace trace;
+  Dart_GetStackTrace(&trace);
   if (verbose) {
     OS::Print(">>> Breakpoint nr. %d in %s <<<\n",
               breakpoint_hit_counter, BreakpointInfo(trace));
@@ -463,7 +468,7 @@
       "}                        \n";
 
   LoadScript(kScriptChars);
-  Dart_SetBreakpointHandler(&StepIntoHandler);
+  Dart_SetPausedEventHandler(&StepIntoHandler);
 
   SetBreakpointAtEntry("", "main");
 
@@ -494,7 +499,7 @@
       "}                                    \n";
 
   LoadScript(kScriptChars);
-  Dart_SetBreakpointHandler(&StepIntoHandler);
+  Dart_SetPausedEventHandler(&StepIntoHandler);
 
 
   // Cause function foo to be optimized before we set a BP.
@@ -518,8 +523,9 @@
 
 
 void TestSingleStepHandler(Dart_IsolateId isolate_id,
-                           Dart_Breakpoint bpt,
-                           Dart_StackTrace trace) {
+                           const Dart_CodeLocation& location) {
+  Dart_StackTrace trace;
+  Dart_GetStackTrace(&trace);
   const char* expected_bpts[] = {
       "moo", "foo", "moo", "foo", "moo", "foo", "main"};
   const intptr_t expected_bpts_length = ARRAY_SIZE(expected_bpts);
@@ -563,7 +569,7 @@
       "}                         \n";
 
   LoadScript(kScriptChars);
-  Dart_SetBreakpointHandler(&TestSingleStepHandler);
+  Dart_SetPausedEventHandler(&TestSingleStepHandler);
 
   SetBreakpointAtEntry("", "moo");
 
@@ -576,8 +582,9 @@
 
 
 static void ClosureBreakpointHandler(Dart_IsolateId isolate_id,
-                                     Dart_Breakpoint bpt,
-                                     Dart_StackTrace trace) {
+                                     const Dart_CodeLocation& location) {
+  Dart_StackTrace trace;
+  Dart_GetStackTrace(&trace);
   const char* expected_trace[] = {"callback", "main"};
   const intptr_t expected_trace_length = 2;
   breakpoint_hit_counter++;
@@ -615,7 +622,7 @@
       "}                      \n";
 
   LoadScript(kScriptChars);
-  Dart_SetBreakpointHandler(&ClosureBreakpointHandler);
+  Dart_SetPausedEventHandler(&ClosureBreakpointHandler);
 
   SetBreakpointAtEntry("", "callback");
 
@@ -630,8 +637,9 @@
 
 
 static void ExprClosureBreakpointHandler(Dart_IsolateId isolate_id,
-                                         Dart_Breakpoint bpt,
-                                         Dart_StackTrace trace) {
+                                         const Dart_CodeLocation& location) {
+  Dart_StackTrace trace;
+  Dart_GetStackTrace(&trace);
   static const char* expected_trace[] = {"<anonymous closure>", "main"};
   Dart_Handle add_locals = Dart_NewList(4);
   Dart_ListSetAt(add_locals, 0, NewString("a"));
@@ -657,7 +665,7 @@
       "}                      \n";
 
   LoadScript(kScriptChars);
-  Dart_SetBreakpointHandler(&ExprClosureBreakpointHandler);
+  Dart_SetPausedEventHandler(&ExprClosureBreakpointHandler);
 
   Dart_Handle script_url = NewString(TestCase::url());
   intptr_t line_no = 5;  // In closure 'add'.
@@ -678,8 +686,9 @@
 static intptr_t bp_id_to_be_deleted;
 
 static void DeleteBreakpointHandler(Dart_IsolateId isolate_id,
-                                    Dart_Breakpoint bpt,
-                                    Dart_StackTrace trace) {
+                                    const Dart_CodeLocation& location) {
+  Dart_StackTrace trace;
+  Dart_GetStackTrace(&trace);
   const char* expected_trace[] = {"foo", "main"};
   const intptr_t expected_trace_length = 2;
   breakpoint_hit_counter++;
@@ -728,7 +737,7 @@
   Dart_Handle script_url = NewString(TestCase::url());
   intptr_t line_no = 4;  // In function 'foo'.
 
-  Dart_SetBreakpointHandler(&DeleteBreakpointHandler);
+  Dart_SetPausedEventHandler(&DeleteBreakpointHandler);
 
   Dart_Handle res = Dart_SetBreakpoint(script_url, line_no);
   EXPECT_VALID(res);
@@ -748,8 +757,9 @@
 
 
 static void InspectStaticFieldHandler(Dart_IsolateId isolate_id,
-                                      Dart_Breakpoint bpt,
-                                      Dart_StackTrace trace) {
+                                      const Dart_CodeLocation& location) {
+  Dart_StackTrace trace;
+  Dart_GetStackTrace(&trace);
   ASSERT(script_lib != NULL);
   ASSERT(!Dart_IsError(script_lib));
   ASSERT(Dart_IsLibrary(script_lib));
@@ -821,7 +831,7 @@
     " }                                         \n";
 
   LoadScript(kScriptChars);
-  Dart_SetBreakpointHandler(&InspectStaticFieldHandler);
+  Dart_SetPausedEventHandler(&InspectStaticFieldHandler);
   SetBreakpointAtEntry("", "debugBreak");
 
   breakpoint_hit_counter = 0;
@@ -1205,9 +1215,11 @@
 }
 
 
-static void StackTraceDump1BreakpointHandler(Dart_IsolateId isolate_id,
-                                             Dart_Breakpoint bpt,
-                                             Dart_StackTrace trace) {
+static void StackTraceDump1BreakpointHandler(
+                Dart_IsolateId isolate_id,
+                const Dart_CodeLocation& location) {
+  Dart_StackTrace trace;
+  Dart_GetStackTrace(&trace);
   const int kStackTraceLen = 4;
   static const char* expected_trace[kStackTraceLen] = {
     "local_to_main",
@@ -1344,7 +1356,7 @@
       "}\n";
 
   LoadScript(kScriptChars);
-  Dart_SetBreakpointHandler(&StackTraceDump1BreakpointHandler);
+  Dart_SetPausedEventHandler(&StackTraceDump1BreakpointHandler);
 
   Dart_Handle script_url = NewString(TestCase::url());
   intptr_t line_no = 34;  // In closure 'local_to_main'.
diff --git a/runtime/vm/deopt_instructions.cc b/runtime/vm/deopt_instructions.cc
index f6f8869..bbb7adc 100644
--- a/runtime/vm/deopt_instructions.cc
+++ b/runtime/vm/deopt_instructions.cc
@@ -759,6 +759,13 @@
 }
 
 
+intptr_t DeoptInfoBuilder::CalculateStackIndex(const Location& from_loc) const {
+  return from_loc.stack_index() < 0 ?
+            from_loc.stack_index() + num_args_ :
+            from_loc.stack_index() + num_args_ - kFirstLocalSlotIndex + 1;
+}
+
+
 void DeoptInfoBuilder::AddReturnAddress(const Function& function,
                                         intptr_t deopt_id,
                                         intptr_t to_index) {
@@ -807,20 +814,24 @@
     }
   } else if (from_loc.IsStackSlot()) {
     ASSERT(value->definition()->representation() == kTagged);
-    intptr_t from_index = (from_loc.stack_index() < 0) ?
-        from_loc.stack_index() + num_args_ :
-        from_loc.stack_index() + num_args_ - kFirstLocalSlotIndex + 1;
+    intptr_t from_index = CalculateStackIndex(from_loc);
     deopt_instr = new DeoptStackSlotInstr(from_index);
   } else if (from_loc.IsDoubleStackSlot()) {
-    intptr_t from_index = (from_loc.stack_index() < 0) ?
-        from_loc.stack_index() + num_args_ :
-        from_loc.stack_index() + num_args_ - kFirstLocalSlotIndex + 1;
+    intptr_t from_index = CalculateStackIndex(from_loc);
     if (value->definition()->representation() == kUnboxedDouble) {
       deopt_instr = new DeoptDoubleStackSlotInstr(from_index);
     } else {
       ASSERT(value->definition()->representation() == kUnboxedMint);
       deopt_instr = new DeoptInt64StackSlotInstr(from_index);
     }
+  } else if (from_loc.IsQuadStackSlot()) {
+    intptr_t from_index = CalculateStackIndex(from_loc);
+    if (value->definition()->representation() == kUnboxedFloat32x4) {
+      deopt_instr = new DeoptFloat32x4StackSlotInstr(from_index);
+    } else {
+      ASSERT(value->definition()->representation() == kUnboxedUint32x4);
+      deopt_instr = new DeoptUint32x4StackSlotInstr(from_index);
+    }
   } else {
     UNREACHABLE();
   }
diff --git a/runtime/vm/deopt_instructions.h b/runtime/vm/deopt_instructions.h
index 5f22368..2f90ad8 100644
--- a/runtime/vm/deopt_instructions.h
+++ b/runtime/vm/deopt_instructions.h
@@ -179,6 +179,7 @@
   class TrieNode;
 
   intptr_t FindOrAddObjectInTable(const Object& obj) const;
+  intptr_t CalculateStackIndex(const Location& from_loc) const;
 
   GrowableArray<DeoptInstr*> instructions_;
   const GrowableObjectArray& object_table_;
diff --git a/runtime/vm/exceptions.cc b/runtime/vm/exceptions.cc
index b05dd6d..a5086cf 100644
--- a/runtime/vm/exceptions.cc
+++ b/runtime/vm/exceptions.cc
@@ -207,17 +207,28 @@
 }
 
 
-void JumpToExceptionHandler(uword program_counter,
-                            uword stack_pointer,
-                            uword frame_pointer,
-                            const Instance& exception_object,
-                            const Instance& stacktrace_object) {
+static void JumpToExceptionHandler(uword program_counter,
+                                   uword stack_pointer,
+                                   uword frame_pointer,
+                                   const Object& exception_object,
+                                   const Object& stacktrace_object) {
   // The no_gc StackResource is unwound through the tear down of
   // stack resources below.
   NoGCScope no_gc;
-  RawInstance* exception = exception_object.raw();
-  RawInstance* stacktrace = stacktrace_object.raw();
+  RawObject* raw_exception = exception_object.raw();
+  RawObject* raw_stacktrace = stacktrace_object.raw();
 
+#if defined(USING_SIMULATOR)
+  // Unwinding of the C++ frames and destroying of their stack resources is done
+  // by the simulator, because the target stack_pointer is a simulated stack
+  // pointer and not the C++ stack pointer.
+
+  // Continue simulating at the given pc in the given frame after setting up the
+  // exception object in the kExceptionObjectReg register and the stacktrace
+  // object (may be raw null) in the kStackTraceObjectReg register.
+  Simulator::Current()->Longjmp(program_counter, stack_pointer, frame_pointer,
+                                raw_exception, raw_stacktrace);
+#else
   // Prepare for unwinding frames by destroying all the stack resources
   // in the previous frames.
   Isolate* isolate = Isolate::Current();
@@ -226,39 +237,15 @@
     isolate->top_resource()->~StackResource();
   }
 
-  // Set up the appropriate register state and jump to the handler.
-  typedef void (*ExcpHandler)(uword, uword, uword, RawInstance*, RawInstance*);
+  // Call a stub to set up the exception object in kExceptionObjectReg,
+  // to set up the stacktrace object in kStackTraceObjectReg, and to
+  // continue execution at the given pc in the given frame.
+  typedef void (*ExcpHandler)(uword, uword, uword, RawObject*, RawObject*);
   ExcpHandler func = reinterpret_cast<ExcpHandler>(
       StubCode::JumpToExceptionHandlerEntryPoint());
-  func(program_counter, stack_pointer, frame_pointer, exception, stacktrace);
-  UNREACHABLE();
-}
-
-
-void JumpToErrorHandler(uword program_counter,
-                        uword stack_pointer,
-                        uword frame_pointer,
-                        const Error& error) {
-  // The no_gc StackResource is unwound through the tear down of
-  // stack resources below.
-  NoGCScope no_gc;
-  ASSERT(!error.IsNull());
-  RawError* raw_error = error.raw();
-
-  // Prepare for unwinding frames by destroying all the stack resources
-  // in the previous frames.
-  Isolate* isolate = Isolate::Current();
-  while (isolate->top_resource() != NULL &&
-         (reinterpret_cast<uword>(isolate->top_resource()) < stack_pointer)) {
-    isolate->top_resource()->~StackResource();
-  }
-
-  // Set up the error object as the return value in EAX and continue
-  // from the invocation stub.
-  typedef void (*ErrorHandler)(uword, uword, uword, RawError*);
-  ErrorHandler func = reinterpret_cast<ErrorHandler>(
-      StubCode::JumpToErrorHandlerEntryPoint());
-  func(program_counter, stack_pointer, frame_pointer, raw_error);
+  func(program_counter, stack_pointer, frame_pointer,
+       raw_exception, raw_stacktrace);
+#endif
   UNREACHABLE();
 }
 
@@ -359,7 +346,12 @@
     // the isolate etc.).
     const UnhandledException& unhandled_exception = UnhandledException::Handle(
         UnhandledException::New(exception, stacktrace));
-    JumpToErrorHandler(handler_pc, handler_sp, handler_fp, unhandled_exception);
+    stacktrace = Stacktrace::null();
+    JumpToExceptionHandler(handler_pc,
+                           handler_sp,
+                           handler_fp,
+                           unhandled_exception,
+                           stacktrace);
   }
   UNREACHABLE();
 }
@@ -523,7 +515,8 @@
     uword handler_sp = 0;
     uword handler_fp = 0;
     FindErrorHandler(&handler_pc, &handler_sp, &handler_fp);
-    JumpToErrorHandler(handler_pc, handler_sp, handler_fp, error);
+    JumpToExceptionHandler(handler_pc, handler_sp, handler_fp, error,
+                           Stacktrace::Handle());  // Null stacktrace.
   }
   UNREACHABLE();
 }
diff --git a/runtime/vm/exceptions_test.cc b/runtime/vm/exceptions_test.cc
index a1b5867..5ccec16 100644
--- a/runtime/vm/exceptions_test.cc
+++ b/runtime/vm/exceptions_test.cc
@@ -9,8 +9,12 @@
 
 namespace dart {
 
-// Only ia32 and x64 can run execution tests.
-#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
+// Only ia32, x64, and arm can run execution tests.
+#if defined(TARGET_ARCH_IA32) ||                                               \
+    defined(TARGET_ARCH_X64) ||                                                \
+    defined(TARGET_ARCH_ARM)
+
+
 #define FUNCTION_NAME(name) UnhandledExcp_##name
 #define REGISTER_FUNCTION(name, count)                                         \
   { ""#name, FUNCTION_NAME(name), count },
@@ -129,6 +133,6 @@
       reinterpret_cast<Dart_NativeEntryResolver>(native_lookup));
   EXPECT_VALID(Dart_Invoke(lib, NewString("testMain"), 0, NULL));
 }
-#endif  // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64).
+#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM
 
 }  // namespace dart
diff --git a/runtime/vm/flow_graph.cc b/runtime/vm/flow_graph.cc
index cb8ca07..167e443 100644
--- a/runtime/vm/flow_graph.cc
+++ b/runtime/vm/flow_graph.cc
@@ -410,8 +410,9 @@
 }
 
 
-void FlowGraph::ComputeSSA(intptr_t next_virtual_register_number,
-                           GrowableArray<Definition*>* inlining_parameters) {
+void FlowGraph::ComputeSSA(
+    intptr_t next_virtual_register_number,
+    ZoneGrowableArray<Definition*>* inlining_parameters) {
   ASSERT((next_virtual_register_number == 0) || (inlining_parameters != NULL));
   current_ssa_temp_index_ = next_virtual_register_number;
   GrowableArray<BitVector*> dominance_frontier;
@@ -611,7 +612,7 @@
 
 void FlowGraph::Rename(GrowableArray<PhiInstr*>* live_phis,
                        VariableLivenessAnalysis* variable_liveness,
-                       GrowableArray<Definition*>* inlining_parameters) {
+                       ZoneGrowableArray<Definition*>* inlining_parameters) {
   // TODO(fschneider): Support catch-entry.
   if (graph_entry_->SuccessorCount() > 1) {
     Bailout("Catch-entry support in SSA.");
diff --git a/runtime/vm/flow_graph.h b/runtime/vm/flow_graph.h
index d761fa2..4d384f3 100644
--- a/runtime/vm/flow_graph.h
+++ b/runtime/vm/flow_graph.h
@@ -124,7 +124,7 @@
 
   // Operations on the flow graph.
   void ComputeSSA(intptr_t next_virtual_register_number,
-                  GrowableArray<Definition*>* inlining_parameters);
+                  ZoneGrowableArray<Definition*>* inlining_parameters);
 
   // Finds natural loops in the flow graph and attaches a list of loop
   // body blocks for each loop header.
@@ -156,8 +156,7 @@
 
   void Rename(GrowableArray<PhiInstr*>* live_phis,
               VariableLivenessAnalysis* variable_liveness,
-              GrowableArray<Definition*>* inlining_parameters);
-
+              ZoneGrowableArray<Definition*>* inlining_parameters);
   void RenameRecursive(
       BlockEntryInstr* block_entry,
       GrowableArray<Definition*>* env,
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index 21a3a35..cf08e61 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -41,7 +41,7 @@
 
 
 FlowGraphBuilder::FlowGraphBuilder(const ParsedFunction& parsed_function,
-                                   InliningContext* inlining_context)
+                                   InlineExitCollector* exit_collector)
   : parsed_function_(parsed_function),
     num_copied_params_(parsed_function.num_copied_params()),
     // All parameters are copied if any parameter is.
@@ -49,7 +49,7 @@
         ? parsed_function.function().num_fixed_parameters()
         : 0),
     num_stack_locals_(parsed_function.num_stack_locals()),
-    inlining_context_(inlining_context),
+    exit_collector_(exit_collector),
     last_used_block_id_(0),  // 0 is used for the graph entry.
     context_level_(0),
     last_used_try_index_(CatchClauseNode::kInvalidTryIndex),
@@ -62,7 +62,7 @@
 }
 
 
-void InliningContext::PrepareGraphs(FlowGraph* callee_graph) {
+void InlineExitCollector::PrepareGraphs(FlowGraph* callee_graph) {
   ASSERT(callee_graph->graph_entry()->SuccessorCount() == 1);
   ASSERT(callee_graph->max_block_id() > caller_graph_->max_block_id());
   ASSERT(callee_graph->max_virtual_register_number() >
@@ -90,18 +90,18 @@
 }
 
 
-void InliningContext::AddExit(ReturnInstr* exit) {
+void InlineExitCollector::AddExit(ReturnInstr* exit) {
   Data data = { NULL, exit };
   exits_.Add(data);
 }
 
 
-int InliningContext::LowestBlockIdFirst(const Data* a, const Data* b) {
+int InlineExitCollector::LowestBlockIdFirst(const Data* a, const Data* b) {
   return (a->exit_block->block_id() - b->exit_block->block_id());
 }
 
 
-void InliningContext::SortExits() {
+void InlineExitCollector::SortExits() {
   // Assign block entries here because we did not necessarily know them when
   // the return exit was added to the array.
   for (int i = 0; i < exits_.length(); ++i) {
@@ -111,8 +111,8 @@
 }
 
 
-Definition* InliningContext::JoinReturns(BlockEntryInstr** exit_block,
-                                         Instruction** last_instruction) {
+Definition* InlineExitCollector::JoinReturns(BlockEntryInstr** exit_block,
+                                             Instruction** last_instruction) {
   // First sort the list of exits by block id (caching return instruction
   // block entries as a side effect).
   SortExits();
@@ -217,13 +217,10 @@
 }
 
 
-void InliningContext::ReplaceCall(FlowGraph* callee_graph) {
+void InlineExitCollector::ReplaceCall(TargetEntryInstr* callee_entry) {
   ASSERT(call_->previous() != NULL);
   ASSERT(call_->next() != NULL);
-  PrepareGraphs(callee_graph);
-
   BlockEntryInstr* call_block = call_->GetBlock();
-  TargetEntryInstr* callee_entry = callee_graph->graph_entry()->normal_entry();
 
   // Insert the callee graph into the caller graph.
   BlockEntryInstr* callee_exit = NULL;
@@ -350,9 +347,9 @@
   ASSERT(is_open());
   ReturnInstr* return_instr = new ReturnInstr(token_pos, value);
   AddInstruction(return_instr);
-  InliningContext* inlining_context = owner()->inlining_context();
-  if (inlining_context != NULL) {
-    inlining_context->AddExit(return_instr);
+  InlineExitCollector* exit_collector = owner()->exit_collector();
+  if (exit_collector != NULL) {
+    exit_collector->AddExit(return_instr);
   }
   CloseFragment();
 }
@@ -710,7 +707,7 @@
 
 void EffectGraphVisitor::InlineBailout(const char* reason) {
   owner()->parsed_function().function().set_is_inlinable(false);
-  if (owner()->InInliningContext()) owner()->Bailout(reason);
+  if (owner()->IsInlining()) owner()->Bailout(reason);
 }
 
 
@@ -1932,30 +1929,6 @@
 // <Expression> ::= StaticCall { function: Function
 //                               arguments: <ArgumentList> }
 void EffectGraphVisitor::VisitStaticCallNode(StaticCallNode* node) {
-  if (node->function().name() == Symbols::Identical().raw()) {
-    // Attempt to replace top level defined 'identical' from the core
-    // library with strict equal early on.
-    // TODO(hausner): Evaluate if this can happen at AST building time.
-    const Class& cls = Class::Handle(node->function().Owner());
-    if (cls.IsTopLevel()) {
-      const Library& core_lib = Library::Handle(Library::CoreLibrary());
-      if (cls.library() == core_lib.raw()) {
-        ASSERT(node->arguments()->length() == 2);
-        ValueGraphVisitor for_left_value(owner(), temp_index());
-        node->arguments()->NodeAt(0)->Visit(&for_left_value);
-        Append(for_left_value);
-        ValueGraphVisitor for_right_value(owner(), temp_index());
-        node->arguments()->NodeAt(1)->Visit(&for_right_value);
-        Append(for_right_value);
-        StrictCompareInstr* comp = new StrictCompareInstr(
-            Token::kEQ_STRICT,
-            for_left_value.value(),
-            for_right_value.value());
-        ReturnDefinition(comp);
-        return;
-      }
-    }
-  }
   ZoneGrowableArray<PushArgumentInstr*>* arguments =
       new ZoneGrowableArray<PushArgumentInstr*>(node->arguments()->length());
   BuildPushArguments(*node->arguments(), arguments);
@@ -2079,7 +2052,7 @@
 #define RECOGNIZED_LIST_FACTORY_LIST(V)                                        \
   V(ObjectArrayFactory, kArrayCid, 97987288)                                   \
   V(GrowableObjectArrayWithData, kGrowableObjectArrayCid, 816132033)           \
-  V(GrowableObjectArrayFactory, kGrowableObjectArrayCid, 369608996)            \
+  V(GrowableObjectArrayFactory, kGrowableObjectArrayCid, 552407276)            \
   V(Int8ListFactory, kTypedDataInt8ArrayCid, 2066002614)                       \
   V(Uint8ListFactory, kTypedDataUint8ArrayCid, 1883551322)                     \
   V(Uint8ClampedListFactory, kTypedDataUint8ClampedArrayCid, 244333676)        \
@@ -3386,12 +3359,12 @@
                            CatchClauseNode::kInvalidTryIndex);
   graph_entry_ = new GraphEntryInstr(parsed_function(), normal_entry);
   EffectGraphVisitor for_effect(this, 0);
-  // TODO(kmillikin): We can eliminate stack checks in some cases (e.g., the
-  // stack check on entry for leaf routines).
-  Instruction* check = new CheckStackOverflowInstr(function.token_pos());
+  // This check may be deleted if the generated code is leaf.
+  CheckStackOverflowInstr* check =
+      new CheckStackOverflowInstr(function.token_pos());
   // If we are inlining don't actually attach the stack check. We must still
-  // create the stack check inorder to allocate a deopt id.
-  if (!InInliningContext()) for_effect.AddInstruction(check);
+  // create the stack check in order to allocate a deopt id.
+  if (!IsInlining()) for_effect.AddInstruction(check);
   parsed_function().node_sequence()->Visit(&for_effect);
   AppendFragment(normal_entry, for_effect);
   // Check that the graph is properly terminated.
diff --git a/runtime/vm/flow_graph_builder.h b/runtime/vm/flow_graph_builder.h
index 4bb63ba..3350151 100644
--- a/runtime/vm/flow_graph_builder.h
+++ b/runtime/vm/flow_graph_builder.h
@@ -16,26 +16,28 @@
 class Instruction;
 class ParsedFunction;
 
-// An InliningContext collects the exits from an inlined function during
-// graph construction so they can be plugged into the caller's flow graph.
-class InliningContext: public ValueObject {
+// An class to collect the exits from an inlined function during graph
+// construction so they can be plugged into the caller's flow graph.
+class InlineExitCollector: public ZoneAllocated {
  public:
-  InliningContext(FlowGraph* caller_graph, Definition* call)
+  InlineExitCollector(FlowGraph* caller_graph, Definition* call)
       : caller_graph_(caller_graph), call_(call), exits_(4) { }
 
   void AddExit(ReturnInstr* exit);
 
-  // Inline a flow graph at a call site.
+  // Before replacing a call with a graph, the outer environment needs to be
+  // attached to each instruction in the callee graph and the caller graph
+  // needs to have its block and instruction ID state updated.
+  void PrepareGraphs(FlowGraph* callee_graph);
+
+  // Inline a graph at a call site.
   //
-  // Assumes the callee graph was computed by BuildGraph with an inlining
-  // context and transformed to SSA with ComputeSSA with a correct virtual
-  // register number, and that the use lists have been correctly computed.
+  // Assumes the callee is in SSA with a correct dominator tree and use
+  // lists.
   //
   // After inlining the caller graph will have correctly adjusted the use
-  // lists.  The block orders will need to be recomputed, and the dominator
-  // tree will need to be recomputed if it is marked invalid in the caller
-  // graph.
-  void ReplaceCall(FlowGraph* callee_graph);
+  // lists.  The block orders will need to be recomputed.
+  void ReplaceCall(TargetEntryInstr* callee_entry);
 
  private:
   struct Data {
@@ -43,8 +45,6 @@
     ReturnInstr* exit_return;
   };
 
-  void PrepareGraphs(FlowGraph* caller_graph);
-
   BlockEntryInstr* ExitBlockAt(intptr_t i) const {
     ASSERT(exits_[i].exit_block != NULL);
     return exits_[i].exit_block;
@@ -79,7 +79,7 @@
  public:
   // The inlining context is NULL if not inlining.
   FlowGraphBuilder(const ParsedFunction& parsed_function,
-                   InliningContext* inlining_context);
+                   InlineExitCollector* exit_collector);
 
   FlowGraph* BuildGraph();
 
@@ -112,8 +112,8 @@
     return num_stack_locals_;
   }
 
-  bool InInliningContext() const { return (inlining_context_ != NULL); }
-  InliningContext* inlining_context() const { return inlining_context_; }
+  bool IsInlining() const { return (exit_collector_ != NULL); }
+  InlineExitCollector* exit_collector() const { return exit_collector_; }
 
  private:
   intptr_t parameter_count() const {
@@ -128,7 +128,7 @@
   const intptr_t num_copied_params_;
   const intptr_t num_non_copied_params_;
   const intptr_t num_stack_locals_;  // Does not include any parameters.
-  InliningContext* const inlining_context_;
+  InlineExitCollector* const exit_collector_;
 
   intptr_t last_used_block_id_;
   intptr_t context_level_;
diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc
index 14e4dd9..4a363ce5 100644
--- a/runtime/vm/flow_graph_compiler.cc
+++ b/runtime/vm/flow_graph_compiler.cc
@@ -129,6 +129,7 @@
                                      bool is_optimizing)
     : assembler_(assembler),
       parsed_function_(flow_graph.parsed_function()),
+      flow_graph_(flow_graph),
       block_order_(flow_graph.reverse_postorder()),
       current_block_(NULL),
       exception_handlers_list_(NULL),
@@ -160,6 +161,8 @@
   pc_descriptors_list_ = new DescriptorList(64);
   exception_handlers_list_ = new ExceptionHandlerList();
   block_info_.Clear();
+  bool is_leaf = !parsed_function().function().IsClosureFunction() &&
+                 is_optimizing();
   for (int i = 0; i < block_order_.length(); ++i) {
     block_info_.Add(new BlockInfo());
     if (is_optimizing()) {
@@ -185,9 +188,24 @@
           may_reoptimize_ = true;
           break;
         }
+        if (is_leaf && !current->IsCheckStackOverflow()) {
+          // Note that we do no care if the code contains instructions that
+          // can deoptimize.
+          LocationSummary* locs = current->locs();
+          if ((locs != NULL) && locs->can_call()) {
+            is_leaf = false;
+          }
+        }
       }
     }
   }
+  if (is_leaf) {
+    // Remove check stack overflow at entry.
+    CheckStackOverflowInstr* check = flow_graph_.graph_entry()->normal_entry()
+        ->next()->AsCheckStackOverflow();
+    ASSERT(check != NULL);
+    check->RemoveFromGraph();
+  }
 }
 
 
@@ -729,20 +747,15 @@
   bool blocked_registers[kNumberOfCpuRegisters];
 
   // Mark all available registers free.
-  for (intptr_t i = 0; i < kFirstFreeCpuRegister; i++) {
-    blocked_registers[i] = true;
-  }
-  for (intptr_t i = kFirstFreeCpuRegister; i <= kLastFreeCpuRegister; i++) {
+  for (intptr_t i = 0; i < kNumberOfCpuRegisters; i++) {
     blocked_registers[i] = false;
   }
-  for (intptr_t i = kLastFreeCpuRegister + 1; i < kNumberOfCpuRegisters; i++) {
-    blocked_registers[i] = true;
-  }
 
   // Mark all fixed input, temp and output registers as used.
   for (intptr_t i = 0; i < locs->input_count(); i++) {
     Location loc = locs->in(i);
     if (loc.IsRegister()) {
+      // Check that a register is not specified twice in the summary.
       ASSERT(!blocked_registers[loc.reg()]);
       blocked_registers[loc.reg()] = true;
     }
@@ -751,6 +764,7 @@
   for (intptr_t i = 0; i < locs->temp_count(); i++) {
     Location loc = locs->temp(i);
     if (loc.IsRegister()) {
+      // Check that a register is not specified twice in the summary.
       ASSERT(!blocked_registers[loc.reg()]);
       blocked_registers[loc.reg()] = true;
     }
@@ -773,6 +787,14 @@
     blocked_registers[PP] = true;
   }
 
+  // Block all non-free registers.
+  for (intptr_t i = 0; i < kFirstFreeCpuRegister; i++) {
+    blocked_registers[i] = true;
+  }
+  for (intptr_t i = kLastFreeCpuRegister + 1; i < kNumberOfCpuRegisters; i++) {
+    blocked_registers[i] = true;
+  }
+
   // Allocate all unallocated input locations.
   const bool should_pop = !instr->IsPushArgument();
   for (intptr_t i = locs->input_count() - 1; i >= 0; i--) {
diff --git a/runtime/vm/flow_graph_compiler.h b/runtime/vm/flow_graph_compiler.h
index 6ae9b1f..26c0d80 100644
--- a/runtime/vm/flow_graph_compiler.h
+++ b/runtime/vm/flow_graph_compiler.h
@@ -429,8 +429,6 @@
 
   bool may_reoptimize() const { return may_reoptimize_; }
 
-  static const int kLocalsOffsetFromFP = (-1 * kWordSize);
-
   static Condition FlipCondition(Condition condition);
 
   static bool EvaluateCondition(Condition condition, intptr_t l, intptr_t r);
@@ -552,6 +550,7 @@
 
   class Assembler* assembler_;
   const ParsedFunction& parsed_function_;
+  const FlowGraph& flow_graph_;
   const GrowableArray<BlockEntryInstr*>& block_order_;
 
   // Compiler specific per-block state.  Indexed by postorder block number
diff --git a/runtime/vm/flow_graph_compiler_arm.cc b/runtime/vm/flow_graph_compiler_arm.cc
index c9b8b86..5b0020b 100644
--- a/runtime/vm/flow_graph_compiler_arm.cc
+++ b/runtime/vm/flow_graph_compiler_arm.cc
@@ -111,14 +111,68 @@
 }
 
 
+// Jumps to labels 'is_instance' or 'is_not_instance' respectively, if
+// type test is conclusive, otherwise fallthrough if a type test could not
+// be completed.
+// R0: instance being type checked (preserved).
+// Clobbers R2.
 RawSubtypeTestCache*
 FlowGraphCompiler::GenerateInstantiatedTypeWithArgumentsTest(
     intptr_t token_pos,
     const AbstractType& type,
     Label* is_instance_lbl,
     Label* is_not_instance_lbl) {
-  UNIMPLEMENTED();
-  return NULL;
+  __ Comment("InstantiatedTypeWithArgumentsTest");
+  ASSERT(type.IsInstantiated());
+  const Class& type_class = Class::ZoneHandle(type.type_class());
+  ASSERT(type_class.HasTypeArguments());
+  const Register kInstanceReg = R0;
+  // A Smi object cannot be the instance of a parameterized class.
+  __ tst(kInstanceReg, ShifterOperand(kSmiTagMask));
+  __ b(is_not_instance_lbl, EQ);
+  const AbstractTypeArguments& type_arguments =
+      AbstractTypeArguments::ZoneHandle(type.arguments());
+  const bool is_raw_type = type_arguments.IsNull() ||
+      type_arguments.IsRaw(type_arguments.Length());
+  if (is_raw_type) {
+    const Register kClassIdReg = R2;
+    // dynamic type argument, check only classes.
+    __ LoadClassId(kClassIdReg, kInstanceReg);
+    __ CompareImmediate(kClassIdReg, type_class.id());
+    __ b(is_instance_lbl, EQ);
+    // List is a very common case.
+    if (type_class.IsListClass()) {
+      GenerateListTypeCheck(kClassIdReg, is_instance_lbl);
+    }
+    return GenerateSubtype1TestCacheLookup(
+        token_pos, type_class, is_instance_lbl, is_not_instance_lbl);
+  }
+  // If one type argument only, check if type argument is Object or dynamic.
+  if (type_arguments.Length() == 1) {
+    const AbstractType& tp_argument = AbstractType::ZoneHandle(
+        type_arguments.TypeAt(0));
+    ASSERT(!tp_argument.IsMalformed());
+    if (tp_argument.IsType()) {
+      ASSERT(tp_argument.HasResolvedTypeClass());
+      // Check if type argument is dynamic or Object.
+      const Type& object_type = Type::Handle(Type::ObjectType());
+      if (object_type.IsSubtypeOf(tp_argument, NULL)) {
+        // Instance class test only necessary.
+        return GenerateSubtype1TestCacheLookup(
+            token_pos, type_class, is_instance_lbl, is_not_instance_lbl);
+      }
+    }
+  }
+  // Regular subtype test cache involving instance's type arguments.
+  const Register kTypeArgumentsReg = kNoRegister;
+  const Register kTempReg = kNoRegister;
+  // R0: instance (must be preserved).
+  return GenerateCallSubtypeTestStub(kTestTypeTwoArgs,
+                                     kInstanceReg,
+                                     kTypeArgumentsReg,
+                                     kTempReg,
+                                     is_instance_lbl,
+                                     is_not_instance_lbl);
 }
 
 
@@ -662,12 +716,25 @@
 
 
 void FlowGraphCompiler::GenerateInlinedGetter(intptr_t offset) {
-  UNIMPLEMENTED();
+  // LR: return address.
+  // SP: receiver.
+  // Sequence node has one return node, its input is load field node.
+  __ ldr(R0, Address(SP, 0 * kWordSize));
+  __ LoadFromOffset(kLoadWord, R0, R0, offset - kHeapObjectTag);
+  __ Ret();
 }
 
 
 void FlowGraphCompiler::GenerateInlinedSetter(intptr_t offset) {
-  UNIMPLEMENTED();
+  // LR: return address.
+  // SP+1: receiver.
+  // SP+0: value.
+  // Sequence node has one store node and one return NULL node.
+  __ ldr(R0, Address(SP, 1 * kWordSize));  // Receiver.
+  __ ldr(R1, Address(SP, 0 * kWordSize));  // Value.
+  __ StoreIntoObject(R0, FieldAddress(R0, offset), R1);
+  __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null()));
+  __ Ret();
 }
 
 
@@ -683,10 +750,7 @@
       __ mov(R7, ShifterOperand(PP));
 
       // Temporarily setup pool pointer for this dart function.
-      const intptr_t object_pool_pc_dist =
-         Instructions::HeaderSize() - Instructions::object_pool_offset() +
-         assembler()->CodeSize() + Instr::kPCReadOffset;
-      __ ldr(PP, Address(PC, -object_pool_pc_dist));
+      __ LoadPoolPointer();
 
       // Load function object from object pool.
       __ LoadObject(function_reg, function);  // Uses PP.
@@ -1101,7 +1165,7 @@
                                                           intptr_t index_scale,
                                                           Register array,
                                                           Register index) {
-  UNIMPLEMENTED();
+  UNREACHABLE();  // No register indexed with offset addressing mode on ARM.
   return FieldAddress(array, index);
 }
 
diff --git a/runtime/vm/flow_graph_inliner.cc b/runtime/vm/flow_graph_inliner.cc
index 2956d0c..fab2e96 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -359,10 +359,25 @@
   }
 
  private:
+  struct InlinedCallData {
+   public:
+    InlinedCallData(Definition* call, GrowableArray<Value*>* arguments)
+        : call(call),
+          arguments(arguments),
+          callee_graph(NULL),
+          parameter_stubs(NULL),
+          exit_collector(NULL) { }
+
+    Definition* call;
+    GrowableArray<Value*>* arguments;
+    FlowGraph* callee_graph;
+    ZoneGrowableArray<Definition*>* parameter_stubs;
+    InlineExitCollector* exit_collector;
+  };
+
   bool TryInlining(const Function& function,
                    const Array& argument_names,
-                   GrowableArray<Value*>* arguments,
-                   Definition* call) {
+                   InlinedCallData* call_data) {
     TRACE_INLINING(OS::Print("  => %s (deopt count %d)\n",
                              function.ToCString(),
                              function.deoptimization_counter()));
@@ -381,6 +396,7 @@
       return false;
     }
 
+    GrowableArray<Value*>* arguments = call_data->arguments;
     const intptr_t constant_arguments = CountConstants(*arguments);
     if (!ShouldWeInline(function.optimized_instruction_count(),
                         function.optimized_call_site_count(),
@@ -396,6 +412,7 @@
     }
 
     // Abort if this is a recursive occurrence.
+    Definition* call = call_data->call;
     if (!FLAG_inline_recursive && IsCallRecursive(function, call)) {
       function.set_is_inlinable(false);
       TRACE_INLINING(OS::Print("     Bailout: recursive function\n"));
@@ -439,8 +456,9 @@
       }
 
       // Build the callee graph.
-      InliningContext inlining_context(caller_graph_, call);
-      FlowGraphBuilder builder(*parsed_function, &inlining_context);
+      InlineExitCollector* exit_collector =
+          new InlineExitCollector(caller_graph_, call);
+      FlowGraphBuilder builder(*parsed_function, exit_collector);
       builder.SetInitialBlockId(caller_graph_->max_block_id());
       FlowGraph* callee_graph;
       {
@@ -454,11 +472,12 @@
       // concrete information about the values, for example constant values,
       // without linking between the caller and callee graphs.
       // TODO(zerny): Put more information in the stubs, eg, type information.
-      GrowableArray<Definition*> param_stubs(function.NumParameters());
+      ZoneGrowableArray<Definition*>* param_stubs =
+          new ZoneGrowableArray<Definition*>(function.NumParameters());
 
       // Create a parameter stub for each fixed positional parameter.
       for (intptr_t i = 0; i < function.num_fixed_parameters(); ++i) {
-        param_stubs.Add(CreateParameterStub(i, (*arguments)[i], callee_graph));
+        param_stubs->Add(CreateParameterStub(i, (*arguments)[i], callee_graph));
       }
 
       // If the callee has optional parameters, rebuild the argument and stub
@@ -469,7 +488,7 @@
         AdjustForOptionalParameters(*parsed_function,
                                     argument_names,
                                     arguments,
-                                    &param_stubs,
+                                    param_stubs,
                                     callee_graph);
         // Add a bogus parameter at the end for the (unused) arguments
         // descriptor slot. The parser allocates an extra slot between
@@ -478,14 +497,14 @@
         // expressions or escaping variables so this parameter and the stack
         // slot are not used.
         if (parsed_function->GetSavedArgumentsDescriptorVar() != NULL) {
-          param_stubs.Add(new ParameterInstr(
+          param_stubs->Add(new ParameterInstr(
               function.NumParameters(), callee_graph->graph_entry()));
         }
       }
 
       // After treating optional parameters the actual/formal count must match.
       ASSERT(arguments->length() == function.NumParameters());
-      ASSERT(param_stubs.length() == callee_graph->parameter_count());
+      ASSERT(param_stubs->length() == callee_graph->parameter_count());
 
       {
         TimerScope timer(FLAG_compiler_stats,
@@ -493,7 +512,7 @@
                          isolate);
         // Compute SSA on the callee graph, catching bailouts.
         callee_graph->ComputeSSA(caller_graph_->max_virtual_register_number(),
-                                 &param_stubs);
+                                 param_stubs);
         DEBUG_ASSERT(callee_graph->VerifyUseLists());
       }
 
@@ -518,8 +537,8 @@
       // Collect information about the call site and caller graph.
       // TODO(zerny): Do this after CP and dead code elimination.
       intptr_t constants_count = 0;
-      for (intptr_t i = 0; i < param_stubs.length(); ++i) {
-        if (param_stubs[i]->IsConstant()) ++constants_count;
+      for (intptr_t i = 0; i < param_stubs->length(); ++i) {
+        if ((*param_stubs)[i]->IsConstant()) ++constants_count;
       }
       GraphInfoCollector info;
       info.Collect(*callee_graph);
@@ -556,57 +575,20 @@
         collected_call_sites_->FindCallSites(callee_graph);
       }
 
-      {
-        TimerScope timer(FLAG_compiler_stats,
-                         &CompilerStats::graphinliner_subst_timer,
-                         isolate);
-
-        // Plug result in the caller graph.
-        inlining_context.ReplaceCall(callee_graph);
-
-        // Replace each stub with the actual argument or the caller's constant.
-        // Nulls denote optional parameters for which no actual was given.
-        for (intptr_t i = 0; i < arguments->length(); ++i) {
-          Definition* stub = param_stubs[i];
-          Value* actual = (*arguments)[i];
-          if (actual != NULL) stub->ReplaceUsesWith(actual->definition());
-        }
-
-        // Remove push arguments of the call.
-        for (intptr_t i = 0; i < call->ArgumentCount(); ++i) {
-          PushArgumentInstr* push = call->PushArgumentAt(i);
-          push->ReplaceUsesWith(push->value()->definition());
-          push->RemoveFromGraph();
-        }
-
-        // Replace remaining constants with uses by constants in the caller's
-        // initial definitions.
-        GrowableArray<Definition*>* defns =
-            callee_graph->graph_entry()->initial_definitions();
-        for (intptr_t i = 0; i < defns->length(); ++i) {
-          ConstantInstr* constant = (*defns)[i]->AsConstant();
-          if ((constant != NULL) && constant->HasUses()) {
-            constant->ReplaceUsesWith(
-                caller_graph_->AddConstantToInitialDefinitions(
-                    constant->value()));
-          }
-        }
-      }
-
-      TRACE_INLINING(OS::Print("     Success\n"));
-
       // Add the function to the cache.
       if (!in_cache) function_cache_.Add(parsed_function);
 
-      // Check that inlining maintains use lists.
-      DEBUG_ASSERT(!FLAG_verify_compiler || caller_graph_->VerifyUseLists());
-
       // Build succeeded so we restore the bailout jump.
       inlined_ = true;
       inlined_size_ += size;
       isolate->set_long_jump_base(base);
       isolate->set_deopt_id(prev_deopt_id);
       isolate->set_ic_data_array(prev_ic_data.raw());
+
+      call_data->callee_graph = callee_graph;
+      call_data->parameter_stubs = param_stubs;
+      call_data->exit_collector = exit_collector;
+      TRACE_INLINING(OS::Print("     Success\n"));
       return true;
     } else {
       Error& error = Error::Handle();
@@ -620,6 +602,51 @@
     }
   }
 
+  void InlineCall(InlinedCallData* call_data) {
+    TimerScope timer(FLAG_compiler_stats,
+                     &CompilerStats::graphinliner_subst_timer,
+                     Isolate::Current());
+
+    // Plug result in the caller graph.
+    FlowGraph* callee_graph = call_data->callee_graph;
+    InlineExitCollector* exit_collector = call_data->exit_collector;
+    exit_collector->PrepareGraphs(callee_graph);
+    exit_collector->ReplaceCall(callee_graph->graph_entry()->normal_entry());
+
+    // Replace each stub with the actual argument or the caller's constant.
+    // Nulls denote optional parameters for which no actual was given.
+    GrowableArray<Value*>* arguments = call_data->arguments;
+    for (intptr_t i = 0; i < arguments->length(); ++i) {
+      Definition* stub = (*call_data->parameter_stubs)[i];
+      Value* actual = (*arguments)[i];
+      if (actual != NULL) stub->ReplaceUsesWith(actual->definition());
+    }
+
+    // Remove push arguments of the call.
+    Definition* call = call_data->call;
+    for (intptr_t i = 0; i < call->ArgumentCount(); ++i) {
+      PushArgumentInstr* push = call->PushArgumentAt(i);
+      push->ReplaceUsesWith(push->value()->definition());
+      push->RemoveFromGraph();
+    }
+
+    // Replace remaining constants with uses by constants in the caller's
+    // initial definitions.
+    GrowableArray<Definition*>* defns =
+        callee_graph->graph_entry()->initial_definitions();
+    for (intptr_t i = 0; i < defns->length(); ++i) {
+      ConstantInstr* constant = (*defns)[i]->AsConstant();
+      if ((constant != NULL) && constant->HasUses()) {
+        constant->ReplaceUsesWith(
+            caller_graph_->AddConstantToInitialDefinitions(
+                constant->value()));
+      }
+    }
+
+    // Check that inlining maintains use lists.
+    DEBUG_ASSERT(!FLAG_verify_compiler || caller_graph_->VerifyUseLists());
+  }
+
   static intptr_t CountConstants(const GrowableArray<Value*>& arguments) {
     intptr_t count = 0;
     for (intptr_t i = 0; i < arguments.length(); i++) {
@@ -672,7 +699,10 @@
       for (int i = 0; i < call->ArgumentCount(); ++i) {
         arguments.Add(call->PushArgumentAt(i)->value());
       }
-      TryInlining(call->function(), call->argument_names(), &arguments, call);
+      InlinedCallData call_data(call, &arguments);
+      if (TryInlining(call->function(), call->argument_names(), &call_data)) {
+        InlineCall(&call_data);
+      }
     }
   }
 
@@ -694,10 +724,12 @@
       for (int i = 0; i < call->ArgumentCount(); ++i) {
         arguments.Add(call->PushArgumentAt(i)->value());
       }
-      TryInlining(closure->function(),
-                  call->argument_names(),
-                  &arguments,
-                  call);
+      InlinedCallData call_data(call, &arguments);
+      if (TryInlining(closure->function(),
+                      call->argument_names(),
+                      &call_data)) {
+        InlineCall(&call_data);
+      }
     }
   }
 
@@ -707,10 +739,10 @@
     TRACE_INLINING(OS::Print("  Polymorphic Instance Calls (%d)\n",
                              call_info.length()));
     for (intptr_t i = 0; i < call_info.length(); ++i) {
-      PolymorphicInstanceCallInstr* instr = call_info[i].call;
-      const ICData& ic_data = instr->ic_data();
+      PolymorphicInstanceCallInstr* call = call_info[i].call;
+      const ICData& ic_data = call->ic_data();
       const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0));
-      if (instr->with_checks()) {
+      if (call->with_checks()) {
         TRACE_INLINING(OS::Print(
             "  => %s (deopt count %d)\n     Bailout: %"Pd" checks\n",
             target.ToCString(),
@@ -726,21 +758,23 @@
             call_info[i].ratio));
         continue;
       }
-      GrowableArray<Value*> arguments(instr->ArgumentCount());
-      for (int arg_i = 0; arg_i < instr->ArgumentCount(); ++arg_i) {
-        arguments.Add(instr->PushArgumentAt(arg_i)->value());
+      GrowableArray<Value*> arguments(call->ArgumentCount());
+      for (int arg_i = 0; arg_i < call->ArgumentCount(); ++arg_i) {
+        arguments.Add(call->PushArgumentAt(arg_i)->value());
       }
-      TryInlining(target,
-                  instr->instance_call()->argument_names(),
-                  &arguments,
-                  instr);
+      InlinedCallData call_data(call, &arguments);
+      if (TryInlining(target,
+                      call->instance_call()->argument_names(),
+                      &call_data)) {
+        InlineCall(&call_data);
+      }
     }
   }
 
   void AdjustForOptionalParameters(const ParsedFunction& parsed_function,
                                    const Array& argument_names,
                                    GrowableArray<Value*>* arguments,
-                                   GrowableArray<Definition*>* param_stubs,
+                                   ZoneGrowableArray<Definition*>* param_stubs,
                                    FlowGraph* callee_graph) {
     const Function& function = parsed_function.function();
     // The language and this code does not support both optional positional
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index 8833ac3..a021388 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -70,6 +70,9 @@
         ComparisonInstr* compare = instr->AsBranch()->comparison();
         if (compare->IsStrictCompare()) {
           VisitStrictCompare(compare->AsStrictCompare());
+        } else if (compare->IsEqualityCompare()) {
+          StrictifyEqualityCompare(compare->AsEqualityCompare(),
+                                   instr->AsBranch());
         }
       }
     }
@@ -531,6 +534,11 @@
       ICDataHasReceiverArgumentClassIds(ic_data, kSmiCid, kSmiCid);
 }
 
+static bool HasOnlyTwoFloat32x4s(const ICData& ic_data) {
+  return (ic_data.NumberOfChecks() == 1) &&
+      ICDataHasReceiverArgumentClassIds(ic_data, kFloat32x4Cid, kFloat32x4Cid);
+}
+
 
 // Returns false if the ICData contains anything other than the 4 combinations
 // of Mint and Smi for the receiver and argument classes.
@@ -965,6 +973,8 @@
         operands_type = kMintCid;
       } else if (ShouldSpecializeForDouble(ic_data)) {
         operands_type = kDoubleCid;
+      } else if (HasOnlyTwoFloat32x4s(ic_data)) {
+        operands_type = kFloat32x4Cid;
       } else {
         return false;
       }
@@ -978,6 +988,8 @@
         operands_type = kSmiCid;
       } else if (ShouldSpecializeForDouble(ic_data)) {
         operands_type = kDoubleCid;
+      } else if (HasOnlyTwoFloat32x4s(ic_data)) {
+        operands_type = kFloat32x4Cid;
       } else {
         return false;
       }
@@ -985,6 +997,8 @@
     case Token::kDIV:
       if (ShouldSpecializeForDouble(ic_data)) {
         operands_type = kDoubleCid;
+      } else if (HasOnlyTwoFloat32x4s(ic_data)) {
+        operands_type = kFloat32x4Cid;
       } else {
         return false;
       }
@@ -1071,6 +1085,26 @@
                                 call);
       ReplaceCall(call, bin_op);
     }
+  } else if (operands_type == kFloat32x4Cid) {
+    // Type check left.
+    AddCheckClass(left,
+                  ICData::ZoneHandle(
+                      call->ic_data()->AsUnaryClassChecksForArgNr(0)),
+                  call->deopt_id(),
+                  call->env(),
+                  call);
+    // Type check right.
+    AddCheckClass(right,
+                  ICData::ZoneHandle(
+                      call->ic_data()->AsUnaryClassChecksForArgNr(1)),
+                  call->deopt_id(),
+                  call->env(),
+                  call);
+    // Replace call.
+    BinaryFloat32x4OpInstr* float32x4_bin_op =
+        new BinaryFloat32x4OpInstr(op_kind, new Value(left), new Value(right),
+                                   call);
+    ReplaceCall(call, float32x4_bin_op);
   } else if (op_kind == Token::kMOD) {
     // TODO(vegorov): implement fast path code for modulo.
     ASSERT(operands_type == kSmiCid);
@@ -2153,24 +2187,78 @@
 }
 
 
+bool FlowGraphOptimizer::CanStrictifyEqualityCompare(
+    EqualityCompareInstr* compare) {
+  // If one of the inputs is null this is a strict comparison.
+  if (compare->left()->BindsToConstantNull() ||
+      compare->right()->BindsToConstantNull()) {
+    return true;
+  }
+
+  if (compare->left()->Type()->IsNone()) {
+    return false;  // We might be running prior to any type propagation passes.
+  }
+
+  // Try resolving target function using propagated cid for the receiver.
+  // If receiver is either null or has default equality operator then
+  // we can convert such comparison to a strict one.
+  const intptr_t receiver_cid =
+     compare->left()->Type()->ToNullableCid();
+
+  if (receiver_cid == kDynamicCid) {
+    return false;
+  }
+
+  const Class& receiver_class = Class::Handle(
+      Isolate::Current()->class_table()->At(receiver_cid));
+
+  // Resolve equality operator.
+  const Function& function = Function::Handle(
+      Resolver::ResolveDynamicForReceiverClass(
+          receiver_class,
+          Symbols::EqualOperator(),
+          2,
+          0));
+
+  if (function.IsNull()) {
+    return false;
+  }
+
+  // Default equality operator declared on the Object class just calls
+  // identical.
+  return (Class::Handle(function.Owner()).id() == kInstanceCid);
+}
+
+
 template <typename T>
-void FlowGraphOptimizer::HandleEqualityCompare(EqualityCompareInstr* comp,
-                                               T current_instruction) {
-  // If one of the inputs is null, no ICdata will be collected.
-  if (comp->left()->BindsToConstantNull() ||
-      comp->right()->BindsToConstantNull()) {
-    Token::Kind strict_kind = (comp->kind() == Token::kEQ) ?
+bool FlowGraphOptimizer::StrictifyEqualityCompare(
+    EqualityCompareInstr* compare,
+    T current_instruction) const {
+  if (CanStrictifyEqualityCompare(compare)) {
+    Token::Kind strict_kind = (compare->kind() == Token::kEQ) ?
         Token::kEQ_STRICT : Token::kNE_STRICT;
     StrictCompareInstr* strict_comp =
         new StrictCompareInstr(strict_kind,
-                               comp->left()->Copy(),
-                               comp->right()->Copy());
+                               compare->left()->CopyWithType(),
+                               compare->right()->CopyWithType());
     current_instruction->ReplaceWith(strict_comp, current_iterator());
+    return true;
+  }
+  return false;
+}
+
+
+template <typename T>
+void FlowGraphOptimizer::HandleEqualityCompare(EqualityCompareInstr* comp,
+                                               T current_instruction) {
+  if (StrictifyEqualityCompare(comp, current_instruction)) {
     return;
   }
+
   if (!comp->HasICData() || (comp->ic_data()->NumberOfChecks() == 0)) {
     return;
   }
+
   ASSERT(comp->ic_data()->num_args_tested() == 2);
   if (comp->ic_data()->NumberOfChecks() == 1) {
     GrowableArray<intptr_t> class_ids;
@@ -2236,6 +2324,8 @@
 }
 
 
+
+
 void FlowGraphOptimizer::VisitEqualityCompare(EqualityCompareInstr* instr) {
   HandleEqualityCompare(instr, instr);
 }
@@ -4399,6 +4489,19 @@
 }
 
 
+void ConstantPropagator::VisitBinaryFloat32x4Op(
+    BinaryFloat32x4OpInstr* instr) {
+  const Object& left = instr->left()->definition()->constant_value();
+  const Object& right = instr->right()->definition()->constant_value();
+  if (IsNonConstant(left) || IsNonConstant(right)) {
+    SetValue(instr, non_constant_);
+  } else if (IsConstant(left) && IsConstant(right)) {
+    // TODO(kmillikin): Handle binary operation.
+    SetValue(instr, non_constant_);
+  }
+}
+
+
 void ConstantPropagator::VisitMathSqrt(MathSqrtInstr* instr) {
   const Object& value = instr->value()->definition()->constant_value();
   if (IsNonConstant(value)) {
diff --git a/runtime/vm/flow_graph_optimizer.h b/runtime/vm/flow_graph_optimizer.h
index 1b48ac2..80c8e7f 100644
--- a/runtime/vm/flow_graph_optimizer.h
+++ b/runtime/vm/flow_graph_optimizer.h
@@ -155,6 +155,12 @@
   void HandleEqualityCompare(EqualityCompareInstr* comp,
                              T current_instruction);
 
+  static bool CanStrictifyEqualityCompare(EqualityCompareInstr* call);
+
+  template <typename T>
+  bool StrictifyEqualityCompare(EqualityCompareInstr* compare,
+                                T current_instruction) const;
+
   void OptimizeLeftShiftBitAndSmiOp(Definition* bit_and_instr,
                                     Definition* left_instr,
                                     Definition* right_instr);
diff --git a/runtime/vm/flow_graph_type_propagator.cc b/runtime/vm/flow_graph_type_propagator.cc
index 2e5abea..ec1a880 100644
--- a/runtime/vm/flow_graph_type_propagator.cc
+++ b/runtime/vm/flow_graph_type_propagator.cc
@@ -962,6 +962,11 @@
 }
 
 
+CompileType BinaryFloat32x4OpInstr::ComputeType() const {
+  return CompileType::FromCid(kFloat32x4Cid);
+}
+
+
 CompileType MathSqrtInstr::ComputeType() const {
   return CompileType::FromCid(kDoubleCid);
 }
diff --git a/runtime/vm/il_printer.cc b/runtime/vm/il_printer.cc
index 1465a83..ce75a13 100644
--- a/runtime/vm/il_printer.cc
+++ b/runtime/vm/il_printer.cc
@@ -595,6 +595,14 @@
 }
 
 
+void BinaryFloat32x4OpInstr::PrintOperandsTo(BufferFormatter* f) const {
+  f->Print("%s, ", Token::Str(op_kind()));
+  left()->PrintTo(f);
+  f->Print(", ");
+  right()->PrintTo(f);
+}
+
+
 void BinaryMintOpInstr::PrintOperandsTo(BufferFormatter* f) const {
   f->Print("%s, ", Token::Str(op_kind()));
   left()->PrintTo(f);
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 0c64c34..55de520 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -1316,16 +1316,7 @@
     return this;
   }
 
-  const intptr_t num_checks = unary_checks().NumberOfChecks();
-
-  for (intptr_t i = 0; i < num_checks; i++) {
-    if (value_cid == unary_checks().GetReceiverClassIdAt(i)) {
-      // No checks needed.
-      return NULL;
-    }
-  }
-
-  return this;
+  return unary_checks().HasReceiverClassId(value_cid) ? NULL : this;
 }
 
 
@@ -1511,7 +1502,7 @@
 
 
 void StoreContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  // Nothing to do.  Context register were loaded by register allocator.
+  // Nothing to do.  Context register was loaded by the register allocator.
   ASSERT(locs()->in(0).reg() == CTX);
 }
 
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 1b00413..05b0a21 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -504,6 +504,7 @@
   M(InvokeMathCFunction)                                                       \
   M(GuardField)                                                                \
   M(IfThenElse)                                                                \
+  M(BinaryFloat32x4Op)                                                         \
 
 #define FORWARD_DECLARATION(type) class type##Instr;
 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION)
@@ -753,6 +754,7 @@
   friend class UnboxDoubleInstr;
   friend class UnboxFloat32x4Instr;
   friend class BinaryDoubleOpInstr;
+  friend class BinaryFloat32x4OpInstr;
   friend class BinaryMintOpInstr;
   friend class BinarySmiOpInstr;
   friend class UnarySmiOpInstr;
@@ -1198,7 +1200,7 @@
  private:
   // Classes that have access to predecessors_ when inlining.
   friend class BlockEntryInstr;
-  friend class InliningContext;
+  friend class InlineExitCollector;
 
   // Direct access to phis_ in order to resize it due to phi elimination.
   friend class ConstantPropagator;
@@ -4083,6 +4085,60 @@
 };
 
 
+class BinaryFloat32x4OpInstr : public TemplateDefinition<2> {
+ public:
+  BinaryFloat32x4OpInstr(Token::Kind op_kind,
+                         Value* left,
+                         Value* right,
+                         InstanceCallInstr* instance_call)
+      : op_kind_(op_kind) {
+    SetInputAt(0, left);
+    SetInputAt(1, right);
+    deopt_id_ = instance_call->deopt_id();
+  }
+
+  Value* left() const { return inputs_[0]; }
+  Value* right() const { return inputs_[1]; }
+
+  Token::Kind op_kind() const { return op_kind_; }
+
+  virtual void PrintOperandsTo(BufferFormatter* f) const;
+
+  virtual bool CanDeoptimize() const { return false; }
+
+  virtual bool HasSideEffect() const { return false; }
+
+  virtual bool AffectedBySideEffect() const { return false; }
+
+  virtual bool AttributesEqual(Instruction* other) const {
+    return op_kind() == other->AsBinaryFloat32x4Op()->op_kind();
+  }
+
+  virtual Representation representation() const {
+    return kUnboxedFloat32x4;
+  }
+
+  virtual Representation RequiredInputRepresentation(intptr_t idx) const {
+    ASSERT((idx == 0) || (idx == 1));
+    return kUnboxedFloat32x4;
+  }
+
+  virtual intptr_t DeoptimizationTarget() const {
+    // Direct access since this instruction cannot deoptimize, and the deopt-id
+    // was inherited from another instruction that could deoptimize.
+    return deopt_id_;
+  }
+
+  DECLARE_INSTRUCTION(BinaryFloat32x4Op)
+  virtual CompileType ComputeType() const;
+
+ private:
+  const Token::Kind op_kind_;
+
+  DISALLOW_COPY_AND_ASSIGN(BinaryFloat32x4OpInstr);
+};
+
+
 class BinaryMintOpInstr : public TemplateDefinition<2> {
  public:
   BinaryMintOpInstr(Token::Kind op_kind,
diff --git a/runtime/vm/intermediate_language_arm.cc b/runtime/vm/intermediate_language_arm.cc
index 5ae8494..64e8e39 100644
--- a/runtime/vm/intermediate_language_arm.cc
+++ b/runtime/vm/intermediate_language_arm.cc
@@ -65,7 +65,7 @@
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
   LocationSummary* locs =
-      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RegisterLocation(R0));
   return locs;
 }
@@ -84,9 +84,11 @@
   // not optimized.
   if (!compiler->HasFinally()) {
     __ Comment("Stack Check");
-    const int sp_fp_dist = compiler->StackSize() + (-kFirstLocalSlotIndex - 1);
-    __ sub(R2, FP, ShifterOperand(SP));
-    __ CompareImmediate(R2, sp_fp_dist * kWordSize);
+    const intptr_t fp_sp_dist =
+        (kFirstLocalSlotIndex + 1 - compiler->StackSize()) * kWordSize;
+    ASSERT(fp_sp_dist <= 0);
+    __ sub(R2, SP, ShifterOperand(FP));
+    __ CompareImmediate(R2, fp_sp_dist);
     __ bkpt(0, NE);
   }
 #endif
@@ -128,8 +130,31 @@
 
 
 LocationSummary* ClosureCallInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 0;
+  const intptr_t kNumTemps = 1;
+  LocationSummary* result =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
+  result->set_out(Location::RegisterLocation(R0));
+  result->set_temp(0, Location::RegisterLocation(R4));  // Arg. descriptor.
+  return result;
+}
+
+
+void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  // The arguments to the stub include the closure, as does the arguments
+  // descriptor.
+  Register temp_reg = locs()->temp(0).reg();
+  int argument_count = ArgumentCount();
+  const Array& arguments_descriptor =
+      Array::ZoneHandle(ArgumentsDescriptor::New(argument_count,
+                                                 argument_names()));
+  __ LoadObject(temp_reg, arguments_descriptor);
+  compiler->GenerateDartCall(deopt_id(),
+                             token_pos(),
+                             &StubCode::CallClosureFunctionLabel(),
+                             PcDescriptors::kOther,
+                             locs());
+  __ Drop(argument_count);
 }
 
 
@@ -842,57 +867,345 @@
 
 
 LocationSummary* StoreIndexedInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 3;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* locs =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  locs->set_in(0, Location::RequiresRegister());
+  // The smi index is either untagged (element size == 1), or it is left smi
+  // tagged (for all element sizes > 1).
+  // TODO(regis): Revisit and see if the index can be immediate.
+  locs->set_in(1, Location::WritableRegister());
+  switch (class_id()) {
+    case kArrayCid:
+      locs->set_in(2, ShouldEmitStoreBarrier()
+                        ? Location::WritableRegister()
+                        : Location::RegisterOrConstant(value()));
+      break;
+    case kExternalTypedDataUint8ArrayCid:
+    case kExternalTypedDataUint8ClampedArrayCid:
+    case kTypedDataInt8ArrayCid:
+    case kTypedDataUint8ArrayCid:
+    case kTypedDataUint8ClampedArrayCid:
+    case kTypedDataInt16ArrayCid:
+    case kTypedDataUint16ArrayCid:
+    case kTypedDataInt32ArrayCid:
+    case kTypedDataUint32ArrayCid:
+    case kTypedDataFloat32ArrayCid:
+    case kTypedDataFloat64ArrayCid:
+    case kTypedDataFloat32x4ArrayCid:
+      UNIMPLEMENTED();
+      break;
+    default:
+      UNREACHABLE();
+      return NULL;
+  }
+  return locs;
 }
 
 
 void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Register array = locs()->in(0).reg();
+  Location index = locs()->in(1);
+
+  Address element_address(kNoRegister, 0);
+  if (IsExternal()) {
+    UNIMPLEMENTED();
+  } else {
+    ASSERT(this->array()->definition()->representation() == kTagged);
+    ASSERT(index.IsRegister());  // TODO(regis): Revisit.
+    // Note that index is expected smi-tagged, (i.e, times 2) for all arrays
+    // with index scale factor > 1. E.g., for Uint8Array and OneByteString the
+    // index is expected to be untagged before accessing.
+    ASSERT(kSmiTagShift == 1);
+    switch (index_scale()) {
+      case 1: {
+        __ SmiUntag(index.reg());
+        break;
+      }
+      case 2: {
+        break;
+      }
+      case 4: {
+        __ mov(index.reg(), ShifterOperand(index.reg(), LSL, 1));
+        break;
+      }
+      case 8: {
+        __ mov(index.reg(), ShifterOperand(index.reg(), LSL, 2));
+        break;
+      }
+      case 16: {
+        __ mov(index.reg(), ShifterOperand(index.reg(), LSL, 3));
+        break;
+      }
+      default:
+        UNREACHABLE();
+    }
+    __ AddImmediate(index.reg(),
+        FlowGraphCompiler::DataOffsetFor(class_id()) - kHeapObjectTag);
+    element_address = Address(array, index.reg(), LSL, 0);
+  }
+
+  switch (class_id()) {
+    case kArrayCid:
+      if (ShouldEmitStoreBarrier()) {
+        Register value = locs()->in(2).reg();
+        __ StoreIntoObject(array, element_address, value);
+      } else if (locs()->in(2).IsConstant()) {
+        const Object& constant = locs()->in(2).constant();
+        __ StoreIntoObjectNoBarrier(array, element_address, constant);
+      } else {
+        Register value = locs()->in(2).reg();
+        __ StoreIntoObjectNoBarrier(array, element_address, value);
+      }
+      break;
+    case kTypedDataInt8ArrayCid:
+    case kTypedDataUint8ArrayCid:
+    case kExternalTypedDataUint8ArrayCid:
+    case kTypedDataUint8ClampedArrayCid:
+    case kExternalTypedDataUint8ClampedArrayCid:
+    case kTypedDataInt16ArrayCid:
+    case kTypedDataUint16ArrayCid:
+    case kTypedDataInt32ArrayCid:
+    case kTypedDataUint32ArrayCid:
+    case kTypedDataFloat32ArrayCid:
+    case kTypedDataFloat64ArrayCid:
+    case kTypedDataFloat32x4ArrayCid:
+      UNIMPLEMENTED();
+      break;
+    default:
+      UNREACHABLE();
+  }
 }
 
 
 LocationSummary* GuardFieldInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 1;
+  LocationSummary* summary =
+      new LocationSummary(kNumInputs, 0, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresRegister());
+  if ((value()->Type()->ToCid() == kDynamicCid) &&
+      (field().guarded_cid() != kSmiCid)) {
+    summary->AddTemp(Location::RequiresRegister());
+  }
+  if (field().guarded_cid() == kIllegalCid) {
+    summary->AddTemp(Location::RequiresRegister());
+  }
+  return summary;
 }
 
 
 void GuardFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  const intptr_t field_cid = field().guarded_cid();
+  const intptr_t nullability = field().is_nullable() ? kNullCid : kIllegalCid;
+
+  if (field_cid == kDynamicCid) {
+    ASSERT(!compiler->is_optimizing());
+    return;  // Nothing to emit.
+  }
+
+  const intptr_t value_cid = value()->Type()->ToCid();
+
+  Register value_reg = locs()->in(0).reg();
+
+  Register value_cid_reg = ((value_cid == kDynamicCid) &&
+      (field_cid != kSmiCid)) ? locs()->temp(0).reg() : kNoRegister;
+
+  Register field_reg = (field_cid == kIllegalCid) ?
+      locs()->temp(locs()->temp_count() - 1).reg() : kNoRegister;
+
+  Label ok, fail_label;
+
+  Label* deopt = compiler->is_optimizing() ?
+      compiler->AddDeoptStub(deopt_id(), kDeoptGuardField) : NULL;
+
+  Label* fail = (deopt != NULL) ? deopt : &fail_label;
+
+  const bool ok_is_fall_through = (deopt != NULL);
+
+  if (!compiler->is_optimizing() || (field_cid == kIllegalCid)) {
+    if (!compiler->is_optimizing()) {
+      // Currently we can't have different location summaries for optimized
+      // and non-optimized code. So instead we manually pick up a register
+      // that is known to be free because we know how non-optimizing compiler
+      // allocates registers.
+      field_reg = R2;
+      ASSERT((field_reg != value_reg) && (field_reg != value_cid_reg));
+    }
+
+    __ LoadObject(field_reg, Field::ZoneHandle(field().raw()));
+
+    FieldAddress field_cid_operand(field_reg, Field::guarded_cid_offset());
+    FieldAddress field_nullability_operand(
+        field_reg, Field::is_nullable_offset());
+
+    if (value_cid == kDynamicCid) {
+      if (value_cid_reg == kNoRegister) {
+        ASSERT(!compiler->is_optimizing());
+        value_cid_reg = R3;
+        ASSERT((value_cid_reg != value_reg) && (field_reg != value_cid_reg));
+      }
+
+      LoadValueCid(compiler, value_cid_reg, value_reg);
+
+      __ ldr(IP, field_cid_operand);
+      __ cmp(value_cid_reg, ShifterOperand(IP));
+      __ b(&ok, EQ);
+      __ ldr(IP, field_nullability_operand);
+      __ cmp(value_cid_reg, ShifterOperand(IP));
+    } else if (value_cid == kNullCid) {
+      // TODO(regis): IP may conflict. Revisit.
+      __ ldr(IP, field_nullability_operand);
+      __ CompareImmediate(IP, value_cid);
+    } else {
+      // TODO(regis): IP may conflict. Revisit.
+      __ ldr(IP, field_cid_operand);
+      __ CompareImmediate(IP, value_cid);
+    }
+    __ b(&ok, EQ);
+
+    __ ldr(IP, field_cid_operand);
+    __ CompareImmediate(IP, kIllegalCid);
+    __ b(fail, NE);
+
+    if (value_cid == kDynamicCid) {
+      __ str(value_cid_reg, field_cid_operand);
+      __ str(value_cid_reg, field_nullability_operand);
+    } else {
+      __ LoadImmediate(IP, value_cid);
+      __ str(IP, field_cid_operand);
+      __ str(IP, field_nullability_operand);
+    }
+
+    if (!ok_is_fall_through) {
+      __ b(&ok);
+    }
+  } else {
+    if (value_cid == kDynamicCid) {
+      // Field's guarded class id is fixed by value's class id is not known.
+      __ tst(value_reg, ShifterOperand(kSmiTagMask));
+
+      if (field_cid != kSmiCid) {
+        __ b(fail, EQ);
+        __ LoadClassId(value_cid_reg, value_reg);
+        __ CompareImmediate(value_cid_reg, field_cid);
+      }
+
+      if (field().is_nullable() && (field_cid != kNullCid)) {
+        __ b(&ok, EQ);
+        __ CompareImmediate(value_reg,
+                            reinterpret_cast<intptr_t>(Object::null()));
+      }
+
+      if (ok_is_fall_through) {
+        __ b(fail, NE);
+      } else {
+        __ b(&ok, EQ);
+      }
+    } else {
+      // Both value's and field's class id is known.
+      if ((value_cid != field_cid) && (value_cid != nullability)) {
+        if (ok_is_fall_through) {
+          __ b(fail);
+        }
+      } else {
+        // Nothing to emit.
+        ASSERT(!compiler->is_optimizing());
+        return;
+      }
+    }
+  }
+
+  if (deopt == NULL) {
+    ASSERT(!compiler->is_optimizing());
+    __ Bind(fail);
+
+    __ ldr(IP, FieldAddress(field_reg, Field::guarded_cid_offset()));
+    __ CompareImmediate(IP, kDynamicCid);
+    __ b(&ok, EQ);
+
+    __ Push(field_reg);
+    __ Push(value_reg);
+    __ CallRuntime(kUpdateFieldCidRuntimeEntry);
+    __ Drop(2);  // Drop the field and the value.
+  }
+
+  __ Bind(&ok);
 }
 
 
 LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 2;
+  const intptr_t num_temps =  0;
+  LocationSummary* summary =
+      new LocationSummary(kNumInputs, num_temps, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresRegister());
+  summary->set_in(1, ShouldEmitStoreBarrier()
+                       ? Location::WritableRegister()
+                       : Location::RegisterOrConstant(value()));
+  return summary;
 }
 
 
 void StoreInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Register instance_reg = locs()->in(0).reg();
+  if (ShouldEmitStoreBarrier()) {
+    Register value_reg = locs()->in(1).reg();
+    __ StoreIntoObject(instance_reg,
+                       FieldAddress(instance_reg, field().Offset()),
+                       value_reg,
+                       CanValueBeSmi());
+  } else {
+    if (locs()->in(1).IsConstant()) {
+      __ StoreIntoObjectNoBarrier(
+          instance_reg,
+          FieldAddress(instance_reg, field().Offset()),
+          locs()->in(1).constant());
+    } else {
+      Register value_reg = locs()->in(1).reg();
+      __ StoreIntoObjectNoBarrier(instance_reg,
+          FieldAddress(instance_reg, field().Offset()), value_reg);
+    }
+  }
 }
 
 
 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  return LocationSummary::Make(0,
+                               Location::RequiresRegister(),
+                               LocationSummary::kNoCall);
 }
 
 
 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Register result = locs()->out().reg();
+  __ LoadObject(result, field());
+  __ LoadFromOffset(kLoadWord, result,
+                    result, Field::value_offset() - kHeapObjectTag);
 }
 
 
 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  LocationSummary* locs = new LocationSummary(1, 1, LocationSummary::kNoCall);
+  locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister()
+                                              : Location::RequiresRegister());
+  locs->set_temp(0, Location::RequiresRegister());
+  return locs;
 }
 
 
 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Register value = locs()->in(0).reg();
+  Register temp = locs()->temp(0).reg();
+
+  __ LoadObject(temp, field());
+  if (this->value()->NeedsStoreBuffer()) {
+    __ StoreIntoObject(temp,
+        FieldAddress(temp, Field::value_offset()), value, CanValueBeSmi());
+  } else {
+    __ StoreIntoObjectNoBarrier(
+        temp, FieldAddress(temp, Field::value_offset()), value);
+  }
 }
 
 
@@ -908,13 +1221,25 @@
 
 
 LocationSummary* CreateArrayInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* locs =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
+  locs->set_in(0, Location::RegisterLocation(R1));
+  locs->set_out(Location::RegisterLocation(R0));
+  return locs;
 }
 
 
 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  // Allocate the array.  R2 = length, R1 = element type.
+  ASSERT(locs()->in(0).reg() == R1);
+  __ LoadImmediate(R2, Smi::RawValue(num_elements()));
+  compiler->GenerateCall(token_pos(),
+                         &StubCode::AllocateArrayLabel(),
+                         PcDescriptors::kOther,
+                         locs());
+  ASSERT(locs()->out().reg() == R0);
 }
 
 
@@ -932,62 +1257,227 @@
 
 
 LocationSummary* LoadFieldInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  return LocationSummary::Make(1,
+                               Location::RequiresRegister(),
+                               LocationSummary::kNoCall);
 }
 
 
 void LoadFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Register instance_reg = locs()->in(0).reg();
+  Register result_reg = locs()->out().reg();
+
+  __ LoadFromOffset(kLoadWord, result_reg,
+                    instance_reg, offset_in_bytes() - kHeapObjectTag);
 }
 
 
 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 1;
+  LocationSummary* locs =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
+  locs->set_in(0, Location::RegisterLocation(R0));
+  locs->set_temp(0, Location::RegisterLocation(R1));
+  locs->set_out(Location::RegisterLocation(R0));
+  return locs;
 }
 
 
 void InstantiateTypeArgumentsInstr::EmitNativeCode(
     FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Register instantiator_reg = locs()->in(0).reg();
+  Register temp = locs()->temp(0).reg();
+  Register result_reg = locs()->out().reg();
+
+  // 'instantiator_reg' is the instantiator AbstractTypeArguments object
+  // (or null).
+  // If the instantiator is null and if the type argument vector
+  // instantiated from null becomes a vector of dynamic, then use null as
+  // the type arguments.
+  Label type_arguments_instantiated;
+  const intptr_t len = type_arguments().Length();
+  if (type_arguments().IsRawInstantiatedRaw(len)) {
+    __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null()));
+    __ cmp(instantiator_reg, ShifterOperand(IP));
+    __ b(&type_arguments_instantiated, EQ);
+  }
+  // Instantiate non-null type arguments.
+  if (type_arguments().IsUninstantiatedIdentity()) {
+    // Check if the instantiator type argument vector is a TypeArguments of a
+    // matching length and, if so, use it as the instantiated type_arguments.
+    // No need to check the instantiator ('instantiator_reg') for null here,
+    // because a null instantiator will have the wrong class (Null instead of
+    // TypeArguments).
+    Label type_arguments_uninstantiated;
+    __ CompareClassId(instantiator_reg, kTypeArgumentsCid, temp);
+    __ b(&type_arguments_uninstantiated, NE);
+    __ ldr(temp,
+           FieldAddress(instantiator_reg, TypeArguments::length_offset()));
+    __ CompareImmediate(temp, Smi::RawValue(len));
+    __ b(&type_arguments_instantiated, EQ);
+    __ Bind(&type_arguments_uninstantiated);
+  }
+  // A runtime call to instantiate the type arguments is required.
+  __ PushObject(Object::ZoneHandle());  // Make room for the result.
+  __ PushObject(type_arguments());
+  __ Push(instantiator_reg);  // Push instantiator type arguments.
+  compiler->GenerateCallRuntime(token_pos(),
+                                deopt_id(),
+                                kInstantiateTypeArgumentsRuntimeEntry,
+                                locs());
+  __ Drop(2);  // Drop instantiator and uninstantiated type arguments.
+  __ Pop(result_reg);  // Pop instantiated type arguments.
+  __ Bind(&type_arguments_instantiated);
+  ASSERT(instantiator_reg == result_reg);
+  // 'result_reg': Instantiated type arguments.
 }
 
 
 LocationSummary*
 ExtractConstructorTypeArgumentsInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 1;
+  LocationSummary* locs =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  locs->set_in(0, Location::RequiresRegister());
+  locs->set_out(Location::SameAsFirstInput());
+  locs->set_temp(0, Location::RequiresRegister());
+  return locs;
 }
 
 
 void ExtractConstructorTypeArgumentsInstr::EmitNativeCode(
     FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Register instantiator_reg = locs()->in(0).reg();
+  Register result_reg = locs()->out().reg();
+  ASSERT(instantiator_reg == result_reg);
+  Register temp_reg = locs()->temp(0).reg();
+
+  // instantiator_reg is the instantiator type argument vector, i.e. an
+  // AbstractTypeArguments object (or null).
+  // If the instantiator is null and if the type argument vector
+  // instantiated from null becomes a vector of dynamic, then use null as
+  // the type arguments.
+  Label type_arguments_instantiated;
+  const intptr_t len = type_arguments().Length();
+  if (type_arguments().IsRawInstantiatedRaw(len)) {
+    __ CompareImmediate(instantiator_reg,
+                        reinterpret_cast<intptr_t>(Object::null()));
+    __ b(&type_arguments_instantiated, EQ);
+  }
+  // Instantiate non-null type arguments.
+  if (type_arguments().IsUninstantiatedIdentity()) {
+    // Check if the instantiator type argument vector is a TypeArguments of a
+    // matching length and, if so, use it as the instantiated type_arguments.
+    // No need to check instantiator_reg for null here, because a null
+    // instantiator will have the wrong class (Null instead of TypeArguments).
+    Label type_arguments_uninstantiated;
+    __ CompareClassId(instantiator_reg, kTypeArgumentsCid, temp_reg);
+    __ b(&type_arguments_uninstantiated, NE);
+    __ ldr(temp_reg,
+           FieldAddress(instantiator_reg, TypeArguments::length_offset()));
+    __ CompareImmediate(temp_reg, Smi::RawValue(type_arguments().Length()));
+    __ b(&type_arguments_instantiated, EQ);
+    __ Bind(&type_arguments_uninstantiated);
+  }
+  // In the non-factory case, we rely on the allocation stub to
+  // instantiate the type arguments.
+  __ LoadObject(result_reg, type_arguments());
+  // result_reg: uninstantiated type arguments.
+  __ Bind(&type_arguments_instantiated);
+  // result_reg: uninstantiated or instantiated type arguments.
 }
 
 
 LocationSummary*
 ExtractConstructorInstantiatorInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 1;
+  LocationSummary* locs =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  locs->set_in(0, Location::RequiresRegister());
+  locs->set_out(Location::SameAsFirstInput());
+  locs->set_temp(0, Location::RequiresRegister());
+  return locs;
 }
 
 
 void ExtractConstructorInstantiatorInstr::EmitNativeCode(
     FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Register instantiator_reg = locs()->in(0).reg();
+  ASSERT(locs()->out().reg() == instantiator_reg);
+  Register temp_reg = locs()->temp(0).reg();
+
+  // instantiator_reg is the instantiator AbstractTypeArguments object
+  // (or null).  If the instantiator is null and if the type argument vector
+  // instantiated from null becomes a vector of dynamic, then use null as
+  // the type arguments and do not pass the instantiator.
+  Label done;
+  const intptr_t len = type_arguments().Length();
+  if (type_arguments().IsRawInstantiatedRaw(len)) {
+    Label instantiator_not_null;
+    __ CompareImmediate(instantiator_reg,
+                        reinterpret_cast<intptr_t>(Object::null()));
+    __ b(&instantiator_not_null, NE);
+    // Null was used in VisitExtractConstructorTypeArguments as the
+    // instantiated type arguments, no proper instantiator needed.
+    __ LoadImmediate(instantiator_reg,
+                     Smi::RawValue(StubCode::kNoInstantiator));
+    __ b(&done);
+    __ Bind(&instantiator_not_null);
+  }
+  // Instantiate non-null type arguments.
+  if (type_arguments().IsUninstantiatedIdentity()) {
+    // TODO(regis): The following emitted code is duplicated in
+    // VisitExtractConstructorTypeArguments above. The reason is that the code
+    // is split between two computations, so that each one produces a
+    // single value, rather than producing a pair of values.
+    // If this becomes an issue, we should expose these tests at the IL level.
+
+    // Check if the instantiator type argument vector is a TypeArguments of a
+    // matching length and, if so, use it as the instantiated type_arguments.
+    // No need to check the instantiator ('instantiator_reg') for null here,
+    // because a null instantiator will have the wrong class (Null instead of
+    // TypeArguments).
+    __ CompareClassId(instantiator_reg, kTypeArgumentsCid, temp_reg);
+    __ b(&done, NE);
+    __ ldr(temp_reg,
+           FieldAddress(instantiator_reg, TypeArguments::length_offset()));
+    __ CompareImmediate(temp_reg, Smi::RawValue(type_arguments().Length()));
+    __ b(&done, NE);
+    // The instantiator was used in VisitExtractConstructorTypeArguments as the
+    // instantiated type arguments, no proper instantiator needed.
+    __ LoadImmediate(instantiator_reg,
+                     Smi::RawValue(StubCode::kNoInstantiator));
+  }
+  __ Bind(&done);
+  // instantiator_reg: instantiator or kNoInstantiator.
 }
 
 
 LocationSummary* AllocateContextInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 0;
+  const intptr_t kNumTemps = 1;
+  LocationSummary* locs =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
+  locs->set_temp(0, Location::RegisterLocation(R1));
+  locs->set_out(Location::RegisterLocation(R0));
+  return locs;
 }
 
 
 void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  ASSERT(locs()->temp(0).reg() == R1);
+  ASSERT(locs()->out().reg() == R0);
+
+  __ LoadImmediate(R1, num_context_variables());
+  const ExternalLabel label("alloc_context",
+                            StubCode::AllocateContextEntryPoint());
+  compiler->GenerateCall(token_pos(),
+                         &label,
+                         PcDescriptors::kOther,
+                         locs());
 }
 
 
@@ -1003,13 +1493,31 @@
 
 
 LocationSummary* CatchEntryInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  return LocationSummary::Make(0,
+                               Location::NoLocation(),
+                               LocationSummary::kNoCall);
 }
 
 
+// Restore stack and initialize the two exception variables:
+// exception and stack trace variables.
 void CatchEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  // Restore SP from FP as we are coming from a throw and the code for
+  // popping arguments has not been run.
+  const intptr_t fp_sp_dist =
+      (kFirstLocalSlotIndex + 1 - compiler->StackSize()) * kWordSize;
+  ASSERT(fp_sp_dist <= 0);
+  __ AddImmediate(SP, FP, fp_sp_dist);
+
+  ASSERT(!exception_var().is_captured());
+  ASSERT(!stacktrace_var().is_captured());
+  __ StoreToOffset(kStoreWord, kExceptionObjectReg,
+                   FP, exception_var().index() * kWordSize);
+  __ StoreToOffset(kStoreWord, kStackTraceObjectReg,
+                   FP, stacktrace_var().index() * kWordSize);
+
+  // Restore the pool pointer.
+  __ LoadPoolPointer();
 }
 
 
@@ -1321,6 +1829,17 @@
 }
 
 
+LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary() const {
+  UNIMPLEMENTED();
+  return NULL;
+}
+
+
+void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  UNIMPLEMENTED();
+}
+
+
 LocationSummary* MathSqrtInstr::MakeLocationSummary() const {
   UNIMPLEMENTED();
   return NULL;
@@ -1548,25 +2067,30 @@
 
 
 LocationSummary* ThrowInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  return new LocationSummary(0, 0, LocationSummary::kCall);
 }
 
 
-
 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  compiler->GenerateCallRuntime(token_pos(),
+                                deopt_id(),
+                                kThrowRuntimeEntry,
+                                locs());
+  __ bkpt(0);
 }
 
 
 LocationSummary* ReThrowInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  return new LocationSummary(0, 0, LocationSummary::kCall);
 }
 
 
 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  compiler->GenerateCallRuntime(token_pos(),
+                                deopt_id(),
+                                kReThrowRuntimeEntry,
+                                locs());
+  __ bkpt(0);
 }
 
 
@@ -1646,13 +2170,14 @@
 
 
 LocationSummary* CurrentContextInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  return LocationSummary::Make(0,
+                               Location::RequiresRegister(),
+                               LocationSummary::kNoCall);
 }
 
 
 void CurrentContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  __ mov(locs()->out().reg(), ShifterOperand(CTX));
 }
 
 
@@ -1739,19 +2264,23 @@
 }
 
 
-void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
-}
-
-
 LocationSummary* BooleanNegateInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  return LocationSummary::Make(1,
+                               Location::RequiresRegister(),
+                               LocationSummary::kNoCall);
 }
 
 
 void BooleanNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Register value = locs()->in(0).reg();
+  Register result = locs()->out().reg();
+
+  Label done;
+  __ LoadObject(result, Bool::True());
+  __ cmp(result, ShifterOperand(value));
+  __ b(&done, NE);
+  __ LoadObject(result, Bool::False());
+  __ Bind(&done);
 }
 
 
@@ -1795,13 +2324,21 @@
 
 
 LocationSummary* CreateClosureInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  return MakeCallSummary();
 }
 
 
 void CreateClosureInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  const Function& closure_function = function();
+  ASSERT(!closure_function.IsImplicitStaticClosureFunction());
+  const Code& stub = Code::Handle(
+      StubCode::GetAllocationStubForClosure(closure_function));
+  const ExternalLabel label(closure_function.ToCString(), stub.EntryPoint());
+  compiler->GenerateCall(token_pos(),
+                         &label,
+                         PcDescriptors::kOther,
+                         locs());
+  __ Drop(2);  // Discard type arguments and receiver.
 }
 
 }  // namespace dart
diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc
index 689f965..ad46c62 100644
--- a/runtime/vm/intermediate_language_ia32.cc
+++ b/runtime/vm/intermediate_language_ia32.cc
@@ -64,7 +64,7 @@
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
   LocationSummary* locs =
-      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RegisterLocation(EAX));
   return locs;
 }
@@ -84,10 +84,12 @@
   if (!compiler->HasFinally()) {
     __ Comment("Stack Check");
     Label done;
-    const int sp_fp_dist = compiler->StackSize() + (-kFirstLocalSlotIndex - 1);
-    __ movl(EDI, EBP);
-    __ subl(EDI, ESP);
-    __ cmpl(EDI, Immediate(sp_fp_dist * kWordSize));
+    const intptr_t fp_sp_dist =
+        (kFirstLocalSlotIndex + 1 - compiler->StackSize()) * kWordSize;
+    ASSERT(fp_sp_dist <= 0);
+    __ movl(EDI, ESP);
+    __ subl(EDI, EBP);
+    __ cmpl(EDI, Immediate(fp_sp_dist));
     __ j(EQUAL, &done, Assembler::kNearJump);
     __ int3();
     __ Bind(&done);
@@ -2023,7 +2025,7 @@
 
     // Check if the instantiator type argument vector is a TypeArguments of a
     // matching length and, if so, use it as the instantiated type_arguments.
-    // No need to check the instantiator (RAX) for null here, because a null
+    // No need to check the instantiator for null here, because a null
     // instantiator will have the wrong class (Null instead of TypeArguments).
     __ CompareClassId(instantiator_reg, kTypeArgumentsCid, temp_reg);
     __ j(NOT_EQUAL, &done, Assembler::kNearJump);
@@ -2103,13 +2105,12 @@
 // Restore stack and initialize the two exception variables:
 // exception and stack trace variables.
 void CatchEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  // Restore RSP from RBP as we are coming from a throw and the code for
+  // Restore ESP from EBP as we are coming from a throw and the code for
   // popping arguments has not been run.
-  const intptr_t locals_space_size = compiler->StackSize() * kWordSize;
-  ASSERT(locals_space_size >= 0);
-  const intptr_t offset_size =
-      -locals_space_size + FlowGraphCompiler::kLocalsOffsetFromFP;
-  __ leal(ESP, Address(EBP, offset_size));
+  const intptr_t fp_sp_dist =
+      (kFirstLocalSlotIndex + 1 - compiler->StackSize()) * kWordSize;
+  ASSERT(fp_sp_dist <= 0);
+  __ leal(ESP, Address(EBP, fp_sp_dist));
 
   ASSERT(!exception_var().is_captured());
   ASSERT(!stacktrace_var().is_captured());
@@ -2815,6 +2816,33 @@
 }
 
 
+LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary() const {
+  const intptr_t kNumInputs = 2;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresFpuRegister());
+  summary->set_in(1, Location::RequiresFpuRegister());
+  summary->set_out(Location::SameAsFirstInput());
+  return summary;
+}
+
+
+void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  XmmRegister left = locs()->in(0).fpu_reg();
+  XmmRegister right = locs()->in(1).fpu_reg();
+
+  ASSERT(locs()->out().fpu_reg() == left);
+
+  switch (op_kind()) {
+    case Token::kADD: __ addps(left, right); break;
+    case Token::kSUB: __ subps(left, right); break;
+    case Token::kMUL: __ mulps(left, right); break;
+    case Token::kDIV: __ divps(left, right); break;
+    default: UNREACHABLE();
+  }
+}
+
 LocationSummary* MathSqrtInstr::MakeLocationSummary() const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
diff --git a/runtime/vm/intermediate_language_mips.cc b/runtime/vm/intermediate_language_mips.cc
index 9eb5cdc..03b08cf 100644
--- a/runtime/vm/intermediate_language_mips.cc
+++ b/runtime/vm/intermediate_language_mips.cc
@@ -65,7 +65,7 @@
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
   LocationSummary* locs =
-      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RegisterLocation(V0));
   return locs;
 }
@@ -85,10 +85,12 @@
   if (!compiler->HasFinally()) {
     Label stack_ok;
     __ Comment("Stack Check");
-    const int sp_fp_dist = compiler->StackSize() + (-kFirstLocalSlotIndex - 1);
-    __ subu(T2, FP, SP);
+    const intptr_t fp_sp_dist =
+        (kFirstLocalSlotIndex + 1 - compiler->StackSize()) * kWordSize;
+    ASSERT(fp_sp_dist <= 0);
+    __ subu(T2, SP, FP);
 
-    __ BranchEqual(T2, sp_fp_dist * kWordSize, &stack_ok);
+    __ BranchEqual(T2, fp_sp_dist, &stack_ok);
     __ break_(0);
 
     __ Bind(&stack_ok);
@@ -1333,6 +1335,17 @@
 }
 
 
+LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary() const {
+  UNIMPLEMENTED();
+  return NULL;
+}
+
+
+void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  UNIMPLEMENTED();
+}
+
+
 LocationSummary* MathSqrtInstr::MakeLocationSummary() const {
   UNIMPLEMENTED();
   return NULL;
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index 3a7a6e1..2e45481 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -64,7 +64,7 @@
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
   LocationSummary* locs =
-      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RegisterLocation(RAX));
   return locs;
 }
@@ -84,10 +84,12 @@
   if (!compiler->HasFinally()) {
     __ Comment("Stack Check");
     Label done;
-    const int sp_fp_dist = compiler->StackSize() + (-kFirstLocalSlotIndex - 1);
-    __ movq(RDI, RBP);
-    __ subq(RDI, RSP);
-    __ cmpq(RDI, Immediate(sp_fp_dist * kWordSize));
+    const intptr_t fp_sp_dist =
+        (kFirstLocalSlotIndex + 1 - compiler->StackSize()) * kWordSize;
+    ASSERT(fp_sp_dist <= 0);
+    __ movq(RDI, RSP);
+    __ subq(RDI, RBP);
+    __ cmpq(RDI, Immediate(fp_sp_dist));
     __ j(EQUAL, &done, Assembler::kNearJump);
     __ int3();
     __ Bind(&done);
@@ -1988,8 +1990,9 @@
 
     // Check if the instantiator type argument vector is a TypeArguments of a
     // matching length and, if so, use it as the instantiated type_arguments.
-    // No need to check the instantiator (RAX) for null here, because a null
-    // instantiator will have the wrong class (Null instead of TypeArguments).
+    // No need to check the instantiator ('instantiator_reg') for null here,
+    // because a null instantiator will have the wrong class (Null instead of
+    // TypeArguments).
     __ CompareClassId(instantiator_reg, kTypeArgumentsCid);
     __ j(NOT_EQUAL, &done, Assembler::kNearJump);
     const Immediate& arguments_length =
@@ -2070,11 +2073,10 @@
 void CatchEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   // Restore RSP from RBP as we are coming from a throw and the code for
   // popping arguments has not been run.
-  const intptr_t locals_space_size = compiler->StackSize() * kWordSize;
-  ASSERT(locals_space_size >= 0);
-  const intptr_t offset_size =
-      -locals_space_size + FlowGraphCompiler::kLocalsOffsetFromFP;
-  __ leaq(RSP, Address(RBP, offset_size));
+  const intptr_t fp_sp_dist =
+      (kFirstLocalSlotIndex + 1 - compiler->StackSize()) * kWordSize;
+  ASSERT(fp_sp_dist <= 0);
+  __ leaq(RSP, Address(RBP, fp_sp_dist));
 
   ASSERT(!exception_var().is_captured());
   ASSERT(!stacktrace_var().is_captured());
@@ -2831,6 +2833,34 @@
 }
 
 
+LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary() const {
+  const intptr_t kNumInputs = 2;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresFpuRegister());
+  summary->set_in(1, Location::RequiresFpuRegister());
+  summary->set_out(Location::SameAsFirstInput());
+  return summary;
+}
+
+
+void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  XmmRegister left = locs()->in(0).fpu_reg();
+  XmmRegister right = locs()->in(1).fpu_reg();
+
+  ASSERT(locs()->out().fpu_reg() == left);
+
+  switch (op_kind()) {
+    case Token::kADD: __ addps(left, right); break;
+    case Token::kSUB: __ subps(left, right); break;
+    case Token::kMUL: __ mulps(left, right); break;
+    case Token::kDIV: __ divps(left, right); break;
+    default: UNREACHABLE();
+  }
+}
+
+
 LocationSummary* MathSqrtInstr::MakeLocationSummary() const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
diff --git a/runtime/vm/intrinsifier.h b/runtime/vm/intrinsifier.h
index 0a1afd9..1b851aa 100644
--- a/runtime/vm/intrinsifier.h
+++ b/runtime/vm/intrinsifier.h
@@ -23,6 +23,7 @@
   V(_IntegerImplementation, _mulFromInteger, Integer_mulFromInteger, 726019207)\
   V(_IntegerImplementation, *, Integer_mul, 1853182047)                        \
   V(_IntegerImplementation, %, Integer_modulo, 1211518976)                     \
+  V(_IntegerImplementation, remainder, Integer_remainder, 1131753683)          \
   V(_IntegerImplementation, ~/, Integer_truncDivide, 142750059)                \
   V(_IntegerImplementation, unary-, Integer_negate, 676633254)                 \
   V(_IntegerImplementation, _bitAndFromInteger,                                \
diff --git a/runtime/vm/intrinsifier_arm.cc b/runtime/vm/intrinsifier_arm.cc
index 2e8f6ea..6b006a9 100644
--- a/runtime/vm/intrinsifier_arm.cc
+++ b/runtime/vm/intrinsifier_arm.cc
@@ -81,7 +81,7 @@
 
 
 bool Intrinsifier::TypedData_getLength(Assembler* assembler) {
-  return true;
+  return false;
 }
 
 
@@ -131,6 +131,11 @@
 }
 
 
+bool Intrinsifier::Integer_remainder(Assembler* assembler) {
+  return false;
+}
+
+
 bool Intrinsifier::Integer_truncDivide(Assembler* assembler) {
   return false;
 }
diff --git a/runtime/vm/intrinsifier_ia32.cc b/runtime/vm/intrinsifier_ia32.cc
index f99d22b..2afcd70 100644
--- a/runtime/vm/intrinsifier_ia32.cc
+++ b/runtime/vm/intrinsifier_ia32.cc
@@ -40,7 +40,7 @@
   // RoundedAllocationSize((array_length * kwordSize) + sizeof(RawArray)).
   __ movl(EDI, Address(ESP, kArrayLengthOffset));  // Array length.
   // Check that length is a positive Smi.
-  __ testl(EDI, Immediate(kSmiTagSize));
+  __ testl(EDI, Immediate(kSmiTagMask));
   __ j(NOT_ZERO, &fall_through);
   __ cmpl(EDI, Immediate(0));
   __ j(LESS, &fall_through);
@@ -290,9 +290,11 @@
 
   // Store backing array object in growable array object.
   __ movl(EBX, Address(ESP, kArrayOffset));  // data argument.
-  __ StoreIntoObject(EAX,
-                     FieldAddress(EAX, GrowableObjectArray::data_offset()),
-                     EBX);
+  // EAX is new, no barrier needed.
+  __ StoreIntoObjectNoBarrier(
+      EAX,
+      FieldAddress(EAX, GrowableObjectArray::data_offset()),
+      EBX);
 
   // EAX: new growable array object start as a tagged pointer.
   // Store the type argument field in the growable array object.
@@ -462,7 +464,7 @@
   __ movl(EDI, Address(ESP, kArrayLengthStackOffset));  /* Array length. */    \
   /* Check that length is a positive Smi. */                                   \
   /* EDI: requested array length argument. */                                  \
-  __ testl(EDI, Immediate(kSmiTagSize));                                       \
+  __ testl(EDI, Immediate(kSmiTagMask));                                       \
   __ j(NOT_ZERO, &fall_through);                                               \
   __ cmpl(EDI, Immediate(0));                                                  \
   __ j(LESS, &fall_through);                                                   \
@@ -665,35 +667,107 @@
 }
 
 
-bool Intrinsifier::Integer_modulo(Assembler* assembler) {
-  Label fall_through, return_zero, try_modulo;
-  TestBothArgumentsSmis(assembler, &fall_through);
-  // EAX: right argument (divisor)
-  // Check if modulo by zero -> exception thrown in main function.
+// Optimizations:
+// - result is 0 if:
+//   - left is 0
+//   - left equals right
+// - result is left if
+//   - left > 0 && left < right
+// EAX: Tagged left (dividend).
+// EBX: Tagged right (divisor).
+// EDX: Untagged result (remainder).
+void EmitRemainderOperation(Assembler* assembler) {
+  Label return_zero, modulo;
+  // Check for quick zero results.
   __ cmpl(EAX, Immediate(0));
-  __ j(EQUAL, &fall_through,  Assembler::kNearJump);
-  __ movl(EBX, Address(ESP, + 2 * kWordSize));  // Left argument (dividend).
-  __ cmpl(EBX, Immediate(0));
-  __ j(LESS, &fall_through, Assembler::kNearJump);
-  __ cmpl(EBX, EAX);
   __ j(EQUAL, &return_zero, Assembler::kNearJump);
-  __ j(GREATER, &try_modulo, Assembler::kNearJump);
-  __ movl(EAX, EBX);  // Return dividend as it is smaller than divisor.
+  __ cmpl(EAX, EBX);
+  __ j(EQUAL, &return_zero, Assembler::kNearJump);
+
+  // Check if result equals left.
+  __ cmpl(EAX, Immediate(0));
+  __ j(LESS, &modulo, Assembler::kNearJump);
+  // left is positive.
+  __ cmpl(EAX, EBX);
+  __ j(GREATER, &modulo,  Assembler::kNearJump);
+  // left is less than right, result is left (EAX).
   __ ret();
+
   __ Bind(&return_zero);
-  __ xorl(EAX, EAX);  // Return zero.
+  __ xorl(EAX, EAX);
   __ ret();
-  __ Bind(&try_modulo);
-  // EAX: right (non-null divisor).
-  __ movl(EBX, EAX);
+
+  __ Bind(&modulo);
   __ SmiUntag(EBX);
-  __ movl(EAX, Address(ESP, + 2 * kWordSize));  // Left argument (dividend).
   __ SmiUntag(EAX);
   __ cdq();
   __ idivl(EBX);
+}
+
+
+// Implementation:
+//  res = left % right;
+//  if (res < 0) {
+//    if (right < 0) {
+//      res = res - right;
+//    } else {
+//      res = res + right;
+//    }
+//  }
+bool Intrinsifier::Integer_modulo(Assembler* assembler) {
+  Label fall_through, subtract;
+  TestBothArgumentsSmis(assembler, &fall_through);
+  // EAX: right argument (divisor)
+  __ movl(EBX, EAX);
+  __ movl(EAX, Address(ESP, + 2 * kWordSize));  // Left argument (dividend).
+  // EAX: Tagged left (dividend).
+  // EBX: Tagged right (divisor).
+  // Check if modulo by zero -> exception thrown in main function.
+  __ cmpl(EBX, Immediate(0));
+  __ j(EQUAL, &fall_through, Assembler::kNearJump);
+  EmitRemainderOperation(assembler);
+  // Untagged remainder result in EDX.
+  Label done;
+  __ movl(EAX, EDX);
+  __ cmpl(EAX, Immediate(0));
+  __ j(GREATER_EQUAL, &done, Assembler::kNearJump);
+  // Result is negative, adjust it.
+  __ cmpl(EBX, Immediate(0));
+  __ j(LESS, &subtract, Assembler::kNearJump);
+  __ addl(EAX, EBX);
+  __ SmiTag(EAX);
+  __ ret();
+
+  __ Bind(&subtract);
+  __ subl(EAX, EBX);
+
+  __ Bind(&done);
+  // The remainder of two Smi-s is always a Smi, no overflow check needed.
+  __ SmiTag(EAX);
+  __ ret();
+
+  __ Bind(&fall_through);
+  return false;
+}
+
+
+bool Intrinsifier::Integer_remainder(Assembler* assembler) {
+  Label fall_through;
+  TestBothArgumentsSmis(assembler, &fall_through);
+  // EAX: right argument (divisor)
+  __ movl(EBX, EAX);
+  __ movl(EAX, Address(ESP, + 2 * kWordSize));  // Left argument (dividend).
+  // EAX: Tagged left (dividend).
+  // EBX: Tagged right (divisor).
+  // Check if modulo by zero -> exception thrown in main function.
+  __ cmpl(EBX, Immediate(0));
+  __ j(EQUAL, &fall_through, Assembler::kNearJump);
+  EmitRemainderOperation(assembler);
+  // Untagged remainder result in EDX.
   __ movl(EAX, EDX);
   __ SmiTag(EAX);
   __ ret();
+
   __ Bind(&fall_through);
   return false;
 }
diff --git a/runtime/vm/intrinsifier_mips.cc b/runtime/vm/intrinsifier_mips.cc
index 7b47cdf..75e10dd 100644
--- a/runtime/vm/intrinsifier_mips.cc
+++ b/runtime/vm/intrinsifier_mips.cc
@@ -81,7 +81,7 @@
 
 
 bool Intrinsifier::TypedData_getLength(Assembler* assembler) {
-  return true;
+  return false;
 }
 
 
@@ -131,6 +131,11 @@
 }
 
 
+bool Intrinsifier::Integer_remainder(Assembler* assembler) {
+  return false;
+}
+
+
 bool Intrinsifier::Integer_truncDivide(Assembler* assembler) {
   return false;
 }
diff --git a/runtime/vm/intrinsifier_x64.cc b/runtime/vm/intrinsifier_x64.cc
index d92086b..59f1794 100644
--- a/runtime/vm/intrinsifier_x64.cc
+++ b/runtime/vm/intrinsifier_x64.cc
@@ -39,7 +39,7 @@
   // RoundedAllocationSize((array_length * kwordSize) + sizeof(RawArray)).
   __ movq(RDI, Address(RSP, kArrayLengthOffset));  // Array Length.
   // Check that length is a positive Smi.
-  __ testq(RDI, Immediate(kSmiTagSize));
+  __ testq(RDI, Immediate(kSmiTagMask));
   __ j(NOT_ZERO, &fall_through);
   __ cmpq(RDI, Immediate(0));
   __ j(LESS, &fall_through);
@@ -246,9 +246,11 @@
 
   // Store backing array object in growable array object.
   __ movq(RCX, Address(RSP, kArrayOffset));  // data argument.
-  __ StoreIntoObject(RAX,
-                     FieldAddress(RAX, GrowableObjectArray::data_offset()),
-                     RCX);
+  // RAX is new, no barrier needed.
+  __ StoreIntoObjectNoBarrier(
+      RAX,
+      FieldAddress(RAX, GrowableObjectArray::data_offset()),
+      RCX);
 
   // RAX: new growable array object start as a tagged pointer.
   // Store the type argument field in the growable array object.
@@ -415,7 +417,7 @@
   __ movq(RDI, Address(RSP, kArrayLengthStackOffset));  /* Array length. */    \
   /* Check that length is a positive Smi. */                                   \
   /* RDI: requested array length argument. */                                  \
-  __ testq(RDI, Immediate(kSmiTagSize));                                       \
+  __ testq(RDI, Immediate(kSmiTagMask));                                       \
   __ j(NOT_ZERO, &fall_through);                                               \
   __ cmpq(RDI, Immediate(0));                                                  \
   __ j(LESS, &fall_through);                                                   \
@@ -558,7 +560,7 @@
   __ movq(RCX, Address(RSP, + 2 * kWordSize));
   __ orq(RCX, RAX);
   __ testq(RCX, Immediate(kSmiTagMask));
-  __ j(NOT_ZERO, not_smi, Assembler::kNearJump);
+  __ j(NOT_ZERO, not_smi);
 }
 
 
@@ -629,30 +631,37 @@
 }
 
 
-bool Intrinsifier::Integer_modulo(Assembler* assembler) {
-  Label fall_through, return_zero, try_modulo, not_32bit;
-  TestBothArgumentsSmis(assembler, &fall_through);
-  // RAX: right argument (divisor)
-  // Check if modulo by zero -> exception thrown in main function.
+// Optimizations:
+// - result is 0 if:
+//   - left is 0
+//   - left equals right
+// - result is left if
+//   - left > 0 && left < right
+// RAX: Tagged left (dividend).
+// RCX: Tagged right (divisor).
+// RAX: Untagged result (remainder).
+void EmitRemainderOperation(Assembler* assembler) {
+  Label return_zero, try_modulo, not_32bit, done;
+  // Check for quick zero results.
   __ cmpq(RAX, Immediate(0));
-  __ j(EQUAL, &fall_through,  Assembler::kNearJump);
-  __ movq(RCX, Address(RSP, + 2 * kWordSize));  // Left argument (dividend).
-  __ cmpq(RCX, Immediate(0));
-  __ j(LESS, &fall_through, Assembler::kNearJump);
-  __ cmpq(RCX, RAX);
   __ j(EQUAL, &return_zero, Assembler::kNearJump);
-  __ j(GREATER, &try_modulo, Assembler::kNearJump);
-  __ movq(RAX, RCX);  // Return dividend as it is smaller than divisor.
+  __ cmpq(RAX, RCX);
+  __ j(EQUAL, &return_zero, Assembler::kNearJump);
+
+  // Check if result equals left.
+  __ cmpq(RAX, Immediate(0));
+  __ j(LESS, &try_modulo, Assembler::kNearJump);
+  // left is positive.
+  __ cmpq(RAX, RCX);
+  __ j(GREATER, &try_modulo,  Assembler::kNearJump);
+  // left is less than right, result is left (RAX).
   __ ret();
 
   __ Bind(&return_zero);
-  __ xorq(RAX, RAX);  // Return zero.
+  __ xorq(RAX, RAX);
   __ ret();
 
   __ Bind(&try_modulo);
-  // RAX: right (non-null divisor).
-  __ movq(RCX, RAX);
-  __ movq(RAX, Address(RSP, + 2 * kWordSize));  // Left argument (dividend).
 
   // Check if both operands fit into 32bits as idiv with 64bit operands
   // requires twice as many cycles and has much higher latency. We are checking
@@ -660,10 +669,10 @@
   // raises exception because quotient is too large for 32bit register.
   __ movsxd(RBX, RAX);
   __ cmpq(RBX, RAX);
-  __ j(NOT_EQUAL, &not_32bit);
+  __ j(NOT_EQUAL, &not_32bit, Assembler::kNearJump);
   __ movsxd(RBX, RCX);
   __ cmpq(RBX, RCX);
-  __ j(NOT_EQUAL, &not_32bit);
+  __ j(NOT_EQUAL, &not_32bit, Assembler::kNearJump);
 
   // Both operands are 31bit smis. Divide using 32bit idiv.
   __ SmiUntag(RAX);
@@ -671,8 +680,7 @@
   __ cdq();
   __ idivl(RCX);
   __ movsxd(RAX, RDX);
-  __ SmiTag(RAX);
-  __ ret();
+  __ jmp(&done, Assembler::kNearJump);
 
   // Divide using 64bit idiv.
   __ Bind(&not_32bit);
@@ -681,9 +689,70 @@
   __ cqo();
   __ idivq(RCX);
   __ movq(RAX, RDX);
+  __ Bind(&done);
+}
+
+
+// Implementation:
+//  res = left % right;
+//  if (res < 0) {
+//    if (right < 0) {
+//      res = res - right;
+//    } else {
+//      res = res + right;
+//    }
+//  }
+bool Intrinsifier::Integer_modulo(Assembler* assembler) {
+  Label fall_through, negative_result;
+  TestBothArgumentsSmis(assembler, &fall_through);
+  // RAX: right argument (divisor)
+  __ movq(RCX, RAX);
+  __ movq(RAX, Address(RSP, + 2 * kWordSize));  // Left argument (dividend).
+  // RAX: Tagged left (dividend).
+  // RCX: Tagged right (divisor).
+  __ cmpq(RCX, Immediate(0));
+  __ j(EQUAL, &fall_through);
+  EmitRemainderOperation(assembler);
+  // Untagged remainder result in RAX.
+  __ cmpq(RAX, Immediate(0));
+  __ j(LESS, &negative_result, Assembler::kNearJump);
   __ SmiTag(RAX);
   __ ret();
 
+  __ Bind(&negative_result);
+  Label subtract;
+  // RAX: Untagged result.
+  // RCX: Untagged right.
+  __ cmpq(RCX, Immediate(0));
+  __ j(LESS, &subtract, Assembler::kNearJump);
+  __ addq(RAX, RCX);
+  __ SmiTag(RAX);
+  __ ret();
+
+  __ Bind(&subtract);
+  __ subq(RAX, RCX);
+  __ SmiTag(RAX);
+  __ ret();
+
+  __ Bind(&fall_through);
+  return false;
+}
+
+
+bool Intrinsifier::Integer_remainder(Assembler* assembler) {
+  Label fall_through;
+  TestBothArgumentsSmis(assembler, &fall_through);
+  // RAX: right argument (divisor)
+  __ movq(RCX, RAX);
+  __ movq(RAX, Address(RSP, + 2 * kWordSize));  // Left argument (dividend).
+  // RAX: Tagged left (dividend).
+  // RCX: Tagged right (divisor).
+  __ cmpq(RCX, Immediate(0));
+  __ j(EQUAL, &fall_through);
+  EmitRemainderOperation(assembler);
+  // Untagged remainder result in RAX.
+  __ SmiTag(RAX);
+  __ ret();
   __ Bind(&fall_through);
   return false;
 }
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index a4369d9..72f386e 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -338,6 +338,7 @@
       message_handler_(NULL),
       spawn_data_(0),
       is_runnable_(false),
+      running_state_(kIsolateWaiting),
       gc_prologue_callbacks_(),
       gc_epilogue_callbacks_(),
       deopt_cpu_registers_copy_(NULL),
@@ -884,18 +885,28 @@
   if (status_sync == NULL) {
     status_sync = new Monitor();
   }
-  ScheduleInterrupts(Isolate::kVmStatusInterrupt);
-  {
-    MonitorLocker ml(status_sync);
-    if (stacktrace_ == NULL) {  // It may already be available.
-      ml.Wait();
+  if (is_runnable()) {
+    ScheduleInterrupts(Isolate::kVmStatusInterrupt);
+    {
+      MonitorLocker ml(status_sync);
+      if (stacktrace_ == NULL) {  // It may already be available.
+        ml.Wait(1000);
+      }
     }
+    SetVmStatsCallback(NULL);
   }
-  SetVmStatsCallback(NULL);
-  ASSERT(stacktrace_ != NULL);
-  // result is freed by VmStats::WebServer().
   char* result = stacktrace_;
   stacktrace_ = NULL;
+  if (result == NULL) {
+    // Return empty stack.
+    TextBuffer buffer(256);
+    buffer.Printf("{ \"handle\": \"0x%"Px64"\", \"stacktrace\": []}",
+                  reinterpret_cast<int64_t>(this));
+
+    result = OS::StrNDup(buffer.buf(), buffer.length());
+  }
+  ASSERT(result != NULL);
+  // result is freed by VmStats::WebServer().
   return result;
 }
 
diff --git a/runtime/vm/isolate.h b/runtime/vm/isolate.h
index 05c05b4..99f3f3b 100644
--- a/runtime/vm/isolate.h
+++ b/runtime/vm/isolate.h
@@ -273,6 +273,11 @@
         kVmStatusInterrupt,
   };
 
+  enum IsolateRunState {
+    kIsolateWaiting = 0,      // The isolate is waiting for code to execute.
+    kIsolateRunning,          // The isolate is executing code.
+  };
+
   void ScheduleInterrupts(uword interrupt_bits);
   uword GetAndClearInterrupts();
 
@@ -285,6 +290,9 @@
   bool is_runnable() const { return is_runnable_; }
   void set_is_runnable(bool value) { is_runnable_ = value; }
 
+  IsolateRunState running_state() const { return running_state_; }
+  void set_running_state(IsolateRunState value) { running_state_ = value; }
+
   uword spawn_data() const { return spawn_data_; }
   void set_spawn_data(uword value) { spawn_data_ = value; }
 
@@ -492,6 +500,7 @@
   MessageHandler* message_handler_;
   uword spawn_data_;
   bool is_runnable_;
+  IsolateRunState running_state_;
   GcPrologueCallbacks gc_prologue_callbacks_;
   GcEpilogueCallbacks gc_epilogue_callbacks_;
 
@@ -607,6 +616,29 @@
   char* exception_callback_name_;
 };
 
+
+class IsolateRunStateManager : public StackResource {
+ public:
+  explicit IsolateRunStateManager()
+      : StackResource(Isolate::Current()),
+        saved_state_(Isolate::kIsolateWaiting) {
+    saved_state_ = reinterpret_cast<Isolate*>(isolate())->running_state();
+  }
+
+  virtual ~IsolateRunStateManager() {
+    reinterpret_cast<Isolate*>(isolate())->set_running_state(saved_state_);
+  }
+
+  void SetRunState(Isolate::IsolateRunState run_state) {
+    reinterpret_cast<Isolate*>(isolate())->set_running_state(run_state);
+  }
+
+ private:
+  Isolate::IsolateRunState saved_state_;
+
+  DISALLOW_COPY_AND_ASSIGN(IsolateRunStateManager);
+};
+
 }  // namespace dart
 
 #endif  // VM_ISOLATE_H_
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index c62f845..b579c2a 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -25,6 +25,7 @@
 #include "vm/exceptions.h"
 #include "vm/growable_array.h"
 #include "vm/heap.h"
+#include "vm/intermediate_language.h"
 #include "vm/intrinsifier.h"
 #include "vm/object_store.h"
 #include "vm/parser.h"
@@ -497,8 +498,10 @@
   // Allocate and initialize the empty_array instance.
   {
     uword address = heap->Allocate(Array::InstanceSize(0), Heap::kOld);
-    *empty_array_ = reinterpret_cast<RawArray*>(address + kHeapObjectTag);
     InitializeObject(address, kArrayCid, Array::InstanceSize(0));
+    Array::initializeHandle(
+        empty_array_,
+        reinterpret_cast<RawArray*>(address + kHeapObjectTag));
     empty_array_->raw()->ptr()->length_ = Smi::New(0);
   }
 
@@ -507,6 +510,16 @@
   isolate->object_store()->set_bool_class(cls);
   *bool_true_ = Bool::New(true);
   *bool_false_ = Bool::New(false);
+  ASSERT(!empty_array_->IsSmi());
+  ASSERT(empty_array_->IsArray());
+  ASSERT(!sentinel_->IsSmi());
+  ASSERT(sentinel_->IsInstance());
+  ASSERT(!transition_sentinel_->IsSmi());
+  ASSERT(transition_sentinel_->IsInstance());
+  ASSERT(!bool_true_->IsSmi());
+  ASSERT(bool_true_->IsBool());
+  ASSERT(!bool_false_->IsSmi());
+  ASSERT(bool_false_->IsBool());
 }
 
 
@@ -6846,6 +6859,66 @@
   return error.raw();
 }
 
+struct FpDiff {
+  FpDiff(int32_t old_, int32_t new_): old_fp(old_), new_fp(new_) {}
+  int32_t old_fp;
+  int32_t new_fp;
+};
+
+void Library::CheckFunctionFingerprints() {
+  GrowableArray<FpDiff> collected_fp_diffs;
+  Library& lib = Library::Handle();
+  Class& cls = Class::Handle();
+  Function& func = Function::Handle();
+  String& str = String::Handle();
+  bool has_errors = false;
+
+#define CHECK_FINGERPRINTS(class_name, function_name, dest, fp)                \
+  func = Function::null();                                                     \
+  if (strcmp(#class_name, "::") == 0) {                                        \
+    str = Symbols::New(#function_name);                                        \
+    func = lib.LookupFunctionAllowPrivate(str);                                \
+  } else {                                                                     \
+    str = String::New(#class_name);                                            \
+    cls = lib.LookupClassAllowPrivate(str);                                    \
+    if (!cls.IsNull()) {                                                       \
+      if (#function_name[0] == '.') {                                          \
+        str = String::New(#class_name#function_name);                          \
+      } else {                                                                 \
+        str = String::New(#function_name);                                     \
+      }                                                                        \
+      func = cls.LookupFunctionAllowPrivate(str);                              \
+    }                                                                          \
+  }                                                                            \
+  if (!func.IsNull() && (func.SourceFingerprint() != fp)) {                    \
+    has_errors = true;                                                         \
+    OS::Print("Wrong fingerprint for '%s': expecting %d found %d\n",           \
+        func.ToFullyQualifiedCString(), fp, func.SourceFingerprint());         \
+    collected_fp_diffs.Add(FpDiff(fp, func.SourceFingerprint()));              \
+  }                                                                            \
+
+  lib = Library::CoreLibrary();
+  CORE_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS);
+
+  RECOGNIZED_LIST(CHECK_FINGERPRINTS);
+
+  lib = Library::MathLibrary();
+  MATH_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS);
+
+  lib = Library::TypedDataLibrary();
+  TYPEDDATA_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS);
+
+#undef CHECK_FINGERPRINTS
+  if (has_errors) {
+    for (intptr_t i = 0; i < collected_fp_diffs.length(); i++) {
+      OS::Print("s/%d/%d/\n",
+          collected_fp_diffs[i].old_fp, collected_fp_diffs[i].new_fp);
+    }
+    OS::Print("\n");
+    FATAL("Fingerprint mismatch.");
+  }
+}
+
 
 RawInstructions* Instructions::New(intptr_t size) {
   ASSERT(Object::instructions_class() != Class::null());
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 02c4831..9dfdad2 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -2189,6 +2189,10 @@
   // Eagerly compile all classes and functions in the library.
   static RawError* CompileAll();
 
+  // Checks function fingerprints. Prints mismatches and aborts if
+  // mismatch found.
+  static void CheckFunctionFingerprints();
+
  private:
   static const int kInitialImportsCapacity = 4;
   static const int kImportsCapacityIncrement = 8;
@@ -4834,6 +4838,7 @@
 
   HEAP_OBJECT_IMPLEMENTATION(Array, Instance);
   friend class Class;
+  friend class Object;
   friend class String;
 };
 
diff --git a/runtime/vm/object_arm_test.cc b/runtime/vm/object_arm_test.cc
index 7056f92..ab6f791 100644
--- a/runtime/vm/object_arm_test.cc
+++ b/runtime/vm/object_arm_test.cc
@@ -18,21 +18,38 @@
 // Generate a simple dart code sequence.
 // This is used to test Code and Instruction object creation.
 void GenerateIncrement(Assembler* assembler) {
-  __ Unimplemented("GenerateIncrement");
+  __ LoadImmediate(R0, 0);
+  __ Push(R0);
+  __ ldr(IP, Address(SP, 0));
+  __ add(IP, IP, ShifterOperand(1));
+  __ str(IP, Address(SP, 0));
+  __ ldr(IP, Address(SP, 0));
+  __ add(IP, IP, ShifterOperand(1));
+  __ Pop(R0);
+  __ mov(R0, ShifterOperand(IP));
+  __ Ret();
 }
 
 
 // Generate a dart code sequence that embeds a string object in it.
 // This is used to test Embedded String objects in the instructions.
 void GenerateEmbedStringInCode(Assembler* assembler, const char* str) {
-  __ Unimplemented("GenerateEmbedStringInCode");
+  __ EnterDartFrame(0);  // To setup pp.
+  const String& string_object =
+      String::ZoneHandle(String::New(str, Heap::kOld));
+  __ LoadObject(R0, string_object);
+  __ LeaveDartFrame();
+  __ Ret();
 }
 
 
 // Generate a dart code sequence that embeds a smi object in it.
 // This is used to test Embedded Smi objects in the instructions.
 void GenerateEmbedSmiInCode(Assembler* assembler, intptr_t value) {
-  __ Unimplemented("GenerateEmbedSmiInCode");
+  // No need to setup pp, since Smis are not stored in the object pool.
+  const Smi& smi_object = Smi::ZoneHandle(Smi::New(value));
+  __ LoadObject(R0, smi_object);
+  __ Ret();
 }
 
 }  // namespace dart
diff --git a/runtime/vm/object_test.cc b/runtime/vm/object_test.cc
index df54b52..7ad93d2 100644
--- a/runtime/vm/object_test.cc
+++ b/runtime/vm/object_test.cc
@@ -9,6 +9,7 @@
 #include "vm/isolate.h"
 #include "vm/object.h"
 #include "vm/object_store.h"
+#include "vm/simulator.h"
 #include "vm/symbols.h"
 #include "vm/unit_test.h"
 
@@ -2236,8 +2237,10 @@
 }
 
 
-// only ia32 and x64 can run execution tests.
-#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
+// Only ia32, x64, and arm can run execution tests.
+#if defined(TARGET_ARCH_IA32) ||                                               \
+    defined(TARGET_ARCH_X64) ||                                                \
+    defined(TARGET_ARCH_ARM)
 
 static Function* CreateFunction(const char* name) {
   const String& class_name = String::Handle(Symbols::New("ownerClass"));
@@ -2259,9 +2262,16 @@
   Code& code = Code::Handle(Code::FinalizeCode(
       *CreateFunction("Test_Code"), &_assembler_));
   Instructions& instructions = Instructions::Handle(code.instructions());
-  typedef int (*IncrementCode)();
-  EXPECT_EQ(2, reinterpret_cast<IncrementCode>(instructions.EntryPoint())());
   uword entry_point = instructions.EntryPoint();
+  intptr_t retval = 0;
+#if defined(USING_SIMULATOR)
+  retval = bit_copy<intptr_t, int64_t>(Simulator::Current()->Call(
+      static_cast<int32_t>(entry_point), 0, 0, 0, 0));
+#else
+  typedef intptr_t (*IncrementCode)();
+  retval = reinterpret_cast<IncrementCode>(entry_point)();
+#endif
+  EXPECT_EQ(2, retval);
   EXPECT_EQ(instructions.raw(), Instructions::FromEntryPoint(entry_point));
 }
 
@@ -2276,8 +2286,14 @@
   Code& code = Code::Handle(Code::FinalizeCode(
       *CreateFunction("Test_EmbedStringInCode"), &_assembler_));
   Instructions& instructions = Instructions::Handle(code.instructions());
+  uword retval = 0;
+#if defined(USING_SIMULATOR)
+  retval = bit_copy<uword, int64_t>(Simulator::Current()->Call(
+      static_cast<int32_t>(instructions.EntryPoint()), 0, 0, 0, 0));
+#else
   typedef uword (*EmbedStringCode)();
-  uword retval = reinterpret_cast<EmbedStringCode>(instructions.EntryPoint())();
+  retval = reinterpret_cast<EmbedStringCode>(instructions.EntryPoint())();
+#endif
   EXPECT((retval & kSmiTagMask) == kHeapObjectTag);
   String& string_object = String::Handle();
   string_object ^= reinterpret_cast<RawInstructions*>(retval);
@@ -2297,9 +2313,14 @@
   Code& code = Code::Handle(Code::FinalizeCode(
       *CreateFunction("Test_EmbedSmiInCode"), &_assembler_));
   Instructions& instructions = Instructions::Handle(code.instructions());
+  intptr_t retval = 0;
+#if defined(USING_SIMULATOR)
+  retval = bit_copy<intptr_t, int64_t>(Simulator::Current()->Call(
+      static_cast<int32_t>(instructions.EntryPoint()), 0, 0, 0, 0));
+#else
   typedef intptr_t (*EmbedSmiCode)();
-  intptr_t retval =
-      reinterpret_cast<EmbedSmiCode>(instructions.EntryPoint())();
+  retval = reinterpret_cast<EmbedSmiCode>(instructions.EntryPoint())();
+#endif
   EXPECT((retval >> kSmiTagShift) == kSmiTestValue);
 }
 
@@ -2314,9 +2335,14 @@
   Code& code = Code::Handle(Code::FinalizeCode(
       *CreateFunction("Test_EmbedSmiIn64BitCode"), &_assembler_));
   Instructions& instructions = Instructions::Handle(code.instructions());
+  intptr_t retval = 0;
+#if defined(USING_SIMULATOR)
+  retval = bit_copy<intptr_t, int64_t>(Simulator::Current()->Call(
+      static_cast<int32_t>(instructions.EntryPoint()), 0, 0, 0, 0));
+#else
   typedef intptr_t (*EmbedSmiCode)();
-  intptr_t retval =
-      reinterpret_cast<EmbedSmiCode>(instructions.EntryPoint())();
+  retval = reinterpret_cast<EmbedSmiCode>(instructions.EntryPoint())();
+#endif
   EXPECT((retval >> kSmiTagShift) == kSmiTestValue);
 }
 #endif
@@ -3182,6 +3208,6 @@
   EXPECT_EQ(test6.SourceFingerprint(), test7.SourceFingerprint());
 }
 
-#endif  // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64).
+#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM
 
 }  // namespace dart
diff --git a/runtime/vm/os_android.cc b/runtime/vm/os_android.cc
index c77ff51..2fbc169 100644
--- a/runtime/vm/os_android.cc
+++ b/runtime/vm/os_android.cc
@@ -8,6 +8,7 @@
 #include "vm/os.h"
 
 #include <android/log.h>  // NOLINT
+#include <endian.h>  // NOLINT
 #include <errno.h>  // NOLINT
 #include <limits.h>  // NOLINT
 #include <malloc.h>  // NOLINT
@@ -323,6 +324,36 @@
 }
 
 
+uint16_t HostToBigEndian16(uint16_t value) {
+  return htobe16(value);
+}
+
+
+uint32_t HostToBigEndian32(uint32_t value) {
+  return htobe32(value);
+}
+
+
+uint64_t HostToBigEndian64(uint64_t value) {
+  return htobe64(value);
+}
+
+
+uint16_t HostToLittleEndian16(uint16_t value) {
+  return htole16(value);
+}
+
+
+uint32_t HostToLittleEndian32(uint32_t value) {
+  return htole32(value);
+}
+
+
+uint64_t HostToLittleEndian64(uint64_t value) {
+  return htole64(value);
+}
+
+
 void OS::Print(const char* format, ...) {
   va_list args;
   va_start(args, format);
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index b606a43..6f6c4da 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -7350,6 +7350,16 @@
                                   func_name,
                                   InvocationMirror::kStatic,
                                   InvocationMirror::kMethod);
+  } else if (cls.IsTopLevel() &&
+      (cls.library() == Library::CoreLibrary()) &&
+      (func.name() == Symbols::Identical().raw())) {
+    // This is the predefined toplevel function identical(a,b). Create
+    // a comparison node instead.
+    ASSERT(num_arguments == 2);
+    return new ComparisonNode(ident_pos,
+                              Token::kEQ_STRICT,
+                              arguments->NodeAt(0),
+                              arguments->NodeAt(1));
   }
   return new StaticCallNode(call_pos, func, arguments);
 }
diff --git a/runtime/vm/raw_object_snapshot.cc b/runtime/vm/raw_object_snapshot.cc
index 4deaad3..60a22ec 100644
--- a/runtime/vm/raw_object_snapshot.cc
+++ b/runtime/vm/raw_object_snapshot.cc
@@ -2514,7 +2514,10 @@
     SnapshotWriterVisitor visitor(writer);
     visitor.VisitPointers(from(), to());
   } else {
-    UNREACHABLE();  // Stacktraces are not supported for other snapshot forms.
+    // Stacktraces are not allowed in other snapshot forms.
+    writer->SetWriteException(Exceptions::kArgument,
+                              "Illegal argument in isolate message"
+                              " : (object is a stacktrace)");
   }
 }
 
diff --git a/runtime/vm/simulator_arm.cc b/runtime/vm/simulator_arm.cc
index d027df8..6cd45fc 100644
--- a/runtime/vm/simulator_arm.cc
+++ b/runtime/vm/simulator_arm.cc
@@ -64,7 +64,8 @@
     simulator_ = sim;
     link_ = sim->last_setjmp_buffer();
     sim->set_last_setjmp_buffer(this);
-    sp_ = sim->get_register(SP);
+    sp_ = static_cast<uword>(sim->get_register(SP));
+    native_sp_ = reinterpret_cast<uword>(&sim);  // Current C++ stack pointer.
   }
 
   ~SimulatorSetjmpBuffer() {
@@ -74,10 +75,12 @@
 
   SimulatorSetjmpBuffer* link() { return link_; }
 
-  int32_t sp() { return sp_; }
+  uword sp() { return sp_; }
+  uword native_sp() { return native_sp_; }
 
  private:
-  int32_t sp_;
+  uword sp_;
+  uword native_sp_;
   Simulator* simulator_;
   SimulatorSetjmpBuffer* link_;
   jmp_buf buffer_;
@@ -1397,6 +1400,9 @@
 
         // Return.
         set_pc(saved_lr);
+      } else {
+        // Coming via long jump from a throw. Continue to exception handler.
+        set_top_exit_frame_info(0);
       }
 
       break;
@@ -2863,22 +2869,38 @@
 }
 
 
-void Simulator::Longjmp(
-    int32_t pc, int32_t sp, int32_t fp, const Instance& object) {
-  set_register(SP, sp);
-  set_register(FP, fp);
-  set_register(PC, pc);
-  SimulatorSetjmpBuffer* buf = last_setjmp_buffer();
-
+void Simulator::Longjmp(uword pc,
+                        uword sp,
+                        uword fp,
+                        RawObject* raw_exception,
+                        RawObject* raw_stacktrace) {
   // Walk over all setjmp buffers (simulated --> C++ transitions)
-  // and try to find the setjmp associated with the stack pointer.
+  // and try to find the setjmp associated with the simulated stack pointer.
+  SimulatorSetjmpBuffer* buf = last_setjmp_buffer();
   while (buf->link() != NULL && buf->link()->sp() <= sp) {
     buf = buf->link();
   }
   ASSERT(buf != NULL);
 
-  // The caller has already cleaned up the stack memory of C++ frames.
-  set_register(kExceptionObjectReg, bit_cast<int32_t>(object.raw()));
+  // The C++ caller has not cleaned up the stack memory of C++ frames.
+  // Prepare for unwinding frames by destroying all the stack resources
+  // in the previous C++ frames.
+  uword native_sp = buf->native_sp();
+  Isolate* isolate = Isolate::Current();
+  while (isolate->top_resource() != NULL &&
+         (reinterpret_cast<uword>(isolate->top_resource()) < native_sp)) {
+    isolate->top_resource()->~StackResource();
+  }
+
+  // Unwind the C++ stack and continue simulation in the target frame.
+  set_register(PC, static_cast<int32_t>(pc));
+  set_register(SP, static_cast<int32_t>(sp));
+  set_register(FP, static_cast<int32_t>(fp));
+  ASSERT(raw_exception != NULL);
+  set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception));
+  if (raw_stacktrace != NULL) {
+    set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace));
+  }
   buf->Longjmp();
 }
 
diff --git a/runtime/vm/simulator_arm.h b/runtime/vm/simulator_arm.h
index 71ae8d2..c819d1c 100644
--- a/runtime/vm/simulator_arm.h
+++ b/runtime/vm/simulator_arm.h
@@ -86,7 +86,11 @@
   };
   static uword RedirectExternalReference(uword function, CallKind call_kind);
 
-  void Longjmp(int32_t pc, int32_t sp, int32_t fp, const Instance& object);
+  void Longjmp(uword pc,
+               uword sp,
+               uword fp,
+               RawObject* raw_exception,
+               RawObject* raw_stacktrace);
 
  private:
   // Known bad pc value to ensure that the simulator does not execute
diff --git a/runtime/vm/simulator_mips.cc b/runtime/vm/simulator_mips.cc
index e144c8a..3031ddc 100644
--- a/runtime/vm/simulator_mips.cc
+++ b/runtime/vm/simulator_mips.cc
@@ -51,7 +51,8 @@
     simulator_ = sim;
     link_ = sim->last_setjmp_buffer();
     sim->set_last_setjmp_buffer(this);
-    sp_ = sim->get_register(SP);
+    sp_ = static_cast<uword>(sim->get_register(SP));
+    native_sp_ = reinterpret_cast<uword>(&sim);  // Current C++ stack pointer.
   }
 
   ~SimulatorSetjmpBuffer() {
@@ -61,10 +62,12 @@
 
   SimulatorSetjmpBuffer* link() { return link_; }
 
-  int32_t sp() { return sp_; }
+  uword sp() { return sp_; }
+  uword native_sp() { return native_sp_; }
 
  private:
-  int32_t sp_;
+  uword sp_;
+  uword native_sp_;
   Simulator* simulator_;
   SimulatorSetjmpBuffer* link_;
   jmp_buf buffer_;
@@ -980,6 +983,9 @@
 
       // Return. Subtract to account for pc_ increment after return.
       set_pc(saved_ra - Instr::kInstrSize);
+    } else {
+      // Coming via long jump from a throw. Continue to exception handler.
+      set_top_exit_frame_info(0);
     }
   } else {
     SimulatorDebugger dbg(this);
@@ -1829,6 +1835,42 @@
   return Utils::LowHighTo64Bits(get_register(V0), get_register(V1));
 }
 
+
+void Simulator::Longjmp(uword pc,
+                        uword sp,
+                        uword fp,
+                        RawObject* raw_exception,
+                        RawObject* raw_stacktrace) {
+  // Walk over all setjmp buffers (simulated --> C++ transitions)
+  // and try to find the setjmp associated with the simulated stack pointer.
+  SimulatorSetjmpBuffer* buf = last_setjmp_buffer();
+  while (buf->link() != NULL && buf->link()->sp() <= sp) {
+    buf = buf->link();
+  }
+  ASSERT(buf != NULL);
+
+  // The C++ caller has not cleaned up the stack memory of C++ frames.
+  // Prepare for unwinding frames by destroying all the stack resources
+  // in the previous C++ frames.
+  uword native_sp = buf->native_sp();
+  Isolate* isolate = Isolate::Current();
+  while (isolate->top_resource() != NULL &&
+         (reinterpret_cast<uword>(isolate->top_resource()) < native_sp)) {
+    isolate->top_resource()->~StackResource();
+  }
+
+  // Unwind the C++ stack and continue simulation in the target frame.
+  set_pc(static_cast<int32_t>(pc));
+  set_register(SP, static_cast<int32_t>(sp));
+  set_register(FP, static_cast<int32_t>(fp));
+  ASSERT(raw_exception != NULL);
+  set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception));
+  if (raw_stacktrace != NULL) {
+    set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace));
+  }
+  buf->Longjmp();
+}
+
 }  // namespace dart
 
 #endif  // !defined(HOST_ARCH_MIPS)
diff --git a/runtime/vm/simulator_mips.h b/runtime/vm/simulator_mips.h
index a3bd6c7..5cee182 100644
--- a/runtime/vm/simulator_mips.h
+++ b/runtime/vm/simulator_mips.h
@@ -17,6 +17,7 @@
 #endif
 
 #include "vm/constants_mips.h"
+#include "vm/object.h"
 
 namespace dart {
 
@@ -89,6 +90,12 @@
   };
   static uword RedirectExternalReference(uword function, CallKind call_kind);
 
+  void Longjmp(uword pc,
+               uword sp,
+               uword fp,
+               RawObject* raw_exception,
+               RawObject* raw_stacktrace);
+
  private:
   // A pc value used to signal the simulator to stop execution.  Generally
   // the ra is set to this value on transition from native C code to
@@ -171,6 +178,7 @@
 
   friend class SimulatorDebugger;
   friend class SimulatorSetjmpBuffer;
+  DISALLOW_COPY_AND_ASSIGN(Simulator);
 };
 
 }  // namespace dart
diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc
index d7ba30d..0342930 100644
--- a/runtime/vm/snapshot.cc
+++ b/runtime/vm/snapshot.cc
@@ -1318,24 +1318,28 @@
 void SnapshotWriter::CheckIfSerializable(RawClass* cls) {
   if (Class::IsSignatureClass(cls)) {
     // We do not allow closure objects in an isolate message.
-    set_exception_type(Exceptions::kArgument);
-    // TODO(6726): Allocate these constant strings once in the VM isolate.
-    set_exception_msg("Illegal argument in isolate message"
+    SetWriteException(Exceptions::kArgument,
+                      "Illegal argument in isolate message"
                       " : (object is a closure)");
-    Isolate::Current()->long_jump_base()->Jump(1, *ErrorHandle());
   }
   if (cls->ptr()->num_native_fields_ != 0) {
     // We do not allow objects with native fields in an isolate message.
-    set_exception_type(Exceptions::kArgument);
-    // TODO(6726): Allocate these constant strings once in the VM isolate.
-    set_exception_msg("Illegal argument in isolate message"
+    SetWriteException(Exceptions::kArgument,
+                      "Illegal argument in isolate message"
                       " : (object extends NativeWrapper)");
-
-    Isolate::Current()->long_jump_base()->Jump(1, *ErrorHandle());
   }
 }
 
 
+void SnapshotWriter::SetWriteException(Exceptions::ExceptionType type,
+                                       const char* msg) {
+  set_exception_type(type);
+  // TODO(6726): Allocate these constant strings once in the VM isolate.
+  set_exception_msg(msg);
+  Isolate::Current()->long_jump_base()->Jump(1, *ErrorHandle());
+}
+
+
 void SnapshotWriter::WriteInstance(intptr_t object_id,
                                    RawObject* raw,
                                    RawClass* cls,
diff --git a/runtime/vm/snapshot.h b/runtime/vm/snapshot.h
index de87940..9b649bd 100644
--- a/runtime/vm/snapshot.h
+++ b/runtime/vm/snapshot.h
@@ -505,6 +505,7 @@
                     RawAbstractTypeArguments* type_arguments,
                     RawObject* data[]);
   void CheckIfSerializable(RawClass* cls);
+  void SetWriteException(Exceptions::ExceptionType type, const char* msg);
   void WriteInstance(intptr_t object_id,
                      RawObject* raw,
                      RawClass* cls,
@@ -531,6 +532,7 @@
   friend class RawLibrary;
   friend class RawLiteralToken;
   friend class RawScript;
+  friend class RawStacktrace;
   friend class RawTokenStream;
   friend class RawTypeArguments;
   friend class SnapshotWriterVisitor;
diff --git a/runtime/vm/snapshot_test.cc b/runtime/vm/snapshot_test.cc
index 6e0911b..d219122 100644
--- a/runtime/vm/snapshot_test.cc
+++ b/runtime/vm/snapshot_test.cc
@@ -2184,28 +2184,74 @@
 }
 
 UNIT_TEST_CASE(DartGeneratedListMessagesWithTypedData) {
-  const int kArrayLength = 10;
   static const char* kScriptChars =
       "import 'dart:typeddata';\n"
-      "final int kArrayLength = 10;\n"
       "getTypedDataList() {\n"
-      "  var list = new List(kArrayLength);\n"
-      "  list[0] = new Int8List(256);\n"
-      "  list[1] = new Uint8List(256);\n"
-      "  list[2] = new Int16List(256);\n"
-      "  list[3] = new Uint16List(256);\n"
+      "  var list = new List(10);\n"
+      "  var index = 0;\n"
+      "  list[index++] = new Int8List(256);\n"
+      "  list[index++] = new Uint8List(256);\n"
+      "  list[index++] = new Int16List(256);\n"
+      "  list[index++] = new Uint16List(256);\n"
+      "  list[index++] = new Int32List(256);\n"
+      "  list[index++] = new Uint32List(256);\n"
+      "  list[index++] = new Int64List(256);\n"
+      "  list[index++] = new Uint64List(256);\n"
+      "  list[index++] = new Float32List(256);\n"
+      "  list[index++] = new Float64List(256);\n"
       "  return list;\n"
       "}\n"
       "getTypedDataViewList() {\n"
-      "  var list = new List(kArrayLength);\n"
-      "  list[0] = new Int8List.view(new Int8List(256));\n"
-      "  list[1] = new Uint8List.view(new Uint8List(256));\n"
-      "  list[2] = new Int16List.view(new Int16List(256));\n"
-      "  list[3] = new Uint16List.view(new Uint16List(256));\n"
-      "  list[4] = new Int8List.view(new Int16List(256));\n"
-      "  list[5] = new Uint8List.view(new Uint16List(256));\n"
-      "  list[6] = new Int16List.view(new Int8List(256));\n"
-      "  list[7] = new Uint16List.view(new Uint8List(256));\n"
+      "  var list = new List(30);\n"
+      "  var index = 0;\n"
+      "  list[index++] = new Int8List.view(new Int8List(256));\n"
+      "  list[index++] = new Uint8List.view(new Uint8List(256));\n"
+      "  list[index++] = new Int16List.view(new Int16List(256));\n"
+      "  list[index++] = new Uint16List.view(new Uint16List(256));\n"
+      "  list[index++] = new Int32List.view(new Int32List(256));\n"
+      "  list[index++] = new Uint32List.view(new Uint32List(256));\n"
+      "  list[index++] = new Int64List.view(new Int64List(256));\n"
+      "  list[index++] = new Uint64List.view(new Uint64List(256));\n"
+      "  list[index++] = new Float32List.view(new Float32List(256));\n"
+      "  list[index++] = new Float64List.view(new Float64List(256));\n"
+
+      "  list[index++] = new Int8List.view(new Int16List(256));\n"
+      "  list[index++] = new Uint8List.view(new Uint16List(256));\n"
+      "  list[index++] = new Int8List.view(new Int32List(256));\n"
+      "  list[index++] = new Uint8List.view(new Uint32List(256));\n"
+      "  list[index++] = new Int8List.view(new Int64List(256));\n"
+      "  list[index++] = new Uint8List.view(new Uint64List(256));\n"
+      "  list[index++] = new Int8List.view(new Float32List(256));\n"
+      "  list[index++] = new Uint8List.view(new Float32List(256));\n"
+      "  list[index++] = new Int8List.view(new Float64List(256));\n"
+      "  list[index++] = new Uint8List.view(new Float64List(256));\n"
+
+      "  list[index++] = new Int16List.view(new Int8List(256));\n"
+      "  list[index++] = new Uint16List.view(new Uint8List(256));\n"
+      "  list[index++] = new Int16List.view(new Int32List(256));\n"
+      "  list[index++] = new Uint16List.view(new Uint32List(256));\n"
+      "  list[index++] = new Int16List.view(new Int64List(256));\n"
+      "  list[index++] = new Uint16List.view(new Uint64List(256));\n"
+      "  list[index++] = new Int16List.view(new Float32List(256));\n"
+      "  list[index++] = new Uint16List.view(new Float32List(256));\n"
+      "  list[index++] = new Int16List.view(new Float64List(256));\n"
+      "  list[index++] = new Uint16List.view(new Float64List(256));\n"
+      "  return list;\n"
+      "}\n"
+      "getMultipleTypedDataViewList() {\n"
+      "  var list = new List(10);\n"
+      "  var index = 0;\n"
+      "  var data = new Uint8List(256);\n"
+      "  list[index++] = new Int8List.view(data);\n"
+      "  list[index++] = new Uint8List.view(data);\n"
+      "  list[index++] = new Int16List.view(data);\n"
+      "  list[index++] = new Uint16List.view(data);\n"
+      "  list[index++] = new Int32List.view(data);\n"
+      "  list[index++] = new Uint32List.view(data);\n"
+      "  list[index++] = new Int64List.view(data);\n"
+      "  list[index++] = new Uint64List.view(data);\n"
+      "  list[index++] = new Float32List.view(data);\n"
+      "  list[index++] = new Float64List.view(data);\n"
       "  return list;\n"
       "}\n";
 
@@ -2225,52 +2271,125 @@
       Dart_CObject* root = GetDeserializedDartMessage(lib, "getTypedDataList");
       EXPECT_NOTNULL(root);
       EXPECT_EQ(Dart_CObject::kArray, root->type);
-      EXPECT_EQ(kArrayLength, root->value.as_array.length);
-      CheckTypedData(root->value.as_array.values[0],
-                     Dart_CObject::kInt8Array,
-                     256);
-      CheckTypedData(root->value.as_array.values[1],
-                     Dart_CObject::kUint8Array,
-                     256);
-      CheckTypedData(root->value.as_array.values[2],
-                     Dart_CObject::kInt16Array,
-                     512);
-      CheckTypedData(root->value.as_array.values[3],
-                     Dart_CObject::kUint16Array,
-                     512);
+      struct {
+        Dart_CObject::TypedDataType type;
+        int size;
+      } expected[] = {
+        { Dart_CObject::kInt8Array, 256},
+        { Dart_CObject::kUint8Array, 256},
+        { Dart_CObject::kInt16Array, 512},
+        { Dart_CObject::kUint16Array, 512},
+        { Dart_CObject::kInt32Array, 1024},
+        { Dart_CObject::kUint32Array, 1024},
+        { Dart_CObject::kInt64Array, 2048},
+        { Dart_CObject::kUint64Array, 2048},
+        { Dart_CObject::kFloat32Array, 1024},
+        { Dart_CObject::kFloat64Array, 2048},
+        { Dart_CObject::kNumberOfTypedDataTypes, -1 }
+      };
+
+      int i = 0;
+      while (expected[i].type != Dart_CObject::kNumberOfTypedDataTypes) {
+        CheckTypedData(root->value.as_array.values[i],
+                       expected[i].type,
+                       expected[i].size);
+        i++;
+      }
+      EXPECT_EQ(i, root->value.as_array.length);
     }
     {
       // Generate a list of Uint8List views from Dart code.
+
       ApiNativeScope scope;
       Dart_CObject* root =
           GetDeserializedDartMessage(lib, "getTypedDataViewList");
       EXPECT_NOTNULL(root);
       EXPECT_EQ(Dart_CObject::kArray, root->type);
-      EXPECT_EQ(kArrayLength, root->value.as_array.length);
-      CheckTypedData(root->value.as_array.values[0],
-                     Dart_CObject::kInt8Array,
-                     256);
-      CheckTypedData(root->value.as_array.values[1],
-                     Dart_CObject::kUint8Array,
-                     256);
-      CheckTypedData(root->value.as_array.values[2],
-                     Dart_CObject::kInt16Array,
-                     512);
-      CheckTypedData(root->value.as_array.values[3],
-                     Dart_CObject::kUint16Array,
-                     512);
-      CheckTypedData(root->value.as_array.values[4],
-                     Dart_CObject::kInt8Array,
-                     512);
-      CheckTypedData(root->value.as_array.values[5],
-                     Dart_CObject::kUint8Array,
-                     512);
-      CheckTypedData(root->value.as_array.values[6],
-                     Dart_CObject::kInt16Array,
-                     256);
-      CheckTypedData(root->value.as_array.values[7],
-                     Dart_CObject::kUint16Array,
-                     256);
+      struct {
+        Dart_CObject::TypedDataType type;
+        int size;
+      } expected[] = {
+        { Dart_CObject::kInt8Array, 256},
+        { Dart_CObject::kUint8Array, 256},
+        { Dart_CObject::kInt16Array, 512},
+        { Dart_CObject::kUint16Array, 512},
+        { Dart_CObject::kInt32Array, 1024},
+        { Dart_CObject::kUint32Array, 1024},
+        { Dart_CObject::kInt64Array, 2048},
+        { Dart_CObject::kUint64Array, 2048},
+        { Dart_CObject::kFloat32Array, 1024},
+        { Dart_CObject::kFloat64Array, 2048},
+
+        { Dart_CObject::kInt8Array, 512},
+        { Dart_CObject::kUint8Array, 512},
+        { Dart_CObject::kInt8Array, 1024},
+        { Dart_CObject::kUint8Array, 1024},
+        { Dart_CObject::kInt8Array, 2048},
+        { Dart_CObject::kUint8Array, 2048},
+        { Dart_CObject::kInt8Array, 1024},
+        { Dart_CObject::kUint8Array, 1024},
+        { Dart_CObject::kInt8Array, 2048},
+        { Dart_CObject::kUint8Array, 2048},
+
+        { Dart_CObject::kInt16Array, 256},
+        { Dart_CObject::kUint16Array, 256},
+        { Dart_CObject::kInt16Array, 1024},
+        { Dart_CObject::kUint16Array, 1024},
+        { Dart_CObject::kInt16Array, 2048},
+        { Dart_CObject::kUint16Array, 2048},
+        { Dart_CObject::kInt16Array, 1024},
+        { Dart_CObject::kUint16Array, 1024},
+        { Dart_CObject::kInt16Array, 2048},
+        { Dart_CObject::kUint16Array, 2048},
+
+        { Dart_CObject::kNumberOfTypedDataTypes, -1 }
+      };
+
+      int i = 0;
+      while (expected[i].type != Dart_CObject::kNumberOfTypedDataTypes) {
+        CheckTypedData(root->value.as_array.values[i],
+                       expected[i].type,
+                       expected[i].size);
+        i++;
+      }
+      EXPECT_EQ(i, root->value.as_array.length);
+    }
+    {
+      // Generate a list of Uint8Lists from Dart code.
+      ApiNativeScope scope;
+      Dart_CObject* root =
+          GetDeserializedDartMessage(lib, "getMultipleTypedDataViewList");
+      EXPECT_NOTNULL(root);
+      EXPECT_EQ(Dart_CObject::kArray, root->type);
+      struct {
+        Dart_CObject::TypedDataType type;
+        int size;
+      } expected[] = {
+        { Dart_CObject::kInt8Array, 256},
+        { Dart_CObject::kUint8Array, 256},
+        { Dart_CObject::kInt16Array, 256},
+        { Dart_CObject::kUint16Array, 256},
+        { Dart_CObject::kInt32Array, 256},
+        { Dart_CObject::kUint32Array, 256},
+        { Dart_CObject::kInt64Array, 256},
+        { Dart_CObject::kUint64Array, 256},
+        { Dart_CObject::kFloat32Array, 256},
+        { Dart_CObject::kFloat64Array, 256},
+        { Dart_CObject::kNumberOfTypedDataTypes, -1 }
+      };
+
+      int i = 0;
+      while (expected[i].type != Dart_CObject::kNumberOfTypedDataTypes) {
+        CheckTypedData(root->value.as_array.values[i],
+                       expected[i].type,
+                       expected[i].size);
+
+        // All views point to the same data.
+        EXPECT_EQ(root->value.as_array.values[0]->value.as_typed_data.values,
+                  root->value.as_array.values[i]->value.as_typed_data.values);
+        i++;
+      }
+      EXPECT_EQ(i, root->value.as_array.length);
     }
   }
   Dart_ExitScope();
diff --git a/runtime/vm/stack_frame_test.cc b/runtime/vm/stack_frame_test.cc
index ecdf38e..37a0801 100644
--- a/runtime/vm/stack_frame_test.cc
+++ b/runtime/vm/stack_frame_test.cc
@@ -16,8 +16,11 @@
 
 namespace dart {
 
-// Only ia32 and x64 can run stack frame iteration tests.
-#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
+// Only ia32, x64, and arm can run stack frame iteration tests.
+#if defined(TARGET_ARCH_IA32) ||                                               \
+    defined(TARGET_ARCH_X64) ||                                                \
+    defined(TARGET_ARCH_ARM)
+
 // Unit test for empty stack frame iteration.
 TEST_CASE(EmptyStackFrameIteration) {
   StackFrameIterator iterator(StackFrameIterator::kValidateFrames);
@@ -286,6 +289,7 @@
   Dart_Handle cls = Dart_GetClass(lib, NewString("StackFrame2Test"));
   EXPECT_VALID(Dart_Invoke(cls, NewString("testMain"), 0, NULL));
 }
-#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64.
+
+#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM
 
 }  // namespace dart
diff --git a/runtime/vm/stub_code.h b/runtime/vm/stub_code.h
index da0fe25..0f54897 100644
--- a/runtime/vm/stub_code.h
+++ b/runtime/vm/stub_code.h
@@ -38,7 +38,6 @@
   V(Subtype3TestCache)                                                         \
   V(GetStackPointer)                                                           \
   V(JumpToExceptionHandler)                                                    \
-  V(JumpToErrorHandler)                                                        \
   V(IdenticalWithNumberCheck)                                                  \
 
 // Is it permitted for the stubs above to refer to Object::null(), which is
diff --git a/runtime/vm/stub_code_arm.cc b/runtime/vm/stub_code_arm.cc
index 0bf4538..0e9fbfe 100644
--- a/runtime/vm/stub_code_arm.cc
+++ b/runtime/vm/stub_code_arm.cc
@@ -7,9 +7,11 @@
 
 #include "vm/assembler.h"
 #include "vm/code_generator.h"
+#include "vm/compiler.h"
 #include "vm/dart_entry.h"
 #include "vm/flow_graph_compiler.h"
 #include "vm/instructions.h"
+#include "vm/object_store.h"
 #include "vm/stack_frame.h"
 #include "vm/stub_code.h"
 
@@ -217,8 +219,75 @@
 }
 
 
+// Input parameters:
+//   R2: smi-tagged argument count, may be zero.
+//   FP[kLastParamSlotIndex]: last argument.
+static void PushArgumentsArray(Assembler* assembler) {
+  // Allocate array to store arguments of caller.
+  __ LoadImmediate(R1, reinterpret_cast<intptr_t>(Object::null()));
+  // R1: null element type for raw Array.
+  // R2: smi-tagged argument count, may be zero.
+  __ BranchLink(&StubCode::AllocateArrayLabel());
+  // R0: newly allocated array.
+  // R2: smi-tagged argument count, may be zero (was preserved by the stub).
+  __ Push(R0);  // Array is in R0 and on top of stack.
+  __ add(R1, FP, ShifterOperand(R2, LSL, 1));
+  __ AddImmediate(R1, (kLastParamSlotIndex - 1) * kWordSize);
+  __ AddImmediate(R3, R0, Array::data_offset() - kHeapObjectTag);
+  // R1: address of first argument on stack.
+  // R3: address of first argument in array.
+  Label loop;
+  __ Bind(&loop);
+  __ subs(R2, R2, ShifterOperand(Smi::RawValue(1)));  // R2 is Smi.
+  __ ldr(IP, Address(R1, 0), PL);
+  __ str(IP, Address(R3, 0), PL);
+  __ AddImmediate(R1, -kWordSize, PL);
+  __ AddImmediate(R3, kWordSize, PL);
+  __ b(&loop, PL);
+}
+
+
+// Input parameters:
+//   R5: ic-data.
+//   R4: arguments descriptor array.
+// Note: The receiver object is the first argument to the function being
+//       called, the stub accesses the receiver from this location directly
+//       when trying to resolve the call.
 void StubCode::GenerateInstanceFunctionLookupStub(Assembler* assembler) {
-  __ Unimplemented("InstanceFunctionLookup stub");
+  __ EnterStubFrame();
+
+  // Load the receiver.
+  __ ldr(R2, FieldAddress(R4, ArgumentsDescriptor::count_offset()));
+  __ add(IP, FP, ShifterOperand(R2, LSL, 1));  // R2 is Smi.
+  __ ldr(R6, Address(IP, (kLastParamSlotIndex - 1) * kWordSize));
+
+  // Push space for the return value.
+  // Push the receiver.
+  // Push IC data object.
+  // Push arguments descriptor array.
+  __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null()));
+  __ PushList((1 << R4) | (1 << R5) | (1 << R6) | (1 << IP));
+
+  // R2: Smi-tagged arguments array length.
+  PushArgumentsArray(assembler);
+
+  // Stack:
+  // TOS + 0: argument array.
+  // TOS + 1: arguments descriptor array.
+  // TOS + 2: IC data object.
+  // TOS + 3: Receiver.
+  // TOS + 4: place for result from the call.
+  // TOS + 5: saved FP of previous frame.
+  // TOS + 6: dart code return address
+  // TOS + 7: pc marker (0 for stub).
+  // TOS + 8: last argument of caller.
+  // ....
+  __ CallRuntime(kInstanceFunctionLookupRuntimeEntry);
+  // Remove arguments.
+  __ Drop(4);
+  __ Pop(R0);  // Get result into R0.
+  __ LeaveStubFrame();
+  __ Ret();
 }
 
 
@@ -237,13 +306,237 @@
 }
 
 
+// Called for inline allocation of arrays.
+// Input parameters:
+//   LR: return address.
+//   R2: array length as Smi.
+//   R1: array element type (either NULL or an instantiated type).
+// NOTE: R2 cannot be clobbered here as the caller relies on it being saved.
+// The newly allocated object is returned in R0.
 void StubCode::GenerateAllocateArrayStub(Assembler* assembler) {
-  __ Unimplemented("AllocateArray stub");
+  Label slow_case;
+  if (FLAG_inline_alloc) {
+    // Compute the size to be allocated, it is based on the array length
+    // and is computed as:
+    // RoundedAllocationSize((array_length * kwordSize) + sizeof(RawArray)).
+    // Assert that length is a Smi.
+    __ tst(R2, ShifterOperand(kSmiTagMask));
+    if (FLAG_use_slow_path) {
+      __ b(&slow_case);
+    } else {
+      __ b(&slow_case, NE);
+    }
+    __ ldr(R8, FieldAddress(CTX, Context::isolate_offset()));
+    __ LoadFromOffset(kLoadWord, R8, R8, Isolate::heap_offset());
+    __ LoadFromOffset(kLoadWord, R8, R8, Heap::new_space_offset());
+
+    // Calculate and align allocation size.
+    // Load new object start and calculate next object start.
+    // R1: array element type.
+    // R2: array length as Smi.
+    // R8: points to new space object.
+    __ LoadFromOffset(kLoadWord, R0, R8, Scavenger::top_offset());
+    intptr_t fixed_size = sizeof(RawArray) + kObjectAlignment - 1;
+    __ LoadImmediate(R3, fixed_size);
+    __ add(R3, R3, ShifterOperand(R2, LSL, 1));  // R2 is Smi.
+    ASSERT(kSmiTagShift == 1);
+    __ bic(R3, R3, ShifterOperand(kObjectAlignment - 1));
+    __ add(R7, R3, ShifterOperand(R0));
+
+    // Check if the allocation fits into the remaining space.
+    // R0: potential new object start.
+    // R1: array element type.
+    // R2: array length as Smi.
+    // R3: array size.
+    // R7: potential next object start.
+    // R8: points to new space object.
+    __ LoadFromOffset(kLoadWord, IP, R8, Scavenger::end_offset());
+    __ cmp(R7, ShifterOperand(IP));
+    __ b(&slow_case, CS);  // Branch if unsigned higher or equal.
+
+    // Successfully allocated the object(s), now update top to point to
+    // next object start and initialize the object.
+    // R0: potential new object start.
+    // R7: potential next object start.
+    // R8: Points to new space object.
+    __ StoreToOffset(kStoreWord, R7, R8, Scavenger::top_offset());
+    __ add(R0, R0, ShifterOperand(kHeapObjectTag));
+
+    // R0: new object start as a tagged pointer.
+    // R1: array element type.
+    // R2: array length as Smi.
+    // R3: array size.
+    // R7: new object end address.
+
+    // Store the type argument field.
+    __ StoreIntoObjectNoBarrier(
+        R0,
+        FieldAddress(R0, Array::type_arguments_offset()),
+        R1);
+
+    // Set the length field.
+    __ StoreIntoObjectNoBarrier(
+        R0,
+        FieldAddress(R0, Array::length_offset()),
+        R2);
+
+    // Calculate the size tag.
+    // R0: new object start as a tagged pointer.
+    // R2: array length as Smi.
+    // R3: array size.
+    // R7: new object end address.
+    const intptr_t shift = RawObject::kSizeTagBit - kObjectAlignmentLog2;
+    __ CompareImmediate(R3, RawObject::SizeTag::kMaxSizeTag);
+    // If no size tag overflow, shift R1 left, else set R1 to zero.
+    __ mov(R1, ShifterOperand(R3, LSL, shift), LS);
+    __ mov(R1, ShifterOperand(0), HI);
+
+    // Get the class index and insert it into the tags.
+    __ LoadImmediate(IP, RawObject::ClassIdTag::encode(kArrayCid));
+    __ orr(R1, R1, ShifterOperand(IP));
+    __ str(R1, FieldAddress(R0, Array::tags_offset()));
+
+    // Initialize all array elements to raw_null.
+    // R0: new object start as a tagged pointer.
+    // R7: new object end address.
+    // R2: array length as Smi.
+    __ AddImmediate(R1, R0, Array::data_offset() - kHeapObjectTag);
+    // R1: iterator which initially points to the start of the variable
+    // data area to be initialized.
+    __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null()));
+    Label loop;
+    __ Bind(&loop);
+    // TODO(cshapiro): StoreIntoObjectNoBarrier
+    __ cmp(R1, ShifterOperand(R7));
+    __ str(IP, Address(R1, 0), CC);  // Store if unsigned lower.
+    __ AddImmediate(R1, kWordSize, CC);
+    __ b(&loop, CS);
+
+    // Done allocating and initializing the array.
+    // R0: new object.
+    // R2: array length as Smi (preserved for the caller.)
+    __ Ret();
+  }
+
+  // Unable to allocate the array using the fast inline code, just call
+  // into the runtime.
+  __ Bind(&slow_case);
+  // Create a stub frame as we are pushing some objects on the stack before
+  // calling into the runtime.
+  __ EnterStubFrame();
+  __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null()));
+  // Setup space on stack for return value.
+  // Push array length as Smi and element type.
+  __ PushList((1 << R1) | (1 << R2) | (1 << IP));
+  __ CallRuntime(kAllocateArrayRuntimeEntry);
+  // Pop arguments; result is popped in IP.
+  __ PopList((1 << R1) | (1 << R2) | (1 << IP));  // R2 is restored.
+  __ mov(R0, ShifterOperand(IP));
+  __ LeaveStubFrame();
+  __ Ret();
 }
 
 
+// Input parameters:
+//   LR: return address.
+//   SP: address of last argument.
+//   R4: arguments descriptor array.
+// Note: The closure object is the first argument to the function being
+//       called, the stub accesses the closure from this location directly
+//       when trying to resolve the call.
 void StubCode::GenerateCallClosureFunctionStub(Assembler* assembler) {
-  __ Unimplemented("CallClosureFunction stub");
+  // Load num_args.
+  __ ldr(R0, FieldAddress(R4, ArgumentsDescriptor::count_offset()));
+  __ sub(R0, R0, ShifterOperand(Smi::RawValue(1)));
+  // Load closure object in R1.
+  __ ldr(R1, Address(SP, R0, LSL, 1));  // R0 (num_args - 1) is a Smi.
+
+  // Verify that R1 is a closure by checking its class.
+  Label not_closure;
+  __ LoadImmediate(R8, reinterpret_cast<intptr_t>(Object::null()));
+  __ cmp(R1, ShifterOperand(R8));
+  // Not a closure, but null object.
+  __ b(&not_closure, EQ);
+  __ tst(R1, ShifterOperand(kSmiTagMask));
+  __ b(&not_closure, EQ);  // Not a closure, but a smi.
+  // Verify that the class of the object is a closure class by checking that
+  // class.signature_function() is not null.
+  __ LoadClass(R0, R1, R2);
+  __ ldr(R0, FieldAddress(R0, Class::signature_function_offset()));
+  __ cmp(R0, ShifterOperand(R8));  // R8 is raw null.
+  // Actual class is not a closure class.
+  __ b(&not_closure, EQ);
+
+  // R0 is just the signature function. Load the actual closure function.
+  __ ldr(R2, FieldAddress(R1, Closure::function_offset()));
+
+  // Load closure context in CTX; note that CTX has already been preserved.
+  __ ldr(CTX, FieldAddress(R1, Closure::context_offset()));
+
+  // Load closure function code in R0.
+  __ ldr(R0, FieldAddress(R2, Function::code_offset()));
+  __ cmp(R0, ShifterOperand(R8));  // R8 is raw null.
+  Label function_compiled;
+  __ b(&function_compiled, NE);
+
+  // Create a stub frame as we are pushing some objects on the stack before
+  // calling into the runtime.
+  __ EnterStubFrame();
+
+  // Preserve arguments descriptor array and read-only function object argument.
+  __ PushList((1 << R2) | (1 << R4));
+  __ CallRuntime(kCompileFunctionRuntimeEntry);
+  // Restore arguments descriptor array and read-only function object argument.
+  __ PopList((1 << R2) | (1 << R4));
+  // Restore R0.
+  __ ldr(R0, FieldAddress(R2, Function::code_offset()));
+
+  // Remove the stub frame as we are about to jump to the closure function.
+  __ LeaveStubFrame();
+
+  __ Bind(&function_compiled);
+  // R0: code.
+  // R4: arguments descriptor array.
+  __ ldr(R0, FieldAddress(R0, Code::instructions_offset()));
+  __ AddImmediate(R0, Instructions::HeaderSize() - kHeapObjectTag);
+  __ bx(R0);
+
+  __ Bind(&not_closure);
+  // Call runtime to attempt to resolve and invoke a call method on a
+  // non-closure object, passing the non-closure object and its arguments array,
+  // returning here.
+  // If no call method exists, throw a NoSuchMethodError.
+  // R1: non-closure object.
+  // R4: arguments descriptor array.
+
+  // Create a stub frame as we are pushing some objects on the stack before
+  // calling into the runtime.
+  __ EnterStubFrame();
+
+  // Setup space on stack for result from error reporting.
+  __ PushList((1 << R4) | (1 << R8));  // Arguments descriptor and raw null.
+
+  // Load smi-tagged arguments array length, including the non-closure.
+  __ ldr(R2, FieldAddress(R4, ArgumentsDescriptor::count_offset()));
+  PushArgumentsArray(assembler);
+
+  // Stack:
+  // TOS + 0: argument array.
+  // TOS + 1: arguments descriptor array.
+  // TOS + 2: place for result from the call.
+  // TOS + 3: saved FP of previous frame.
+  // TOS + 4: dart code return address
+  // TOS + 5: pc marker (0 for stub).
+  // TOS + 6: last argument of caller.
+  // ....
+  __ CallRuntime(kInvokeNonClosureRuntimeEntry);
+  // Remove arguments.
+  __ Drop(2);
+  __ Pop(R0);  // Get result into R0.
+
+  // Remove the stub frame as we are about to return.
+  __ LeaveStubFrame();
+  __ Ret();
 }
 
 
@@ -351,8 +644,119 @@
 }
 
 
+// Called for inline allocation of contexts.
+// Input:
+//   R1: number of context variables.
+// Output:
+//   R0: new allocated RawContext object.
 void StubCode::GenerateAllocateContextStub(Assembler* assembler) {
-  __ Unimplemented("AllocateContext stub");
+  if (FLAG_inline_alloc) {
+    const Class& context_class = Class::ZoneHandle(Object::context_class());
+    Label slow_case;
+    Heap* heap = Isolate::Current()->heap();
+    // First compute the rounded instance size.
+    // R1: number of context variables.
+    intptr_t fixed_size = sizeof(RawContext) + kObjectAlignment - 1;
+    __ LoadImmediate(R2, fixed_size);
+    __ add(R2, R2, ShifterOperand(R1, LSL, 2));
+    ASSERT(kSmiTagShift == 1);
+    __ bic(R2, R2, ShifterOperand(kObjectAlignment - 1));
+
+    // Now allocate the object.
+    // R1: number of context variables.
+    // R2: object size.
+    __ LoadImmediate(R5, heap->TopAddress());
+    __ ldr(R0, Address(R5, 0));
+    __ add(R3, R2, ShifterOperand(R0));
+    // Check if the allocation fits into the remaining space.
+    // R0: potential new object.
+    // R1: number of context variables.
+    // R2: object size.
+    // R3: potential next object start.
+    __ LoadImmediate(IP, heap->EndAddress());
+    __ ldr(IP, Address(IP, 0));
+    __ cmp(R3, ShifterOperand(IP));
+    if (FLAG_use_slow_path) {
+      __ b(&slow_case);
+    } else {
+      __ b(&slow_case, CS);  // Branch if unsigned higher or equal.
+    }
+
+    // Successfully allocated the object, now update top to point to
+    // next object start and initialize the object.
+    // R0: new object.
+    // R1: number of context variables.
+    // R2: object size.
+    // R3: next object start.
+    __ str(R3, Address(R5, 0));
+    __ add(R0, R0, ShifterOperand(kHeapObjectTag));
+
+    // Calculate the size tag.
+    // R0: new object.
+    // R1: number of context variables.
+    // R2: object size.
+    const intptr_t shift = RawObject::kSizeTagBit - kObjectAlignmentLog2;
+    __ CompareImmediate(R2, RawObject::SizeTag::kMaxSizeTag);
+    // If no size tag overflow, shift R2 left, else set R2 to zero.
+    __ mov(R2, ShifterOperand(R2, LSL, shift), LS);
+    __ mov(R2, ShifterOperand(0), HI);
+
+    // Get the class index and insert it into the tags.
+    // R2: size and bit tags.
+    __ LoadImmediate(IP, RawObject::ClassIdTag::encode(context_class.id()));
+    __ orr(R2, R2, ShifterOperand(IP));
+    __ str(R2, FieldAddress(R0, Context::tags_offset()));
+
+    // Setup up number of context variables field.
+    // R0: new object.
+    // R1: number of context variables as integer value (not object).
+    __ str(R1, FieldAddress(R0, Context::num_variables_offset()));
+
+    // Setup isolate field.
+    // Load Isolate pointer from Context structure into R2.
+    // R0: new object.
+    // R1: number of context variables.
+    __ ldr(R2, FieldAddress(CTX, Context::isolate_offset()));
+    // R2: isolate, not an object.
+    __ str(R2, FieldAddress(R0, Context::isolate_offset()));
+
+    // Setup the parent field.
+    // R0: new object.
+    // R1: number of context variables.
+    __ LoadImmediate(R2, reinterpret_cast<intptr_t>(Object::null()));
+    __ str(R2, FieldAddress(R0, Context::parent_offset()));
+
+    // Initialize the context variables.
+    // R0: new object.
+    // R1: number of context variables.
+    // R2: raw null.
+    Label loop;
+    __ AddImmediate(R3, R0, Context::variable_offset(0) - kHeapObjectTag);
+    __ Bind(&loop);
+    __ subs(R1, R1, ShifterOperand(1));
+    __ str(R2, Address(R3, R1, LSL, 2), PL);  // Store if R1 positive or zero.
+    __ b(&loop, NE);  // Loop if R1 not zero.
+
+    // Done allocating and initializing the context.
+    // R0: new object.
+    __ Ret();
+
+    __ Bind(&slow_case);
+  }
+  // Create a stub frame as we are pushing some objects on the stack before
+  // calling into the runtime.
+  __ EnterStubFrame();
+  // Setup space on stack for return value.
+  __ LoadImmediate(R2, reinterpret_cast<intptr_t>(Object::null()));
+  __ SmiTag(R1);
+  __ PushList((1 << R1) | (1 << R2));
+  __ CallRuntime(kAllocateContextRuntimeEntry);  // Allocate context.
+  __ Drop(1);  // Pop number of context variables argument.
+  __ Pop(R0);  // Pop the new context object.
+  // R0: new object
+  // Restore the frame pointer.
+  __ LeaveStubFrame();
+  __ Ret();
 }
 
 
@@ -360,18 +764,18 @@
 
 // Helper stub to implement Assembler::StoreIntoObject.
 // Input parameters:
-//   R0: Address (i.e. object) being stored into.
+//   R0: address (i.e. object) being stored into.
 void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) {
   // Save values being destroyed.
   __ PushList((1 << R1) | (1 << R2) | (1 << R3));
 
   // Load the isolate out of the context.
   // Spilled: R1, R2, R3.
-  // R0: Address being stored.
+  // R0: address being stored.
   __ ldr(R1, FieldAddress(CTX, Context::isolate_offset()));
 
   // Load top_ out of the StoreBufferBlock and add the address to the pointers_.
-  // R1: Isolate.
+  // R1: isolate.
   intptr_t store_buffer_offset = Isolate::store_buffer_block_offset();
   __ LoadFromOffset(kLoadWord, R2, R1,
                     store_buffer_offset + StoreBufferBlock::top_offset());
@@ -380,8 +784,8 @@
                    store_buffer_offset + StoreBufferBlock::pointers_offset());
 
   // Increment top_ and check for overflow.
-  // R2: top_
-  // R1: Isolate
+  // R2: top_.
+  // R1: isolate.
   Label L;
   __ add(R2, R2, ShifterOperand(1));
   __ StoreToOffset(kStoreWord, R2, R1,
@@ -442,11 +846,12 @@
     // Check if the allocation fits into the remaining space.
     // R2: potential new object start.
     // R3: potential next object start.
+    __ LoadImmediate(IP, heap->EndAddress());
+    __ ldr(IP, Address(IP, 0));
+    __ cmp(R3, ShifterOperand(IP));
     if (FLAG_use_slow_path) {
       __ b(&slow_case);
     } else {
-      __ LoadImmediate(IP, heap->EndAddress());
-      __ cmp(R3, ShifterOperand(IP));
       __ b(&slow_case, CS);  // Branch if unsigned higher or equal.
     }
 
@@ -539,6 +944,7 @@
     // Done allocating and initializing the instance.
     // R2: new object still missing its heap tag.
     __ add(R0, R2, ShifterOperand(kHeapObjectTag));
+    // R0: new object.
     __ Ret();
 
     __ Bind(&slow_case);
@@ -570,9 +976,154 @@
 }
 
 
+// Called for inline allocation of closures.
+// Input parameters:
+//   LR : return address.
+//   SP + 4 : receiver (null if not an implicit instance closure).
+//   SP + 0 : type arguments object (null if class is no parameterized).
 void StubCode::GenerateAllocationStubForClosure(Assembler* assembler,
                                                 const Function& func) {
-  __ Unimplemented("AllocateClosure stub");
+  ASSERT(func.IsClosureFunction());
+  const bool is_implicit_static_closure =
+      func.IsImplicitStaticClosureFunction();
+  const bool is_implicit_instance_closure =
+      func.IsImplicitInstanceClosureFunction();
+  const Class& cls = Class::ZoneHandle(func.signature_class());
+  const bool has_type_arguments = cls.HasTypeArguments();
+
+  __ EnterStubFrame(true);  // Uses pool pointer to refer to function.
+  const intptr_t kTypeArgumentsFPOffset = 3 * kWordSize;
+  const intptr_t kReceiverFPOffset = 4 * kWordSize;
+  const intptr_t closure_size = Closure::InstanceSize();
+  const intptr_t context_size = Context::InstanceSize(1);  // Captured receiver.
+  if (FLAG_inline_alloc &&
+      PageSpace::IsPageAllocatableSize(closure_size + context_size)) {
+    Label slow_case;
+    Heap* heap = Isolate::Current()->heap();
+    __ LoadImmediate(R5, heap->TopAddress());
+    __ ldr(R2, Address(R5, 0));
+    __ AddImmediate(R3, R2, closure_size);
+    if (is_implicit_instance_closure) {
+      __ mov(R4, ShifterOperand(R3));  // R4: new context address.
+      __ AddImmediate(R3, context_size);
+    }
+    // Check if the allocation fits into the remaining space.
+    // R2: potential new closure object.
+    // R3: potential next object start.
+    // R4: potential new context object (only if is_implicit_closure).
+    __ LoadImmediate(IP, heap->EndAddress());
+    __ ldr(IP, Address(IP, 0));
+    __ cmp(R3, ShifterOperand(IP));
+    if (FLAG_use_slow_path) {
+      __ b(&slow_case);
+    } else {
+      __ b(&slow_case, CS);  // Branch if unsigned higher or equal.
+    }
+
+    // Successfully allocated the object, now update top to point to
+    // next object start and initialize the object.
+    __ str(R3, Address(R5, 0));
+
+    // R2: new closure object.
+    // R4: new context object (only if is_implicit_closure).
+    // Set the tags.
+    uword tags = 0;
+    tags = RawObject::SizeTag::update(closure_size, tags);
+    tags = RawObject::ClassIdTag::update(cls.id(), tags);
+    __ LoadImmediate(R0, tags);
+    __ str(R0, Address(R2, Instance::tags_offset()));
+
+    // Initialize the function field in the object.
+    // R2: new closure object.
+    // R4: new context object (only if is_implicit_closure).
+    __ LoadObject(R0, func);  // Load function of closure to be allocated.
+    __ str(R0, Address(R2, Closure::function_offset()));
+
+    // Setup the context for this closure.
+    if (is_implicit_static_closure) {
+      ObjectStore* object_store = Isolate::Current()->object_store();
+      ASSERT(object_store != NULL);
+      const Context& empty_context =
+          Context::ZoneHandle(object_store->empty_context());
+      __ LoadObject(R0, empty_context);
+      __ str(R0, Address(R2, Closure::context_offset()));
+    } else if (is_implicit_instance_closure) {
+      // Initialize the new context capturing the receiver.
+      const Class& context_class = Class::ZoneHandle(Object::context_class());
+      // Set the tags.
+      uword tags = 0;
+      tags = RawObject::SizeTag::update(context_size, tags);
+      tags = RawObject::ClassIdTag::update(context_class.id(), tags);
+      __ LoadImmediate(R0, tags);
+      __ str(R0, Address(R4, Context::tags_offset()));
+
+      // Set number of variables field to 1 (for captured receiver).
+      __ LoadImmediate(R0, 1);
+      __ str(R0, Address(R4, Context::num_variables_offset()));
+
+      // Set isolate field to isolate of current context.
+      __ ldr(R0, FieldAddress(CTX, Context::isolate_offset()));
+      __ str(R0, Address(R4, Context::isolate_offset()));
+
+      // Set the parent to null.
+      __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null()));
+      __ str(R0, Address(R4, Context::parent_offset()));
+
+      // Initialize the context variable to the receiver.
+      __ ldr(R0, Address(FP, kReceiverFPOffset));
+      __ str(R0, Address(R4, Context::variable_offset(0)));
+
+      // Set the newly allocated context in the newly allocated closure.
+      __ add(R1, R4, ShifterOperand(kHeapObjectTag));
+      __ str(R1, Address(R2, Closure::context_offset()));
+    } else {
+      __ str(CTX, Address(R2, Closure::context_offset()));
+    }
+
+    // Set the type arguments field in the newly allocated closure.
+    __ ldr(R0, Address(FP, kTypeArgumentsFPOffset));
+    __ str(R0, Address(R2, Closure::type_arguments_offset()));
+
+    // Done allocating and initializing the instance.
+    // R2: new object still missing its heap tag.
+    __ add(R0, R2, ShifterOperand(kHeapObjectTag));
+    // R0: new object.
+    __ LeaveStubFrame(true);
+    __ Ret();
+
+    __ Bind(&slow_case);
+  }
+  __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null()));
+  __ Push(R0);  // Setup space on stack for return value.
+  __ PushObject(func);
+  if (is_implicit_static_closure) {
+    __ CallRuntime(kAllocateImplicitStaticClosureRuntimeEntry);
+  } else {
+    if (is_implicit_instance_closure) {
+      __ ldr(R1, Address(FP, kReceiverFPOffset));
+      __ Push(R1);  // Receiver.
+    }
+    // R0: raw null.
+    if (has_type_arguments) {
+      __ ldr(R0, Address(FP, kTypeArgumentsFPOffset));
+    }
+    __ Push(R0);  // Push type arguments of closure to be allocated or null.
+
+    if (is_implicit_instance_closure) {
+      __ CallRuntime(kAllocateImplicitInstanceClosureRuntimeEntry);
+      __ Drop(2);  // Pop arguments (type arguments of object and receiver).
+    } else {
+      ASSERT(func.IsNonImplicitClosureFunction());
+      __ CallRuntime(kAllocateClosureRuntimeEntry);
+      __ Drop(1);  // Pop argument (type arguments of object).
+    }
+  }
+  __ Drop(1);  // Pop function object.
+  __ Pop(R0);
+  // R0: new object
+  // Restore the frame pointer.
+  __ LeaveStubFrame(true);
+  __ Ret();
 }
 
 
@@ -612,9 +1163,9 @@
 
 
 // Generate inline cache check for 'num_args'.
-//  LR: return address
-//  R5: Inline cache data object.
-//  R4: Arguments descriptor array.
+//  LR: return address.
+//  R5: inline cache data object.
+//  R4: arguments descriptor array.
 // Control flow:
 // - If receiver is null -> jump to IC miss.
 // - If receiver is Smi -> load Smi class.
@@ -697,8 +1248,7 @@
   // Restore return address.
   __ mov(LR, ShifterOperand(R8));
 
-  // Compute address of arguments (first read number of arguments from
-  // arguments descriptor array and then compute address on the stack).
+  // Compute address of arguments.
   // R7: argument_count - 1 (smi).
   __ add(R7, SP, ShifterOperand(R7, LSL, 1));  // R7 is Smi.
   // R7: address of receiver.
@@ -744,7 +1294,7 @@
   __ Branch(&StubCode::InstanceFunctionLookupLabel());
 
   __ Bind(&found);
-  // R6: Pointer to an IC data check group.
+  // R6: pointer to an IC data check group.
   const intptr_t target_offset = ICData::TargetIndexFor(num_args) * kWordSize;
   const intptr_t count_offset = ICData::CountIndexFor(num_args) * kWordSize;
   __ LoadFromOffset(kLoadWord, R0, R6, target_offset);
@@ -756,7 +1306,7 @@
   __ StoreToOffset(kStoreWord, R1, R6, count_offset);
 
   __ Bind(&call_target_function);
-  // R0: Target function.
+  // R0: target function.
   __ ldr(R0, FieldAddress(R0, Function::code_offset()));
   __ ldr(R0, FieldAddress(R0, Code::instructions_offset()));
   __ AddImmediate(R0, Instructions::HeaderSize() - kHeapObjectTag);
@@ -777,9 +1327,9 @@
 
 // Use inline cache data array to invoke the target or continue in inline
 // cache miss handler. Stub for 1-argument check (receiver class).
-//  LR: Return address.
-//  R5: Inline cache data object.
-//  R4: Arguments descriptor array.
+//  LR: return address.
+//  R5: inline cache data object.
+//  R4: arguments descriptor array.
 // Inline cache data object structure:
 // 0: function-name
 // 1: N, number of arguments checked.
@@ -882,7 +1432,7 @@
   __ AddImmediate(R2, Array::data_offset() - kHeapObjectTag);
 
   Label loop, found, not_found, next_iteration;
-  // R2: Entry start.
+  // R2: entry start.
   // R3: instance class id.
   // R4: instance type arguments.
   __ SmiTag(R3);
@@ -962,17 +1512,24 @@
 }
 
 
-// Jump to the exception handler.
-// No Result.
+// Jump to the exception or error handler.
+// LR: return address.
+// R0: program_counter.
+// R1: stack_pointer.
+// R2: frame_pointer.
+// R3: error object.
+// SP: address of stacktrace object.
+// Does not return.
 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) {
-  __ Unimplemented("JumpToExceptionHandler Stub");
-}
-
-
-// Jump to the error handler.
-// No Result.
-void StubCode::GenerateJumpToErrorHandlerStub(Assembler* assembler) {
-  __ Unimplemented("JumpToErrorHandler Stub");
+  ASSERT(kExceptionObjectReg == R0);
+  ASSERT(kStackTraceObjectReg == R1);
+  __ mov(IP, ShifterOperand(R1));  // Stack pointer.
+  __ mov(LR, ShifterOperand(R0));  // Program counter.
+  __ mov(R0, ShifterOperand(R3));  // Exception object.
+  __ ldr(R1, Address(SP, 0));  // StackTrace object.
+  __ mov(FP, ShifterOperand(R2));  // Frame_pointer.
+  __ mov(SP, ShifterOperand(IP));  // Stack pointer.
+  __ bx(LR);  // Jump to the exception handler code.
 }
 
 
diff --git a/runtime/vm/stub_code_ia32.cc b/runtime/vm/stub_code_ia32.cc
index c99c981..6da47f7 100644
--- a/runtime/vm/stub_code_ia32.cc
+++ b/runtime/vm/stub_code_ia32.cc
@@ -477,7 +477,7 @@
     // and is computed as:
     // RoundedAllocationSize((array_length * kwordSize) + sizeof(RawArray)).
     // Assert that length is a Smi.
-    __ testl(EDX, Immediate(kSmiTagSize));
+    __ testl(EDX, Immediate(kSmiTagMask));
     if (FLAG_use_slow_path) {
       __ jmp(&slow_case);
     } else {
@@ -1879,7 +1879,7 @@
 }
 
 
-// Jump to the exception handler.
+// Jump to the exception or error handler.
 // TOS + 0: return address
 // TOS + 1: program_counter
 // TOS + 2: stack_pointer
@@ -1899,22 +1899,6 @@
 }
 
 
-// Jump to the error handler.
-// TOS + 0: return address
-// TOS + 1: program_counter
-// TOS + 2: stack_pointer
-// TOS + 3: frame_pointer
-// TOS + 4: error object
-// No Result.
-void StubCode::GenerateJumpToErrorHandlerStub(Assembler* assembler) {
-  __ movl(EAX, Address(ESP, 4 * kWordSize));  // Load error object.
-  __ movl(EBP, Address(ESP, 3 * kWordSize));  // Load target frame_pointer.
-  __ movl(EBX, Address(ESP, 1 * kWordSize));  // Load target PC into EBX.
-  __ movl(ESP, Address(ESP, 2 * kWordSize));  // Load target stack_pointer.
-  __ jmp(EBX);  // Jump to the exception handler code.
-}
-
-
 // Implements equality operator when one of the arguments is null
 // (identity check) and updates ICData if necessary.
 // TOS + 0: return address
diff --git a/runtime/vm/stub_code_mips.cc b/runtime/vm/stub_code_mips.cc
index 91c919d..077690c 100644
--- a/runtime/vm/stub_code_mips.cc
+++ b/runtime/vm/stub_code_mips.cc
@@ -378,8 +378,58 @@
 }
 
 
+DECLARE_LEAF_RUNTIME_ENTRY(void, StoreBufferBlockProcess, Isolate* isolate);
+
+
+// Helper stub to implement Assembler::StoreIntoObject.
+// Input parameters:
+//   T0: Address (i.e. object) being stored into.
 void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) {
-  __ Unimplemented("UpdateStoreBuffer stub");
+  // Save values being destroyed.
+  __ addiu(SP, SP, Immediate(-3 * kWordSize));
+  __ sw(T3, Address(SP, 2 * kWordSize));
+  __ sw(T2, Address(SP, 1 * kWordSize));
+  __ sw(T1, Address(SP, 0 * kWordSize));
+
+  // Load the isolate out of the context.
+  // Spilled: T1, T2, T3.
+  // T0: Address being stored.
+  __ lw(T1, FieldAddress(CTX, Context::isolate_offset()));
+
+  // Load top_ out of the StoreBufferBlock and add the address to the pointers_.
+  // T1: Isolate.
+  intptr_t store_buffer_offset = Isolate::store_buffer_block_offset();
+  __ lw(T2, Address(T1, store_buffer_offset + StoreBufferBlock::top_offset()));
+  __ sll(T3, T2, 1);
+  __ addu(T3, T1, T3);
+  __ sw(T0,
+        Address(T3, store_buffer_offset + StoreBufferBlock::pointers_offset()));
+
+  // Increment top_ and check for overflow.
+  // T2: top_
+  // T1: Isolate
+  Label L;
+  __ AddImmediate(T2, 1);
+  __ sw(T2, Address(T1, store_buffer_offset + StoreBufferBlock::top_offset()));
+  __ addiu(CMPRES, T2, Immediate(-StoreBufferBlock::kSize));
+  // Restore values.
+  __ lw(T1, Address(SP, 0 * kWordSize));
+  __ lw(T2, Address(SP, 1 * kWordSize));
+  __ lw(T3, Address(SP, 2 * kWordSize));
+  __ beq(CMPRES, ZR, &L);
+  __ delay_slot()->addiu(SP, SP, Immediate(3 * kWordSize));
+  __ Ret();
+
+  // Handle overflow: Call the runtime leaf function.
+  __ Bind(&L);
+  // Setup frame, push callee-saved registers.
+
+  __ EnterCallRuntimeFrame(0 * kWordSize);
+  __ lw(T0, FieldAddress(CTX, Context::isolate_offset()));
+  __ CallRuntime(kStoreBufferBlockProcessRuntimeEntry);
+  // Restore callee-saved registers, tear down frame.
+  __ LeaveCallRuntimeFrame();
+  __ Ret();
 }
 
 
@@ -965,20 +1015,13 @@
 }
 
 
-// Jump to the exception handler.
+// Jump to the exception or error handler.
 // No Result.
 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) {
   __ Unimplemented("JumpToExceptionHandler Stub");
 }
 
 
-// Jump to the error handler.
-// No Result.
-void StubCode::GenerateJumpToErrorHandlerStub(Assembler* assembler) {
-  __ Unimplemented("JumpToErrorHandler Stub");
-}
-
-
 void StubCode::GenerateEqualityWithNullArgStub(Assembler* assembler) {
   __ Unimplemented("EqualityWithNullArg Stub");
 }
diff --git a/runtime/vm/stub_code_x64.cc b/runtime/vm/stub_code_x64.cc
index 014b798..0f688e5 100644
--- a/runtime/vm/stub_code_x64.cc
+++ b/runtime/vm/stub_code_x64.cc
@@ -472,7 +472,7 @@
     // and is computed as:
     // RoundedAllocationSize((array_length * kwordSize) + sizeof(RawArray)).
     // Assert that length is a Smi.
-    __ testq(R10, Immediate(kSmiTagSize));
+    __ testq(R10, Immediate(kSmiTagMask));
     if (FLAG_use_slow_path) {
       __ jmp(&slow_case);
     } else {
@@ -1847,7 +1847,7 @@
 }
 
 
-// Jump to the exception handler.
+// Jump to the exception or error handler.
 // TOS + 0: return address
 // RDI: program counter
 // RSI: stack pointer
@@ -1866,21 +1866,6 @@
 }
 
 
-// Jump to the error handler.
-// TOS + 0: return address
-// RDI: program_counter
-// RSI: stack_pointer
-// RDX: frame_pointer
-// RCX: error object
-// No Result.
-void StubCode::GenerateJumpToErrorHandlerStub(Assembler* assembler) {
-  __ movq(RAX, RCX);  // error object.
-  __ movq(RBP, RDX);  // target frame_pointer.
-  __ movq(RSP, RSI);  // target stack_pointer.
-  __ jmp(RDI);  // Jump to the exception handler code.
-}
-
-
 // Implements equality operator when one of the arguments is null
 // (identity check) and updates ICData if necessary.
 // TOS + 0: return address
diff --git a/runtime/vm/utils_test.cc b/runtime/vm/utils_test.cc
index 14e37da..1e86f7a 100644
--- a/runtime/vm/utils_test.cc
+++ b/runtime/vm/utils_test.cc
@@ -180,4 +180,47 @@
   EXPECT_EQ(0x00ff0000ff00LL, Utils::LowHighTo64Bits(0xff00, 0x00ff));
 }
 
+
+UNIT_TEST_CASE(Endianity) {
+  uint16_t value16be = Utils::HostToBigEndian16(0xf1);
+  EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value16be)[0]);
+  EXPECT_EQ(0xf1, reinterpret_cast<uint8_t*>(&value16be)[1]);
+
+  uint16_t value16le = Utils::HostToLittleEndian16(0xf1);
+  EXPECT_EQ(0xf1, reinterpret_cast<uint8_t*>(&value16le)[0]);
+  EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value16le)[1]);
+
+  uint32_t value32be = Utils::HostToBigEndian32(0xf1f2);
+  EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value32be)[0]);
+  EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value32be)[1]);
+  EXPECT_EQ(0xf1, reinterpret_cast<uint8_t*>(&value32be)[2]);
+  EXPECT_EQ(0xf2, reinterpret_cast<uint8_t*>(&value32be)[3]);
+
+  uint32_t value32le = Utils::HostToLittleEndian32(0xf1f2);
+  EXPECT_EQ(0xf2, reinterpret_cast<uint8_t*>(&value32le)[0]);
+  EXPECT_EQ(0xf1, reinterpret_cast<uint8_t*>(&value32le)[1]);
+  EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value32le)[2]);
+  EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value32le)[3]);
+
+  uint64_t value64be = Utils::HostToBigEndian64(0xf1f2f3f4);
+  EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value64be)[0]);
+  EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value64be)[1]);
+  EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value64be)[2]);
+  EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value64be)[3]);
+  EXPECT_EQ(0xf1, reinterpret_cast<uint8_t*>(&value64be)[4]);
+  EXPECT_EQ(0xf2, reinterpret_cast<uint8_t*>(&value64be)[5]);
+  EXPECT_EQ(0xf3, reinterpret_cast<uint8_t*>(&value64be)[6]);
+  EXPECT_EQ(0xf4, reinterpret_cast<uint8_t*>(&value64be)[7]);
+
+  uint64_t value64le = Utils::HostToLittleEndian64(0xf1f2f3f4);
+  EXPECT_EQ(0xf4, reinterpret_cast<uint8_t*>(&value64le)[0]);
+  EXPECT_EQ(0xf3, reinterpret_cast<uint8_t*>(&value64le)[1]);
+  EXPECT_EQ(0xf2, reinterpret_cast<uint8_t*>(&value64le)[2]);
+  EXPECT_EQ(0xf1, reinterpret_cast<uint8_t*>(&value64le)[3]);
+  EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value64le)[4]);
+  EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value64le)[5]);
+  EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value64le)[6]);
+  EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value64le)[7]);
+}
+
 }  // namespace dart
diff --git a/sdk/lib/_collection_dev/symbol.dart b/sdk/lib/_collection_dev/symbol.dart
index 1a81f47..7fd79d3 100644
--- a/sdk/lib/_collection_dev/symbol.dart
+++ b/sdk/lib/_collection_dev/symbol.dart
@@ -15,6 +15,30 @@
 class Symbol implements core.Symbol {
   final String _name;
 
+  static final RegExp validationPattern =
+      new RegExp(r'^(?:[a-zA-Z$][a-zA-Z$0-9_]*\.)*(?:[a-zA-Z$][a-zA-Z$0-9_]*=?|'
+                 r'-|'
+                 r'unary-|'
+                 r'\[\]=|'
+                 r'~|'
+                 r'==|'
+                 r'\[\]|'
+                 r'\*|'
+                 r'/|'
+                 r'%|'
+                 r'~/|'
+                 r'\+|'
+                 r'<<|'
+                 r'>>|'
+                 r'>=|'
+                 r'>|'
+                 r'<=|'
+                 r'<|'
+                 r'&|'
+                 r'\^|'
+                 r'\|'
+                 r')$');
+
   external const Symbol(String name);
 
   /**
@@ -23,6 +47,10 @@
    */
   const Symbol.unvalidated(this._name);
 
+  // This is called by dart2js.
+  Symbol.validated(String name)
+      : this._name = validate(name);
+
   bool operator ==(other) => other is Symbol && _name == other._name;
 
   int get hashCode {
@@ -32,4 +60,16 @@
 
   /// Platform-private accessor which cannot be called from user libraries.
   static String getName(Symbol symbol) => symbol._name;
+
+  static String validate(String name) {
+    if (name.isEmpty) return name;
+    if (name.startsWith('_')) {
+      throw new ArgumentError('"$name" is a private identifier');
+    }
+    if (!validationPattern.hasMatch(name)) {
+      throw new ArgumentError(
+          '"$name" is not an identifier or an empty String');
+    }
+    return name;
+  }
 }
diff --git a/sdk/lib/_internal/compiler/implementation/compiler.dart b/sdk/lib/_internal/compiler/implementation/compiler.dart
index 4493412..1c409a2 100644
--- a/sdk/lib/_internal/compiler/implementation/compiler.dart
+++ b/sdk/lib/_internal/compiler/implementation/compiler.dart
@@ -306,6 +306,23 @@
   ClassElement listClass;
   ClassElement typeClass;
   ClassElement mapClass;
+  ClassElement symbolClass;
+
+  // Initialized after mirrorSystemClass has been resolved.
+  FunctionElement symbolConstructor;
+
+  // Initialized when dart:mirrors is loaded.
+  ClassElement mirrorSystemClass;
+
+  // Initialized after mirrorSystemClass has been resolved.
+  FunctionElement mirrorSystemGetNameFunction;
+
+  // Initialized when dart:_collection-dev is loaded.
+  ClassElement symbolImplementationClass;
+
+  // Initialized when symbolImplementationClass has been resolved.
+  FunctionElement symbolValidatedConstructor;
+
   ClassElement jsInvocationMirrorClass;
   /// Document class from dart:mirrors.
   ClassElement documentClass;
@@ -316,6 +333,12 @@
   Element createInvocationMirrorElement;
 
   Element get currentElement => _currentElement;
+
+  /**
+   * Perform an operation, [f], returning the return value from [f].  If an
+   * error occurs then report it as having occurred during compilation of
+   * [element].  Can be nested.
+   */
   withCurrentElement(Element element, f()) {
     Element old = currentElement;
     _currentElement = element;
@@ -372,7 +395,7 @@
   static const int NO_SUCH_METHOD_ARG_COUNT = 1;
   static const SourceString CREATE_INVOCATION_MIRROR =
       const SourceString('createInvocationMirror');
-  static const SourceString INVOKE_ON = const SourceString('invokeOn');
+  static const SourceString INVOKE_ON = const SourceString('_invokeOn');
   static const SourceString RUNTIME_TYPE = const SourceString('runtimeType');
   static const SourceString START_ROOT_ISOLATE =
       const SourceString('startRootIsolate');
@@ -383,6 +406,10 @@
       new Selector.getter(const SourceString('current'), null);
   final Selector moveNextSelector =
       new Selector.call(const SourceString('moveNext'), null, 0);
+  final Selector noSuchMethodSelector = new Selector.call(
+      Compiler.NO_SUCH_METHOD, null, Compiler.NO_SUCH_METHOD_ARG_COUNT);
+  final Selector symbolValidatedConstructorSelector = new Selector.call(
+      const SourceString('validated'), null, 1);
 
   bool enabledNoSuchMethod = false;
   bool enabledRuntimeType = false;
@@ -614,6 +641,23 @@
         library.addToScope(dynamicClass, this);
       });
     }
+    if (uri == Uri.parse('dart:mirrors')) {
+      mirrorSystemClass = library.find(const SourceString('MirrorSystem'));
+    } else if (uri == Uri.parse('dart:_collection-dev')) {
+      symbolImplementationClass = library.find(const SourceString('Symbol'));
+    }
+  }
+
+  void onClassResolved(ClassElement cls) {
+    if (mirrorSystemClass == cls) {
+      mirrorSystemGetNameFunction =
+        cls.lookupLocalMember(const SourceString('getName'));
+    } else if (symbolClass == cls) {
+      symbolConstructor = cls.constructors.head;
+    } else if (symbolImplementationClass == cls) {
+      symbolValidatedConstructor = symbolImplementationClass.lookupConstructor(
+          symbolValidatedConstructorSelector);
+    }
   }
 
   LibraryElement scanBuiltinLibrary(String filename);
@@ -643,6 +687,11 @@
           '$missingCoreClasses');
     }
 
+    // The Symbol class may not exist during unit testing.
+    // TODO(ahe): It is possible that we have to require the presence
+    // of Symbol as we change how we implement noSuchMethod.
+    symbolClass = lookupCoreClass('Symbol');
+
     final List missingHelperClasses = [];
     ClassElement lookupHelperClass(String name) {
       ClassElement result = jsHelperLibrary.find(new SourceString(name));
@@ -697,8 +746,7 @@
     functionApplyMethod =
         functionClass.lookupLocalMember(const SourceString('apply'));
     jsInvocationMirrorClass.ensureResolved(this);
-    invokeOnMethod = jsInvocationMirrorClass.lookupLocalMember(
-        const SourceString('invokeOn'));
+    invokeOnMethod = jsInvocationMirrorClass.lookupLocalMember(INVOKE_ON);
 
     if (preserveComments) {
       var uri = new Uri.fromComponents(scheme: 'dart', path: 'mirrors');
@@ -807,8 +855,7 @@
           isolateHelperLibrary.find(Compiler.START_ROOT_ISOLATE));
     }
     if (enabledNoSuchMethod) {
-      Selector selector = new Selector.noSuchMethod();
-      enqueuer.codegen.registerInvocation(NO_SUCH_METHOD, selector);
+      enqueuer.codegen.registerInvocation(NO_SUCH_METHOD, noSuchMethodSelector);
       enqueuer.codegen.addToWorkList(createInvocationMirrorElement);
     }
     processQueue(enqueuer.codegen, main);
@@ -1013,6 +1060,14 @@
                   api.Diagnostic.ERROR);
   }
 
+  // TODO(ahe): Rename to reportWarning when that method has been removed.
+  void reportWarningCode(Spannable node, MessageKind errorCode,
+                         [Map arguments = const {}]) {
+    reportMessage(spanFromSpannable(node),
+                  errorCode.error(arguments),
+                  api.Diagnostic.WARNING);
+  }
+
   void reportMessage(SourceSpan span, Diagnostic message, api.Diagnostic kind) {
     // TODO(ahe): The names Diagnostic and api.Diagnostic are in
     // conflict. Fix it.
diff --git a/sdk/lib/_internal/compiler/implementation/dart_types.dart b/sdk/lib/_internal/compiler/implementation/dart_types.dart
index 560bb53..9639b3d 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_types.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_types.dart
@@ -298,6 +298,7 @@
    *
    * For instance, for a resolved but malformed type like [: Map<String> :] the
    * [declaredType] is [: Map<String> :] whereas for an unresolved type
+   * [userProvidedBadType] is [: null :].
    */
   final DartType userProvidedBadType;
 
diff --git a/sdk/lib/_internal/compiler/implementation/deferred_load.dart b/sdk/lib/_internal/compiler/implementation/deferred_load.dart
index a9045d0c..31abe43 100644
--- a/sdk/lib/_internal/compiler/implementation/deferred_load.dart
+++ b/sdk/lib/_internal/compiler/implementation/deferred_load.dart
@@ -92,7 +92,7 @@
     if (main == null) return;
     LibraryElement mainApp = main.getLibrary();
     measureElement(mainApp, () {
-      deferredLibraries.addAll(findDeferredLibraries(mainApp));
+      deferredLibraries.addAll(findDeferredLibraries(mainApp).toList());
       if (deferredLibraries.isEmpty) return;
 
       // TODO(ahe): Enforce the following invariants on
diff --git a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
index 915a55d..71d6a39 100644
--- a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
+++ b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
@@ -1049,7 +1049,7 @@
 
   List<Element> get orderedOptionalParameters {
     if (_orderedOptionalParameters != null) return _orderedOptionalParameters;
-    List<Element> list = new List<Element>.from(optionalParameters);
+    List<Element> list = optionalParameters.toList();
     if (optionalParametersAreNamed) {
       list.sort((Element a, Element b) {
         return a.name.slowToString().compareTo(b.name.slowToString());
diff --git a/sdk/lib/_internal/compiler/implementation/enqueue.dart b/sdk/lib/_internal/compiler/implementation/enqueue.dart
index 70897cb..768ec2f 100644
--- a/sdk/lib/_internal/compiler/implementation/enqueue.dart
+++ b/sdk/lib/_internal/compiler/implementation/enqueue.dart
@@ -523,7 +523,7 @@
     if (compiler.enabledNoSuchMethod) return;
     if (compiler.backend.isDefaultNoSuchMethodImplementation(element)) return;
 
-    Selector selector = new Selector.noSuchMethod();
+    Selector selector = compiler.noSuchMethodSelector;
     compiler.enabledNoSuchMethod = true;
     registerInvocation(Compiler.NO_SUCH_METHOD, selector);
 
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
index 98e41ed..de43ed6 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -913,6 +913,10 @@
     jsArrayClass.ensureResolved(compiler);
     jsArrayLength = compiler.lookupElementIn(
         jsArrayClass, const SourceString('length'));
+    if (jsArrayLength != null && jsArrayLength.isAbstractField()) {
+      AbstractFieldElement element = jsArrayLength;
+      jsArrayLength = element.getter;
+    }
     jsArrayRemoveLast = compiler.lookupElementIn(
         jsArrayClass, const SourceString('removeLast'));
     jsArrayAdd = compiler.lookupElementIn(
@@ -921,6 +925,10 @@
     jsStringClass.ensureResolved(compiler);
     jsStringLength = compiler.lookupElementIn(
         jsStringClass, const SourceString('length'));
+    if (jsStringLength != null && jsStringLength.isAbstractField()) {
+      AbstractFieldElement element = jsStringLength;
+      jsStringLength = element.getter;
+    }
     jsStringSplit = compiler.lookupElementIn(
         jsStringClass, const SourceString('split'));
     jsStringConcat = compiler.lookupElementIn(
@@ -1017,7 +1025,8 @@
     types[0] = new HType.nonNullExact(
         compiler.jsInvocationMirrorClass.computeType(compiler),
         compiler);
-    argumentTypes.registerDynamicInvocation(types, new Selector.noSuchMethod());
+    argumentTypes.registerDynamicInvocation(
+        types, compiler.noSuchMethodSelector);
   }
 
   void registerInstantiatedClass(ClassElement cls,
@@ -1634,8 +1643,8 @@
       } else {
         if (nativeCheck) {
           return typeCast
-              ? const SourceString("callTypeCast")
-              : const SourceString('callTypeCheck');
+              ? const SourceString("interceptedTypeCast")
+              : const SourceString('interceptedTypeCheck');
         } else {
           return typeCast
               ? const SourceString("propertyTypeCast")
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
index effe177..92be012 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
@@ -35,6 +35,9 @@
 class ClassBuilder {
   final List<jsAst.Property> properties = <jsAst.Property>[];
 
+  /// Set to true by user if class is indistinguishable from its superclass.
+  bool isTrivial = false;
+
   // Has the same signature as [DefineStubFunction].
   void addProperty(String name, jsAst.Expression value) {
     properties.add(new jsAst.Property(js.string(name), value));
@@ -1172,17 +1175,11 @@
         includeSuperMembers: false);
 
     void generateIsTest(Element other) {
-      jsAst.Expression code;
       if (other == compiler.objectClass && other != classElement) {
         // Avoid emitting [:$isObject:] on all classes but [Object].
         return;
       }
-      if (nativeEmitter.requiresNativeIsCheck(other)) {
-        code = js.fun([], [js.return_(true)]);
-      } else {
-        code = js('true');
-      }
-      builder.addProperty(namer.operatorIs(other), code);
+      builder.addProperty(namer.operatorIs(other), js('true'));
     }
 
     void generateSubstitution(Element other, {bool emitNull: false}) {
@@ -1200,9 +1197,6 @@
         }
       }
       if (expression != null) {
-        if (needsNativeCheck) {
-          expression = js.fun([], js.return_(expression));
-        }
         builder.addProperty(namer.substitutionName(other), expression);
       }
     }
@@ -2617,7 +2611,7 @@
     // class. If so, we let the native emitter deal with it.
     if (compiler.enabledNoSuchMethod) {
       SourceString noSuchMethodName = Compiler.NO_SUCH_METHOD;
-      Selector noSuchMethodSelector = new Selector.noSuchMethod();
+      Selector noSuchMethodSelector = compiler.noSuchMethodSelector;
       for (ClassElement element in sortedClasses) {
         if (!element.isNative()) continue;
         Element member = element.lookupLocalMember(noSuchMethodName);
@@ -2818,11 +2812,11 @@
   }
 
   /**
-   * If [:invokeOn:] has been compiled, emit all the possible selector names
-   * that are intercepted into the [:interceptedNames:] top-level
-   * variable. The implementation of [:invokeOn:] will use it to
-   * determine whether it should call the method with an extra
-   * parameter.
+   * If [JSInvocationMirror._invokeOn] has been compiled, emit all the
+   * possible selector names that are intercepted into the
+   * [interceptedNames] top-level variable. The implementation of
+   * [_invokeOn] will use it to determine whether it should call the
+   * method with an extra parameter.
    */
   void emitInterceptedNames(CodeBuffer buffer) {
     if (!compiler.enabledInvokeOn) return;
@@ -2900,9 +2894,8 @@
       final CodeBuffer nativeBuffer = new CodeBuffer();
       if (!nativeClasses.isEmpty) {
         addComment('Native classes', nativeBuffer);
-        for (ClassElement element in nativeClasses) {
-          nativeEmitter.generateNativeClass(element, mainBuffer);
-        }
+        addComment('Native classes', mainBuffer);
+        nativeEmitter.generateNativeClasses(nativeClasses, mainBuffer);
       }
       nativeEmitter.finishGenerateNativeClasses();
       nativeEmitter.assembleCode(nativeBuffer);
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart b/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart
index 07c32c0..3a60f41 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart
@@ -364,8 +364,7 @@
       assert(name == operatorNameToIdentifier(name));
       StringBuffer buffer = new StringBuffer();
       for (SourceString argumentName in selector.getOrderedNamedArguments()) {
-        buffer.write(r'$');
-        argumentName.printOn(buffer);
+        buffer.write('\$${safeName(argumentName.slowToString())}');
       }
       String suffix = '\$${selector.argumentCount}$buffer';
       // We don't mangle the closure invoking function name because it
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart b/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
index 6ef9fc3..93e706b 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
@@ -9,12 +9,8 @@
   CodeEmitterTask emitter;
   CodeBuffer nativeBuffer;
 
-  // Classes that participate in dynamic dispatch. These are the
-  // classes that contain used members.
-  Set<ClassElement> classesWithDynamicDispatch;
-
   // Native classes found in the application.
-  Set<ClassElement> nativeClasses;
+  Set<ClassElement> nativeClasses = new Set<ClassElement>();
 
   // Caches the native subtypes of a native class.
   Map<ClassElement, List<ClassElement>> subtypes;
@@ -31,9 +27,7 @@
   bool handleNoSuchMethod = false;
 
   NativeEmitter(this.emitter)
-      : classesWithDynamicDispatch = new Set<ClassElement>(),
-        nativeClasses = new Set<ClassElement>(),
-        subtypes = new Map<ClassElement, List<ClassElement>>(),
+      : subtypes = new Map<ClassElement, List<ClassElement>>(),
         directSubtypes = new Map<ClassElement, List<ClassElement>>(),
         nativeMethods = new Set<FunctionElement>(),
         nativeBuffer = new CodeBuffer();
@@ -57,12 +51,6 @@
     return backend.namer.isolateAccess(element);
   }
 
-  String get dynamicSetMetadataName {
-    Element element = compiler.findHelper(
-        const SourceString('dynamicSetMetadata'));
-    return backend.namer.isolateAccess(element);
-  }
-
   String get typeNameOfName {
     Element element = compiler.findHelper(
         const SourceString('getTypeNameOf'));
@@ -125,7 +113,151 @@
     }
   }
 
-  void generateNativeClass(ClassElement classElement, CodeBuffer mainBuffer) {
+  /**
+   * Writes the class definitions for the interceptors to [mainBuffer].
+   * Writes code to associate dispatch tags with interceptors to [nativeBuffer].
+   *
+   * The interceptors are filtered to avoid emitting trivial interceptors.  For
+   * example, if the program contains no code that can distinguish between the
+   * numerous subclasses of `Element` then we can pretend that `Element` is a
+   * leaf class, and all instances of subclasses of `Element` are instances of
+   * `Element`.
+   *
+   * There is also a performance benefit (in addition to the obvious code size
+   * benefit), due to how [getNativeInterceptor] works.  Finding the interceptor
+   * of a leaf class in the hierarchy is more efficient that a non-leaf, so it
+   * improves performance when more classes can be treated as leaves.
+   */
+  void generateNativeClasses(List<ClassElement> classes,
+                             CodeBuffer mainBuffer) {
+    // Compute a pre-order traversal of the subclass forest.  We actually want a
+    // post-order traversal but it is easier to compute the pre-order and use it
+    // in reverse.
+
+    List<ClassElement> preOrder = <ClassElement>[];
+    Set<ClassElement> seen = new Set<ClassElement>();
+    void walk(ClassElement element) {
+      if (seen.contains(element) || element == compiler.objectClass) return;
+      seen.add(element);
+      walk(element.superclass);
+      preOrder.add(element);
+    }
+    classes.forEach(walk);
+
+    // Generate code for each native class into [ClassBuilder]s.
+
+    Map<ClassElement, ClassBuilder> builders =
+        new Map<ClassElement, ClassBuilder>();
+    for (ClassElement classElement in classes) {
+      ClassBuilder builder = generateNativeClass(classElement);
+      builders[classElement] = builder;
+    }
+
+    // Find which classes are needed and which are non-leaf classes.  Any class
+    // that is not needed can be treated as a leaf class equivalent to some
+    // needed class.
+
+    Set<ClassElement> neededClasses = new Set<ClassElement>();
+    Set<ClassElement> nonleafClasses = new Set<ClassElement>();
+    neededClasses.add(compiler.objectClass);
+
+    for (ClassElement classElement in preOrder.reversed) {
+      // Post-order traversal ensures we visit the subclasses before their
+      // superclass.  This makes it easy to tell if a class is needed because a
+      // subclass is needed.
+      ClassBuilder builder = builders[classElement];
+      bool needed = false;
+      if (builder == null) {
+        // Mixin applications (native+mixin) are non-native, so [classElement]
+        // has already been emitted as a regular class.  Mark [classElement] as
+        // 'needed' to ensure the native superclass is needed.
+        needed = true;
+      } else if (!builder.isTrivial) {
+        needed = true;
+      } else {
+        // TODO(9556): We can't remove any unneeded classes until the class
+        // builders contain all the information.  [emitRuntimeTypeSupport] must
+        // no longer add information to a class definition.
+        needed = true;
+      }
+
+      // BUG.  There is a missing proto in the picture the DOM gives of the
+      // proto chain.
+      // TODO(9907): Fix DOM generation. We might need an annotation.
+      if (classElement.isNative()) {
+        String nativeTag = toNativeTag(classElement);
+        if (nativeTag == 'HTMLElement') {
+          nonleafClasses.add(classElement);
+          needed = true;
+        }
+      }
+
+      if (needed || neededClasses.contains(classElement)) {
+        neededClasses.add(classElement);
+        neededClasses.add(classElement.superclass);
+        nonleafClasses.add(classElement.superclass);
+      }
+    }
+
+    // Collect all the tags that map to each class.
+
+    Map<ClassElement, Set<String>> leafTags =
+        new Map<ClassElement, Set<String>>();
+    Map<ClassElement, Set<String>> nonleafTags =
+        new Map<ClassElement, Set<String>>();
+
+    for (ClassElement classElement in classes) {
+      String nativeTag = toNativeTag(classElement);
+
+      if (nonleafClasses.contains(classElement)) {
+        nonleafTags
+            .putIfAbsent(classElement, () => new Set<String>())
+            .add(nativeTag);
+      } else {
+        ClassElement sufficingInterceptor = classElement;
+        while (!neededClasses.contains(sufficingInterceptor)) {
+          sufficingInterceptor = sufficingInterceptor.superclass;
+        }
+        if (sufficingInterceptor == compiler.objectClass) {
+          sufficingInterceptor = backend.jsInterceptorClass;
+        }
+        leafTags
+            .putIfAbsent(sufficingInterceptor, () => new Set<String>())
+            .add(nativeTag);
+      }
+    }
+
+    // Emit code to set up dispatch data that maps tags to the interceptors.
+
+    void generateDefines(ClassElement classElement) {
+      generateDefineNativeMethods(leafTags[classElement], classElement,
+          defineNativeMethodsName);
+      generateDefineNativeMethods(nonleafTags[classElement], classElement,
+          defineNativeMethodsNonleafName);
+    }
+    generateDefines(backend.jsInterceptorClass);
+    for (ClassElement classElement in classes) {
+      generateDefines(classElement);
+    }
+
+    // Emit the native class interceptors that were actually used.
+
+    for (ClassElement classElement in classes) {
+      if (neededClasses.contains(classElement)) {
+        ClassBuilder builder = builders[classElement];
+        // Define interceptor class for [classElement].
+        String className = backend.namer.getName(classElement);
+        jsAst.Expression init =
+            js(emitter.classesCollector)[className].assign(
+                builder.toObjectInitializer());
+        mainBuffer.write(jsAst.prettyPrint(init, compiler));
+        mainBuffer.write('$N$n');
+        emitter.needsDefineClass = true;
+      }
+    }
+  }
+
+  ClassBuilder generateNativeClass(ClassElement classElement) {
     assert(!classElement.hasBackendMembers);
     nativeClasses.add(classElement);
 
@@ -144,47 +276,32 @@
     bool hasFields = emitter.emitClassFields(classElement, builder,
         classIsNative: true,
         superClass: superName);
+    int propertyCount = builder.properties.length;
     emitter.emitClassGettersSetters(classElement, builder);
     emitter.emitInstanceMembers(classElement, builder);
 
-    // An empty native class may be omitted since the superclass methods can be
-    // located via the dispatch metadata.
-    // TODO(sra): Also need to check there are no subclasses that will reference
-    // this class.
-    // bool hasOnlyGeneratedFields = builder.properties.length == 1;
-    // if (hasOnlyGeneratedFields == 1 && !hasFields) return;
+    if (!hasFields && builder.properties.length == propertyCount) {
+      builder.isTrivial = true;
+    }
 
-    // Define interceptor class for [classElement].
-    String className = backend.namer.getName(classElement);
-    jsAst.Expression init =
-        js(emitter.classesCollector)[className].assign(
-            builder.toObjectInitializer());
-    mainBuffer.write(jsAst.prettyPrint(init, compiler));
-    mainBuffer.write('$N$n');
+    return builder;
+  }
 
-    emitter.needsDefineClass = true;
+  void generateDefineNativeMethods(
+      Set<String> tags, ClassElement classElement, String definer) {
+    if (tags == null) return;
 
-    // Define dispatch for [classElement].
-    String nativeTag = toNativeTag(classElement);
-    String definer = directSubtypes[classElement] == null
-        ? defineNativeMethodsName
-        : defineNativeMethodsNonleafName;
-
-    // TODO(sra): Fix DOM generation.  There is a missing proto in the picture
-    // the DOM gives of the proto chain.  We might need an annotation.
-    if (nativeTag == 'HTMLElement') definer = defineNativeMethodsNonleafName;
-
+    String tagsString = (tags.toList()..sort()).join('|');
     jsAst.Expression definition =
         js(definer)(
-            [js.string(nativeTag),
+            [js.string(tagsString),
              js(backend.namer.isolateAccess(classElement))]);
 
     nativeBuffer.add(jsAst.prettyPrint(definition, compiler));
     nativeBuffer.add('$N$n');
-
-    classesWithDynamicDispatch.add(classElement);
   }
 
+
   void finishGenerateNativeClasses() {
     // TODO(sra): Put specialized version of getNativeMethods on
     // `Object.prototype` to avoid checking in `getInterceptor` and
@@ -195,11 +312,6 @@
     // nativeBuffer.add('$N$n');
   }
 
-  List<ClassElement> getDirectSubclasses(ClassElement cls) {
-    List<ClassElement> result = directSubtypes[cls];
-    return result == null ? const<ClassElement>[] : result;
-  }
-
   void potentiallyConvertDartClosuresToJs(
       List<jsAst.Statement> statements,
       FunctionElement member,
@@ -281,156 +393,6 @@
     return statements;
   }
 
-  void emitDynamicDispatchMetadata() {
-    if (classesWithDynamicDispatch.isEmpty) return;
-    int length = classesWithDynamicDispatch.length;
-    if (!compiler.enableMinification) {
-      nativeBuffer.add('// $length dynamic classes.\n');
-    }
-
-    // Build a pre-order traversal over all the classes and their subclasses.
-    Set<ClassElement> seen = new Set<ClassElement>();
-    List<ClassElement> classes = <ClassElement>[];
-    void visit(ClassElement cls) {
-      if (seen.contains(cls)) return;
-      seen.add(cls);
-      getDirectSubclasses(cls).forEach(visit);
-      classes.add(cls);
-    }
-    Elements.sortedByPosition(classesWithDynamicDispatch).forEach(visit);
-
-    List<ClassElement> preorderDispatchClasses = classes.where(
-        (cls) => !getDirectSubclasses(cls).isEmpty &&
-                  classesWithDynamicDispatch.contains(cls)).toList();
-
-    if (!compiler.enableMinification) {
-      nativeBuffer.add('// ${classes.length} classes\n');
-    }
-    Iterable<ClassElement> classesThatHaveSubclasses = classes.where(
-        (ClassElement t) => !getDirectSubclasses(t).isEmpty);
-    if (!compiler.enableMinification) {
-      nativeBuffer.add('// ${classesThatHaveSubclasses.length} !leaf\n');
-    }
-
-    // Generate code that builds the map from cls tags used in dynamic dispatch
-    // to the set of cls tags of classes that extend (TODO: or implement) those
-    // classes.  The set is represented as a string of tags joined with '|'.
-    // This is easily split into an array of tags, or converted into a regexp.
-    //
-    // To reduce the size of the sets, subsets are CSE-ed out into variables.
-    // The sets could be much smaller if we could make assumptions about the
-    // cls tags of other classes (which are constructor names or part of the
-    // result of Object.protocls.toString).  For example, if objects that are
-    // Dart objects could be easily excluded, then we might be able to simplify
-    // the test, replacing dozens of HTMLxxxElement classes with the regexp
-    // /HTML.*Element/.
-
-    // Temporary variables for common substrings.
-    List<String> varNames = <String>[];
-    // Values of temporary variables.
-    Map<String, jsAst.Expression> varDefns = new Map<String, jsAst.Expression>();
-
-    // Expression to compute tags string for a class.  The expression will
-    // initially be a string or expression building a string, but may be
-    // replaced with a variable reference to the common substring.
-    Map<ClassElement, jsAst.Expression> tagDefns =
-        new Map<ClassElement, jsAst.Expression>();
-
-    jsAst.Expression makeExpression(ClassElement classElement) {
-      // Expression fragments for this set of cls keys.
-      List<jsAst.Expression> expressions = <jsAst.Expression>[];
-      // TODO: Remove if cls is abstract.
-      List<String> subtags = [toNativeTag(classElement)];
-      void walk(ClassElement cls) {
-        for (final ClassElement subclass in getDirectSubclasses(cls)) {
-          ClassElement tag = subclass;
-          jsAst.Expression existing = tagDefns[tag];
-          if (existing == null) {
-            // [subclass] is still within the subtree between dispatch classes.
-            subtags.add(toNativeTag(tag));
-            walk(subclass);
-          } else {
-            // [subclass] is one of the preorderDispatchClasses, so CSE this
-            // reference with the previous reference.
-            jsAst.VariableUse use = existing.asVariableUse();
-            if (use != null && varDefns.containsKey(use.name)) {
-              // We end up here if the subclasses have a DAG structure.  We
-              // don't have DAGs yet, but if the dispatch is used for mixins
-              // that will be a possibility.
-              // Re-use the previously created temporary variable.
-              expressions.add(js(use.name));
-            } else {
-              String varName = 'v${varNames.length}_${tag.name.slowToString()}';
-              varNames.add(varName);
-              varDefns[varName] = existing;
-              tagDefns[tag] = js(varName);
-              expressions.add(js(varName));
-            }
-          }
-        }
-      }
-      walk(classElement);
-
-      if (!subtags.isEmpty) {
-        subtags.sort();
-        expressions.add(js.string(subtags.join('|')));
-      }
-      jsAst.Expression expression;
-      if (expressions.length == 1) {
-        expression = expressions[0];
-      } else {
-        jsAst.Expression array = new jsAst.ArrayInitializer.from(expressions);
-        expression = array['join']([js.string('|')]);
-      }
-      return expression;
-    }
-
-    for (final ClassElement classElement in preorderDispatchClasses) {
-      tagDefns[classElement] = makeExpression(classElement);
-    }
-
-    // Write out a thunk that builds the metadata.
-    if (!tagDefns.isEmpty) {
-      List<jsAst.Statement> statements = <jsAst.Statement>[];
-
-      List<jsAst.VariableInitialization> initializations =
-          <jsAst.VariableInitialization>[];
-      for (final String varName in varNames) {
-        initializations.add(
-            new jsAst.VariableInitialization(
-                new jsAst.VariableDeclaration(varName),
-                varDefns[varName]));
-      }
-      if (!initializations.isEmpty) {
-        statements.add(
-            new jsAst.ExpressionStatement(
-                new jsAst.VariableDeclarationList(initializations)));
-      }
-
-      // [table] is a list of lists, each inner list of the form:
-      //   [dynamic-dispatch-tag, tags-of-classes-implementing-dispatch-tag]
-      // E.g.
-      //   [['Node', 'Text|HTMLElement|HTMLDivElement|...'], ...]
-      jsAst.Expression table =
-          new jsAst.ArrayInitializer.from(
-              preorderDispatchClasses.map((cls) =>
-                  new jsAst.ArrayInitializer.from([
-                      js.string(toNativeTag(cls)),
-                      tagDefns[cls]])));
-
-      statements.add(js('$dynamicSetMetadataName(#)', table).toStatement());
-
-      //  (function(){statements})();
-      if (emitter.compiler.enableMinification) nativeBuffer.add(';');
-      nativeBuffer.add(
-          jsAst.prettyPrint(
-              new jsAst.ExpressionStatement(
-                  new jsAst.Call(new jsAst.Fun([], new jsAst.Block(statements)),
-                                 [])),
-              compiler));
-    }
-  }
-
   bool isSupertypeOfNativeClass(Element element) {
     if (element.isTypeVariable()) {
       compiler.cancel("Is check for type variable", element: element);
@@ -451,6 +413,12 @@
   }
 
   bool requiresNativeIsCheck(Element element) {
+    // TODO(sra): Remove this function.  It determines if a native type may
+    // satisfy a check against [element], in whcih case an interceptor must be
+    // used.  We should also use an interceptor if the check can't be satisfied
+    // by a native class in case we get a natibe instance that tries to spoof
+    // the type info.  i.e the criteria for whether or not to use an interceptor
+    // is whether the receiver can be native, not the type of the test.
     if (!element.isClass()) return false;
     ClassElement cls = element;
     if (cls.isNative()) return true;
@@ -464,30 +432,7 @@
       objectProperties.add(new jsAst.Property(js.string(name), value));
     }
 
-    // Because of native classes, we have to generate some is checks
-    // by calling a method, instead of accessing a property. So we
-    // attach to the JS Object prototype these methods that return
-    // false, and will be overridden by subclasses when they have to
-    // return true.
-    void emitIsChecks() {
-      for (ClassElement element in
-               Elements.sortedByPosition(emitter.checkedClasses)) {
-        if (!requiresNativeIsCheck(element)) continue;
-        if (element.isObject(compiler)) continue;
-        // Add function for the is-test.
-        String name = backend.namer.operatorIs(element);
-        addProperty(name,
-            js.fun([], js.return_(js('false'))));
-        // Add a function for the (trivial) substitution.
-        addProperty(backend.namer.substitutionName(element),
-                    js.fun([], js.return_(js('null'))));
-      }
-    }
-    emitIsChecks();
-
     if (!nativeClasses.isEmpty) {
-      emitDynamicDispatchMetadata();
-
       // If the native emitter has been asked to take care of the
       // noSuchMethod handlers, we do that now.
       if (handleNoSuchMethod) {
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart b/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
index 9c5008f..951cc2a 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
@@ -254,7 +254,8 @@
     InterfaceType interface = type;
     Link<DartType> variables = interface.element.typeVariables;
     if (variables.isEmpty) return name;
-    String arguments = variables.map((_) => 'dynamic').join(', ');
+    String arguments =
+        new List.filled(variables.slowLength(), 'dynamic').join(', ');
     return '$name<$arguments>';
   }
 
@@ -319,7 +320,7 @@
     };
     InterfaceType type = cls.computeType(compiler);
     InterfaceType target = type.asInstanceOf(check);
-    String substitution = target.typeArguments
+    String substitution = target.typeArguments.toList()
         .map((type) => _getTypeRepresentation(type, onVariable))
         .join(', ');
     substitution = '[$substitution]';
diff --git a/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart b/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart
index 56baf45..38adaf1 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart
@@ -13,6 +13,16 @@
                               stringJoinUnchecked;
 import "dart:_collection-dev" as _symbol_dev;
 
+String _symbolToString(Symbol symbol) => _symbol_dev.Symbol.getName(symbol);
+
+_symbolMapToStringMap(Map<Symbol, dynamic> map) {
+  var result = new Map<String, dynamic>();
+  map.forEach((Symbol key, value) {
+    result[_symbolToString(key)] = value;
+  });
+  return result;
+}
+
 patch void print(var object) {
   Primitives.printString(object.toString());
 }
@@ -24,10 +34,11 @@
   patch String toString() => Primitives.objectToString(this);
 
   patch dynamic noSuchMethod(Invocation invocation) {
-    throw new NoSuchMethodError(this,
-                                invocation.memberName,
-                                invocation.positionalArguments,
-                                invocation.namedArguments);
+    throw new NoSuchMethodError(
+        this,
+        _symbolToString(invocation.memberName),
+        invocation.positionalArguments,
+        _symbolMapToStringMap(invocation.namedArguments));
   }
 
   patch Type get runtimeType {
@@ -50,7 +61,7 @@
     if (namedArguments == null) return null;
     Map<String, dynamic> result = {};
     namedArguments.forEach((symbol, value) {
-      result[_symbol_dev.Symbol.getName(symbol)] = value;
+      result[_symbolToString(symbol)] = value;
     });
     return result;
   }
diff --git a/sdk/lib/_internal/compiler/implementation/lib/interceptors.dart b/sdk/lib/_internal/compiler/implementation/lib/interceptors.dart
index 915fbf1..c704b03 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/interceptors.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/interceptors.dart
@@ -140,7 +140,7 @@
 }
 
 /**
- * If [Invocation.invokeOn] is being used, this variable
+ * If [JSInvocationMirror._invokeOn] is being used, this variable
  * contains a JavaScript array with the names of methods that are
  * intercepted.
  */
diff --git a/sdk/lib/_internal/compiler/implementation/lib/io_patch.dart b/sdk/lib/_internal/compiler/implementation/lib/io_patch.dart
index 49cf730..9b38456 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/io_patch.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/io_patch.dart
@@ -162,15 +162,18 @@
 }
 
 patch class _ProcessUtils {
-  patch static _exit(int status) {
+  patch static void _exit(int status) {
     throw new UnsupportedError("ProcessUtils._exit");
   }
-  patch static _setExitCode(int status) {
+  patch static void _setExitCode(int status) {
     throw new UnsupportedError("ProcessUtils._setExitCode");
   }
-  patch static _sleep(int millis) {
+  patch static void _sleep(int millis) {
     throw new UnsupportedError("ProcessUtils._sleep");
   }
+  patch static int _pid(Process process) {
+    throw new UnsupportedError("ProcessUtils._pid");
+  }
 }
 
 patch class Process {
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart b/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
index a6ed014..d363676 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
@@ -20,6 +20,7 @@
                                  setDispatchProperty,
                                  Interceptor,
                                  JSIndexable;
+import "dart:_collection-dev" as _symbol_dev;
 
 part 'constant_map.dart';
 part 'native_helper.dart';
@@ -62,15 +63,20 @@
   return res;
 }
 
-createInvocationMirror(name, internalName, type, arguments, argumentNames) =>
-    new JSInvocationMirror(name, internalName, type, arguments, argumentNames);
+createInvocationMirror(name, internalName, type, arguments, argumentNames) {
+  return new JSInvocationMirror(new _symbol_dev.Symbol.unvalidated(name),
+                                internalName,
+                                type,
+                                arguments,
+                                argumentNames);
+}
 
 class JSInvocationMirror implements Invocation {
   static const METHOD = 0;
   static const GETTER = 1;
   static const SETTER = 2;
 
-  final String memberName;
+  final Symbol memberName;
   final String _internalName;
   final int _kind;
   final List _arguments;
@@ -100,18 +106,19 @@
     return list;
   }
 
-  Map<String,dynamic> get namedArguments {
+  Map<Symbol,dynamic> get namedArguments {
     if (isAccessor) return null;
-    var map = <String,dynamic>{};
+    var map = new Map<Symbol, dynamic>();
     int namedArgumentCount = _namedArgumentNames.length;
     int namedArgumentsStartIndex = _arguments.length - namedArgumentCount;
     for (int i = 0; i < namedArgumentCount; i++) {
-      map[_namedArgumentNames[i]] = _arguments[namedArgumentsStartIndex + i];
+      map[new _symbol_dev.Symbol.unvalidated(_namedArgumentNames[i])] =
+          _arguments[namedArgumentsStartIndex + i];
     }
     return map;
   }
 
-  invokeOn(Object object) {
+  _invokeOn(Object object) {
     var interceptor = getInterceptor(object);
     var receiver = object;
     var name = _internalName;
@@ -128,6 +135,11 @@
     }
     return JS("var", "#[#].apply(#, #)", receiver, name, receiver, arguments);
   }
+
+  /// This method is called by [InstanceMirror.delegate].
+  static invokeFromMirror(JSInvocationMirror invocation, victim) {
+    return invocation._invokeOn(victim);
+  }
 }
 
 class Primitives {
@@ -1139,28 +1151,28 @@
 }
 
 /**
- * For types that are supertypes of native (eg DOM) types, we emit a
- * call because we cannot add a JS property to their prototype at load
- * time.
+ * For types that are supertypes of native (eg DOM) types, we use the
+ * interceptor for the class because we cannot add a JS property to the
+ * prototype at load time.
  */
-callTypeCheck(value, property) {
+interceptedTypeCheck(value, property) {
   if (value == null) return value;
   if ((identical(JS('String', 'typeof #', value), 'object'))
-      && JS('bool', '#[#]()', getInterceptor(value), property)) {
+      && JS('bool', '#[#]', getInterceptor(value), property)) {
     return value;
   }
   propertyTypeError(value, property);
 }
 
 /**
- * For types that are supertypes of native (eg DOM) types, we emit a
- * call because we cannot add a JS property to their prototype at load
- * time.
+ * For types that are supertypes of native (eg DOM) types, we use the
+ * interceptor for the class because we cannot add a JS property to the
+ * prototype at load time.
  */
-callTypeCast(value, property) {
+interceptedTypeCast(value, property) {
   if (value == null
       || ((JS('bool', 'typeof # === "object"', value))
-          && JS('bool', '#[#]()', getInterceptor(value), property))) {
+          && JS('bool', '#[#]', getInterceptor(value), property))) {
     return value;
   }
   propertyTypeCastError(value, property);
@@ -1188,7 +1200,7 @@
   if (value == null) return value;
   if (value is String) return value;
   if (value is num) return value;
-  if (JS('bool', '#[#]()', value, property)) return value;
+  if (JS('bool', '#[#]', getInterceptor(value), property)) return value;
   propertyTypeError(value, property);
 }
 
@@ -1196,7 +1208,7 @@
   if (value == null) return value;
   if (value is String) return value;
   if (value is num) return value;
-  if (JS('bool', '#[#]()', value, property)) return value;
+  if (JS('bool', '#[#]', getInterceptor(value), property)) return value;
   propertyTypeCastError(value, property);
 }
 
@@ -1219,13 +1231,13 @@
 stringSuperNativeTypeCheck(value, property) {
   if (value == null) return value;
   if (value is String) return value;
-  if (JS('bool', '#[#]()', value, property)) return value;
+  if (JS('bool', '#[#]', getInterceptor(value), property)) return value;
   propertyTypeError(value, property);
 }
 
 stringSuperNativeTypeCast(value, property) {
   if (value is String || value == null) return value;
-  if (JS('bool', '#[#]()', value, property)) return value;
+  if (JS('bool', '#[#]', getInterceptor(value), property)) return value;
   propertyTypeCastError(value, property);
 }
 
@@ -1260,13 +1272,13 @@
 listSuperNativeTypeCheck(value, property) {
   if (value == null) return value;
   if (value is List) return value;
-  if (JS('bool', '#[#]()', value, property)) return value;
+  if (JS('bool', '#[#]', getInterceptor(value), property)) return value;
   propertyTypeError(value, property);
 }
 
 listSuperNativeTypeCast(value, property) {
   if (value is List || value == null) return value;
-  if (JS('bool', '#[#]()', value, property)) return value;
+  if (JS('bool', '#[#]', getInterceptor(value), property)) return value;
   propertyTypeCastError(value, property);
 }
 
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart b/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart
index b986503..b8f4e7d 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart
@@ -108,11 +108,8 @@
  * - [asField]: the name of the function that transforms the type
  *   arguments of [objects] to an instance of the class that we check
  *   against.
- * - [native]: [:true:] if we need to use calls (for handling native
- *   objects).
  */
-bool checkSubtype(Object object, String isField, List checks, String asField,
-                  bool native) {
+bool checkSubtype(Object object, String isField, List checks, String asField) {
   if (object == null) return false;
   var arguments = getRuntimeTypeInfo(object);
   // Interceptor is needed for JSArray and native classes.
@@ -120,15 +117,11 @@
   // `null` or a primitive.
   // TODO(9586): Move type info for static functions onto an interceptor.
   var interceptor = isJsFunction(object) ? object : getInterceptor(object);
-  bool isSubclass = native
-      ? call(interceptor, isField)
-      : getField(interceptor, isField);
+  bool isSubclass = getField(interceptor, isField);
   // When we read the field and it is not there, [isSubclass] will be [:null:].
   if (isSubclass == null || !isSubclass) return false;
   // Should the asField function be passed the receiver?
-  var substitution = native
-      ? call(interceptor, asField)
-      : getField(interceptor, asField);
+  var substitution = getField(interceptor, asField);
   return checkArguments(substitution, arguments, checks);
 }
 
diff --git a/sdk/lib/_internal/compiler/implementation/lib/mirrors_patch.dart b/sdk/lib/_internal/compiler/implementation/lib/mirrors_patch.dart
index 020b836..dda7d3d 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/mirrors_patch.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/mirrors_patch.dart
@@ -5,6 +5,7 @@
 // Patch library for dart:mirrors.
 
 import 'dart:_foreign_helper' show JS;
+import "dart:_collection-dev" as _symbol_dev;
 
 // Yeah, seriously: mirrors in dart2js are experimental...
 const String _MIRROR_OPT_IN_MESSAGE = """
@@ -25,8 +26,7 @@
 
 patch class MirrorSystem {
   patch static String getName(Symbol symbol) {
-    throw new UnimplementedError('MirrorSystem.getName is not yet implemented '
-                                 'in dart2js');
+    return _symbol_dev.Symbol.getName(symbol);
   }
 }
 
@@ -49,22 +49,25 @@
     _mirrorsEnabled = true;
     print(reflectee);
   }
-  _ensureEnabled();
   return new _InstanceMirror(reflectee);
 }
 
+patch ClassMirror reflectClass(Type key) {
+  throw new UnimplementedError('reflectClass is not yet implemented'
+                               'in dart2js');
+}
+
 class _InstanceMirror extends InstanceMirror {
   static final Expando<ClassMirror> classMirrors = new Expando<ClassMirror>();
 
   final reflectee;
 
-  _InstanceMirror(this.reflectee) {
-    _ensureEnabled();
-  }
+  _InstanceMirror(this.reflectee);
 
   bool get hasReflectee => true;
 
   ClassMirror get type {
+    _ensureEnabled();
     String className = Primitives.objectTypeName(reflectee);
     var constructor = Primitives.getConstructor(className);
     var mirror = classMirrors[constructor];
@@ -78,6 +81,7 @@
   Future<InstanceMirror> invokeAsync(String memberName,
                                      List<Object> positionalArguments,
                                      [Map<String,Object> namedArguments]) {
+    _ensureEnabled();
     if (namedArguments != null && !namedArguments.isEmpty) {
       throw new UnsupportedError('Named arguments are not implemented');
     }
@@ -101,6 +105,10 @@
     return completer.future;
   }
 
+  delegate(Invocation invocation) {
+    return JSInvocationMirror.invokeFromMirror(invocation, reflectee);
+  }
+
   String toString() => 'InstanceMirror($reflectee)';
 }
 
diff --git a/sdk/lib/_internal/compiler/implementation/lib/native_helper.dart b/sdk/lib/_internal/compiler/implementation/lib/native_helper.dart
index 345120a..8f469a3 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/native_helper.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/native_helper.dart
@@ -28,6 +28,7 @@
   if (name == 'Oscillator') return 'OscillatorNode';
   if (name == 'RealtimeAnalyserNode') return 'AnalyserNode';
   if (name == 'IDBVersionChangeRequest') return 'IDBOpenDBRequest';
+  if (name == 'WebKitTransitionEvent') return 'TransitionEvent';
   return name;
 }
 
@@ -231,17 +232,6 @@
   return JS('bool', '((#) instanceof (#))', obj, JS_DART_OBJECT_CONSTRUCTOR());
 }
 
-// For each method name and class inheritance subtree, we use an ordinary JS
-// object as a hash map to store the methods for each class.  Entries are added
-// in native_emitter.dart (see dynamicName).  In order to avoid class names
-// clashing with the method names on Object.prototype (needed for native
-// objects) we must always use hasOwnProperty.
-lookupDynamicClass(var hasOwnPropertyFunction, var methods, String className) {
-  return callHasOwnProperty(hasOwnPropertyFunction, methods, className)
-      ? propertyGet(methods, className)
-      : null;
-}
-
 /// A JavaScript object mapping tags to interceptors.
 var interceptorsByTag;
 
@@ -288,20 +278,24 @@
   // classes over unknown.
 }
 
+lookupInterceptor(var hasOwnPropertyFunction, String tag) {
+  var map = interceptorsByTag;
+  return callHasOwnProperty(hasOwnPropertyFunction, map, tag)
+      ? propertyGet(map, tag)
+      : null;
+}
+
 lookupDispatchRecord(obj) {
   var hasOwnPropertyFunction = JS('var', 'Object.prototype.hasOwnProperty');
   var interceptor = null;
   assert(!isDartObject(obj));
   String tag = getTypeNameOf(obj);
 
-  interceptor = lookupInterceptor(
-      hasOwnPropertyFunction, tag, interceptorsByTag);
-
+  interceptor = lookupInterceptor(hasOwnPropertyFunction, tag);
   if (interceptor == null) {
     String secondTag = alternateTag(obj, tag);
     if (secondTag != null) {
-      interceptor = lookupInterceptor(
-          hasOwnPropertyFunction, secondTag, interceptorsByTag);
+      interceptor = lookupInterceptor(hasOwnPropertyFunction, secondTag);
     }
   }
   if (interceptor == null) {
@@ -316,94 +310,3 @@
     return makeDispatchRecord(interceptor, proto, null);
   }
 }
-
-lookupInterceptor(var hasOwnPropertyFunction, String tag, var methods) {
-  var method = lookupDynamicClass(hasOwnPropertyFunction, methods, tag);
-  // Look at the inheritance data, getting the class tags and using them
-  // to check the methods table for this method name.
-  if (method == null && _dynamicMetadata != null) {
-    for (int i = 0; i < arrayLength(_dynamicMetadata); i++) {
-      MetaInfo entry = arrayGet(_dynamicMetadata, i);
-      if (callHasOwnProperty(hasOwnPropertyFunction, entry._set, tag)) {
-        method =
-            lookupDynamicClass(hasOwnPropertyFunction, methods, entry._tag);
-        // Stop if we found it in the methods array.
-        if (method != null) break;
-      }
-    }
-  }
-  return method;
-}
-
-/**
- * This class encodes the class hierarchy when we need it for dynamic
- * dispatch.
- */
-class MetaInfo {
-  /**
-   * The type name this [MetaInfo] relates to.
-   */
-  String _tag;
-
-  /**
-   * A string containing the names of subtypes of [tag], separated by
-   * '|'.
-   */
-  String _tags;
-
-  /**
-   * A list of names of subtypes of [tag].
-   */
-  Object _set;
-
-  MetaInfo(this._tag, this._tags, this._set);
-}
-
-List<MetaInfo> get _dynamicMetadata {
-  // Because [dynamicMetadata] has to be shared with multiple isolates
-  // that access native classes (eg multiple DOM isolates),
-  // [_dynamicMetadata] cannot be a field, otherwise all non-main
-  // isolates would not have any value for it.
-  if (identical(JS('var', 'typeof(\$dynamicMetadata)'), 'undefined')) {
-    _dynamicMetadata = <MetaInfo>[];
-  }
-  return JS('var', '\$dynamicMetadata');
-}
-
-void set _dynamicMetadata(List<MetaInfo> table) {
-  JS('void', '\$dynamicMetadata = #', table);
-}
-
-/**
- * Builds the metadata used for encoding the class hierarchy of native
- * classes. The following example:
- *
- * class A native "*A" {}
- * class B extends A native "*B" {}
- *
- * Will generate:
- * ['A', 'A|B']
- *
- * This method returns a list of [MetaInfo] objects.
- */
-List <MetaInfo> buildDynamicMetadata(List<List<String>> inputTable) {
-  List<MetaInfo> result = <MetaInfo>[];
-  for (int i = 0; i < arrayLength(inputTable); i++) {
-    String tag = JS('String', '#', arrayGet(arrayGet(inputTable, i), 0));
-    String tags = JS('String', '#', arrayGet(arrayGet(inputTable, i), 1));
-    var set = newJsObject();
-    List<String> tagNames = tags.split('|');
-    for (int j = 0; j < arrayLength(tagNames); j++) {
-      propertySet(set, arrayGet(tagNames, j), true);
-    }
-    result.add(new MetaInfo(tag, tags, set));
-  }
-  return result;
-}
-
-/**
- * Called by the compiler to setup [_dynamicMetadata].
- */
-void dynamicSetMetadata(List<List<String>> inputTable) {
-  _dynamicMetadata = buildDynamicMetadata(inputTable);
-}
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
index 9504271..c890123 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -17,6 +17,9 @@
   Selector getOperatorSelectorInComplexSendSet(SendSet node);
   DartType getType(Node node);
   bool isParameterChecked(Element element);
+  void setSelector(Node node, Selector selector);
+  void setGetterSelectorInComplexSendSet(SendSet node, Selector selector);
+  void setOperatorSelectorInComplexSendSet(SendSet node, Selector selector);
 
   /// Register additional dependencies required by [currentElement].
   /// For example, elements that are used by a backend.
@@ -545,6 +548,7 @@
             new ClassResolverVisitor(compiler, element);
         visitor.visit(tree);
         element.resolutionState = STATE_DONE;
+        compiler.onClassResolved(element);
       }));
       if (element.isPatched) {
         // Ensure handling patch after origin.
@@ -696,6 +700,7 @@
       if (compiler.onDeprecatedFeature(member, 'conflicting constructor')) {
         compiler.reportMessage(
             compiler.spanFromElement(otherMember),
+            // Using GENERIC as this message is temporary.
             MessageKind.GENERIC.error({'text': 'This member conflicts with a'
                                                ' constructor.'}),
             Diagnostic.INFO);
@@ -1619,6 +1624,31 @@
   int allowedCategory = ElementCategory.VARIABLE | ElementCategory.FUNCTION
       | ElementCategory.IMPLIES_TYPE;
 
+  // TODO(ahe): Find a way to share this with runtime implementation.
+  static final RegExp symbolValidationPattern =
+      new RegExp(r'^(?:[a-zA-Z$][a-zA-Z$0-9_]*\.)*(?:[a-zA-Z$][a-zA-Z$0-9_]*=?|'
+                 r'-|'
+                 r'unary-|'
+                 r'\[\]=|'
+                 r'~|'
+                 r'==|'
+                 r'\[\]|'
+                 r'\*|'
+                 r'/|'
+                 r'%|'
+                 r'~/|'
+                 r'\+|'
+                 r'<<|'
+                 r'>>|'
+                 r'>=|'
+                 r'>|'
+                 r'<=|'
+                 r'<|'
+                 r'&|'
+                 r'\^|'
+                 r'\|'
+                 r')$');
+
   ResolverVisitor(Compiler compiler, Element element, this.mapping)
     : this.enclosingElement = element,
       // When the element is a field, we are actually resolving its
@@ -1982,6 +2012,7 @@
     Element target;
     SourceString name = node.selector.asIdentifier().source;
     if (identical(name.stringValue, 'this')) {
+      // TODO(ahe): Why is this using GENERIC?
       error(node.selector, MessageKind.GENERIC,
             {'text': "expected an identifier"});
     } else if (node.isSuperCall) {
@@ -2012,8 +2043,8 @@
             node, name, MessageKind.NO_SUCH_SUPER_MEMBER,
             {'className': currentClass, 'memberName': name});
         // We still need to register the invocation, because we might
-        // call [:super.noSuchMethod:] that does a
-        // [:Invocation.invokeOn:].
+        // call [:super.noSuchMethod:] which calls
+        // [JSInvocationMirror._invokeOn].
         world.registerDynamicInvocation(selector.name, selector);
         compiler.backend.registerSuperNoSuchMethod(mapping);
       }
@@ -2162,6 +2193,13 @@
     Element target = resolveSend(node);
     sendIsMemberAccess = oldSendIsMemberAccess;
 
+    if (target != null && target == compiler.mirrorSystemGetNameFunction) {
+      compiler.reportWarningCode(
+          node.selector, MessageKind.STATIC_FUNCTION_BLOAT,
+          {'class': compiler.mirrorSystemClass.name,
+           'name': compiler.mirrorSystemGetNameFunction.name});
+    }
+
     if (!Elements.isUnresolved(target)) {
       if (target.isAbstractField()) {
         AbstractFieldElement field = target;
@@ -2411,6 +2449,7 @@
   }
 
   void handleRedirectingFactoryBody(Return node) {
+    final isSymbolConstructor = enclosingElement == compiler.symbolConstructor;
     if (!enclosingElement.isFactoryConstructor()) {
       compiler.reportErrorCode(
           node, MessageKind.FACTORY_REDIRECTION_IN_NON_FACTORY);
@@ -2445,6 +2484,11 @@
     world.registerStaticUse(redirectionTarget);
     world.registerInstantiatedClass(
         redirectionTarget.enclosingElement.declaration, mapping);
+    if (isSymbolConstructor) {
+      // Make sure that collection_dev.Symbol.validated is registered.
+      assert(invariant(node, compiler.symbolValidatedConstructor != null));
+      world.registerStaticUse(compiler.symbolValidatedConstructor);
+    }
   }
 
   visitThrow(Throw node) {
@@ -2490,6 +2534,12 @@
   visitNewExpression(NewExpression node) {
     Node selector = node.send.selector;
     FunctionElement constructor = resolveConstructor(node);
+    final bool isSymbolConstructor = constructor == compiler.symbolConstructor;
+    if (!node.isConst() && isSymbolConstructor) {
+      compiler.reportWarningCode(
+          node.newToken, MessageKind.NON_CONST_BLOAT,
+          {'name': compiler.symbolClass.name});
+    }
     resolveSelector(node.send);
     resolveArguments(node.send.argumentsNode);
     useElement(node.send, constructor);
@@ -2532,9 +2582,39 @@
         },
         includeBackendMembers: false,
         includeSuperMembers: true);
+
+    if (node.isConst() && isSymbolConstructor) {
+      Node argumentNode = node.send.arguments.head;
+      Constant name = compiler.metadataHandler.compileNodeWithDefinitions(
+          argumentNode, mapping, isConst: true);
+      if (!name.isString()) {
+        DartType type = name.computeType(compiler);
+        compiler.reportErrorCode(argumentNode, MessageKind.STRING_EXPECTED,
+                                 {'type': type});
+      } else {
+        StringConstant stringConstant = name;
+        validateSymbol(argumentNode,
+                       stringConstant.toDartString().slowToString());
+      }
+    }
+
     return null;
   }
 
+  void validateSymbol(Node node, String name) {
+    if (name.isEmpty) return;
+    if (name.startsWith('_')) {
+      compiler.reportErrorCode(node, MessageKind.PRIVATE_IDENTIFIER,
+                               {'value': name});
+      return;
+    }
+    if (!symbolValidationPattern.hasMatch(name)) {
+      compiler.reportErrorCode(node, MessageKind.INVALID_SYMBOL,
+                               {'value': name});
+    }
+  }
+
+
   /**
    * Try to resolve the constructor that is referred to by [node].
    * Note: this function may return an ErroneousFunctionElement instead of
@@ -2735,6 +2815,7 @@
     }
     if (loopVariableSelector != null) {
       mapping.setSelector(declaration, loopVariableSelector);
+      registerSend(loopVariableSelector, loopVariable);
     } else {
       // The selector may only be null if we reported an error.
       assert(invariant(declaration, compiler.compilationFailed));
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
index 57b3aca..0da0ae4 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -1028,17 +1028,35 @@
    */
   InliningState enterInlinedMethod(PartialFunctionElement function,
                                    Selector selector,
-                                   Link<Node> arguments,
+                                   Link<Node> argumentsNodes,
+                                   List<HInstruction> providedArguments,
                                    Node currentNode) {
     assert(invariant(function, function.isImplementation));
 
-    // Once we start to compile the arguments we must be sure that we don't
-    // abort.
     List<HInstruction> compiledArguments = new List<HInstruction>();
-    bool succeeded = addStaticSendArgumentsToList(selector,
-                                                  arguments,
-                                                  function,
-                                                  compiledArguments);
+    bool succeeded;
+    bool isInstanceMember = function.isInstanceMember();
+
+    if (isInstanceMember) {
+      assert(providedArguments != null);
+      int argumentIndex = 1; // Skip receiver.
+      compiledArguments.add(providedArguments[0]);
+      succeeded = selector.addArgumentsToList(
+          argumentsNodes,
+          compiledArguments,
+          function,
+          (node) => providedArguments[argumentIndex++],
+          handleConstantForOptionalParameter,
+          compiler);
+    } else {
+      assert(providedArguments == null);
+      succeeded = addStaticSendArgumentsToList(selector,
+                                               argumentsNodes,
+                                               function,
+                                               compiledArguments);
+    }
+    // The caller of [enterInlinedMethod] has ensured the selector
+    // matches the element.
     assert(succeeded);
 
     // Create the inlining state after evaluating the arguments, that
@@ -1049,6 +1067,7 @@
 
     FunctionSignature signature = function.computeSignature(compiler);
     int index = 0;
+    if (isInstanceMember) index++;
     signature.orderedForEachParameter((Element parameter) {
       HInstruction argument = compiledArguments[index++];
       localsHandler.updateLocal(parameter, argument);
@@ -1108,7 +1127,8 @@
    */
   bool tryInlineMethod(Element element,
                        Selector selector,
-                       Link<Node> arguments,
+                       Link<Node> argumentsNodes,
+                       List<HInstruction> providedArguments,
                        Node currentNode) {
     // We cannot inline a method from a deferred library into a method
     // which isn't deferred.
@@ -1157,7 +1177,7 @@
 
     assert(canBeInlined);
     InliningState state = enterInlinedMethod(
-        function, selector, arguments, currentNode);
+        function, selector, argumentsNodes, providedArguments, currentNode);
     inlinedFrom(element, () {
       functionExpression.body.accept(this);
     });
@@ -2375,7 +2395,7 @@
     }
 
     HInvokeDynamicMethod result =
-        buildInvokeDynamic(node, elements.getSelector(node), operand, []);
+        buildInvokeDynamic(node, elements.getSelector(node), [operand]);
     pushWithPosition(result, node);
   }
 
@@ -2396,7 +2416,7 @@
     }
 
     pushWithPosition(
-          buildInvokeDynamic(send, selector, left, [right]),
+          buildInvokeDynamic(send, selector, [left, right]),
           op);
     if (op.source.stringValue == '!=') {
       pushWithPosition(new HNot(popBoolified()), op);
@@ -2429,28 +2449,8 @@
                                                   HInstruction receiver) {
     assert(Elements.isInstanceSend(send, elements));
     assert(selector.isGetter());
-    SourceString getterName = selector.name;
-    Set<ClassElement> interceptedClasses =
-        backend.getInterceptedClassesOn(getterName);
-
-    bool hasGetter = compiler.world.hasAnyUserDefinedGetter(selector);
-    HInstruction instruction;
-    if (interceptedClasses != null) {
-      // If we're using an interceptor class, emit a call to the
-      // interceptor method and then the actual dynamic call on the
-      // interceptor object.
-      instruction =
-          invokeInterceptor(interceptedClasses, receiver, send);
-      instruction = new HInvokeDynamicGetter(
-          selector, null, instruction, !hasGetter);
-      // Add the receiver as an argument to the getter call on the
-      // interceptor.
-      instruction.inputs.add(receiver);
-    } else {
-      instruction = new HInvokeDynamicGetter(
-          selector, null, receiver, !hasGetter);
-    }
-    pushWithPosition(instruction, send);
+    HInstruction res = buildInvokeDynamic(send, selector, [receiver]);
+    pushWithPosition(res, send);
   }
 
   void generateGetter(Send send, Element element) {
@@ -2468,7 +2468,8 @@
       } else {
         if (element.isGetter()) {
           Selector selector = elements.getSelector(send);
-          if (tryInlineMethod(element, selector, const Link<Node>(), send)) {
+          if (tryInlineMethod(
+                element, selector, const Link<Node>(), null, send)) {
             return;
           }
         }
@@ -2514,49 +2515,39 @@
       location = send;
     }
     assert(selector.isSetter());
-    bool hasSetter = compiler.world.hasAnyUserDefinedSetter(selector);
-    Set<ClassElement> interceptedClasses =
-        backend.getInterceptedClassesOn(selector.name);
-    HInstruction instruction;
-    if (interceptedClasses != null) {
-      // If we're using an interceptor class, emit a call to the
-      // getInterceptor method and then the actual dynamic call on the
-      // interceptor object.
-      instruction = invokeInterceptor(interceptedClasses, receiver, send);
-      instruction = new HInvokeDynamicSetter(
-          selector, null, instruction, receiver, !hasSetter);
-      // Add the value as an argument to the setter call on the
-      // interceptor.
-      instruction.inputs.add(value);
-    } else {
-      instruction = new HInvokeDynamicSetter(
-          selector, null, receiver, value, !hasSetter);
-    }
-    addWithPosition(instruction, location);
+    HInstruction res = buildInvokeDynamic(
+        location, selector, [receiver, value]);
+    addWithPosition(res, location);
     stack.add(value);
   }
 
   void generateNonInstanceSetter(SendSet send,
                                  Element element,
-                                 HInstruction value) {
-    assert(!Elements.isInstanceSend(send, elements));
+                                 HInstruction value,
+                                 {Node location}) {
+    assert(send == null || !Elements.isInstanceSend(send, elements));
+    if (location == null) {
+      assert(send != null);
+      location = send;
+    }
     if (Elements.isStaticOrTopLevelField(element)) {
       if (element.isSetter()) {
         HStatic target = new HStatic(element);
         add(target);
         addWithPosition(
             new HInvokeStatic(<HInstruction>[target, value], HType.UNKNOWN),
-            send);
+            location);
       } else {
         value = potentiallyCheckType(value, element.computeType(compiler));
-        addWithPosition(new HStaticStore(element, value), send);
+        addWithPosition(new HStaticStore(element, value), location);
       }
       stack.add(value);
     } else if (Elements.isErroneousElement(element)) {
       // An erroneous element indicates an unresolved static setter.
-      generateThrowNoSuchMethod(send,
-                                getTargetName(element, 'set'),
-                                argumentNodes: send.arguments);
+      generateThrowNoSuchMethod(
+          location,
+          getTargetName(element, 'set'),
+          argumentNodes: (send == null ? const Link<Node>() : send.arguments));
     } else {
       stack.add(value);
       // If the value does not already have a name, give it here.
@@ -2575,7 +2566,7 @@
 
   HInstruction invokeInterceptor(Set<ClassElement> intercepted,
                                  HInstruction receiver,
-                                 Send send) {
+                                 Node node) {
     HInterceptor interceptor = new HInterceptor(intercepted, receiver);
     add(interceptor);
     return interceptor;
@@ -2757,8 +2748,6 @@
                             HIs.VARIABLE_CHECK);
     } else if (RuntimeTypes.hasTypeArguments(type)) {
       Element element = type.element;
-      bool needsNativeCheck =
-          backend.emitter.nativeEmitter.requiresNativeIsCheck(element);
       Element helper = backend.getCheckSubtype();
       HInstruction helperCall = new HStatic(helper);
       add(helperCall);
@@ -2771,14 +2760,11 @@
       // have a subclass.
       HInstruction asFieldName =
           addConstantString(node, backend.namer.substitutionName(element));
-      HInstruction native =
-          graph.addConstantBool(needsNativeCheck, constantSystem);
       List<HInstruction> inputs = <HInstruction>[helperCall,
                                                  expression,
                                                  isFieldName,
                                                  representations,
-                                                 asFieldName,
-                                                 native];
+                                                 asFieldName];
       HInstruction call = new HInvokeStatic(inputs, HType.BOOLEAN);
       add(call);
       instruction = new HIs(type, <HInstruction>[expression, call],
@@ -2828,6 +2814,19 @@
     }
   }
 
+  HInstruction handleConstantForOptionalParameter(Element parameter) {
+    Constant constant;
+    Element element = parameter.enclosingElement;
+    TreeElements calleeElements =
+        compiler.enqueuer.resolution.getCachedElements(element);
+    if (calleeElements.isParameterChecked(parameter)) {
+      constant = SentinelConstant.SENTINEL;
+    } else {
+      constant = compileConstant(parameter);
+    }
+    return graph.addConstant(constant);
+  }
+
   /**
    * Returns true if the arguments were compatible with the function signature.
    *
@@ -2844,23 +2843,11 @@
       return pop();
     }
 
-    HInstruction handleConstant(Element parameter) {
-      Constant constant;
-      TreeElements calleeElements =
-          compiler.enqueuer.resolution.getCachedElements(element);
-      if (calleeElements.isParameterChecked(parameter)) {
-        constant = SentinelConstant.SENTINEL;
-      } else {
-        constant = compileConstant(parameter);
-      }
-      return graph.addConstant(constant);
-    }
-
     return selector.addArgumentsToList(arguments,
                                        list,
                                        element,
                                        compileArgument,
-                                       handleConstant,
+                                       handleConstantForOptionalParameter,
                                        compiler);
   }
 
@@ -2881,53 +2868,27 @@
   visitDynamicSend(Send node, {bool inline: true}) {
     Selector selector = elements.getSelector(node);
 
-    // TODO(kasperl): It would be much better to try to get the
-    // guaranteed type of the receiver after we've evaluated it, but
-    // because of the way inlining currently works that is hard to do
-    // with re-evaluating the receiver.
+    List<HInstruction> inputs = <HInstruction>[];
+    HInstruction receiver = generateInstanceSendReceiver(node);
+    inputs.add(receiver);
+    addDynamicSendArgumentsToList(node, inputs);
+
+    // TODO(ngeoffray): Also inline for non-this sends. Currently, the
+    // inliner does not work when the receiver is not [:this:].
     if (isThisSend(node)) {
       HType receiverType = getTypeOfThis();
       selector = receiverType.refine(selector, compiler);
-    }
-
-    Element element = compiler.world.locateSingleElement(selector);
-    bool isClosureCall = false;
-    if (inline && element != null) {
-      if (tryInlineMethod(element, selector, node.arguments, node)) {
-        if (element.isGetter()) {
-          // If the element is a getter, we are doing a closure call
-          // on what this getter returns.
-          assert(selector.isCall());
-          isClosureCall = true;
-        } else {
+      Element element = compiler.world.locateSingleElement(selector);
+      // TODO(ngeoffray): If [element] is a getter, then this send is
+      // a closure send. We should teach that to [ResolvedVisitor].
+      if (inline && element != null && !element.isGetter()) {
+        if (tryInlineMethod(element, selector, node.arguments, inputs, node)) {
           return;
         }
       }
     }
 
-    List<HInstruction> inputs = <HInstruction>[];
-    if (isClosureCall) inputs.add(pop());
-
-    HInstruction receiver;
-    if (!isClosureCall) {
-      if (node.receiver == null) {
-        receiver = localsHandler.readThis();
-      } else {
-        visit(node.receiver);
-        receiver = pop();
-      }
-    }
-
-    addDynamicSendArgumentsToList(node, inputs);
-
-    HInstruction invoke;
-    if (isClosureCall) {
-      Selector closureSelector = new Selector.callClosureFrom(selector);
-      invoke = new HInvokeClosure(closureSelector, inputs);
-    } else {
-      invoke = buildInvokeDynamic(node, selector, receiver, inputs);
-    }
-
+    HInstruction invoke = buildInvokeDynamic(node, selector, inputs);
     pushWithPosition(invoke, node);
   }
 
@@ -3135,10 +3096,10 @@
     ClassElement cls = currentElement.getEnclosingClass();
     Element element = cls.lookupSuperMember(Compiler.NO_SUCH_METHOD);
     if (element.enclosingElement.declaration != compiler.objectClass) {
-      // Register the call as dynamic if [:noSuchMethod:] on the super class
-      // is _not_ the default implementation from [:Object:], in case
-      // the [:noSuchMethod:] implementation does an [:invokeOn:] on
-      // the invocation mirror.
+      // Register the call as dynamic if [noSuchMethod] on the super
+      // class is _not_ the default implementation from [Object], in
+      // case the [noSuchMethod] implementation calls
+      // [JSInvocationMirror._invokeOn].
       compiler.enqueuer.codegen.registerSelectorUse(selector);
     }
     HStatic target = new HStatic(element);
@@ -3378,6 +3339,18 @@
     }
     FunctionElement functionElement = constructor;
     constructor = functionElement.redirectionTarget;
+    final bool isSymbolConstructor =
+        functionElement == compiler.symbolConstructor;
+
+    if (isSymbolConstructor) {
+      constructor = compiler.symbolValidatedConstructor;
+      assert(invariant(node, constructor != null,
+                       message: 'Constructor Symbol.validated is missing'));
+      selector = compiler.symbolValidatedConstructorSelector;
+      assert(invariant(node, selector != null,
+                       message: 'Constructor Symbol.validated is missing'));
+    }
+
     // TODO(5346): Try to avoid the need for calling [declaration] before
     // creating an [HStatic].
     HInstruction target = new HStatic(constructor.declaration);
@@ -3452,7 +3425,7 @@
       bool isIdenticalFunction = element == compiler.identicalFunction;
 
       if (!isIdenticalFunction
-          && tryInlineMethod(element, selector, node.arguments, node)) {
+          && tryInlineMethod(element, selector, node.arguments, null, node)) {
         return;
       }
 
@@ -3658,17 +3631,18 @@
         Send send = node.send;
         Element constructor = elements[send];
         Selector selector = elements.getSelector(send);
-        if (!tryInlineMethod(constructor, selector, send.arguments, node)) {
+        if (!tryInlineMethod(
+              constructor, selector, send.arguments, null, node)) {
           visitNewSend(send, type);
         }
       }
     }
   }
 
-  HInvokeDynamicMethod buildInvokeDynamic(Node node,
-                                          Selector selector,
-                                          HInstruction receiver,
-                                          List<HInstruction> arguments) {
+  HInstruction buildInvokeDynamic(Node node,
+                                  Selector selector,
+                                  List<HInstruction> arguments) {
+    HInstruction receiver = arguments[0];
     Set<ClassElement> interceptedClasses =
         backend.getInterceptedClassesOn(selector.name);
     List<HInstruction> inputs = <HInstruction>[];
@@ -3677,9 +3651,16 @@
       assert(!interceptedClasses.isEmpty);
       inputs.add(invokeInterceptor(interceptedClasses, receiver, node));
     }
-    inputs.add(receiver);
     inputs.addAll(arguments);
-    return new HInvokeDynamicMethod(selector, inputs, isIntercepted);
+    if (selector.isGetter()) {
+      bool hasGetter = compiler.world.hasAnyUserDefinedGetter(selector);
+      return new HInvokeDynamicGetter(selector, null, inputs, !hasGetter);
+    } else if (selector.isSetter()) {
+      bool hasSetter = compiler.world.hasAnyUserDefinedSetter(selector);
+      return new HInvokeDynamicSetter(selector, null, inputs, !hasSetter);
+    } else {
+      return new HInvokeDynamicMethod(selector, inputs, isIntercepted);
+    }
   }
 
   void handleComplexOperatorSend(SendSet node,
@@ -3794,15 +3775,14 @@
         HInvokeDynamicMethod getterInstruction = buildInvokeDynamic(
             node,
             elements.getGetterSelectorInComplexSendSet(node),
-            receiver,
-            <HInstruction>[index]);
+            [receiver, index]);
         add(getterInstruction);
 
         handleComplexOperatorSend(node, getterInstruction, arguments);
         HInstruction value = pop();
 
         HInvokeDynamicMethod assign = buildInvokeDynamic(
-            node, elements.getSelector(node), receiver, [index, value]);
+            node, elements.getSelector(node), [receiver, index, value]);
         add(assign);
 
         if (node.isPostfix) {
@@ -4097,58 +4077,39 @@
     HInstruction iterator;
     void buildInitializer() {
       Selector selector = compiler.iteratorSelector;
-      Set<ClassElement> interceptedClasses =
-          backend.getInterceptedClassesOn(selector.name);
       visit(node.expression);
       HInstruction receiver = pop();
-      bool hasGetter = compiler.world.hasAnyUserDefinedGetter(selector);
-      if (interceptedClasses == null) {
-        iterator =
-            new HInvokeDynamicGetter(selector, null, receiver, !hasGetter);
-      } else {
-        HInterceptor interceptor =
-            invokeInterceptor(interceptedClasses, receiver, null);
-        iterator =
-            new HInvokeDynamicGetter(selector, null, interceptor, !hasGetter);
-        // Add the receiver as an argument to the getter call on the
-        // interceptor.
-        iterator.inputs.add(receiver);
-      }
+      iterator = buildInvokeDynamic(node, selector, [receiver]);
       add(iterator);
     }
     HInstruction buildCondition() {
       Selector selector = compiler.moveNextSelector;
-      push(new HInvokeDynamicMethod(selector, <HInstruction>[iterator]));
+      push(buildInvokeDynamic(node, selector, [iterator]));
       return popBoolified();
     }
     void buildBody() {
       Selector call = compiler.currentSelector;
-      bool hasGetter = compiler.world.hasAnyUserDefinedGetter(call);
-      push(new HInvokeDynamicGetter(call, null, iterator, !hasGetter));
+      push(buildInvokeDynamic(node, call, [iterator]));
 
-      Element variable = elements[node.declaredIdentifier];
-      Selector selector = elements.getSelector(node.declaredIdentifier);
+      Node identifier = node.declaredIdentifier;
+      Element variable = elements[identifier];
+      Selector selector = elements.getSelector(identifier);
 
-      HInstruction oldVariable = pop();
-      if (Elements.isUnresolved(variable)) {
-        if (Elements.isInStaticContext(currentElement)) {
-          generateThrowNoSuchMethod(
-              node.declaredIdentifier,
-              'set ${selector.name.slowToString()}',
-              argumentValues: <HInstruction>[oldVariable]);
-        } else {
-          // The setter may have been defined in a subclass.
-          generateInstanceSetterWithCompiledReceiver(
-              null,
-              localsHandler.readThis(),
-              oldVariable,
-              selector: selector,
-              location: node.declaredIdentifier);
-        }
-        pop();
+      HInstruction value = pop();
+      if (identifier.asSend() != null
+          && Elements.isInstanceSend(identifier, elements)) {
+        HInstruction receiver = generateInstanceSendReceiver(identifier);
+        assert(receiver != null);
+        generateInstanceSetterWithCompiledReceiver(
+            null,
+            receiver,
+            value,
+            selector: selector,
+            location: identifier);
       } else {
-        localsHandler.updateLocal(variable, oldVariable);
+        generateNonInstanceSetter(null, variable, value, location: identifier);
       }
+      pop(); // Pop the value pushed by the setter call.
 
       visit(node.body);
     }
@@ -4622,7 +4583,10 @@
     startTryBlock = graph.addNewBlock();
     open(startTryBlock);
     visit(node.tryBlock);
-    if (!isAborted()) endTryBlock = close(new HGoto());
+    // We use a [HExitTry] instead of a [HGoto] for the try block
+    // because it will have multiple successors: the join block, and
+    // the catch or finally block.
+    if (!isAborted()) endTryBlock = close(new HExitTry());
     SubGraph bodyGraph = new SubGraph(startTryBlock, lastOpenedBlock);
     SubGraph catchGraph = null;
     HLocalValue exception = null;
@@ -4781,6 +4745,7 @@
       assert(startCatchBlock != null || startFinallyBlock != null);
       endTryBlock.addSuccessor(
           startCatchBlock != null ? startCatchBlock : startFinallyBlock);
+      endTryBlock.addSuccessor(exitBlock);
     }
 
     // The catch block has either the finally or the exit block as
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
index 936ad61..dcfc9dc 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
@@ -1521,11 +1521,11 @@
   }
 
   Selector getOptimizedSelectorFor(HInvokeDynamic node, Selector selector) {
-    // If [JSInvocationMirror.invokeOn] has been called, we must not create a
+    // If [JSInvocationMirror._invokeOn] has been called, we must not create a
     // typed selector based on the receiver type.
     if (node.element == null && // Invocation is not exact.
         backend.compiler.enabledInvokeOn) {
-      return selector;
+      return selector.asUntyped;
     }
     HType receiverType = node.getDartReceiver(compiler).instructionType;
     return receiverType.refine(selector, compiler);
@@ -1808,9 +1808,17 @@
   void generateNot(HInstruction input) {
     bool canGenerateOptimizedComparison(HInstruction instruction) {
       if (instruction is !HRelational) return false;
+
       HRelational relational = instruction;
+      BinaryOperation operation = relational.operation(backend.constantSystem);
+
       HInstruction left = relational.left;
       HInstruction right = relational.right;
+      if (left.instructionType.isUseful() && left.isString() &&
+          right.instructionType.isUseful() && right.isString()) {
+        return true;
+      }
+
       // This optimization doesn't work for NaN, so we only do it if the
       // type is known to be an integer.
       return left.instructionType.isUseful() && left.isInteger()
@@ -1818,7 +1826,9 @@
     }
 
     bool generateAtUseSite = isGenerateAtUseSite(input);
-    if (input is HIdentity && generateAtUseSite) {
+    if (input is HIs) {
+      emitIs(input, '!==');
+    } else if (input is HIdentity && generateAtUseSite) {
       emitIdentityComparison(input.left, input.right, true);
     } else if (input is HBoolify && generateAtUseSite) {
       use(input.inputs[0]);
@@ -2119,8 +2129,7 @@
     use(input);
     js.Expression right = pop();
     // TODO(4984): Deal with infinity and -0.0.
-    push(new js.LiteralExpression.withData('Math.floor(#) === #',
-                                           <js.Expression>[left, right]));
+    push(js.js('Math.floor(#) $cmp #', <js.Expression>[left, right]));
   }
 
   void checkTypeOf(HInstruction input, String cmp, String typeName) {
@@ -2194,15 +2203,19 @@
     push(new js.Binary('!=', pop(), new js.LiteralNull()));
   }
 
-  void checkFunction(HInstruction input, DartType type) {
-    checkTypeOf(input, '===', 'function');
+  void checkFunction(HInstruction input,
+                     DartType type,
+                     { bool negative: false}) {
+    String relation = negative ? '!==' : '===';
+    checkTypeOf(input, relation, 'function');
     js.Expression functionTest = pop();
-    checkObject(input, '===');
+    checkObject(input, relation);
     js.Expression objectTest = pop();
-    checkType(input, type);
-    push(new js.Binary('||',
+    checkType(input, type, negative: negative);
+    String combiner = negative ? '||' : '&&';
+    push(new js.Binary(negative ? '&&' : '||',
                        functionTest,
-                       new js.Binary('&&', objectTest, pop())));
+                       new js.Binary(combiner, objectTest, pop())));
   }
 
   void checkType(HInstruction input, DartType type, {bool negative: false}) {
@@ -2243,69 +2256,86 @@
 
     js.PropertyAccess field =
         new js.PropertyAccess.field(pop(), backend.namer.operatorIs(element));
-    if (backend.emitter.nativeEmitter.requiresNativeIsCheck(element)) {
-      push(new js.Call(field, <js.Expression>[]));
-      if (negative) push(new js.Prefix('!', pop()));
-    } else {
-      // We always negate at least once so that the result is boolified.
-      push(new js.Prefix('!', field));
-      // If the result is not negated, put another '!' in front.
-      if (!negative) push(new js.Prefix('!', pop()));
-    }
-
+    // We always negate at least once so that the result is boolified.
+    push(new js.Prefix('!', field));
+    // If the result is not negated, put another '!' in front.
+    if (!negative) push(new js.Prefix('!', pop()));
   }
 
-  void handleNumberOrStringSupertypeCheck(HInstruction input, DartType type) {
+  void handleNumberOrStringSupertypeCheck(HInstruction input,
+                                          DartType type,
+                                          { bool negative: false }) {
     assert(!identical(type.element, compiler.listClass)
            && !Elements.isListSupertype(type.element, compiler)
            && !Elements.isStringOnlySupertype(type.element, compiler));
-    checkNum(input, '===');
+    String relation = negative ? '!==' : '===';
+    checkNum(input, relation);
     js.Expression numberTest = pop();
-    checkString(input, '===');
+    checkString(input, relation);
     js.Expression stringTest = pop();
-    checkObject(input, '===');
+    checkObject(input, relation);
     js.Expression objectTest = pop();
-    checkType(input, type);
-    push(new js.Binary('||',
-                       new js.Binary('||', numberTest, stringTest),
-                       new js.Binary('&&', objectTest, pop())));
+    checkType(input, type, negative: negative);
+    String combiner = negative ? '&&' : '||';
+    String combiner2 = negative ? '||' : '&&';
+    push(new js.Binary(combiner,
+                       new js.Binary(combiner, numberTest, stringTest),
+                       new js.Binary(combiner2, objectTest, pop())));
   }
 
-  void handleStringSupertypeCheck(HInstruction input, DartType type) {
+  void handleStringSupertypeCheck(HInstruction input,
+                                  DartType type,
+                                  { bool negative: false }) {
     assert(!identical(type.element, compiler.listClass)
            && !Elements.isListSupertype(type.element, compiler)
            && !Elements.isNumberOrStringSupertype(type.element, compiler));
-    checkString(input, '===');
+    String relation = negative ? '!==' : '===';
+    checkString(input, relation);
     js.Expression stringTest = pop();
-    checkObject(input, '===');
+    checkObject(input, relation);
     js.Expression objectTest = pop();
-    checkType(input, type);
-    push(new js.Binary('||',
+    checkType(input, type, negative: negative);
+    String combiner = negative ? '||' : '&&';
+    push(new js.Binary(negative ? '&&' : '||',
                        stringTest,
-                       new js.Binary('&&', objectTest, pop())));
+                       new js.Binary(combiner, objectTest, pop())));
   }
 
-  void handleListOrSupertypeCheck(HInstruction input, DartType type) {
+  void handleListOrSupertypeCheck(HInstruction input,
+                                  DartType type,
+                                  { bool negative: false }) {
     assert(!identical(type.element, compiler.stringClass)
            && !Elements.isStringOnlySupertype(type.element, compiler)
            && !Elements.isNumberOrStringSupertype(type.element, compiler));
-    checkObject(input, '===');
+    String relation = negative ? '!==' : '===';
+    checkObject(input, relation);
     js.Expression objectTest = pop();
-    checkArray(input, '===');
+    checkArray(input, relation);
     js.Expression arrayTest = pop();
-    checkType(input, type);
-    push(new js.Binary('&&',
+    checkType(input, type, negative: negative);
+    String combiner = negative ? '&&' : '||';
+    push(new js.Binary(negative ? '||' : '&&',
                        objectTest,
-                       new js.Binary('||', arrayTest, pop())));
+                       new js.Binary(combiner, arrayTest, pop())));
   }
 
   void visitIs(HIs node) {
+    emitIs(node, "===");
+  }
+
+  void emitIs(HIs node, String relation)  {
     DartType type = node.typeExpression;
     world.registerIsCheck(type, work.resolutionTree);
     HInstruction input = node.expression;
 
+    // If this is changed to single == there are several places below that must
+    // be changed to match.
+    assert(relation == '===' || relation == '!==');
+    bool negative = relation == '!==';
+
     if (node.isVariableCheck || node.isCompoundCheck) {
       use(node.checkCall);
+      if (negative) push(new js.Prefix('!', pop()));
     } else {
       assert(node.isRawCheck);
       LibraryElement coreLibrary = compiler.coreLibrary;
@@ -2316,59 +2346,68 @@
           identical(element, compiler.dynamicClass)) {
         // The constant folder also does this optimization, but we make
         // it safe by assuming it may have not run.
-        push(newLiteralBool(true), node);
+        push(newLiteralBool(!negative), node);
       } else if (element == compiler.stringClass) {
-        checkString(input, '===');
+        checkString(input, relation);
         attachLocationToLast(node);
       } else if (element == compiler.doubleClass) {
-        checkDouble(input, '===');
+        checkDouble(input, relation);
         attachLocationToLast(node);
       } else if (element == compiler.numClass) {
-        checkNum(input, '===');
+        checkNum(input, relation);
         attachLocationToLast(node);
       } else if (element == compiler.boolClass) {
-        checkBool(input, '===');
+        checkBool(input, relation);
         attachLocationToLast(node);
       } else if (element == compiler.functionClass) {
-        checkFunction(input, type);
+        checkFunction(input, type, negative: negative);
         attachLocationToLast(node);
       } else if (element == compiler.intClass) {
         // The is check in the code tells us that it might not be an
         // int. So we do a typeof first to avoid possible
         // deoptimizations on the JS engine due to the Math.floor check.
-        checkNum(input, '===');
+        checkNum(input, relation);
         js.Expression numTest = pop();
-        checkBigInt(input, '===');
-        push(new js.Binary('&&', numTest, pop()), node);
+        checkBigInt(input, relation);
+        push(new js.Binary(negative ? '||' : '&&', numTest, pop()), node);
       } else if (Elements.isNumberOrStringSupertype(element, compiler)) {
-        handleNumberOrStringSupertypeCheck(input, type);
+        handleNumberOrStringSupertypeCheck(input, type, negative: negative);
         attachLocationToLast(node);
       } else if (Elements.isStringOnlySupertype(element, compiler)) {
-        handleStringSupertypeCheck(input, type);
+        handleStringSupertypeCheck(input, type, negative: negative);
         attachLocationToLast(node);
       } else if (identical(element, compiler.listClass)
                  || Elements.isListSupertype(element, compiler)) {
-        handleListOrSupertypeCheck(input, type);
+        handleListOrSupertypeCheck(input, type, negative: negative);
         attachLocationToLast(node);
       } else if (element.isTypedef()) {
-        checkNonNull(input);
+        if (negative) {
+          checkNull(input);
+        } else {
+          checkNonNull(input);
+        }
         js.Expression nullTest = pop();
-        checkType(input, type);
-        push(new js.Binary('&&', nullTest, pop()));
+        checkType(input, type, negative: negative);
+        push(new js.Binary(negative ? '||' : '&&', nullTest, pop()));
         attachLocationToLast(node);
       } else if (input.canBePrimitive(compiler) || input.canBeNull()) {
-        checkObject(input, '===');
+        checkObject(input, relation);
         js.Expression objectTest = pop();
-        checkType(input, type);
-        push(new js.Binary('&&', objectTest, pop()), node);
+        checkType(input, type, negative: negative);
+        push(new js.Binary(negative ? '||' : '&&', objectTest, pop()), node);
       } else {
-        checkType(input, type);
+        checkType(input, type, negative: negative);
         attachLocationToLast(node);
       }
     }
     if (node.nullOk) {
-      checkNull(input);
-      push(new js.Binary('||', pop(), pop()), node);
+      if (negative) {
+        checkNonNull(input);
+        push(new js.Binary('&&', pop(), pop()), node);
+      } else {
+        checkNull(input);
+        push(new js.Binary('||', pop(), pop()), node);
+      }
     }
   }
 
@@ -2498,26 +2537,28 @@
     HInstruction input = node.guarded;
     DartType indexingBehavior =
         backend.jsIndexingBehaviorInterface.computeType(compiler);
+    String message;
+    js.Expression test;
     if (node.isInteger()) {
       // if (input is !int) bailout
       checkInt(input, '!==');
-      js.Statement then = bailout(node, 'Not an integer');
-      pushStatement(new js.If.noElse(pop(), then), node);
+      test = pop();
+      message = 'Not an integer';
     } else if (node.isNumber()) {
       // if (input is !num) bailout
       checkNum(input, '!==');
-      js.Statement then = bailout(node, 'Not a number');
-      pushStatement(new js.If.noElse(pop(), then), node);
+      test = pop();
+      message = 'Not a number';
     } else if (node.isBoolean()) {
       // if (input is !bool) bailout
       checkBool(input, '!==');
-      js.Statement then = bailout(node, 'Not a boolean');
-      pushStatement(new js.If.noElse(pop(), then), node);
+      test = pop();
+      message = 'Not a boolean';
     } else if (node.isString()) {
       // if (input is !string) bailout
       checkString(input, '!==');
-      js.Statement then = bailout(node, 'Not a string');
-      pushStatement(new js.If.noElse(pop(), then), node);
+      test = pop();
+      message = 'Not a string';
     } else if (node.isExtendableArray()) {
       // if (input is !Object || input is !Array || input.isFixed) bailout
       checkObject(input, '!==');
@@ -2525,10 +2566,9 @@
       checkArray(input, '!==');
       js.Expression arrayTest = pop();
       checkFixedArray(input);
-      js.Binary test = new js.Binary('||', objectTest, arrayTest);
+      test = new js.Binary('||', objectTest, arrayTest);
       test = new js.Binary('||', test, pop());
-      js.Statement then = bailout(node, 'Not an extendable array');
-      pushStatement(new js.If.noElse(test, then), node);
+      message = 'Not an extendable array';
     } else if (node.isMutableArray()) {
       // if (input is !Object
       //     || ((input is !Array || input.isImmutable)
@@ -2541,9 +2581,8 @@
       js.Binary notArrayOrImmutable = new js.Binary('||', arrayTest, pop());
       checkType(input, indexingBehavior, negative: true);
       js.Binary notIndexing = new js.Binary('&&', notArrayOrImmutable, pop());
-      js.Binary test = new js.Binary('||', objectTest, notIndexing);
-      js.Statement then = bailout(node, 'Not a mutable array');
-      pushStatement(new js.If.noElse(test, then), node);
+      test = new js.Binary('||', objectTest, notIndexing);
+      message = 'Not a mutable array';
     } else if (node.isReadableArray()) {
       // if (input is !Object
       //     || (input is !Array && input is !JsIndexingBehavior)) bailout
@@ -2553,9 +2592,8 @@
       js.Expression arrayTest = pop();
       checkType(input, indexingBehavior, negative: true);
       js.Expression notIndexing = new js.Binary('&&', arrayTest, pop());
-      js.Binary test = new js.Binary('||', objectTest, notIndexing);
-      js.Statement then = bailout(node, 'Not an array');
-      pushStatement(new js.If.noElse(test, then), node);
+      test = new js.Binary('||', objectTest, notIndexing);
+      message = 'Not an array';
     } else if (node.isIndexablePrimitive()) {
       // if (input is !String
       //     && (input is !Object
@@ -2570,13 +2608,12 @@
       js.Binary notIndexingTest = new js.Binary('&&', arrayTest, pop());
       js.Binary notObjectOrIndexingTest =
           new js.Binary('||', objectTest, notIndexingTest);
-      js.Binary test =
-          new js.Binary('&&', stringTest, notObjectOrIndexingTest);
-      js.Statement then = bailout(node, 'Not a string or array');
-      pushStatement(new js.If.noElse(test, then), node);
+      test = new js.Binary('&&', stringTest, notObjectOrIndexingTest);
+      message = 'Not a string or array';
     } else {
       compiler.internalError('Unexpected type guard', instruction: input);
     }
+    pushStatement(new js.If.noElse(test, bailout(node, message)), node);
   }
 
   void visitBailoutTarget(HBailoutTarget target) {
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart b/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
index fdea257..278c3a7 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
@@ -1385,8 +1385,8 @@
 }
 
 class HInvokeDynamicGetter extends HInvokeDynamicField {
-  HInvokeDynamicGetter(selector, element, receiver, isSideEffectFree)
-    : super(selector, element, [receiver], isSideEffectFree) {
+  HInvokeDynamicGetter(selector, element, inputs, isSideEffectFree)
+    : super(selector, element, inputs, isSideEffectFree) {
     clearAllSideEffects();
     if (isSideEffectFree) {
       setUseGvn();
@@ -1401,8 +1401,8 @@
 }
 
 class HInvokeDynamicSetter extends HInvokeDynamicField {
-  HInvokeDynamicSetter(selector, element, receiver, value, isSideEffectFree)
-    : super(selector, element, [receiver, value], isSideEffectFree) {
+  HInvokeDynamicSetter(selector, element, inputs, isSideEffectFree)
+    : super(selector, element, inputs, isSideEffectFree) {
     clearAllSideEffects();
     if (isSideEffectFree) {
       setChangesInstanceProperty();
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
index 65a82ca..b5f72b9 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
@@ -314,7 +314,8 @@
         return result;
       }
     } else if (selector.isGetter()) {
-      if (selector.applies(backend.jsArrayLength, compiler)) {
+      if (selector.applies(backend.jsArrayLength, compiler)
+          || selector.applies(backend.jsStringLength, compiler)) {
         HInstruction optimized = tryOptimizeLengthInterceptedGetter(node);
         if (optimized != null) return optimized;
       }
@@ -333,7 +334,11 @@
     Selector selector = receiverType.refine(node.selector, compiler);
     Element element = compiler.world.locateSingleElement(selector);
     // TODO(ngeoffray): Also fold if it's a getter or variable.
-    if (element != null && element.isFunction()) {
+    if (element != null
+        && element.isFunction()
+        // If we found out that the only target is a [:noSuchMethod:],
+        // we just ignore it.
+        && element.name == selector.name) {
       FunctionElement method = element;
 
       if (method.isNative()) {
@@ -380,7 +385,7 @@
     // preserve the number of arguments, so check only the actual arguments.
 
     List<HInstruction> inputs = node.inputs.sublist(1);
-    int inputPosition = 0;
+    int inputPosition = 1;  // Skip receiver.
     bool canInline = true;
     signature.forEachParameter((Element element) {
       if (inputPosition < inputs.length && canInline) {
@@ -878,13 +883,17 @@
     // they have side effects.
     if (selector.isGetter()) {
       HInstruction res = new HInvokeDynamicGetter(
-          selector, node.element, constant, false);
-      res.inputs.add(node.inputs[1]);
+          selector,
+          node.element,
+          <HInstruction>[constant, node.inputs[1]],
+          false);
       return res;
     } else if (node.selector.isSetter()) {
       HInstruction res = new HInvokeDynamicSetter(
-          selector, node.element, constant, node.inputs[1], false);
-      res.inputs.add(node.inputs[2]);
+          selector,
+          node.element,
+          <HInstruction>[constant, node.inputs[1], node.inputs[2]],
+          false);
       return res;
     } else {
       List<HInstruction> inputs = new List<HInstruction>.from(node.inputs);
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/variable_allocator.dart b/sdk/lib/_internal/compiler/implementation/ssa/variable_allocator.dart
index 5fe4cb1..7ae36cb 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/variable_allocator.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/variable_allocator.dart
@@ -30,6 +30,12 @@
   final List<LiveRange> ranges;
   LiveInterval() : ranges = <LiveRange>[];
 
+  // We want [HCheck] instructions to have the same name as the
+  // instruction it checks, so both instructions should share the same
+  // live ranges.
+  LiveInterval.forCheck(this.start, LiveInterval checkedInterval)
+      : ranges = checkedInterval.ranges;
+
   /**
    * Update all ranges that are contained in [from, to[ to
    * die at [to].
@@ -114,24 +120,13 @@
    * range: [id, / id contained in [liveInstructions] /].
    */
   void remove(HInstruction instruction, int id) {
-    // Special case the HCheck instruction to have the same live
-    // interval as the instruction it is checking.
-    if (instruction is HCheck) {
-      var input = instruction.checkedInput;
-      while (input is HCheck) input = input.checkedInput;
-      liveIntervals.putIfAbsent(input, () => new LiveInterval());
-      // Unconditionally force the live interval of the HCheck to
-      // be the live interval of the instruction it is checking.
-      liveIntervals[instruction] = liveIntervals[input];
-    } else {
-      LiveInterval range = liveIntervals.putIfAbsent(
-          instruction, () => new LiveInterval());
-      int lastId = liveInstructions[instruction];
-      // If [lastId] is null, then this instruction is not being used.
-      range.add(new LiveRange(id, lastId == null ? id : lastId));
-      // The instruction is defined at [id].
-      range.start = id;
-    }
+    LiveInterval interval = liveIntervals.putIfAbsent(
+        instruction, () => new LiveInterval());
+    int lastId = liveInstructions[instruction];
+    // If [lastId] is null, then this instruction is not being used.
+    interval.add(new LiveRange(id, lastId == null ? id : lastId));
+    // The instruction is defined at [id].
+    interval.start = id;
     liveInstructions.remove(instruction);
   }
 
@@ -143,13 +138,6 @@
     // Note that we are visiting the graph in post-dominator order, so
     // the first time we see a variable is when it dies.
     liveInstructions.putIfAbsent(instruction, () => userId);
-    if (instruction is HCheck) {
-      // Special case the HCheck instruction to mark the actual
-      // checked instruction live.
-      var input = instruction.checkedInput;
-      while (input is HCheck) input = input.checkedInput;
-      liveInstructions.putIfAbsent(input, () => userId);
-    }
   }
 
   /**
@@ -234,13 +222,47 @@
     }
   }
 
+  HInstruction unwrap(instruction) {
+    do {
+      instruction = instruction.checkedInput;
+    } while (instruction is HCheck);
+    return instruction;
+  }
+
   void markAsLiveInEnvironment(HInstruction instruction,
                                LiveEnvironment environment) {
-    if (environment.contains(instruction)) return;
-    environment.add(instruction, instructionId);
-    // HPhis are treated specially.
+    // The inputs of a [HPhi] are being handled at the entry of a
+    // block.
     if (generateAtUseSite.contains(instruction) && instruction is !HPhi) {
       markInputsAsLiveInEnvironment(instruction, environment);
+    } else {
+      environment.add(instruction, instructionId);
+      // Special case the HCheck instruction to mark the actual
+      // checked instruction live. The checked instruction and the
+      // [HCheck] will share the same live ranges.
+      if (instruction is HCheck) {
+        HInstruction checked = unwrap(instruction);
+        if (!generateAtUseSite.contains(checked)) {
+          environment.add(checked, instructionId);
+        }
+      }
+    }
+  }
+
+  void removeFromEnvironment(HInstruction instruction,
+                             LiveEnvironment environment) {
+    environment.remove(instruction, instructionId);
+    // Special case the HCheck instruction to have the same live
+    // interval as the instruction it is checking.
+    if (instruction is HCheck) {
+      HInstruction checked = unwrap(instruction);
+      if (!generateAtUseSite.contains(checked)) {
+        liveIntervals.putIfAbsent(checked, () => new LiveInterval());
+        // Unconditionally force the live ranges of the HCheck to
+        // be the live ranges of the instruction it is checking.
+        liveIntervals[instruction] =
+            new LiveInterval.forCheck(instructionId, liveIntervals[checked]);
+      }
     }
   }
 
@@ -269,10 +291,12 @@
     // environment and add its inputs.
     HInstruction instruction = block.last;
     while (instruction != null) {
-      environment.remove(instruction, instructionId);
-      markInputsAsLiveInEnvironment(instruction, environment);
-      instruction = instruction.previous;
+      if (!generateAtUseSite.contains(instruction)) {
+        removeFromEnvironment(instruction, environment);
+        markInputsAsLiveInEnvironment(instruction, environment);
+      }
       instructionId--;
+      instruction = instruction.previous;
     }
 
     // We just remove the phis from the environment. The inputs of the
@@ -599,7 +623,7 @@
 
   /**
    * Returns whether [instruction] needs a name. Instructions that
-   * have no users or that are generated at use site does not need a name.
+   * have no users or that are generated at use site do not need a name.
    */
   bool needsName(HInstruction instruction) {
     if (instruction is HThis) return false;
@@ -607,7 +631,7 @@
     if (instruction.usedBy.isEmpty) return false;
     if (generateAtUseSite.contains(instruction)) return false;
     // A [HCheck] instruction that has control flow needs a name only if its
-    // checked input needs a name (e.g. a check [HConstant] does not
+    // checked input needs a name (for example, a checked [HConstant] does not
     // need a name).
     if (instruction is HCheck && instruction.isControlFlow()) {
       HCheck check = instruction;
@@ -629,15 +653,6 @@
   void freeUsedNamesAt(HInstruction instruction,
                        HInstruction at,
                        VariableNamer namer) {
-    // TODO(ager): We cannot perform this check to free names for
-    // HCheck instructions because they are special cased to have the
-    // same live intervals as the instruction they are checking. This
-    // includes sharing the start id with the checked
-    // input. Therefore, for HCheck(checkedInput, otherInput) we would
-    // end up checking that otherInput dies not here, but at the
-    // location of checkedInput. We should preserve the start id for
-    // the check instruction.
-    if (at is HCheck) return;
     if (needsName(instruction)) {
       if (diesAt(instruction, at)) {
         namer.freeName(instruction);
@@ -653,6 +668,11 @@
   }
 
   void handleInstruction(HInstruction instruction, VariableNamer namer) {
+    if (generateAtUseSite.contains(instruction)) {
+      assert(!liveIntervals.containsKey(instruction));
+      return;
+    }
+
     for (int i = 0, len = instruction.inputs.length; i < len; i++) {
       HInstruction input = instruction.inputs[i];
       freeUsedNamesAt(input, instruction, namer);
diff --git a/sdk/lib/_internal/compiler/implementation/tree/unparser.dart b/sdk/lib/_internal/compiler/implementation/tree/unparser.dart
index 46eb2bf..1e1b944 100644
--- a/sdk/lib/_internal/compiler/implementation/tree/unparser.dart
+++ b/sdk/lib/_internal/compiler/implementation/tree/unparser.dart
@@ -48,7 +48,7 @@
     visit(node.expression);
   }
 
-  unparseClassWithBody(ClassNode node, Iterable<Node> members) {
+  unparseClassWithBody(ClassNode node, members) {
     addToken(node.beginToken);
     if (node.beginToken.stringValue == 'abstract') {
       addToken(node.beginToken.next);
diff --git a/sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart b/sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart
index 6c923c0..0891574 100644
--- a/sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart
+++ b/sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart
@@ -4,7 +4,7 @@
 
 library simple_types_inferrer;
 
-import 'dart:collection' show Queue;
+import 'dart:collection' show Queue, LinkedHashSet;
 
 import '../closure.dart' show ClosureClassMap, ClosureScope;
 import '../dart_types.dart' show DartType, FunctionType, TypeKind;
@@ -118,7 +118,61 @@
   String toString() => '$name sentinel type mask';
 }
 
+final OPTIMISTIC = 0;
+final RETRY = 1;
+final PESSIMISTIC = 2;
+
 class SimpleTypesInferrer extends TypesInferrer {
+  InternalSimpleTypesInferrer internal;
+  Compiler compiler;
+
+  SimpleTypesInferrer(Compiler compiler) :
+      compiler = compiler,
+      internal = new InternalSimpleTypesInferrer(compiler, OPTIMISTIC);
+
+  TypeMask get dynamicType => internal.dynamicType;
+  TypeMask get nullType => internal.nullType;
+  TypeMask get intType => internal.intType;
+  TypeMask get doubleType => internal.doubleType;
+  TypeMask get numType => internal.numType;
+  TypeMask get boolType => internal.boolType;
+  TypeMask get functionType => internal.functionType;
+  TypeMask get listType => internal.listType;
+  TypeMask get constListType => internal.constListType;
+  TypeMask get fixedListType => internal.fixedListType;
+  TypeMask get growableListType => internal.growableListType;
+  TypeMask get mapType => internal.mapType;
+  TypeMask get constMapType => internal.constMapType;
+  TypeMask get stringType => internal.stringType;
+  TypeMask get typeType => internal.typeType;
+
+  TypeMask getReturnTypeOfElement(Element element) {
+    return internal.getReturnTypeOfElement(element);
+  }
+  TypeMask getTypeOfElement(Element element) {
+    return internal.getTypeOfElement(element);
+  }
+  TypeMask getTypeOfNode(Element owner, Node node) {
+    return internal.getTypeOfNode(owner, node);
+  }
+  TypeMask getTypeOfSelector(Selector selector) {
+    return internal.getTypeOfSelector(selector);
+  }
+
+  bool analyzeMain(Element element) {
+    bool result = internal.analyzeMain(element);
+    if (internal.optimismState == OPTIMISTIC) return result;
+    assert(internal.optimismState == RETRY);
+
+    // Discard the inferrer and start again with a pessimistic one.
+    internal = new InternalSimpleTypesInferrer(compiler, PESSIMISTIC);
+    return internal.analyzeMain(element);
+  }
+}
+
+
+
+class InternalSimpleTypesInferrer extends TypesInferrer {
   /**
    * Maps an element to its callers.
    */
@@ -201,6 +255,8 @@
    */
   final int MAX_ANALYSIS_COUNT_PER_ELEMENT = 5;
 
+  int optimismState;
+
   /**
    * Sentinel used by the inferrer to notify that it does not know
    * the type of a specific element.
@@ -223,6 +279,30 @@
   TypeMask stringType;
   TypeMask typeType;
 
+  /**
+   * These are methods that are expected to return only bool.  We optimistically
+   * assume that they do this.  If we later find a contradiction, we have to
+   * restart the simple types inferrer, because it normally goes from less
+   * optimistic to more optimistic as it refines its type information.  Without
+   * this optimization, method names that are mutually recursive in the tail
+   * position will be typed as dynamic.
+   */
+  // TODO(erikcorry): Autogenerate the alphanumeric names in this set.
+  Set<SourceString> PREDICATES = new Set<SourceString>.from([
+      const SourceString('=='),
+      const SourceString('<='),
+      const SourceString('>='),
+      const SourceString('>'),
+      const SourceString('<'),
+      const SourceString('moveNext')]);
+
+  bool shouldOptimisticallyOptimizeToBool(Element element) {
+    return element == compiler.identicalFunction.implementation
+        || (element.isFunction()
+            && element.isInstanceMember()
+            && PREDICATES.contains(element.name));
+  }
+
   final Compiler compiler;
 
   // Times the computation of re-analysis of methods.
@@ -241,11 +321,11 @@
    */
   int numberOfElementsToAnalyze;
 
-  SimpleTypesInferrer(this.compiler);
+  InternalSimpleTypesInferrer(this.compiler, this.optimismState);
 
   /**
-   * Main entry point of the inferrer. Analyzes all elements that the
-   * resolver found as reachable. Returns whether it succeeded.
+   * Main entry point of the inferrer.  Analyzes all elements that the resolver
+   * found as reachable. Returns whether it succeeded.
    */
   bool analyzeMain(Element element) {
     initializeTypes();
@@ -267,15 +347,17 @@
       }
       bool changed =
           compiler.withCurrentElement(element, () => analyze(element));
+      if (optimismState == RETRY) return true;  // Abort.
       analyzed++;
       if (wasAnalyzed) {
         recomputeWatch.stop();
       }
       checkAnalyzedAll();
-      if (!changed) continue;
-      // If something changed during the analysis of [element],
-      // put back callers of it in the work list.
-      enqueueCallersOf(element);
+      if (changed) {
+        // If something changed during the analysis of [element], put back
+        // callers of it in the work list.
+        enqueueCallersOf(element);
+      }
     } while (!workSet.isEmpty);
     dump();
     clear();
@@ -365,11 +447,24 @@
         // mapping.
         if (mapping == null) return;
         if (element.isAbstract(compiler)) return;
-        int length = mapping.selectors.length;
-        max = length > max ? length : max;
-        Set<Element> set = methodSizes.putIfAbsent(
-            length, () => new Set<Element>());
-        set.add(element);
+        // Add the relational operators, ==, !=, <, etc., before any
+        // others, as well as the identical function.
+        if (shouldOptimisticallyOptimizeToBool(element)) {
+          workSet.add(element);
+          // Optimistically assume that they return bool.  We may need to back
+          // out of this.
+          if (optimismState == OPTIMISTIC) {
+            returnTypeOf[element.implementation] = boolType;
+          }
+        } else {
+          // Put the other operators in buckets by length, later to be added in
+          // length order.
+          int length = mapping.selectors.length;
+          max = length > max ? length : max;
+          Set<Element> set = methodSizes.putIfAbsent(
+              length, () => new LinkedHashSet<Element>());
+          set.add(element);
+        }
     });
 
     // This iteration assumes the [WorkSet] is FIFO.
@@ -483,7 +578,7 @@
     }
     if (element.isGenerativeConstructor()) {
       // We always know the return type of a generative constructor.
-      return false;
+      return false;  // Nothing changed.
     } else if (element.isField()) {
       Node node = element.parseNode(compiler);
       if (element.modifiers.isFinal() || element.modifiers.isConst()) {
@@ -497,11 +592,11 @@
         // Only update types of static fields if there is no
         // assignment. Instance fields are dealt with in the constructor.
         if (Elements.isStaticOrTopLevelField(element)) {
-          recordNonFinalFieldElementType(node, element, returnType);
+          recordNonFinalFieldElementType(node, element, returnType, null);
         }
         return false;
       } else {
-        recordNonFinalFieldElementType(node, element, returnType);
+        recordNonFinalFieldElementType(node, element, returnType, null);
         // [recordNonFinalFieldElementType] takes care of re-enqueuing
         // users of the field.
         return false;
@@ -522,6 +617,14 @@
    * [analyzedElement].
    */
   bool recordReturnType(Element analyzedElement, TypeMask returnType) {
+    assert(analyzedElement.implementation == analyzedElement);
+    if (optimismState == OPTIMISTIC
+        && shouldOptimisticallyOptimizeToBool(analyzedElement)
+        && returnType != returnTypeOf[analyzedElement]) {
+      // One of the functions turned out not to return what we expected.
+      // This means we need to restart the analysis.
+      optimismState = RETRY;
+    }
     return internalRecordType(analyzedElement, returnType, returnTypeOf);
   }
 
@@ -622,7 +725,12 @@
   }
 
   TypeMask typeOfElementWithSelector(Element element, Selector selector) {
-    if (selector.isGetter()) {
+    if (element.name == Compiler.NO_SUCH_METHOD
+        && selector.name != element.name) {
+      // An invocation can resolve to a [noSuchMethod], in which case
+      // we get the return type of [noSuchMethod].
+      return returnTypeOfElement(element);
+    } else if (selector.isGetter()) {
       if (element.isFunction()) {
         // [functionType] is null if the inferrer did not run.
         return functionType == null ? dynamicType : functionType;
@@ -663,13 +771,15 @@
 
   /**
    * Registers that [caller] calls [callee] with the given
-   * [arguments].
+   * [arguments]. [constraint] is a setter constraint (see
+   * [setterConstraints] documentation).
    */
-  void registerCalledElement(Send send,
+  void registerCalledElement(Node node,
                              Selector selector,
                              Element caller,
                              Element callee,
                              ArgumentsTypes arguments,
+                             Selector constraint,
                              bool inLoop) {
     if (inLoop) {
       // For instance methods, we only register a selector called in a
@@ -691,7 +801,8 @@
     }
 
     if (selector.isSetter() && callee.isField()) {
-      recordNonFinalFieldElementType(send, callee, arguments.positional[0]);
+      recordNonFinalFieldElementType(
+          node, callee, arguments.positional[0], constraint);
       return;
     } else if (selector.isGetter()) {
       assert(arguments == null);
@@ -710,7 +821,7 @@
     if (function.computeSignature(compiler).parameterCount == 0) return;
 
     assert(arguments != null);
-    bool isUseful = addArguments(send, callee, arguments);
+    bool isUseful = addArguments(node, callee, arguments);
     if (hasAnalyzedAll && isUseful) {
       updateArgumentsType(callee);
     }
@@ -745,6 +856,10 @@
   void updateArgumentsType(FunctionElement element) {
     assert(hasAnalyzedAll);
     if (methodsThatCanBeClosurized.contains(element)) return;
+    // A [noSuchMethod] method can be the target of any call, with
+    // any number of arguments. For simplicity, we just do not
+    // infer any parameter types for [noSuchMethod].
+    if (element.name == Compiler.NO_SUCH_METHOD) return;
     FunctionSignature signature = element.computeSignature(compiler);
 
     if (typeOfArguments[element].isEmpty) {
@@ -791,28 +906,25 @@
    * Registers that [caller] calls an element matching [selector]
    * with the given [arguments].
    */
-  TypeMask registerCalledSelector(Send send,
+  TypeMask registerCalledSelector(Node node,
                                   Selector selector,
                                   TypeMask receiverType,
                                   Element caller,
                                   ArgumentsTypes arguments,
+                                  Selector constraint,
                                   bool inLoop) {
-    assert(isNotClosure(caller));
-    Selector typedSelector = isDynamicType(receiverType)
-        ? selector
-        : new TypedSelector(receiverType, selector);
-
     TypeMask result;
-    iterateOverElements(typedSelector, (Element element) {
+    iterateOverElements(selector, (Element element) {
       assert(element.isImplementation);
       // TODO(ngeoffray): Enable unregistering by having a
       // [: TypeMask.appliesTo(element) :] method, that will return
       // whether [: element :] is a potential target for the type.
       if (true) {
         registerCalledElement(
-            send, typedSelector, caller, element, arguments, inLoop);
+            node, selector, caller, element, arguments,
+            constraint, inLoop);
       } else {
-        unregisterCalledElement(send, selector, caller, element);
+        unregisterCalledElement(node, selector.asUntyped, caller, element);
       }
       if (!selector.isSetter()) {
         TypeMask type = typeOfElementWithSelector(element, selector);
@@ -844,17 +956,20 @@
    */
   void recordNonFinalFieldElementType(Node node,
                                       Element element,
-                                      TypeMask argumentType) {
+                                      TypeMask argumentType,
+                                      Selector constraint) {
     Map<Node, TypeMask> map =
         typeOfFields.putIfAbsent(element, () => new Map<Node, TypeMask>());
     map[node] = argumentType;
+    bool changed = typeOf[element] != argumentType;
+    if (constraint != null && constraint != setterConstraints[node]) {
+      changed = true;
+      setterConstraints[node] = constraint;
+    }
     // If we have analyzed all elements, we can update the type of the
     // field right away.
-    if (hasAnalyzedAll) {
-      // Only update if the new type provides value.
-      if (typeOf[element] != argumentType) {
-        updateNonFinalFieldType(element);
-      }
+    if (hasAnalyzedAll && changed) {
+      updateNonFinalFieldType(element);
     }
   }
 
@@ -922,8 +1037,14 @@
    * Records in [classInfoForFinalFields] that [constructor] has
    * inferred [type] for the final [field].
    */
-  void recordFinalFieldType(
-      Node node, Element constructor, Element field, TypeMask type) {
+  void recordFinalFieldType(Node node,
+                            Element constructor,
+                            Element field,
+                            TypeMask type,
+                            Selector constraint) {
+    if (constraint != null) {
+      setterConstraints[node] = constraint;
+    }
     // If the field is being set at its declaration site, it is not
     // being tracked in the [classInfoForFinalFields] map.
     if (constructor == field) return;
@@ -982,10 +1103,6 @@
       return union.containsAll(compiler) ? dynamicType : union;
     }
   }
-
-  void recordSetterConstraint(Node node, Selector selector) {
-    setterConstraints[node] = selector;
-  }
 }
 
 /**
@@ -1015,7 +1132,7 @@
  * Placeholder for inferred types of local variables.
  */
 class LocalsHandler {
-  final SimpleTypesInferrer inferrer;
+  final InternalSimpleTypesInferrer inferrer;
   final Map<Element, TypeMask> locals;
   final Set<Element> capturedAndBoxed;
   final Map<Element, TypeMask> fieldsInitializedInConstructor;
@@ -1141,7 +1258,7 @@
 class SimpleTypeInferrerVisitor extends ResolvedVisitor<TypeMask> {
   final Element analyzedElement;
   final Element outermostElement;
-  final SimpleTypesInferrer inferrer;
+  final InternalSimpleTypesInferrer inferrer;
   final Compiler compiler;
   LocalsHandler locals;
   TypeMask returnType;
@@ -1164,7 +1281,7 @@
 
   factory SimpleTypeInferrerVisitor(Element element,
                                     Compiler compiler,
-                                    SimpleTypesInferrer inferrer,
+                                    InternalSimpleTypesInferrer inferrer,
                                     [LocalsHandler handler]) {
     Element outermostElement =
         element.getOutermostEnclosingMemberOrTopLevel().implementation;
@@ -1228,13 +1345,15 @@
                 node,
                 analyzedElement,
                 element.fieldElement,
-                parameterType);
+                parameterType,
+                null);
           } else {
             locals.updateField(element.fieldElement, parameterType);
             inferrer.recordNonFinalFieldElementType(
                 element.parseNode(compiler),
                 element.fieldElement,
-                parameterType);
+                parameterType,
+                null);
           }
         } else {
           locals.update(element, parameterType);
@@ -1253,7 +1372,7 @@
           TypeMask type = locals.fieldsInitializedInConstructor[field];
           if (type == null && field.parseNode(compiler).asSendSet() == null) {
             inferrer.recordNonFinalFieldElementType(
-                node, field, inferrer.nullType);
+                node, field, inferrer.nullType, null);
           }
         });
       }
@@ -1433,7 +1552,8 @@
           // actually had a chance to initialize it, say it can be
           // null.
           inferrer.recordNonFinalFieldElementType(
-              analyzedElement.parseNode(compiler), element, inferrer.nullType);
+              analyzedElement.parseNode(compiler), element,
+              inferrer.nullType, null);
         }
         // Accessing a field does not expose [:this:].
         return true;
@@ -1532,12 +1652,16 @@
         }
       }
     } else if (op == '=') {
-      // [: foo = 42 :] or [: foo.bar = 42 :].
       return handlePlainAssignment(
           node, element, setterSelector, receiverType, rhsType,
           node.arguments.head);
     } else {
       // [: foo++ :] or [: foo += 1 :].
+      Selector constraint;
+      if (!Elements.isLocal(element)) {
+        // Record a constraint of the form [: field++ :], or [: field += 42 :].
+        constraint = operatorSelector;
+      }
       TypeMask getterType;
       TypeMask newType;
       ArgumentsTypes operatorArguments = new ArgumentsTypes([rhsType], null);
@@ -1560,7 +1684,8 @@
         newType = handleDynamicSend(
             node, operatorSelector, getterType, operatorArguments);
         handleDynamicSend(node, setterSelector, receiverType,
-                          new ArgumentsTypes([newType], null));
+                          new ArgumentsTypes([newType], null),
+                          constraint);
       } else if (Elements.isLocal(element)) {
         getterType = locals.use(element);
         newType = handleDynamicSend(
@@ -1573,11 +1698,6 @@
             node, operatorSelector, getterType, operatorArguments);
       }
 
-      if (!Elements.isLocal(element)) {
-        // Record a constraint of the form [: field++ :], or [: field += 42 :].
-        inferrer.recordSetterConstraint(node, operatorSelector);
-      }
-
       if (node.isPostfix) {
         return getterType;
       } else {
@@ -1586,34 +1706,14 @@
     }
   }
 
-  TypeMask handlePlainAssignment(Send node,
+  TypeMask handlePlainAssignment(Node node,
                                  Element element,
                                  Selector setterSelector,
                                  TypeMask receiverType,
                                  TypeMask rhsType,
                                  Node rhs) {
-    ArgumentsTypes arguments = new ArgumentsTypes([rhsType], null);
-    if (Elements.isStaticOrTopLevelField(element)) {
-      handleStaticSend(node, setterSelector, element, arguments);
-    } else if (Elements.isUnresolved(element) || element.isSetter()) {
-      handleDynamicSend(node, setterSelector, receiverType, arguments);
-    } else if (element.isField()) {
-      if (element.modifiers.isFinal()) {
-        inferrer.recordFinalFieldType(
-            node, outermostElement, element, rhsType);
-      } else {
-        locals.updateField(element, rhsType);
-        if (visitingInitializers) {
-          inferrer.recordNonFinalFieldElementType(node, element, rhsType);
-        } else {
-          handleDynamicSend(node, setterSelector, receiverType, arguments);
-        }
-      }
-    } else if (Elements.isLocal(element)) {
-      locals.update(element, rhsType);
-    }
-
-    if (!Elements.isLocal(element)) {
+    Selector constraint;
+    if (node.asSend() != null && !Elements.isLocal(element)) {
       // Recognize a constraint of the form [: field = other.field :].
       // Note that we check if the right hand side is a local to
       // recognize the situation [: var a = 42; this.a = a; :]. Our
@@ -1624,14 +1724,33 @@
           && send.isPropertyAccess
           && !Elements.isLocal(elements[rhs])
           && send.selector.asIdentifier().source
-               == node.selector.asIdentifier().source) {
-        // TODO(ngeoffray): We should update selectors in the
-        // element tree and find out if the typed selector still
-        // applies to the receiver type.
-        Selector constraint = elements.getSelector(rhs);
-        inferrer.recordSetterConstraint(node, constraint);
+               == node.asSend().selector.asIdentifier().source) {
+        constraint = elements.getSelector(rhs);
       }
     }
+    ArgumentsTypes arguments = new ArgumentsTypes([rhsType], null);
+    if (Elements.isStaticOrTopLevelField(element)) {
+      handleStaticSend(node, setterSelector, element, arguments);
+    } else if (Elements.isUnresolved(element) || element.isSetter()) {
+      handleDynamicSend(
+          node, setterSelector, receiverType, arguments, constraint);
+    } else if (element.isField()) {
+      if (element.modifiers.isFinal()) {
+        inferrer.recordFinalFieldType(
+            node, outermostElement, element, rhsType, constraint);
+      } else {
+        locals.updateField(element, rhsType);
+        if (visitingInitializers) {
+          inferrer.recordNonFinalFieldElementType(
+              node, element, rhsType, constraint);
+        } else {
+          handleDynamicSend(
+              node, setterSelector, receiverType, arguments, constraint);
+        }
+      }
+    } else if (Elements.isLocal(element)) {
+      locals.update(element, rhsType);
+    }
     return rhsType;
   }
 
@@ -1858,15 +1977,39 @@
                         ArgumentsTypes arguments) {
     if (Elements.isUnresolved(element)) return;
     inferrer.registerCalledElement(
-        node, selector, outermostElement, element, arguments, inLoop);
+        node, selector, outermostElement, element, arguments, null, inLoop);
+  }
+
+  void updateSelectorInTree(Node node, Selector selector) {
+    if (node.asSendSet() != null) {
+      if (selector.isSetter() || selector.isIndexSet()) {
+        elements.setSelector(node, selector);
+      } else if (selector.isGetter() || selector.isIndex()) {
+        elements.setGetterSelectorInComplexSendSet(node, selector);
+      } else {
+        assert(selector.isOperator());
+        elements.setOperatorSelectorInComplexSendSet(node, selector);
+      }
+    } else {
+      assert(node.asSend() != null);
+      elements.setSelector(node, selector);
+    }
   }
 
   TypeMask handleDynamicSend(Node node,
                              Selector selector,
                              TypeMask receiver,
-                             ArgumentsTypes arguments) {
+                             ArgumentsTypes arguments,
+                             [Selector constraint]) {
+    if (selector.mask != receiver) {
+      selector = inferrer.isDynamicType(receiver)
+          ? selector.asUntyped
+          : new TypedSelector(receiver, selector);
+      updateSelectorInTree(node, selector);
+    }
     return inferrer.registerCalledSelector(
-        node, selector, receiver, outermostElement, arguments, inLoop);
+        node, selector, receiver, outermostElement, arguments,
+        constraint, inLoop);
   }
 
   TypeMask visitDynamicSend(Send node) {
@@ -2028,15 +2171,12 @@
       checkIfExposesThis(
           new TypedSelector(iteratorType, compiler.currentSelector));
     }
-    Element variable = elements[node.declaredIdentifier];
-    Selector selector = elements.getSelector(node.declaredIdentifier);
-    if (!Elements.isUnresolved(variable)) {
-      locals.update(variable, inferrer.dynamicType);
-    } else {
-      handlePlainAssignment(new Send(), variable, selector,
-                            inferrer.dynamicType, inferrer.dynamicType,
-                            node.expression);
-    }
+    Node identifier = node.declaredIdentifier;
+    Element variable = elements[identifier];
+    Selector selector = elements.getSelector(identifier);
+    handlePlainAssignment(identifier, variable, selector,
+                          inferrer.dynamicType, inferrer.dynamicType,
+                          node.expression);
     loopLevel++;
     do {
       LocalsHandler saved = new LocalsHandler.from(locals);
diff --git a/sdk/lib/_internal/compiler/implementation/types/type_mask.dart b/sdk/lib/_internal/compiler/implementation/types/type_mask.dart
index 7af109b..68676f1 100644
--- a/sdk/lib/_internal/compiler/implementation/types/type_mask.dart
+++ b/sdk/lib/_internal/compiler/implementation/types/type_mask.dart
@@ -362,6 +362,127 @@
     }
   }
 
+  /**
+   * Returns whether [element] will be the one used at runtime when being
+   * invoked on an instance of [cls]. [selector] is used to ensure library
+   * privacy is taken into account.
+   */
+  static bool hasElementIn(ClassElement cls,
+                           Selector selector,
+                           Element element) {
+    // Use [:implementation:] of [element]
+    // because our function set only stores declarations.
+    Element result = findMatchIn(cls, selector);
+    return result == null
+        ? false
+        : result.implementation == element.implementation;
+  }
+
+  static Element findMatchIn(ClassElement cls, Selector selector) {
+    // Use the [:implementation] of [cls] in case the found [element]
+    // is in the patch class.
+    return cls.implementation.lookupSelector(selector);
+  }
+
+  /**
+   * Returns whether [element] is a potential target when being
+   * invoked on this type mask. [selector] is used to ensure library
+   * privacy is taken into account.
+   */
+  bool canHit(Element element, Selector selector, Compiler compiler) {
+    if (isEmpty) {
+      if (!isNullable) return false;
+      return hasElementIn(
+          compiler.backend.nullImplementation, selector, element);
+    }
+
+    // TODO(kasperl): Can't we just avoid creating typed selectors
+    // based of function types?
+    Element self = base.element;
+    if (self.isTypedef()) {
+      // A typedef is a function type that doesn't have any
+      // user-defined members.
+      return false;
+    }
+
+    ClassElement other = element.getEnclosingClass();
+    if (compiler.backend.isNullImplementation(other)) {
+      return isNullable;
+    } else if (isExact) {
+      return hasElementIn(self, selector, element);
+    } else if (isSubclass) {
+      return hasElementIn(self, selector, element)
+          || other.isSubclassOf(self)
+          || compiler.world.hasAnySubclassThatMixes(self, other);
+    } else {
+      assert(isSubtype);
+      if (other.implementsInterface(self)
+          || other.isSubclassOf(self)
+          || compiler.world.hasAnySubclassThatMixes(self, other)
+          || compiler.world.hasAnySubclassThatImplements(other, base)) {
+        return true;
+      }
+
+      // If [self] is a subclass of [other], it inherits the
+      // implementation of [element].
+      ClassElement cls = self;
+      if (cls.isSubclassOf(other)) {
+        // Resolve an invocation of [element.name] on [self]. If it
+        // is found, this selector is a candidate.
+        return hasElementIn(cls, selector, element);
+      }
+    }
+    return false;
+  }
+
+  /**
+   * Returns whether a [selector] call on an instance of [cls]
+   * will hit a method at runtime, and not go through [noSuchMethod].
+   */
+  static bool hasConcreteMatch(ClassElement cls,
+                               Selector selector,
+                               Compiler compiler) {
+    Element element = findMatchIn(cls, selector);
+    return element != null
+        && !element.isAbstract(compiler)
+        && selector.appliesUntyped(element, compiler);
+  }
+
+  /**
+   * Returns whether a [selector] call will hit a method at runtime,
+   * and not go through [noSuchMethod].
+   */
+  bool willHit(Selector selector, Compiler compiler) {
+    Element cls;
+    if (isEmpty) {
+      if (!isNullable) return false;
+      cls = compiler.backend.nullImplementation;
+    } else {
+      cls = base.element;
+    }
+
+    if (!cls.isAbstract(compiler)) {
+      return hasConcreteMatch(cls, selector, compiler);
+    }
+
+    Set<ClassElement> subtypesToCheck;
+    if (isExact) {
+      return false;
+    } else if (isSubtype) {
+      subtypesToCheck = compiler.world.subtypes[cls];
+    } else {
+      assert(isSubclass);
+      subtypesToCheck = compiler.world.subclasses[cls];
+    }
+
+    return subtypesToCheck != null
+        && subtypesToCheck.every((ClassElement cls) {
+              return cls.isAbstract(compiler)
+                ? true
+                : hasConcreteMatch(cls, selector, compiler);
+           });
+  }
+
   bool operator ==(var other) {
     if (other is !TypeMask) return false;
     TypeMask otherMask = other;
diff --git a/sdk/lib/_internal/compiler/implementation/types/types.dart b/sdk/lib/_internal/compiler/implementation/types/types.dart
index 35965c0..b350519 100644
--- a/sdk/lib/_internal/compiler/implementation/types/types.dart
+++ b/sdk/lib/_internal/compiler/implementation/types/types.dart
@@ -34,27 +34,135 @@
  * The types task infers guaranteed types globally.
  */
 class TypesTask extends CompilerTask {
+  static final bool DUMP_SURPRISING_RESULTS = false;
+
   final String name = 'Type inference';
   TypesInferrer typesInferrer;
+  TypesInferrer concreteTypesInferrer;
 
-  TypesTask(Compiler compiler)
-    : typesInferrer = compiler.enableConcreteTypeInference
-          ? new ConcreteTypesInferrer(compiler)
-          : new SimpleTypesInferrer(compiler),
-      super(compiler);
+  TypesTask(Compiler compiler) : super(compiler) {
+    typesInferrer = new SimpleTypesInferrer(compiler);
+    if (compiler.enableConcreteTypeInference) {
+      concreteTypesInferrer = new ConcreteTypesInferrer(compiler);
+    }
+  }
+
+  /// Replaces native types by their backend implementation.
+  Element normalize(Element cls) {
+    if (cls == compiler.boolClass) {
+      return compiler.backend.boolImplementation;
+    }
+    if (cls == compiler.intClass) {
+      return compiler.backend.intImplementation;
+    }
+    if (cls == compiler.doubleClass) {
+      return compiler.backend.doubleImplementation;
+    }
+    if (cls == compiler.numClass) {
+      return compiler.backend.numImplementation;
+    }
+    if (cls == compiler.stringClass) {
+      return compiler.backend.stringImplementation;
+    }
+    if (cls == compiler.listClass) {
+      return compiler.backend.listImplementation;
+    }
+    return cls;
+  }
+
+  /// Checks that two [DartType]s are the same modulo normalization.
+  bool same(DartType type1, DartType type2) {
+    return (type1 == type2)
+        || normalize(type1.element) == normalize(type2.element);
+  }
+
+  /**
+   * Checks that one of [type1] and [type2] is a subtype of the other.
+   */
+  bool related(DartType type1, DartType type2) {
+    return compiler.types.isSubtype(type1, type2)
+        || compiler.types.isSubtype(type2, type1);
+  }
+
+  /**
+   * Return the more precise of both types, giving precedence in that order to
+   * exactness, subclassing, subtyping and nullability. The [element] parameter
+   * is for debugging purposes only and can be omitted.
+   */
+  TypeMask best(TypeMask type1, TypeMask type2, [element]) {
+    final result = _best(type1, type2);
+    similar() {
+      if (type1 == null) return type2 == null;
+      if (type2 == null) return false;
+      return same(type1.base, type2.base);
+    }
+    if (DUMP_SURPRISING_RESULTS && result == type1 && !similar()) {
+      print("$type1 better than $type2 for $element");
+    }
+    return result;
+  }
+
+  /// Helper method for [best].
+  TypeMask _best(TypeMask type1, TypeMask type2) {
+    if (type1 == null) return type2;
+    if (type2 == null) return type1;
+    if (type1.isExact) {
+      if (type2.isExact) {
+        assert(same(type1.base, type2.base));
+        return type1.isNullable ? type2 : type1;
+      } else {
+        return type1;
+      }
+    } else if (type2.isExact) {
+      return type2;
+    } else if (type1.isSubclass) {
+      if (type2.isSubclass) {
+        assert(related(type1.base, type2.base));
+        if (same(type1.base, type2.base)) {
+          return type1.isNullable ? type2 : type1;
+        } else if (compiler.types.isSubtype(type1.base, type2.base)) {
+          return type1;
+        } else {
+          return type2;
+        }
+      } else {
+        return type1;
+      }
+    } else if (type2.isSubclass) {
+      return type2;
+    } else if (type1.isSubtype) {
+      if (type2.isSubtype) {
+        assert(related(type1.base, type2.base));
+        if (same(type1.base, type2.base)) {
+          return type1.isNullable ? type2 : type1;
+        } else if (compiler.types.isSubtype(type1.base, type2.base)) {
+          return type1;
+        } else {
+          return type2;
+        }
+      } else {
+        return type1;
+      }
+    } else if (type2.isSubtype) {
+      return type2;
+    } else {
+      return type1.isNullable ? type2 : type1;
+    }
+  }
 
   /**
    * Called when resolution is complete.
    */
   void onResolutionComplete(Element mainElement) {
     measure(() {
-      if (typesInferrer != null) {
-        bool success = typesInferrer.analyzeMain(mainElement);
+      typesInferrer.analyzeMain(mainElement);
+      if (concreteTypesInferrer != null) {
+        bool success = concreteTypesInferrer.analyzeMain(mainElement);
         if (!success) {
           // If the concrete type inference bailed out, we pretend it didn't
           // happen. In the future we might want to record that it failed but
           // use the partial results as hints.
-          typesInferrer = null;
+          concreteTypesInferrer = null;
         }
       }
     });
@@ -65,23 +173,24 @@
    */
   TypeMask getGuaranteedTypeOfElement(Element element) {
     return measure(() {
-      if (typesInferrer != null) {
-        TypeMask guaranteedType =
-            typesInferrer .getTypeOfElement(element);
-        if (guaranteedType != null) return guaranteedType;
-      }
-      return null;
+      TypeMask guaranteedType = typesInferrer.getTypeOfElement(element);
+      return (concreteTypesInferrer == null)
+          ? guaranteedType
+          : best(guaranteedType,
+                 concreteTypesInferrer.getTypeOfElement(element),
+                 element);
     });
   }
 
   TypeMask getGuaranteedReturnTypeOfElement(Element element) {
     return measure(() {
-      if (typesInferrer != null) {
-        TypeMask guaranteedType =
-            typesInferrer.getReturnTypeOfElement(element);
-        if (guaranteedType != null) return guaranteedType;
-      }
-      return null;
+      TypeMask guaranteedType =
+          typesInferrer.getReturnTypeOfElement(element);
+      return (concreteTypesInferrer == null)
+          ? guaranteedType
+          : best(guaranteedType,
+                 concreteTypesInferrer.getReturnTypeOfElement(element),
+                 element);
     });
   }
 
@@ -91,10 +200,12 @@
    */
   TypeMask getGuaranteedTypeOfNode(owner, node) {
     return measure(() {
-      if (typesInferrer != null) {
-        return typesInferrer.getTypeOfNode(owner, node);
-      }
-      return null;
+      TypeMask guaranteedType = typesInferrer.getTypeOfNode(owner, node);
+      return (concreteTypesInferrer == null)
+          ? guaranteedType
+          : best(guaranteedType,
+                 concreteTypesInferrer.getTypeOfNode(owner, node),
+                 node);
     });
   }
 
@@ -104,10 +215,13 @@
    */
   TypeMask getGuaranteedTypeOfSelector(Selector selector) {
     return measure(() {
-      if (typesInferrer != null) {
-        return typesInferrer.getTypeOfSelector(selector);
-      }
-      return null;
+      TypeMask guaranteedType =
+          typesInferrer.getTypeOfSelector(selector);
+      return (concreteTypesInferrer == null)
+          ? guaranteedType
+          : best(guaranteedType,
+                 concreteTypesInferrer.getTypeOfSelector(selector),
+                 selector);
     });
   }
 }
diff --git a/sdk/lib/_internal/compiler/implementation/universe/function_set.dart b/sdk/lib/_internal/compiler/implementation/universe/function_set.dart
index 4375528..2472d07 100644
--- a/sdk/lib/_internal/compiler/implementation/universe/function_set.dart
+++ b/sdk/lib/_internal/compiler/implementation/universe/function_set.dart
@@ -51,9 +51,18 @@
   Iterable<Element> filter(Selector selector) {
     SourceString name = selector.name;
     FunctionSetNode node = nodes[name];
-    return (node != null)
-        ? node.query(selector, compiler).functions
-        : const <Element>[];
+    FunctionSetNode noSuchMethods = nodes[Compiler.NO_SUCH_METHOD];
+    if (node != null) {
+      return node.query(selector, compiler, noSuchMethods).functions;
+    }
+    // If there is no method that matches [selector] we know we can
+    // only hit [:noSuchMethod:].
+    if (noSuchMethods == null) return const <Element>[];
+    selector = (selector.mask == null)
+        ? compiler.noSuchMethodSelector
+        : new TypedSelector(selector.mask, compiler.noSuchMethodSelector);
+
+    return noSuchMethods.query(selector, compiler, null).functions;
   }
 
   void forEach(Function action) {
@@ -124,7 +133,17 @@
     elements.forEach(action);
   }
 
-  FunctionSetQuery query(Selector selector, Compiler compiler) {
+  TypeMask getNonNullTypeMaskOfSelector(Selector selector, Compiler compiler) {
+    // TODO(ngeoffray): We should probably change untyped selector
+    // to always be a subclass of Object.
+    return selector.mask != null
+        ? selector.mask
+        : new TypeMask.subclass(compiler.objectClass.rawType);
+    }
+
+  FunctionSetQuery query(Selector selector,
+                         Compiler compiler,
+                         FunctionSetNode noSuchMethods) {
     assert(selector.name == name);
     FunctionSetQuery result = cache[selector];
     if (result != null) return result;
@@ -140,6 +159,24 @@
         functions.add(element);
       }
     }
+
+    TypeMask mask = getNonNullTypeMaskOfSelector(selector, compiler);
+    // If we cannot ensure a method will be found at runtime, we also
+    // add [noSuchMethod] implementations that apply to [mask] as
+    // potential targets.
+    if (noSuchMethods != null && !mask.willHit(selector, compiler)) {
+      FunctionSetQuery noSuchMethodQuery = noSuchMethods.query(
+          new TypedSelector(mask, compiler.noSuchMethodSelector),
+          compiler,
+          null);
+      if (!noSuchMethodQuery.functions.isEmpty) {
+        if (functions == null) {
+          functions = new List<Element>.from(noSuchMethodQuery.functions);
+        } else {
+          functions.addAll(noSuchMethodQuery.functions);
+        }
+      }
+    }
     cache[selector] = result = (functions != null)
         ? newQuery(functions, selector, compiler)
         : const FunctionSetQuery(const <Element>[]);
diff --git a/sdk/lib/_internal/compiler/implementation/universe/universe.dart b/sdk/lib/_internal/compiler/implementation/universe/universe.dart
index 76d4fb2..1d3a6f2 100644
--- a/sdk/lib/_internal/compiler/implementation/universe/universe.dart
+++ b/sdk/lib/_internal/compiler/implementation/universe/universe.dart
@@ -185,11 +185,6 @@
   Selector.callDefaultConstructor(LibraryElement library)
       : this(SelectorKind.CALL, const SourceString(""), library, 0, const []);
 
-  // TODO(kasperl): This belongs somewhere else.
-  Selector.noSuchMethod()
-      : this(SelectorKind.CALL, Compiler.NO_SUCH_METHOD, null,
-             Compiler.NO_SUCH_METHOD_ARG_COUNT);
-
   bool isGetter() => identical(kind, SelectorKind.GETTER);
   bool isSetter() => identical(kind, SelectorKind.SETTER);
   bool isCall() => identical(kind, SelectorKind.CALL);
@@ -441,20 +436,6 @@
 
   bool get hasExactMask => mask.isExact;
 
-  /**
-   * Check if [element] will be the one used at runtime when being
-   * invoked on an instance of [cls].
-   */
-  bool hasElementIn(ClassElement cls, Element element) {
-    // Use the [:implementation] of [cls] in case [element]
-    // is in the patch class. Also use [:implementation:] of [element]
-    // because our function set only stores declarations.
-    Element result = cls.implementation.lookupSelector(this);
-    return result == null
-        ? false
-        : result.implementation == element.implementation;
-  }
-
   bool appliesUnnamed(Element element, Compiler compiler) {
     assert(sameNameHack(element, compiler));
     // [TypedSelector] are only used after resolution.
@@ -466,53 +447,11 @@
     //   get foo => () => 42;
     //   bar() => foo(); // The call to 'foo' is a typed selector.
     // }
-    ClassElement other = element.getEnclosingClass();
-    if (identical(other.superclass, compiler.closureClass)) {
+    if (element.getEnclosingClass().isClosure()) {
       return appliesUntyped(element, compiler);
     }
 
-    if (mask.isEmpty) {
-      if (!mask.isNullable) return false;
-      return hasElementIn(compiler.backend.nullImplementation, element)
-          && appliesUntyped(element, compiler);
-    }
-
-    // TODO(kasperl): Can't we just avoid creating typed selectors
-    // based of function types?
-    Element self = mask.base.element;
-    if (self.isTypedef()) {
-      // A typedef is a function type that doesn't have any
-      // user-defined members.
-      return false;
-    }
-
-    if (compiler.backend.isNullImplementation(other)) {
-      return mask.isNullable && appliesUntyped(element, compiler);
-    } else if (mask.isExact) {
-      return hasElementIn(self, element) && appliesUntyped(element, compiler);
-    } else if (mask.isSubclass) {
-      return (hasElementIn(self, element)
-              || other.isSubclassOf(self)
-              || compiler.world.hasAnySubclassThatMixes(self, other))
-          && appliesUntyped(element, compiler);
-    } else {
-      assert(mask.isSubtype);
-      if (other.implementsInterface(self)
-          || other.isSubclassOf(self)
-          || compiler.world.hasAnySubclassThatMixes(self, other)
-          || compiler.world.hasAnySubclassThatImplements(other, mask.base)) {
-        return appliesUntyped(element, compiler);
-      }
-
-      // If [self] is a subclass of [other], it inherits the
-      // implementation of [element].
-      ClassElement cls = self;
-      if (cls.isSubclassOf(other)) {
-        // Resolve an invocation of [element.name] on [self]. If it
-        // is found, this selector is a candidate.
-        return hasElementIn(cls, element) && appliesUntyped(element, compiler);
-      }
-    }
-    return false;
+    if (!mask.canHit(element, this, compiler)) return false;
+    return appliesUntyped(element, compiler);
   }
 }
diff --git a/sdk/lib/_internal/compiler/implementation/util/link.dart b/sdk/lib/_internal/compiler/implementation/util/link.dart
index 614b657..29bc4c6 100644
--- a/sdk/lib/_internal/compiler/implementation/util/link.dart
+++ b/sdk/lib/_internal/compiler/implementation/util/link.dart
@@ -4,7 +4,7 @@
 
 part of org_dartlang_compiler_util;
 
-class Link<T> extends IterableBase<T> {
+class Link<T> {
   T get head => null;
   Link<T> get tail => null;
 
@@ -38,7 +38,20 @@
   void printOn(StringBuffer buffer, [separatedBy]) {
   }
 
-  List toList({ bool growable: true }) => growable ? <T>[] : new List<T>(0);
+  List<T> toList({ bool growable: true }) {
+    List<T> result;
+    if (!growable) {
+      result = new List<T>(slowLength());
+    } else {
+      result = new List<T>();
+      result.length = slowLength();
+    }
+    int i = 0;
+    for (Link<T> link = this; !link.isEmpty; link = link.tail) {
+      result[i++] = link.head;
+    }
+    return result;
+  }
 
   bool get isEmpty => true;
 
@@ -68,6 +81,27 @@
   }
 
   int slowLength() => 0;
+
+  // TODO(ahe): Remove this method?
+  bool contains(T element) {
+    for (Link<T> link = this; !link.isEmpty; link = link.tail) {
+      if (link.head == element) return true;
+    }
+    return false;
+  }
+
+  // TODO(ahe): Remove this method?
+  T get single {
+    if (isEmpty) throw new StateError('No elements');
+    if (!tail.isEmpty) throw new StateError('More than one element');
+    return head;
+  }
+
+  // TODO(ahe): Remove this method?
+  T get first {
+    if (isEmpty) throw new StateError('No elements');
+    return head;
+  }
 }
 
 abstract class LinkBuilder<T> {
diff --git a/sdk/lib/_internal/compiler/implementation/util/link_implementation.dart b/sdk/lib/_internal/compiler/implementation/util/link_implementation.dart
index efd0ff9..4b0a618 100644
--- a/sdk/lib/_internal/compiler/implementation/util/link_implementation.dart
+++ b/sdk/lib/_internal/compiler/implementation/util/link_implementation.dart
@@ -81,10 +81,6 @@
 
   bool get isEmpty => false;
 
-  List<T> toList({ bool growable: true }) {
-    return new List<T>.from(this, growable: growable);
-  }
-
   void forEach(void f(T element)) {
     for (Link<T> link = this; !link.isEmpty; link = link.tail) {
       f(link.head);
diff --git a/sdk/lib/_internal/compiler/implementation/warnings.dart b/sdk/lib/_internal/compiler/implementation/warnings.dart
index 49c112e..014415d 100644
--- a/sdk/lib/_internal/compiler/implementation/warnings.dart
+++ b/sdk/lib/_internal/compiler/implementation/warnings.dart
@@ -393,6 +393,27 @@
       "Error: Modifier static is only allowed on functions declared in"
       " a class.");
 
+  static const STATIC_FUNCTION_BLOAT = const MessageKind(
+      'Warning: Using "#{class}.#{name}" may result in larger output.');
+
+  static const NON_CONST_BLOAT = const MessageKind('''
+Warning: Using "new #{name}" may result in larger output.
+Use "const #{name}" if possible.''');
+
+  static const STRING_EXPECTED = const MessageKind(
+      'Error: Expected a "String", but got an instance of "#{type}".');
+
+  static const PRIVATE_IDENTIFIER = const MessageKind(
+      'Error: "#{value}" is not a valid Symbol name because it starts with '
+      '"_".');
+
+  static const INVALID_SYMBOL = const MessageKind('''
+Error: "#{value}" is not a valid Symbol name because is not:
+ * an empty String,
+ * a user defined operator,
+ * a qualified non-private identifier optionally followed by "=", or
+ * a qualified non-private identifier followed by "." and a user-defined operator.''');
+
   static const COMPILER_CRASHED = const MessageKind(
       "Error: The compiler crashed when compiling this element.");
 
diff --git a/sdk/lib/_internal/compiler/implementation/world.dart b/sdk/lib/_internal/compiler/implementation/world.dart
index 66b583f..01f17fd 100644
--- a/sdk/lib/_internal/compiler/implementation/world.dart
+++ b/sdk/lib/_internal/compiler/implementation/world.dart
@@ -165,7 +165,7 @@
   }
 
   Iterable<ClassElement> locateNoSuchMethodHolders(Selector selector) {
-    Selector noSuchMethodSelector = new Selector.noSuchMethod();
+    Selector noSuchMethodSelector = compiler.noSuchMethodSelector;
     ti.TypeMask mask = selector.mask;
     if (mask != null) {
       noSuchMethodSelector = new TypedSelector(mask, noSuchMethodSelector);
diff --git a/sdk/lib/_internal/dartdoc/lib/dartdoc.dart b/sdk/lib/_internal/dartdoc/lib/dartdoc.dart
index 845891c..f9d5d7e 100644
--- a/sdk/lib/_internal/dartdoc/lib/dartdoc.dart
+++ b/sdk/lib/_internal/dartdoc/lib/dartdoc.dart
@@ -143,7 +143,7 @@
     'libPath': libPath.toNativePath()
   }).then((result) {
     if (result.first == 'success') return;
-    throw result[1];
+    throw result[1] + (result[2] == null ? '' : '\n' + result[2]);
   });
 }
 
@@ -165,7 +165,7 @@
       replyTo.send(['success']);
     }).catchError((error) {
       var trace = getAttachedStackTrace(error);
-      var traceString = trace == null ? "" : trace.toString();
+      var traceString = trace == null ? null : trace.toString();
       replyTo.send(['error', error.toString(), traceString]);
     });
   });
diff --git a/sdk/lib/async/stream.dart b/sdk/lib/async/stream.dart
index 3416265..0abee99 100644
--- a/sdk/lib/async/stream.dart
+++ b/sdk/lib/async/stream.dart
@@ -929,25 +929,25 @@
 
 
 /**
- * A [StreamSink] unifies the asynchronous methods from [StreamConsumer<S>] and
- * the synchronous methods from [EventSink<S>].
+ * A [StreamSink] unifies the asynchronous methods from [StreamConsumer] and
+ * the synchronous methods from [EventSink].
  *
- * The [EventSink<S>] methods can't be used while the [addStream] is called.
+ * The [EventSink] methods can't be used while the [addStream] is called.
  * As soon as the [addStream]'s [Future] completes with a value, the
- * [EventSink<S>] methods can be used again.
+ * [EventSink] methods can be used again.
  *
- * If [addStream] is called after any of the [EventSink<S>] methods, it'll
+ * If [addStream] is called after any of the [EventSink] methods, it'll
  * be delayed until the underlying system has consumed the data added by the
- * [EventSink<S>] methods.
+ * [EventSink] methods.
  *
- * When [EventSink<S>] methods are used, the [done] [Future] can be used to
+ * When [EventSink] methods are used, the [done] [Future] can be used to
  * catch any errors.
  *
  * When [close] is called, it will return the [done] [Future].
  */
 abstract class StreamSink<S> implements StreamConsumer<S>, EventSink<S> {
   /**
-   * Close the [StreamSink<S>]. It'll return the [done] Future.
+   * Close the [StreamSink]. It'll return the [done] Future.
    */
   Future close();
 
@@ -955,7 +955,7 @@
    * The [done] Future completes with the same values as [close], except
    * for the following case:
    *
-   * * The synchronous methods of [EventSink<S>] were called, resulting in an
+   * * The synchronous methods of [EventSink] were called, resulting in an
    *   error. If there is no active future (like from an addStream call), the
    *   [done] future will complete with that error
    */
diff --git a/sdk/lib/core/invocation.dart b/sdk/lib/core/invocation.dart
index 2e4dd90..0388e21 100644
--- a/sdk/lib/core/invocation.dart
+++ b/sdk/lib/core/invocation.dart
@@ -13,13 +13,13 @@
  */
 abstract class Invocation {
   /** The name of the invoked member. */
-  String get memberName;
+  Symbol get memberName;
 
   /** An unmodifiable view of the positional arguments of the call. */
   List get positionalArguments;
 
   /** An unmodifiable view of the named arguments of the call. */
-  Map<String, dynamic> get namedArguments;
+  Map<Symbol, dynamic> get namedArguments;
 
   /** Whether the invocation was a method call. */
   bool get isMethod;
@@ -40,13 +40,4 @@
 
   /** Whether the invocation was a getter or a setter call. */
   bool get isAccessor => isGetter || isSetter;
-
-  /**
-   * Perform the invocation on the provided object.
-   *
-   * If the object doesn't support the invocation, its [noSuchMethod]
-   * method will be called with either this [InvocationMirror] or another
-   * equivalent [InvocationMirror].
-   */
-  invokeOn(Object receiver);
 }
diff --git a/sdk/lib/core/list.dart b/sdk/lib/core/list.dart
index 59d4cd1..b7978ff 100644
--- a/sdk/lib/core/list.dart
+++ b/sdk/lib/core/list.dart
@@ -180,8 +180,8 @@
   /**
    * Inserts the element at position [index] in the list.
    *
-   * This increases the length of the list by one and shifts all later elements
-   * towards the end of the list.
+   * This increases the length of the list by one and shifts all elements
+   * at or after the index towards the end of the list.
    *
    * It is an error if the [index] does not point inside the list or at the
    * position after the last element.
@@ -266,8 +266,8 @@
 
   /**
    * Returns an [Iterable] that iterators over the elements in the range
-   * [start] to [end] (exclusive). The result of this function is backed by
-   * `this`.
+   * [start] to [end] exclusive. The result of this function
+   * is backed by `this`.
    *
    * It is an error if [end] is before [start].
    *
@@ -288,7 +288,7 @@
 
   /**
    * Copies the elements of [iterable], skipping the [skipCount] first elements
-   * into the range [start] - [end] (excluding) of `this`.
+   * into the range [start] to [end] exclusive of `this`.
    *
    * If [start] equals [end] and represent a legal range, this method has
    * no effect.
@@ -302,7 +302,7 @@
   void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]);
 
   /**
-   * Removes the elements in the range [start]..[end] (excluding).
+   * Removes the elements in the range [start] to [end] exclusive.
    *
    * It is an error if [start]..[end] is not a valid range pointing into the
    * `this`.
@@ -310,7 +310,7 @@
   void removeRange(int start, int end);
 
   /**
-   * Sets the elements in the range [start]..[end] (excluding) to the given
+   * Sets the elements in the range [start] to [end] exclusive to the given
    * [fillValue].
    *
    * It is an error if [start]..[end] is not a valid range pointing into the
@@ -319,7 +319,7 @@
   void fillRange(int start, int end, [E fillValue]);
 
   /**
-   * Removes the elements in the range [start]..[end] (excluding) and replaces
+   * Removes the elements in the range [start] to [end] exclusive and replaces
    * them with the contents of the [iterable].
    *
    * It is an error if [start]..[end] is not a valid range pointing into the
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 17ea084..6a656c6 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -188,11 +188,11 @@
 @DomName('WebKitAnimationEvent')
 class AnimationEvent extends Event native "*WebKitAnimationEvent" {
 
-  @DomName('WebKitAnimationEvent.animationName')
+  @DomName('AnimationEvent.animationName')
   @DocsEditable
   final String animationName;
 
-  @DomName('WebKitAnimationEvent.elapsedTime')
+  @DomName('AnimationEvent.elapsedTime')
   @DocsEditable
   final num elapsedTime;
 }
@@ -413,9 +413,6 @@
   }
   static ArrayBuffer _create_1(length) => JS('ArrayBuffer', 'new ArrayBuffer(#)', length);
 
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => JS('bool', 'typeof window.ArrayBuffer != "undefined"');
-
   @DomName('ArrayBuffer.byteLength')
   @DocsEditable
   final int byteLength;
@@ -5719,6 +5716,14 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// WARNING: Do not edit - generated code.
+
+
+typedef void DatabaseCallback(database);
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
 
 @DocsEditable
 @DomName('HTMLDetailsElement')
@@ -5744,12 +5749,45 @@
 
 
 @DocsEditable
+@DomName('DeviceAcceleration')
+class DeviceAcceleration native "*DeviceAcceleration" {
+
+  @DomName('DeviceAcceleration.x')
+  @DocsEditable
+  final num x;
+
+  @DomName('DeviceAcceleration.y')
+  @DocsEditable
+  final num y;
+
+  @DomName('DeviceAcceleration.z')
+  @DocsEditable
+  final num z;
+}
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+
+@DocsEditable
 @DomName('DeviceMotionEvent')
 class DeviceMotionEvent extends Event native "*DeviceMotionEvent" {
 
+  @DomName('DeviceMotionEvent.acceleration')
+  @DocsEditable
+  final DeviceAcceleration acceleration;
+
+  @DomName('DeviceMotionEvent.accelerationIncludingGravity')
+  @DocsEditable
+  final DeviceAcceleration accelerationIncludingGravity;
+
   @DomName('DeviceMotionEvent.interval')
   @DocsEditable
   final num interval;
+
+  @DomName('DeviceMotionEvent.rotationRate')
+  @DocsEditable
+  final DeviceRotationRate rotationRate;
 }
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -5797,6 +5835,27 @@
 
 
 @DocsEditable
+@DomName('DeviceRotationRate')
+class DeviceRotationRate native "*DeviceRotationRate" {
+
+  @DomName('DeviceRotationRate.alpha')
+  @DocsEditable
+  final num alpha;
+
+  @DomName('DeviceRotationRate.beta')
+  @DocsEditable
+  final num beta;
+
+  @DomName('DeviceRotationRate.gamma')
+  @DocsEditable
+  final num gamma;
+}
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+
+@DocsEditable
 @DomName('HTMLDialogElement')
 class DialogElement extends Element native "*HTMLDialogElement" {
 
@@ -7096,11 +7155,11 @@
 
   @DomName('DOMNamedFlowCollection.item')
   @DocsEditable
-  WebKitNamedFlow item(int index) native;
+  NamedFlow item(int index) native;
 
   @DomName('DOMNamedFlowCollection.namedItem')
   @DocsEditable
-  WebKitNamedFlow namedItem(String name) native;
+  NamedFlow namedItem(String name) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -14836,73 +14895,6 @@
 // BSD-style license that can be found in the LICENSE file.
 
 
-@DocsEditable
-@DomName('JavaScriptCallFrame')
-class JavaScriptCallFrame native "*JavaScriptCallFrame" {
-
-  static const int CATCH_SCOPE = 4;
-
-  static const int CLOSURE_SCOPE = 3;
-
-  static const int GLOBAL_SCOPE = 0;
-
-  static const int LOCAL_SCOPE = 1;
-
-  static const int WITH_SCOPE = 2;
-
-  @DomName('JavaScriptCallFrame.caller')
-  @DocsEditable
-  final JavaScriptCallFrame caller;
-
-  @DomName('JavaScriptCallFrame.column')
-  @DocsEditable
-  final int column;
-
-  @DomName('JavaScriptCallFrame.functionName')
-  @DocsEditable
-  final String functionName;
-
-  @DomName('JavaScriptCallFrame.line')
-  @DocsEditable
-  final int line;
-
-  @DomName('JavaScriptCallFrame.scopeChain')
-  @DocsEditable
-  final List scopeChain;
-
-  @DomName('JavaScriptCallFrame.sourceID')
-  @DocsEditable
-  final int sourceID;
-
-  @DomName('JavaScriptCallFrame.thisObject')
-  @DocsEditable
-  final Object thisObject;
-
-  @DomName('JavaScriptCallFrame.type')
-  @DocsEditable
-  final String type;
-
-  @DomName('JavaScriptCallFrame.evaluate')
-  @DocsEditable
-  void evaluate(String script) native;
-
-  @DomName('JavaScriptCallFrame.restart')
-  @DocsEditable
-  Object restart() native;
-
-  @DomName('JavaScriptCallFrame.scopeType')
-  @DocsEditable
-  int scopeType(int scopeIndex) native;
-
-  @DomName('JavaScriptCallFrame.setVariableValue')
-  @DocsEditable
-  Object setVariableValue(int scopeIndex, String variableName, Object newValue) native;
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
 @DomName('KeyboardEvent')
 class KeyboardEvent extends UIEvent native "*KeyboardEvent" {
 
@@ -15238,6 +15230,10 @@
   @DomName('Location.toString')
   @DocsEditable
   String toString() native;
+
+  @DomName('Location.valueOf')
+  @DocsEditable
+  Object valueOf() native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -16892,6 +16888,59 @@
 // BSD-style license that can be found in the LICENSE file.
 
 
+@DocsEditable
+@DomName('WebKitNamedFlow')
+class NamedFlow extends EventTarget native "*WebKitNamedFlow" {
+
+  @DomName('NamedFlow.firstEmptyRegionIndex')
+  @DocsEditable
+  final int firstEmptyRegionIndex;
+
+  @DomName('NamedFlow.name')
+  @DocsEditable
+  final String name;
+
+  @DomName('NamedFlow.overset')
+  @DocsEditable
+  final bool overset;
+
+  @JSName('addEventListener')
+  @DomName('NamedFlow.addEventListener')
+  @DocsEditable
+  void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
+
+  @DomName('NamedFlow.dispatchEvent')
+  @DocsEditable
+  bool dispatchEvent(Event event) native;
+
+  @DomName('NamedFlow.getContent')
+  @DocsEditable
+  @Returns('NodeList')
+  @Creates('NodeList')
+  List<Node> getContent() native;
+
+  @DomName('NamedFlow.getRegions')
+  @DocsEditable
+  @Returns('NodeList')
+  @Creates('NodeList')
+  List<Node> getRegions() native;
+
+  @DomName('NamedFlow.getRegionsByContent')
+  @DocsEditable
+  @Returns('NodeList')
+  @Creates('NodeList')
+  List<Node> getRegionsByContent(Node contentNode) native;
+
+  @JSName('removeEventListener')
+  @DomName('NamedFlow.removeEventListener')
+  @DocsEditable
+  void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
+}
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+
 @DomName('Navigator')
 class Navigator native "*Navigator" {
 
@@ -16983,6 +17032,10 @@
   @DocsEditable
   final bool cookieEnabled;
 
+  @DomName('Navigator.doNotTrack')
+  @DocsEditable
+  final String doNotTrack;
+
   @DomName('Navigator.geolocation')
   @DocsEditable
   final Geolocation geolocation;
@@ -20947,6 +21000,10 @@
   @DocsEditable
   final Document emma;
 
+  @DomName('SpeechRecognitionEvent.interpretation')
+  @DocsEditable
+  final Document interpretation;
+
   @DomName('SpeechRecognitionEvent.resultIndex')
   @DocsEditable
   final int resultIndex;
@@ -24262,59 +24319,6 @@
 
 
 @DocsEditable
-@DomName('WebKitNamedFlow')
-class WebKitNamedFlow extends EventTarget native "*WebKitNamedFlow" {
-
-  @DomName('WebKitNamedFlow.firstEmptyRegionIndex')
-  @DocsEditable
-  final int firstEmptyRegionIndex;
-
-  @DomName('WebKitNamedFlow.name')
-  @DocsEditable
-  final String name;
-
-  @DomName('WebKitNamedFlow.overset')
-  @DocsEditable
-  final bool overset;
-
-  @JSName('addEventListener')
-  @DomName('WebKitNamedFlow.addEventListener')
-  @DocsEditable
-  void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
-
-  @DomName('WebKitNamedFlow.dispatchEvent')
-  @DocsEditable
-  bool dispatchEvent(Event event) native;
-
-  @DomName('WebKitNamedFlow.getContent')
-  @DocsEditable
-  @Returns('NodeList')
-  @Creates('NodeList')
-  List<Node> getContent() native;
-
-  @DomName('WebKitNamedFlow.getRegions')
-  @DocsEditable
-  @Returns('NodeList')
-  @Creates('NodeList')
-  List<Node> getRegions() native;
-
-  @DomName('WebKitNamedFlow.getRegionsByContent')
-  @DocsEditable
-  @Returns('NodeList')
-  @Creates('NodeList')
-  List<Node> getRegionsByContent(Node contentNode) native;
-
-  @JSName('removeEventListener')
-  @DomName('WebKitNamedFlow.removeEventListener')
-  @DocsEditable
-  void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
 /**
  * Use the WebSocket interface to connect to a WebSocket,
  * and to send and receive data on that WebSocket.
@@ -25386,6 +25390,10 @@
   @DocsEditable
   void stop() native;
 
+  @DomName('DOMWindow.toString')
+  @DocsEditable
+  String toString() native;
+
   @JSName('webkitConvertPointFromNodeToPage')
   @DomName('DOMWindow.webkitConvertPointFromNodeToPage')
   @DocsEditable
@@ -26801,6 +26809,18 @@
 
 
 @DocsEditable
+@DomName('DatabaseSync')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.SAFARI)
+@Experimental
+abstract class _DatabaseSync native "*DatabaseSync" {
+}
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+
+@DocsEditable
 @DomName('DedicatedWorkerContext')
 abstract class _DedicatedWorkerContext extends _WorkerContext native "*DedicatedWorkerContext" {
 }
@@ -26834,7 +26854,7 @@
 @Experimental
 class _DomPoint native "*WebKitPoint" {
 
-  @DomName('WebKitPoint.WebKitPoint')
+  @DomName('DOMPoint.DOMPoint')
   @DocsEditable
   factory _DomPoint(num x, num y) {
     return _DomPoint._create_1(x, y);
@@ -26844,11 +26864,11 @@
   /// Checks if this type is supported on the current platform.
   static bool get supported => JS('bool', '!!(window.WebKitPoint)');
 
-  @DomName('WebKitPoint.x')
+  @DomName('DOMPoint.x')
   @DocsEditable
   num x;
 
-  @DomName('WebKitPoint.y')
+  @DomName('DOMPoint.y')
   @DocsEditable
   num y;
 }
@@ -28603,28 +28623,6 @@
 // BSD-style license that can be found in the LICENSE file.
 
 
-// This class maps WebKitTransitionEvent to TransitionEvent for older Chrome
-// browser versions.
-@DomName('WebKitTransitionEvent')
-class _WebKitTransitionEvent extends Event implements TransitionEvent  native "*WebKitTransitionEvent" {
-
-  @DomName('WebKitTransitionEvent.elapsedTime')
-  @DocsEditable
-  final num elapsedTime;
-
-  @DomName('WebKitTransitionEvent.propertyName')
-  @DocsEditable
-  final String propertyName;
-
-  @DomName('WebKitTransitionEvent.pseudoElement')
-  @DocsEditable
-  final String pseudoElement;
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
 @DocsEditable
 @DomName('WorkerContext')
 abstract class _WorkerContext extends EventTarget native "*WorkerContext" {
@@ -32135,6 +32133,14 @@
   static _get(p, m) => JS('var', '#[#]', p, m);
   static _set(p, m, v) => JS('void', '#[#] = #', p, m, v);
 }
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+
+class Platform {
+  static final supportsTypedData = JS('bool', '!!(window.ArrayBuffer)');
+}
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index cb67dad..2a139ff 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -265,13 +265,13 @@
 class AnimationEvent extends Event {
   AnimationEvent.internal() : super.internal();
 
-  @DomName('WebKitAnimationEvent.animationName')
+  @DomName('AnimationEvent.animationName')
   @DocsEditable
-  String get animationName native "WebKitAnimationEvent_animationName_Getter";
+  String get animationName native "AnimationEvent_animationName_Getter";
 
-  @DomName('WebKitAnimationEvent.elapsedTime')
+  @DomName('AnimationEvent.elapsedTime')
   @DocsEditable
-  num get elapsedTime native "WebKitAnimationEvent_elapsedTime_Getter";
+  num get elapsedTime native "AnimationEvent_elapsedTime_Getter";
 
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -522,9 +522,6 @@
   @DocsEditable
   static ArrayBuffer _create(length) native "ArrayBuffer_constructorCallback";
 
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => true;
-
   @DomName('ArrayBuffer.byteLength')
   @DocsEditable
   int get byteLength native "ArrayBuffer_byteLength_Getter";
@@ -6393,6 +6390,14 @@
 // WARNING: Do not edit - generated code.
 
 
+typedef void DatabaseCallback(database);
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// WARNING: Do not edit - generated code.
+
+
 @DocsEditable
 @DomName('HTMLDetailsElement')
 @SupportedBrowser(SupportedBrowser.CHROME)
@@ -6425,14 +6430,51 @@
 
 
 @DocsEditable
+@DomName('DeviceAcceleration')
+class DeviceAcceleration extends NativeFieldWrapperClass1 {
+  DeviceAcceleration.internal();
+
+  @DomName('DeviceAcceleration.x')
+  @DocsEditable
+  num get x native "DeviceAcceleration_x_Getter";
+
+  @DomName('DeviceAcceleration.y')
+  @DocsEditable
+  num get y native "DeviceAcceleration_y_Getter";
+
+  @DomName('DeviceAcceleration.z')
+  @DocsEditable
+  num get z native "DeviceAcceleration_z_Getter";
+
+}
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// WARNING: Do not edit - generated code.
+
+
+@DocsEditable
 @DomName('DeviceMotionEvent')
 class DeviceMotionEvent extends Event {
   DeviceMotionEvent.internal() : super.internal();
 
+  @DomName('DeviceMotionEvent.acceleration')
+  @DocsEditable
+  DeviceAcceleration get acceleration native "DeviceMotionEvent_acceleration_Getter";
+
+  @DomName('DeviceMotionEvent.accelerationIncludingGravity')
+  @DocsEditable
+  DeviceAcceleration get accelerationIncludingGravity native "DeviceMotionEvent_accelerationIncludingGravity_Getter";
+
   @DomName('DeviceMotionEvent.interval')
   @DocsEditable
   num get interval native "DeviceMotionEvent_interval_Getter";
 
+  @DomName('DeviceMotionEvent.rotationRate')
+  @DocsEditable
+  DeviceRotationRate get rotationRate native "DeviceMotionEvent_rotationRate_Getter";
+
 }
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -6482,6 +6524,31 @@
 
 
 @DocsEditable
+@DomName('DeviceRotationRate')
+class DeviceRotationRate extends NativeFieldWrapperClass1 {
+  DeviceRotationRate.internal();
+
+  @DomName('DeviceRotationRate.alpha')
+  @DocsEditable
+  num get alpha native "DeviceRotationRate_alpha_Getter";
+
+  @DomName('DeviceRotationRate.beta')
+  @DocsEditable
+  num get beta native "DeviceRotationRate_beta_Getter";
+
+  @DomName('DeviceRotationRate.gamma')
+  @DocsEditable
+  num get gamma native "DeviceRotationRate_gamma_Getter";
+
+}
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// WARNING: Do not edit - generated code.
+
+
+@DocsEditable
 @DomName('HTMLDialogElement')
 class DialogElement extends _Element_Merged {
   DialogElement.internal() : super.internal();
@@ -7703,11 +7770,11 @@
 
   @DomName('DOMNamedFlowCollection.item')
   @DocsEditable
-  WebKitNamedFlow item(int index) native "DOMNamedFlowCollection_item_Callback";
+  NamedFlow item(int index) native "DOMNamedFlowCollection_item_Callback";
 
   @DomName('DOMNamedFlowCollection.namedItem')
   @DocsEditable
-  WebKitNamedFlow namedItem(String name) native "DOMNamedFlowCollection_namedItem_Callback";
+  NamedFlow namedItem(String name) native "DOMNamedFlowCollection_namedItem_Callback";
 
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -13195,6 +13262,10 @@
 class HtmlOptionsCollection extends HtmlCollection {
   HtmlOptionsCollection.internal() : super.internal();
 
+  @DomName('HTMLOptionsCollection.numericIndexGetter')
+  @DocsEditable
+  Node operator[](int index) native "HTMLOptionsCollection_numericIndexGetter_Callback";
+
   @DomName('HTMLOptionsCollection.numericIndexSetter')
   @DocsEditable
   void operator[]=(int index, Node value) native "HTMLOptionsCollection_numericIndexSetter_Callback";
@@ -13379,29 +13450,10 @@
   @DomName('XMLHttpRequest.readystatechangeEvent')
   @DocsEditable
   static const EventStreamProvider<ProgressEvent> readyStateChangeEvent = const EventStreamProvider<ProgressEvent>('readystatechange');
-
-  /**
-   * General constructor for any type of request (GET, POST, etc).
-   *
-   * This call is used in conjunction with [open]:
-   *
-   *     var request = new HttpRequest();
-   *     request.open('GET', 'http://dartlang.org')
-   *     request.on.load.add((event) => print('Request complete'));
-   *
-   * is the (more verbose) equivalent of
-   *
-   *     var request = new HttpRequest.get('http://dartlang.org',
-   *         (event) => print('Request complete'));
-   */
-  @DomName('XMLHttpRequest.XMLHttpRequest')
-  @DocsEditable
-  factory HttpRequest() {
-    return HttpRequest._create_1();
-  }
+  factory HttpRequest() => _create();
 
   @DocsEditable
-  static HttpRequest _create_1() native "XMLHttpRequest__create_1constructorCallback";
+  static HttpRequest _create() native "XMLHttpRequest_constructorCallback";
 
   static const int DONE = 4;
 
@@ -15896,77 +15948,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
-@DomName('JavaScriptCallFrame')
-class JavaScriptCallFrame extends NativeFieldWrapperClass1 {
-  JavaScriptCallFrame.internal();
-
-  static const int CATCH_SCOPE = 4;
-
-  static const int CLOSURE_SCOPE = 3;
-
-  static const int GLOBAL_SCOPE = 0;
-
-  static const int LOCAL_SCOPE = 1;
-
-  static const int WITH_SCOPE = 2;
-
-  @DomName('JavaScriptCallFrame.caller')
-  @DocsEditable
-  JavaScriptCallFrame get caller native "JavaScriptCallFrame_caller_Getter";
-
-  @DomName('JavaScriptCallFrame.column')
-  @DocsEditable
-  int get column native "JavaScriptCallFrame_column_Getter";
-
-  @DomName('JavaScriptCallFrame.functionName')
-  @DocsEditable
-  String get functionName native "JavaScriptCallFrame_functionName_Getter";
-
-  @DomName('JavaScriptCallFrame.line')
-  @DocsEditable
-  int get line native "JavaScriptCallFrame_line_Getter";
-
-  @DomName('JavaScriptCallFrame.scopeChain')
-  @DocsEditable
-  List get scopeChain native "JavaScriptCallFrame_scopeChain_Getter";
-
-  @DomName('JavaScriptCallFrame.sourceID')
-  @DocsEditable
-  int get sourceID native "JavaScriptCallFrame_sourceID_Getter";
-
-  @DomName('JavaScriptCallFrame.thisObject')
-  @DocsEditable
-  Object get thisObject native "JavaScriptCallFrame_thisObject_Getter";
-
-  @DomName('JavaScriptCallFrame.type')
-  @DocsEditable
-  String get type native "JavaScriptCallFrame_type_Getter";
-
-  @DomName('JavaScriptCallFrame.evaluate')
-  @DocsEditable
-  void evaluate(String script) native "JavaScriptCallFrame_evaluate_Callback";
-
-  @DomName('JavaScriptCallFrame.restart')
-  @DocsEditable
-  Object restart() native "JavaScriptCallFrame_restart_Callback";
-
-  @DomName('JavaScriptCallFrame.scopeType')
-  @DocsEditable
-  int scopeType(int scopeIndex) native "JavaScriptCallFrame_scopeType_Callback";
-
-  @DomName('JavaScriptCallFrame.setVariableValue')
-  @DocsEditable
-  Object setVariableValue(int scopeIndex, String variableName, Object newValue) native "JavaScriptCallFrame_setVariableValue_Callback";
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
 
 @DomName('KeyboardEvent')
 class KeyboardEvent extends UIEvent {
@@ -16403,6 +16384,10 @@
   @DocsEditable
   String toString() native "Location_toString_Callback";
 
+  @DomName('Location.valueOf')
+  @DocsEditable
+  Object valueOf() native "Location_valueOf_Callback";
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -17619,15 +17604,10 @@
 @DomName('MessageChannel')
 class MessageChannel extends NativeFieldWrapperClass1 {
   MessageChannel.internal();
-
-  @DomName('MessageChannel.MessageChannel')
-  @DocsEditable
-  factory MessageChannel() {
-    return MessageChannel._create_1();
-  }
+  factory MessageChannel() => _create();
 
   @DocsEditable
-  static MessageChannel _create_1() native "MessageChannel__create_1constructorCallback";
+  static MessageChannel _create() native "MessageChannel_constructorCallback";
 
   @DomName('MessageChannel.port1')
   @DocsEditable
@@ -18245,6 +18225,55 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// WARNING: Do not edit - generated code.
+
+
+@DocsEditable
+@DomName('WebKitNamedFlow')
+class NamedFlow extends EventTarget {
+  NamedFlow.internal() : super.internal();
+
+  @DomName('NamedFlow.firstEmptyRegionIndex')
+  @DocsEditable
+  int get firstEmptyRegionIndex native "NamedFlow_firstEmptyRegionIndex_Getter";
+
+  @DomName('NamedFlow.name')
+  @DocsEditable
+  String get name native "NamedFlow_name_Getter";
+
+  @DomName('NamedFlow.overset')
+  @DocsEditable
+  bool get overset native "NamedFlow_overset_Getter";
+
+  @DomName('NamedFlow.addEventListener')
+  @DocsEditable
+  void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "NamedFlow_addEventListener_Callback";
+
+  @DomName('NamedFlow.dispatchEvent')
+  @DocsEditable
+  bool dispatchEvent(Event event) native "NamedFlow_dispatchEvent_Callback";
+
+  @DomName('NamedFlow.getContent')
+  @DocsEditable
+  List<Node> getContent() native "NamedFlow_getContent_Callback";
+
+  @DomName('NamedFlow.getRegions')
+  @DocsEditable
+  List<Node> getRegions() native "NamedFlow_getRegions_Callback";
+
+  @DomName('NamedFlow.getRegionsByContent')
+  @DocsEditable
+  List<Node> getRegionsByContent(Node contentNode) native "NamedFlow_getRegionsByContent_Callback";
+
+  @DomName('NamedFlow.removeEventListener')
+  @DocsEditable
+  void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "NamedFlow_removeEventListener_Callback";
+
+}
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
 
 @DomName('Navigator')
 class Navigator extends NativeFieldWrapperClass1 {
@@ -18323,6 +18352,10 @@
   @DocsEditable
   bool get cookieEnabled native "Navigator_cookieEnabled_Getter";
 
+  @DomName('Navigator.doNotTrack')
+  @DocsEditable
+  String get doNotTrack native "Navigator_doNotTrack_Getter";
+
   @DomName('Navigator.geolocation')
   @DocsEditable
   Geolocation get geolocation native "Navigator_geolocation_Getter";
@@ -22695,6 +22728,10 @@
   @DocsEditable
   Document get emma native "SpeechRecognitionEvent_emma_Getter";
 
+  @DomName('SpeechRecognitionEvent.interpretation')
+  @DocsEditable
+  Document get interpretation native "SpeechRecognitionEvent_interpretation_Getter";
+
   @DomName('SpeechRecognitionEvent.resultIndex')
   @DocsEditable
   int get resultIndex native "SpeechRecognitionEvent_resultIndex_Getter";
@@ -26375,55 +26412,6 @@
 
 
 @DocsEditable
-@DomName('WebKitNamedFlow')
-class WebKitNamedFlow extends EventTarget {
-  WebKitNamedFlow.internal() : super.internal();
-
-  @DomName('WebKitNamedFlow.firstEmptyRegionIndex')
-  @DocsEditable
-  int get firstEmptyRegionIndex native "WebKitNamedFlow_firstEmptyRegionIndex_Getter";
-
-  @DomName('WebKitNamedFlow.name')
-  @DocsEditable
-  String get name native "WebKitNamedFlow_name_Getter";
-
-  @DomName('WebKitNamedFlow.overset')
-  @DocsEditable
-  bool get overset native "WebKitNamedFlow_overset_Getter";
-
-  @DomName('WebKitNamedFlow.addEventListener')
-  @DocsEditable
-  void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "WebKitNamedFlow_addEventListener_Callback";
-
-  @DomName('WebKitNamedFlow.dispatchEvent')
-  @DocsEditable
-  bool dispatchEvent(Event event) native "WebKitNamedFlow_dispatchEvent_Callback";
-
-  @DomName('WebKitNamedFlow.getContent')
-  @DocsEditable
-  List<Node> getContent() native "WebKitNamedFlow_getContent_Callback";
-
-  @DomName('WebKitNamedFlow.getRegions')
-  @DocsEditable
-  List<Node> getRegions() native "WebKitNamedFlow_getRegions_Callback";
-
-  @DomName('WebKitNamedFlow.getRegionsByContent')
-  @DocsEditable
-  List<Node> getRegionsByContent(Node contentNode) native "WebKitNamedFlow_getRegionsByContent_Callback";
-
-  @DomName('WebKitNamedFlow.removeEventListener')
-  @DocsEditable
-  void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "WebKitNamedFlow_removeEventListener_Callback";
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
 /**
  * Use the WebSocket interface to connect to a WebSocket,
  * and to send and receive data on that WebSocket.
@@ -27247,6 +27235,10 @@
   @DocsEditable
   void stop() native "DOMWindow_stop_Callback";
 
+  @DomName('DOMWindow.toString')
+  @DocsEditable
+  String toString() native "DOMWindow_toString_Callback";
+
   @DomName('DOMWindow.webkitConvertPointFromNodeToPage')
   @DocsEditable
   @SupportedBrowser(SupportedBrowser.CHROME)
@@ -28713,6 +28705,22 @@
 
 
 @DocsEditable
+@DomName('DatabaseSync')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.SAFARI)
+@Experimental
+abstract class _DatabaseSync extends NativeFieldWrapperClass1 {
+  _DatabaseSync.internal();
+
+}
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// WARNING: Do not edit - generated code.
+
+
+@DocsEditable
 @DomName('DedicatedWorkerContext')
 abstract class _DedicatedWorkerContext extends _WorkerContext {
   _DedicatedWorkerContext.internal() : super.internal();
@@ -28761,26 +28769,26 @@
   factory _DomPoint(num x, num y) => _create(x, y);
 
   @DocsEditable
-  static _DomPoint _create(x, y) native "WebKitPoint_constructorCallback";
+  static _DomPoint _create(x, y) native "DOMPoint_constructorCallback";
 
   /// Checks if this type is supported on the current platform.
   static bool get supported => true;
 
-  @DomName('WebKitPoint.x')
+  @DomName('DOMPoint.x')
   @DocsEditable
-  num get x native "WebKitPoint_x_Getter";
+  num get x native "DOMPoint_x_Getter";
 
-  @DomName('WebKitPoint.x')
+  @DomName('DOMPoint.x')
   @DocsEditable
-  void set x(num value) native "WebKitPoint_x_Setter";
+  void set x(num value) native "DOMPoint_x_Setter";
 
-  @DomName('WebKitPoint.y')
+  @DomName('DOMPoint.y')
   @DocsEditable
-  num get y native "WebKitPoint_y_Getter";
+  num get y native "DOMPoint_y_Getter";
 
-  @DomName('WebKitPoint.y')
+  @DomName('DOMPoint.y')
   @DocsEditable
-  void set y(num value) native "WebKitPoint_y_Setter";
+  void set y(num value) native "DOMPoint_y_Setter";
 
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -29757,7 +29765,9 @@
   @DocsEditable
   int get length native "NamedNodeMap_length_Getter";
 
-  Node operator[](int index) native "NamedNodeMap_item_Callback";
+  @DomName('NamedNodeMap.numericIndexGetter')
+  @DocsEditable
+  Node operator[](int index) native "NamedNodeMap_numericIndexGetter_Callback";
 
   void operator[]=(int index, Node value) {
     throw new UnsupportedError("Cannot assign element of immutable List.");
@@ -30778,29 +30788,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-
-// This class maps WebKitTransitionEvent to TransitionEvent for older Chrome
-// browser versions.
-@DomName('WebKitTransitionEvent')
-class _WebKitTransitionEvent extends Event implements TransitionEvent  {
-  _WebKitTransitionEvent.internal() : super.internal();
-
-  @DomName('WebKitTransitionEvent.elapsedTime')
-  @DocsEditable
-  num get elapsedTime native "WebKitTransitionEvent_elapsedTime_Getter";
-
-  @DomName('WebKitTransitionEvent.propertyName')
-  @DocsEditable
-  String get propertyName native "WebKitTransitionEvent_propertyName_Getter";
-
-  @DomName('WebKitTransitionEvent.pseudoElement')
-  @DocsEditable
-  String get pseudoElement native "WebKitTransitionEvent_pseudoElement_Getter";
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
 // WARNING: Do not edit - generated code.
 
 
@@ -33561,6 +33548,14 @@
 class _TextFactoryProvider {
   static Text createText(String data) => document.$dom_createTextNode(data);
 }
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+
+class Platform {
+  static final supportsTypedData = true;
+}
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
diff --git a/sdk/lib/io/buffer_list.dart b/sdk/lib/io/buffer_list.dart
index 72dc92f..c61710f 100644
--- a/sdk/lib/io/buffer_list.dart
+++ b/sdk/lib/io/buffer_list.dart
@@ -5,153 +5,91 @@
 part of dart.io;
 
 /**
- * Utility class that holds a number of byte buffers and can deliver
- * the bytes either one by one or in chunks.
+ * Utility class that can fast concatenate [List<int>]s of bytes. Use
+ * [readBytes] to get the final buffer.
  */
 class _BufferList {
+  const int _INIT_SIZE = 1 * 1024;
+
   _BufferList() {
     clear();
   }
 
-  /**
-   * Adds a new buffer to the list possibly with an offset of the
-   * first byte of interest. The offset can only be specified if the
-   * buffer list is empty.
-   */
-  void add(List<int> buffer, [int offset = 0]) {
-    assert(offset == 0 || _buffers.isEmpty);
-    _buffers.addLast(buffer);
-    _length += buffer.length;
-    if (offset != 0) _index = offset;
-  }
-
-  /** Alias for [add]. */
-  void write(List<int> buffer, [int offset = 0]) {
-    add(buffer, offset);
+  int pow2roundup(int x) {
+    --x;
+    x |= x >> 1;
+    x |= x >> 2;
+    x |= x >> 4;
+    x |= x >> 8;
+    x |= x >> 16;
+    return x + 1;
   }
 
   /**
-   * Returns the first buffer from the list. This returns the whole
-   * buffer and does not remove the buffer from the list. Use
-   * [index] to determine the index of the first byte in the buffer.
+   * Adds a new buffer to the list.
    */
-  List<int> get first => _buffers.first;
-
-  /**
-   * Returns the current index of the next byte. This will always be
-   * an index into the first buffer as when the index is advanced past
-   * the end of a buffer it is removed from the list.
-   */
-  int get index =>  _index;
-
-  /**
-   * Peek at the next available byte.
-   */
-  int peek() => _buffers.first[_index];
-
-  /**
-   * Returns the next available byte removing it from the buffers.
-   */
-  int next() {
-    int value = _buffers.first[_index++];
-    _length--;
-    if (_index == _buffers.first.length) {
-      _buffers.removeFirst();
-      _index = 0;
+  void add(List<int> buffer) {
+    int bufferLength = buffer.length;
+    int required = _length + bufferLength;
+    if (_buffer == null) {
+      int size = pow2roundup(required);
+      if (size < _INIT_SIZE) size = _INIT_SIZE;
+      _buffer = new Uint8List(size);
+    } else if (_buffer.length < required) {
+      // This will give is a list in the range of 2-4 times larger than
+      // required.
+      int size = pow2roundup(required) * 2;
+      Uint8List newBuffer = new Uint8List(size);
+      newBuffer.setRange(0, _buffer.length, _buffer);
+      _buffer = newBuffer;
     }
-    return value;
-  }
-
-  /**
-   * Read [count] bytes from the buffer list. If the number of bytes
-   * requested is not available null will be returned.
-   */
-  List<int> readBytes([int count]) {
-    if (count == null) count = length;
-    List<int> result;
-    if (_length == 0) return new Uint8List(0);
-    if (_length < count) return null;
-    if (_index == 0 && _buffers.first.length == count) {
-      result = _buffers.first;
-      _buffers.removeFirst();
-      _index = 0;
-      _length -= count;
-      return result;
+    assert(_buffer.length >= required);
+    if (buffer is Uint8List) {
+      _buffer.setRange(_length, required, buffer);
     } else {
-      int firstRemaining = _buffers.first.length - _index;
-      if (firstRemaining >= count) {
-        result = _buffers.first.sublist(_index, _index + count);
-        _index += count;
-        _length -= count;
-        if (_index == _buffers.first.length) {
-          _buffers.removeFirst();
-          _index = 0;
-        }
-        return result;
-      } else {
-        result = new Uint8List(count);
-        int remaining = count;
-        while (remaining > 0) {
-          int bytesInFirst = _buffers.first.length - _index;
-          if (bytesInFirst <= remaining) {
-            int startIndex = count - remaining;
-            int endIndex = startIndex + bytesInFirst;
-            result.setRange(startIndex, endIndex, _buffers.first, _index);
-            _buffers.removeFirst();
-            _index = 0;
-            _length -= bytesInFirst;
-            remaining -= bytesInFirst;
-          } else {
-            result.setRange(count - remaining, count, _buffers.first, _index);
-            _index = remaining;
-            _length -= remaining;
-            remaining = 0;
-            assert(_index < _buffers.first.length);
-          }
-        }
-        return result;
+      for (int i = 0; i < bufferLength; i++) {
+        _buffer[_length + i] = buffer[i];
       }
     }
+    _length = required;
   }
 
   /**
-   * Remove a number of bytes from the buffer list. Currently the
-   * number of bytes to remove must be confined to the first buffer.
+   * Same as [add].
    */
-  void removeBytes(int count) {
-    int firstRemaining = first.length - _index;
-    assert(count <= firstRemaining);
-    if (count == firstRemaining) {
-      _buffers.removeFirst();
-      _index = 0;
-    } else {
-      _index += count;
-    }
-    _length -= count;
+  void write(List<int> buffer) {
+    add(buffer);
   }
 
+  /**
+   * Read all the bytes from the buffer list. If it's empty, an empty list
+   * is returned. A call to [readBytes] will clear the buffer.
+   */
+  List<int> readBytes() {
+    if (_buffer == null) return new Uint8List(0);
+    var buffer = new Uint8List.view(_buffer.buffer, 0, _length);
+    clear();
+    return buffer;
+  }
 
   /**
-   * Returns the total number of bytes remaining in the buffers.
+   * Returns the total number of bytes in the buffer.
    */
   int get length => _length;
 
   /**
-   * Returns whether the buffer list is empty that is has no bytes
-   * available.
+   * Returns whether the buffer list is empty.
    */
-  bool get isEmpty => _buffers.isEmpty;
+  bool get isEmpty => _length == 0;
 
   /**
    * Clears the content of the buffer list.
    */
   void clear() {
-    _index = 0;
     _length = 0;
-    _buffers = new Queue();
+    _buffer = null;
   }
 
-  int _length;  // Total number of bytes remaining in the buffers.
-  Queue<List<int>> _buffers;  // List of data buffers.
-  int _index;  // Index of the next byte in the first buffer.
+  int _length;  // Total number of bytes in the buffer.
+  Uint8List _buffer;  // Internal buffer.
 }
diff --git a/sdk/lib/io/file_impl.dart b/sdk/lib/io/file_impl.dart
index a5ae2f5..ef467ac 100644
--- a/sdk/lib/io/file_impl.dart
+++ b/sdk/lib/io/file_impl.dart
@@ -478,8 +478,7 @@
     openRead().listen(
       (d) => chunks.add(d),
       onDone: () {
-        var result = chunks.readBytes(chunks.length);
-        if (result == null) result = <int>[];
+        var result = chunks.readBytes();
         completer.complete(result);
       },
       onError: (e) {
diff --git a/sdk/lib/io/http.dart b/sdk/lib/io/http.dart
index 21830f2..bacd50e 100644
--- a/sdk/lib/io/http.dart
+++ b/sdk/lib/io/http.dart
@@ -62,10 +62,22 @@
   // TODO(ajohnsen): Add HttpServer.secure.
   /**
    * Starts listening for HTTP requests on the specified [address] and
-   * [port]. If a [port] of 0 is specified the server will choose an
-   * ephemeral port. The optional argument [backlog] can be used to
-   * specify the listen backlog for the underlying OS listen
-   * setup.
+   * [port].
+   *
+   * The default value for [address] is 127.0.0.1, which will allow
+   * only incoming connections from the local host. To allow for
+   * incoming connection from the network use either the value 0.0.0.0
+   * to bind to all interfaces or the IP address of a specific
+   * interface.
+   *
+   * If [port] has the value [:0:] (the default) an ephemeral port
+   * will be chosen by the system. The actual port used can be
+   * retrieved using the [:port:] getter.
+   *
+   * The optional argument [backlog] can be used to specify the listen
+   * backlog for the underlying OS listen setup. If [backlog] has the
+   * value of [:0:] (the default) a reasonable value will be chosen by
+   * the system.
    */
   static Future<HttpServer> bind([String address = "127.0.0.1",
                                   int port = 0,
diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart
index 6477f3a..d9db3fd 100644
--- a/sdk/lib/io/http_impl.dart
+++ b/sdk/lib/io/http_impl.dart
@@ -1838,6 +1838,8 @@
 
   int get port => _socket.port;
 
+  String get host => _socket.host;
+
   String get remoteHost => _socket.remoteHost;
 
   int get remotePort => _socket.remotePort;
diff --git a/sdk/lib/io/http_parser.dart b/sdk/lib/io/http_parser.dart
index 3c04684..61407df 100644
--- a/sdk/lib/io/http_parser.dart
+++ b/sdk/lib/io/http_parser.dart
@@ -234,6 +234,15 @@
     return new Future.value(this);
   }
 
+  void _parse() {
+    try {
+      _doParse();
+    } catch (e, s) {
+      _state = _State.FAILURE;
+      error(e, s);
+    }
+  }
+
   // From RFC 2616.
   // generic-message = start-line
   //                   *(message-header CRLF)
@@ -243,201 +252,267 @@
   // Request-Line    = Method SP Request-URI SP HTTP-Version CRLF
   // Status-Line     = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
   // message-header  = field-name ":" [ field-value ]
-  void _parse() {
+  void _doParse() {
     assert(!_parserCalled);
     _parserCalled = true;
-    try {
-      if (_state == _State.CLOSED) {
-        throw new HttpParserException("Data on closed connection");
+    if (_state == _State.CLOSED) {
+      throw new HttpParserException("Data on closed connection");
+    }
+    if (_state == _State.FAILURE) {
+      throw new HttpParserException("Data on failed connection");
+    }
+    while (_buffer != null &&
+           _index < _buffer.length &&
+           _state != _State.FAILURE &&
+           _state != _State.UPGRADED) {
+      if (_paused) {
+        _parserCalled = false;
+        return;
       }
-      if (_state == _State.FAILURE) {
-        throw new HttpParserException("Data on failed connection");
-      }
-      while (_buffer != null &&
-             _index < _buffer.length &&
-             _state != _State.FAILURE &&
-             _state != _State.UPGRADED) {
-        if (_paused) {
-          _parserCalled = false;
-          return;
-        }
-        int byte = _buffer[_index++];
-        switch (_state) {
-          case _State.START:
-            if (byte == _Const.HTTP[0]) {
-              // Start parsing method or HTTP version.
-              _httpVersionIndex = 1;
-              _state = _State.METHOD_OR_RESPONSE_HTTP_VERSION;
+      int byte = _buffer[_index++];
+      switch (_state) {
+        case _State.START:
+          if (byte == _Const.HTTP[0]) {
+            // Start parsing method or HTTP version.
+            _httpVersionIndex = 1;
+            _state = _State.METHOD_OR_RESPONSE_HTTP_VERSION;
+          } else {
+            // Start parsing method.
+            if (!_isTokenChar(byte)) {
+              throw new HttpParserException("Invalid request method");
+            }
+            _method_or_status_code.add(byte);
+            if (!_requestParser) {
+              throw new HttpParserException("Invalid response line");
+            }
+            _state = _State.REQUEST_LINE_METHOD;
+          }
+          break;
+
+        case _State.METHOD_OR_RESPONSE_HTTP_VERSION:
+          if (_httpVersionIndex < _Const.HTTP.length &&
+              byte == _Const.HTTP[_httpVersionIndex]) {
+            // Continue parsing HTTP version.
+            _httpVersionIndex++;
+          } else if (_httpVersionIndex == _Const.HTTP.length &&
+                     byte == _CharCode.SLASH) {
+            // HTTP/ parsed. As method is a token this cannot be a
+            // method anymore.
+            _httpVersionIndex++;
+            if (_requestParser) {
+              throw new HttpParserException("Invalid request line");
+            }
+            _state = _State.RESPONSE_HTTP_VERSION;
+          } else {
+            // Did not parse HTTP version. Expect method instead.
+            for (int i = 0; i < _httpVersionIndex; i++) {
+              _method_or_status_code.add(_Const.HTTP[i]);
+            }
+            if (byte == _CharCode.SP) {
+              _state = _State.REQUEST_LINE_URI;
             } else {
-              // Start parsing method.
-              if (!_isTokenChar(byte)) {
-                throw new HttpParserException("Invalid request method");
-              }
               _method_or_status_code.add(byte);
+              _httpVersion = _HttpVersion.UNDETERMINED;
               if (!_requestParser) {
                 throw new HttpParserException("Invalid response line");
               }
               _state = _State.REQUEST_LINE_METHOD;
             }
-            break;
+          }
+          break;
 
-          case _State.METHOD_OR_RESPONSE_HTTP_VERSION:
-            if (_httpVersionIndex < _Const.HTTP.length &&
-                byte == _Const.HTTP[_httpVersionIndex]) {
-              // Continue parsing HTTP version.
-              _httpVersionIndex++;
-            } else if (_httpVersionIndex == _Const.HTTP.length &&
-                       byte == _CharCode.SLASH) {
-              // HTTP/ parsed. As method is a token this cannot be a
-              // method anymore.
-              _httpVersionIndex++;
-              if (_requestParser) {
-                throw new HttpParserException("Invalid request line");
-              }
-              _state = _State.RESPONSE_HTTP_VERSION;
-            } else {
-              // Did not parse HTTP version. Expect method instead.
-              for (int i = 0; i < _httpVersionIndex; i++) {
-                _method_or_status_code.add(_Const.HTTP[i]);
-              }
-              if (byte == _CharCode.SP) {
-                _state = _State.REQUEST_LINE_URI;
-              } else {
-                _method_or_status_code.add(byte);
-                _httpVersion = _HttpVersion.UNDETERMINED;
-                if (!_requestParser) {
-                  throw new HttpParserException("Invalid response line");
-                }
-                _state = _State.REQUEST_LINE_METHOD;
-              }
+        case _State.RESPONSE_HTTP_VERSION:
+          if (_httpVersionIndex < _Const.HTTP1DOT.length) {
+            // Continue parsing HTTP version.
+            _expect(byte, _Const.HTTP1DOT[_httpVersionIndex]);
+            _httpVersionIndex++;
+          } else if (_httpVersionIndex == _Const.HTTP1DOT.length &&
+                     byte == _CharCode.ONE) {
+            // HTTP/1.1 parsed.
+            _httpVersion = _HttpVersion.HTTP11;
+            _persistentConnection = true;
+            _httpVersionIndex++;
+          } else if (_httpVersionIndex == _Const.HTTP1DOT.length &&
+                     byte == _CharCode.ZERO) {
+            // HTTP/1.0 parsed.
+            _httpVersion = _HttpVersion.HTTP10;
+            _persistentConnection = false;
+            _httpVersionIndex++;
+          } else if (_httpVersionIndex == _Const.HTTP1DOT.length + 1) {
+            _expect(byte, _CharCode.SP);
+            // HTTP version parsed.
+            _state = _State.RESPONSE_LINE_STATUS_CODE;
+          } else {
+            throw new HttpParserException("Invalid response line");
+          }
+          break;
+
+        case _State.REQUEST_LINE_METHOD:
+          if (byte == _CharCode.SP) {
+            _state = _State.REQUEST_LINE_URI;
+          } else {
+            if (_Const.SEPARATORS_AND_CR_LF.indexOf(byte) != -1) {
+              throw new HttpParserException("Invalid request method");
             }
-            break;
+            _method_or_status_code.add(byte);
+          }
+          break;
 
-          case _State.RESPONSE_HTTP_VERSION:
-            if (_httpVersionIndex < _Const.HTTP1DOT.length) {
-              // Continue parsing HTTP version.
-              _expect(byte, _Const.HTTP1DOT[_httpVersionIndex]);
-              _httpVersionIndex++;
-            } else if (_httpVersionIndex == _Const.HTTP1DOT.length &&
-                       byte == _CharCode.ONE) {
+        case _State.REQUEST_LINE_URI:
+          if (byte == _CharCode.SP) {
+            if (_uri_or_reason_phrase.length == 0) {
+              throw new HttpParserException("Invalid request URI");
+            }
+            _state = _State.REQUEST_LINE_HTTP_VERSION;
+            _httpVersionIndex = 0;
+          } else {
+            if (byte == _CharCode.CR || byte == _CharCode.LF) {
+              throw new HttpParserException("Invalid request URI");
+            }
+            _uri_or_reason_phrase.add(byte);
+          }
+          break;
+
+        case _State.REQUEST_LINE_HTTP_VERSION:
+          if (_httpVersionIndex < _Const.HTTP1DOT.length) {
+            _expect(byte, _Const.HTTP11[_httpVersionIndex]);
+            _httpVersionIndex++;
+          } else if (_httpVersionIndex == _Const.HTTP1DOT.length) {
+            if (byte == _CharCode.ONE) {
               // HTTP/1.1 parsed.
               _httpVersion = _HttpVersion.HTTP11;
               _persistentConnection = true;
               _httpVersionIndex++;
-            } else if (_httpVersionIndex == _Const.HTTP1DOT.length &&
-                       byte == _CharCode.ZERO) {
+            } else if (byte == _CharCode.ZERO) {
               // HTTP/1.0 parsed.
               _httpVersion = _HttpVersion.HTTP10;
               _persistentConnection = false;
               _httpVersionIndex++;
-            } else if (_httpVersionIndex == _Const.HTTP1DOT.length + 1) {
-              _expect(byte, _CharCode.SP);
-              // HTTP version parsed.
-              _state = _State.RESPONSE_LINE_STATUS_CODE;
             } else {
               throw new HttpParserException("Invalid response line");
             }
-            break;
+          } else {
+            _expect(byte, _CharCode.CR);
+            _state = _State.REQUEST_LINE_ENDING;
+          }
+          break;
 
-          case _State.REQUEST_LINE_METHOD:
-            if (byte == _CharCode.SP) {
-              _state = _State.REQUEST_LINE_URI;
-            } else {
-              if (_Const.SEPARATORS_AND_CR_LF.indexOf(byte) != -1) {
-                throw new HttpParserException("Invalid request method");
-              }
-              _method_or_status_code.add(byte);
+        case _State.REQUEST_LINE_ENDING:
+          _expect(byte, _CharCode.LF);
+          _messageType = _MessageType.REQUEST;
+          _state = _State.HEADER_START;
+          break;
+
+        case _State.RESPONSE_LINE_STATUS_CODE:
+          if (byte == _CharCode.SP) {
+            if (_method_or_status_code.length != 3) {
+              throw new HttpParserException("Invalid response status code");
             }
-            break;
-
-          case _State.REQUEST_LINE_URI:
-            if (byte == _CharCode.SP) {
-              if (_uri_or_reason_phrase.length == 0) {
-                throw new HttpParserException("Invalid request URI");
-              }
-              _state = _State.REQUEST_LINE_HTTP_VERSION;
-              _httpVersionIndex = 0;
-            } else {
-              if (byte == _CharCode.CR || byte == _CharCode.LF) {
-                throw new HttpParserException("Invalid request URI");
-              }
-              _uri_or_reason_phrase.add(byte);
-            }
-            break;
-
-          case _State.REQUEST_LINE_HTTP_VERSION:
-            if (_httpVersionIndex < _Const.HTTP1DOT.length) {
-              _expect(byte, _Const.HTTP11[_httpVersionIndex]);
-              _httpVersionIndex++;
-            } else if (_httpVersionIndex == _Const.HTTP1DOT.length) {
-              if (byte == _CharCode.ONE) {
-                // HTTP/1.1 parsed.
-                _httpVersion = _HttpVersion.HTTP11;
-                _persistentConnection = true;
-                _httpVersionIndex++;
-              } else if (byte == _CharCode.ZERO) {
-                // HTTP/1.0 parsed.
-                _httpVersion = _HttpVersion.HTTP10;
-                _persistentConnection = false;
-                _httpVersionIndex++;
-              } else {
-                throw new HttpParserException("Invalid response line");
-              }
-            } else {
-              _expect(byte, _CharCode.CR);
-              _state = _State.REQUEST_LINE_ENDING;
-            }
-            break;
-
-          case _State.REQUEST_LINE_ENDING:
-            _expect(byte, _CharCode.LF);
-            _messageType = _MessageType.REQUEST;
-            _state = _State.HEADER_START;
-            break;
-
-          case _State.RESPONSE_LINE_STATUS_CODE:
-            if (byte == _CharCode.SP) {
-              if (_method_or_status_code.length != 3) {
-                throw new HttpParserException("Invalid response status code");
-              }
-              _state = _State.RESPONSE_LINE_REASON_PHRASE;
-            } else {
-              if (byte < 0x30 && 0x39 < byte) {
-                throw new HttpParserException("Invalid response status code");
-              } else {
-                _method_or_status_code.add(byte);
-              }
-            }
-            break;
-
-          case _State.RESPONSE_LINE_REASON_PHRASE:
-            if (byte == _CharCode.CR) {
-              _state = _State.RESPONSE_LINE_ENDING;
-            } else {
-              if (byte == _CharCode.CR || byte == _CharCode.LF) {
-                throw new HttpParserException("Invalid response reason phrase");
-              }
-              _uri_or_reason_phrase.add(byte);
-            }
-            break;
-
-          case _State.RESPONSE_LINE_ENDING:
-            _expect(byte, _CharCode.LF);
-            _messageType == _MessageType.RESPONSE;
-            _statusCode = int.parse(
-                new String.fromCharCodes(_method_or_status_code));
-            if (_statusCode < 100 || _statusCode > 599) {
+            _state = _State.RESPONSE_LINE_REASON_PHRASE;
+          } else {
+            if (byte < 0x30 && 0x39 < byte) {
               throw new HttpParserException("Invalid response status code");
             } else {
-              // Check whether this response will never have a body.
-              _noMessageBody = _statusCode <= 199 || _statusCode == 204 ||
-                  _statusCode == 304;
+              _method_or_status_code.add(byte);
             }
-            _state = _State.HEADER_START;
-            break;
+          }
+          break;
 
-          case _State.HEADER_START:
-            _headers = new _HttpHeaders(version);
+        case _State.RESPONSE_LINE_REASON_PHRASE:
+          if (byte == _CharCode.CR) {
+            _state = _State.RESPONSE_LINE_ENDING;
+          } else {
+            if (byte == _CharCode.CR || byte == _CharCode.LF) {
+              throw new HttpParserException("Invalid response reason phrase");
+            }
+            _uri_or_reason_phrase.add(byte);
+          }
+          break;
+
+        case _State.RESPONSE_LINE_ENDING:
+          _expect(byte, _CharCode.LF);
+          _messageType == _MessageType.RESPONSE;
+          _statusCode = int.parse(
+              new String.fromCharCodes(_method_or_status_code));
+          if (_statusCode < 100 || _statusCode > 599) {
+            throw new HttpParserException("Invalid response status code");
+          } else {
+            // Check whether this response will never have a body.
+            _noMessageBody = _statusCode <= 199 || _statusCode == 204 ||
+                _statusCode == 304;
+          }
+          _state = _State.HEADER_START;
+          break;
+
+        case _State.HEADER_START:
+          _headers = new _HttpHeaders(version);
+          if (byte == _CharCode.CR) {
+            _state = _State.HEADER_ENDING;
+          } else {
+            // Start of new header field.
+            _headerField.add(_toLowerCase(byte));
+            _state = _State.HEADER_FIELD;
+          }
+          break;
+
+        case _State.HEADER_FIELD:
+          if (byte == _CharCode.COLON) {
+            _state = _State.HEADER_VALUE_START;
+          } else {
+            if (!_isTokenChar(byte)) {
+              throw new HttpParserException("Invalid header field name");
+            }
+            _headerField.add(_toLowerCase(byte));
+          }
+          break;
+
+        case _State.HEADER_VALUE_START:
+          if (byte == _CharCode.CR) {
+            _state = _State.HEADER_VALUE_FOLDING_OR_ENDING;
+          } else if (byte != _CharCode.SP && byte != _CharCode.HT) {
+            // Start of new header value.
+            _headerValue.add(byte);
+            _state = _State.HEADER_VALUE;
+          }
+          break;
+
+        case _State.HEADER_VALUE:
+          if (byte == _CharCode.CR) {
+            _state = _State.HEADER_VALUE_FOLDING_OR_ENDING;
+          } else {
+            _headerValue.add(byte);
+          }
+          break;
+
+        case _State.HEADER_VALUE_FOLDING_OR_ENDING:
+          _expect(byte, _CharCode.LF);
+          _state = _State.HEADER_VALUE_FOLD_OR_END;
+          break;
+
+        case _State.HEADER_VALUE_FOLD_OR_END:
+          if (byte == _CharCode.SP || byte == _CharCode.HT) {
+            _state = _State.HEADER_VALUE_START;
+          } else {
+            String headerField = new String.fromCharCodes(_headerField);
+            String headerValue = new String.fromCharCodes(_headerValue);
+            if (headerField == "transfer-encoding" &&
+                       headerValue.toLowerCase() == "chunked") {
+              _chunked = true;
+            }
+            if (headerField == "connection") {
+              List<String> tokens = _tokenizeFieldValue(headerValue);
+              for (int i = 0; i < tokens.length; i++) {
+                if (tokens[i].toLowerCase() == "upgrade") {
+                  _connectionUpgrade = true;
+                }
+                _headers.add(headerField, tokens[i]);
+              }
+            } else {
+              _headers.add(headerField, headerValue);
+            }
+            _headerField.clear();
+            _headerValue.clear();
+
             if (byte == _CharCode.CR) {
               _state = _State.HEADER_ENDING;
             } else {
@@ -445,231 +520,160 @@
               _headerField.add(_toLowerCase(byte));
               _state = _State.HEADER_FIELD;
             }
-            break;
+          }
+          break;
 
-          case _State.HEADER_FIELD:
-            if (byte == _CharCode.COLON) {
-              _state = _State.HEADER_VALUE_START;
-            } else {
-              if (!_isTokenChar(byte)) {
-                throw new HttpParserException("Invalid header field name");
-              }
-              _headerField.add(_toLowerCase(byte));
-            }
-            break;
+        case _State.HEADER_ENDING:
+          _expect(byte, _CharCode.LF);
+          _headers._mutable = false;
 
-          case _State.HEADER_VALUE_START:
-            if (byte == _CharCode.CR) {
-              _state = _State.HEADER_VALUE_FOLDING_OR_ENDING;
-            } else if (byte != _CharCode.SP && byte != _CharCode.HT) {
-              // Start of new header value.
-              _headerValue.add(byte);
-              _state = _State.HEADER_VALUE;
-            }
-            break;
+          _transferLength = _headers.contentLength;
+          // Ignore the Content-Length header if Transfer-Encoding
+          // is chunked (RFC 2616 section 4.4)
+          if (_chunked) _transferLength = -1;
 
-          case _State.HEADER_VALUE:
-            if (byte == _CharCode.CR) {
-              _state = _State.HEADER_VALUE_FOLDING_OR_ENDING;
-            } else {
-              _headerValue.add(byte);
-            }
-            break;
-
-          case _State.HEADER_VALUE_FOLDING_OR_ENDING:
-            _expect(byte, _CharCode.LF);
-            _state = _State.HEADER_VALUE_FOLD_OR_END;
-            break;
-
-          case _State.HEADER_VALUE_FOLD_OR_END:
-            if (byte == _CharCode.SP || byte == _CharCode.HT) {
-              _state = _State.HEADER_VALUE_START;
-            } else {
-              String headerField = new String.fromCharCodes(_headerField);
-              String headerValue = new String.fromCharCodes(_headerValue);
-              if (headerField == "transfer-encoding" &&
-                         headerValue.toLowerCase() == "chunked") {
-                _chunked = true;
-              }
-              if (headerField == "connection") {
-                List<String> tokens = _tokenizeFieldValue(headerValue);
-                for (int i = 0; i < tokens.length; i++) {
-                  if (tokens[i].toLowerCase() == "upgrade") {
-                    _connectionUpgrade = true;
-                  }
-                  _headers.add(headerField, tokens[i]);
-                }
-              } else {
-                _headers.add(headerField, headerValue);
-              }
-              _headerField.clear();
-              _headerValue.clear();
-
-              if (byte == _CharCode.CR) {
-                _state = _State.HEADER_ENDING;
-              } else {
-                // Start of new header field.
-                _headerField.add(_toLowerCase(byte));
-                _state = _State.HEADER_FIELD;
-              }
-            }
-            break;
-
-          case _State.HEADER_ENDING:
-            _expect(byte, _CharCode.LF);
-            _headers._mutable = false;
-
-            _transferLength = _headers.contentLength;
-            // Ignore the Content-Length header if Transfer-Encoding
-            // is chunked (RFC 2616 section 4.4)
-            if (_chunked) _transferLength = -1;
-
-            // If a request message has neither Content-Length nor
-            // Transfer-Encoding the message must not have a body (RFC
-            // 2616 section 4.3).
-            if (_messageType == _MessageType.REQUEST &&
-                _transferLength < 0 &&
-                _chunked == false) {
-              _transferLength = 0;
-            }
-            if (_connectionUpgrade) {
-              _state = _State.UPGRADED;
-              _transferLength = 0;
-            }
-            _createIncoming(_transferLength);
-            if (_requestParser) {
-              _incoming.method =
-                  new String.fromCharCodes(_method_or_status_code);
-              _incoming.uri =
-                  Uri.parse(
-                      new String.fromCharCodes(_uri_or_reason_phrase));
-            } else {
-              _incoming.statusCode = _statusCode;
-              _incoming.reasonPhrase =
-                  new String.fromCharCodes(_uri_or_reason_phrase);
-            }
-            _method_or_status_code.clear();
-            _uri_or_reason_phrase.clear();
-            if (_connectionUpgrade) {
-              _incoming.upgraded = true;
-              _controller.add(_incoming);
-              break;
-            }
-            if (_transferLength == 0 ||
-                (_messageType == _MessageType.RESPONSE &&
-                 (_noMessageBody || _responseToMethod == "HEAD"))) {
-              _reset();
-              var tmp = _incoming;
-              _closeIncoming();
-              _controller.add(tmp);
-              break;
-            } else if (_chunked) {
-              _state = _State.CHUNK_SIZE;
-              _remainingContent = 0;
-            } else if (_transferLength > 0) {
-              _remainingContent = _transferLength;
-              _state = _State.BODY;
-            } else {
-              // Neither chunked nor content length. End of body
-              // indicated by close.
-              _state = _State.BODY;
-            }
+          // If a request message has neither Content-Length nor
+          // Transfer-Encoding the message must not have a body (RFC
+          // 2616 section 4.3).
+          if (_messageType == _MessageType.REQUEST &&
+              _transferLength < 0 &&
+              _chunked == false) {
+            _transferLength = 0;
+          }
+          if (_connectionUpgrade) {
+            _state = _State.UPGRADED;
+            _transferLength = 0;
+          }
+          _createIncoming(_transferLength);
+          if (_requestParser) {
+            _incoming.method =
+                new String.fromCharCodes(_method_or_status_code);
+            _incoming.uri =
+                Uri.parse(
+                    new String.fromCharCodes(_uri_or_reason_phrase));
+          } else {
+            _incoming.statusCode = _statusCode;
+            _incoming.reasonPhrase =
+                new String.fromCharCodes(_uri_or_reason_phrase);
+          }
+          _method_or_status_code.clear();
+          _uri_or_reason_phrase.clear();
+          if (_connectionUpgrade) {
+            _incoming.upgraded = true;
             _controller.add(_incoming);
             break;
-
-          case _State.CHUNK_SIZE_STARTING_CR:
-            _expect(byte, _CharCode.CR);
-            _state = _State.CHUNK_SIZE_STARTING_LF;
-            break;
-
-          case _State.CHUNK_SIZE_STARTING_LF:
-            _expect(byte, _CharCode.LF);
-            _state = _State.CHUNK_SIZE;
-            break;
-
-          case _State.CHUNK_SIZE:
-            if (byte == _CharCode.CR) {
-              _state = _State.CHUNK_SIZE_ENDING;
-            } else if (byte == _CharCode.SEMI_COLON) {
-              _state = _State.CHUNK_SIZE_EXTENSION;
-            } else {
-              int value = _expectHexDigit(byte);
-              _remainingContent = _remainingContent * 16 + value;
-            }
-            break;
-
-          case _State.CHUNK_SIZE_EXTENSION:
-            if (byte == _CharCode.CR) {
-              _state = _State.CHUNK_SIZE_ENDING;
-            }
-            break;
-
-          case _State.CHUNK_SIZE_ENDING:
-            _expect(byte, _CharCode.LF);
-            if (_remainingContent > 0) {
-              _state = _State.BODY;
-            } else {
-              _state = _State.CHUNKED_BODY_DONE_CR;
-            }
-            break;
-
-          case _State.CHUNKED_BODY_DONE_CR:
-            _expect(byte, _CharCode.CR);
-            _state = _State.CHUNKED_BODY_DONE_LF;
-            break;
-
-          case _State.CHUNKED_BODY_DONE_LF:
-            _expect(byte, _CharCode.LF);
+          }
+          if (_transferLength == 0 ||
+              (_messageType == _MessageType.RESPONSE &&
+               (_noMessageBody || _responseToMethod == "HEAD"))) {
             _reset();
+            var tmp = _incoming;
             _closeIncoming();
+            _controller.add(tmp);
             break;
+          } else if (_chunked) {
+            _state = _State.CHUNK_SIZE;
+            _remainingContent = 0;
+          } else if (_transferLength > 0) {
+            _remainingContent = _transferLength;
+            _state = _State.BODY;
+          } else {
+            // Neither chunked nor content length. End of body
+            // indicated by close.
+            _state = _State.BODY;
+          }
+          _controller.add(_incoming);
+          break;
 
-          case _State.BODY:
-            // The body is not handled one byte at a time but in blocks.
-            _index--;
-            int dataAvailable = _buffer.length - _index;
-            List<int> data;
-            if (_remainingContent == null ||
-                dataAvailable <= _remainingContent) {
-              if (_index == 0) {
-                data = _buffer;
-              } else {
-                data = new Uint8List(dataAvailable);
-                data.setRange(0, dataAvailable, _buffer, _index);
-              }
+        case _State.CHUNK_SIZE_STARTING_CR:
+          _expect(byte, _CharCode.CR);
+          _state = _State.CHUNK_SIZE_STARTING_LF;
+          break;
+
+        case _State.CHUNK_SIZE_STARTING_LF:
+          _expect(byte, _CharCode.LF);
+          _state = _State.CHUNK_SIZE;
+          break;
+
+        case _State.CHUNK_SIZE:
+          if (byte == _CharCode.CR) {
+            _state = _State.CHUNK_SIZE_ENDING;
+          } else if (byte == _CharCode.SEMI_COLON) {
+            _state = _State.CHUNK_SIZE_EXTENSION;
+          } else {
+            int value = _expectHexDigit(byte);
+            _remainingContent = _remainingContent * 16 + value;
+          }
+          break;
+
+        case _State.CHUNK_SIZE_EXTENSION:
+          if (byte == _CharCode.CR) {
+            _state = _State.CHUNK_SIZE_ENDING;
+          }
+          break;
+
+        case _State.CHUNK_SIZE_ENDING:
+          _expect(byte, _CharCode.LF);
+          if (_remainingContent > 0) {
+            _state = _State.BODY;
+          } else {
+            _state = _State.CHUNKED_BODY_DONE_CR;
+          }
+          break;
+
+        case _State.CHUNKED_BODY_DONE_CR:
+          _expect(byte, _CharCode.CR);
+          _state = _State.CHUNKED_BODY_DONE_LF;
+          break;
+
+        case _State.CHUNKED_BODY_DONE_LF:
+          _expect(byte, _CharCode.LF);
+          _reset();
+          _closeIncoming();
+          break;
+
+        case _State.BODY:
+          // The body is not handled one byte at a time but in blocks.
+          _index--;
+          int dataAvailable = _buffer.length - _index;
+          List<int> data;
+          if (_remainingContent == null ||
+              dataAvailable <= _remainingContent) {
+            if (_index == 0) {
+              data = _buffer;
             } else {
-              data = new Uint8List(_remainingContent);
-              data.setRange(0, _remainingContent, _buffer, _index);
+              data = new Uint8List(dataAvailable);
+              data.setRange(0, dataAvailable, _buffer, _index);
             }
-            _bodyController.add(data);
-            if (_remainingContent != null) {
-              _remainingContent -= data.length;
+          } else {
+            data = new Uint8List(_remainingContent);
+            data.setRange(0, _remainingContent, _buffer, _index);
+          }
+          _bodyController.add(data);
+          if (_remainingContent != null) {
+            _remainingContent -= data.length;
+          }
+          _index += data.length;
+          if (_remainingContent == 0) {
+            if (!_chunked) {
+              _reset();
+              _closeIncoming();
+            } else {
+              _state = _State.CHUNK_SIZE_STARTING_CR;
             }
-            _index += data.length;
-            if (_remainingContent == 0) {
-              if (!_chunked) {
-                _reset();
-                _closeIncoming();
-              } else {
-                _state = _State.CHUNK_SIZE_STARTING_CR;
-              }
-            }
-            break;
+          }
+          break;
 
-          case _State.FAILURE:
-            // Should be unreachable.
-            assert(false);
-            break;
+        case _State.FAILURE:
+          // Should be unreachable.
+          assert(false);
+          break;
 
-          default:
-            // Should be unreachable.
-            assert(false);
-            break;
-        }
+        default:
+          // Should be unreachable.
+          assert(false);
+          break;
       }
-    } catch (e, s) {
-      _state = _State.FAILURE;
-      error(e, s);
     }
 
     _parserCalled = false;
diff --git a/sdk/lib/io/io_sink.dart b/sdk/lib/io/io_sink.dart
index 8001905..c6a82f0 100644
--- a/sdk/lib/io/io_sink.dart
+++ b/sdk/lib/io/io_sink.dart
@@ -52,22 +52,129 @@
   Future get done;
 }
 
-
-class _IOSinkImpl implements IOSink {
-  final StreamConsumer<List<int>> _target;
+class _StreamSinkImpl<T> implements StreamSink<T> {
+  final StreamConsumer<T> _target;
   Completer _doneCompleter = new Completer();
   Future _doneFuture;
-  StreamController<List<int>> _controllerInstance;
+  StreamController<T> _controllerInstance;
   Completer _controllerCompleter;
-  Encoding _encoding;
   bool _isClosed = false;
   bool _isBound = false;
-  bool _encodingMutable = true;
 
-  _IOSinkImpl(StreamConsumer<List<int>> this._target, this._encoding) {
+  _StreamSinkImpl(StreamConsumer<T> this._target) {
     _doneFuture = _doneCompleter.future;
   }
 
+  void add(T data) {
+    _controller.add(data);
+  }
+
+  void addError(error) {
+    _controller.addError(error);
+  }
+
+  Future addStream(Stream<T> stream) {
+    if (_isBound) {
+      throw new StateError("StreamSink is already bound to a stream");
+    }
+    _isBound = true;
+    // Wait for any sync operations to complete.
+    Future targetAddStream() {
+      return _target.addStream(stream)
+          .whenComplete(() {
+            _isBound = false;
+          });
+    }
+    if (_controllerInstance == null) return targetAddStream();
+    var future = _controllerCompleter.future;
+    _controllerInstance.close();
+    return future.then((_) => targetAddStream());
+  }
+
+  Future close() {
+    if (_isBound) {
+      throw new StateError("StreamSink is bound to a stream");
+    }
+    if (!_isClosed) {
+      _isClosed = true;
+      if (_controllerInstance != null) {
+        _controllerInstance.close();
+      } else {
+        _closeTarget();
+      }
+    }
+    return done;
+  }
+
+  void _closeTarget() {
+    _target.close()
+        .then((value) => _completeDone(value: value),
+              onError: (error) => _completeDone(error: error));
+  }
+
+  Future get done => _doneFuture;
+
+  void _completeDone({value, error}) {
+    if (_doneCompleter == null) return;
+    var tmp = _doneCompleter;
+    _doneCompleter = null;
+    if (error == null) {
+      tmp.complete(value);
+    } else {
+      tmp.completeError(error);
+    }
+  }
+
+  StreamController<T> get _controller {
+    if (_isBound) {
+      throw new StateError("StreamSink is bound to a stream");
+    }
+    if (_isClosed) {
+      throw new StateError("StreamSink is closed");
+    }
+    if (_controllerInstance == null) {
+      _controllerInstance = new StreamController<T>();
+      _controllerCompleter = new Completer();
+      _target.addStream(_controller.stream)
+          .then(
+              (_) {
+                if (_isBound) {
+                  // A new stream takes over - forward values to that stream.
+                  var completer = _controllerCompleter;
+                  _controllerCompleter = null;
+                  _controllerInstance = null;
+                  completer.complete();
+                } else {
+                  // No new stream, .close was called. Close _target.
+                  _closeTarget();
+                }
+              },
+              onError: (error) {
+                if (_isBound) {
+                  // A new stream takes over - forward errors to that stream.
+                  var completer = _controllerCompleter;
+                  _controllerCompleter = null;
+                  _controllerInstance = null;
+                  completer.completeError(error);
+                } else {
+                  // No new stream. No need to close target, as it have already
+                  // failed.
+                  _completeDone(error: error);
+                }
+              });
+    }
+    return _controllerInstance;
+  }
+}
+
+
+class _IOSinkImpl extends _StreamSinkImpl<List<int>> implements IOSink {
+  Encoding _encoding;
+  bool _encodingMutable = true;
+
+  _IOSinkImpl(StreamConsumer<List<int>> target, this._encoding)
+      : super(target);
+
   Encoding get encoding => _encoding;
 
   void set encoding(Encoding value) {
@@ -118,105 +225,4 @@
   void writeCharCode(int charCode) {
     write(new String.fromCharCode(charCode));
   }
-
-  void add(List<int> data) {
-    _controller.add(data);
-  }
-
-  void addError(error) {
-    _controller.addError(error);
-  }
-
-  Future addStream(Stream<List<int>> stream) {
-    if (_isBound) {
-      throw new StateError("IOSink is already bound to a stream");
-    }
-    _isBound = true;
-    // Wait for any sync operations to complete.
-    Future targetAddStream() {
-      return _target.addStream(stream)
-          .whenComplete(() {
-            _isBound = false;
-          });
-    }
-    if (_controllerInstance == null) return targetAddStream();
-    var future = _controllerCompleter.future;
-    _controllerInstance.close();
-    return future.then((_) => targetAddStream());
-  }
-
-  Future close() {
-    if (_isBound) {
-      throw new StateError("IOSink is bound to a stream");
-    }
-    if (!_isClosed) {
-      _isClosed = true;
-      if (_controllerInstance != null) {
-        _controllerInstance.close();
-      } else {
-        _closeTarget();
-      }
-    }
-    return done;
-  }
-
-  void _closeTarget() {
-    _target.close()
-        .then((value) => _completeDone(value: value),
-              onError: (error) => _completeDone(error: error));
-  }
-
-  Future get done => _doneFuture;
-
-  void _completeDone({value, error}) {
-    if (_doneCompleter == null) return;
-    var tmp = _doneCompleter;
-    _doneCompleter = null;
-    if (error == null) {
-      tmp.complete(value);
-    } else {
-      tmp.completeError(error);
-    }
-  }
-
-  StreamController<List<int>> get _controller {
-    if (_isBound) {
-      throw new StateError("IOSink is bound to a stream");
-    }
-    if (_isClosed) {
-      throw new StateError("IOSink is closed");
-    }
-    if (_controllerInstance == null) {
-      _controllerInstance = new StreamController<List<int>>();
-      _controllerCompleter = new Completer();
-      _target.addStream(_controller.stream)
-          .then(
-              (_) {
-                if (_isBound) {
-                  // A new stream takes over - forward values to that stream.
-                  var completer = _controllerCompleter;
-                  _controllerCompleter = null;
-                  _controllerInstance = null;
-                  completer.complete();
-                } else {
-                  // No new stream, .close was called. Close _target.
-                  _closeTarget();
-                }
-              },
-              onError: (error) {
-                if (_isBound) {
-                  // A new stream takes over - forward errors to that stream.
-                  var completer = _controllerCompleter;
-                  _controllerCompleter = null;
-                  _controllerInstance = null;
-                  completer.completeError(error);
-                } else {
-                  // No new stream. No need to close target, as it have already
-                  // failed.
-                  _completeDone(error: error);
-                }
-              });
-    }
-    return _controllerInstance;
-  }
 }
diff --git a/sdk/lib/io/process.dart b/sdk/lib/io/process.dart
index fc2a4aa..c1a060a 100644
--- a/sdk/lib/io/process.dart
+++ b/sdk/lib/io/process.dart
@@ -7,9 +7,10 @@
 // TODO(ager): The only reason for this class is that we
 // cannot patch a top-level at this point.
 class _ProcessUtils {
-  external static _exit(int status);
-  external static _setExitCode(int status);
-  external static _sleep(int millis);
+  external static void _exit(int status);
+  external static void _setExitCode(int status);
+  external static void _sleep(int millis);
+  external static int _pid(Process process);
 }
 
 /**
@@ -54,6 +55,11 @@
 }
 
 /**
+ * Returns the PID if the current process.
+ */
+int get pid => _ProcessUtils._pid(null);
+
+/**
  * [Process] is used to start new processes using the static
  * [start] and [run] methods.
  */
@@ -118,6 +124,11 @@
   IOSink get stdin;
 
   /**
+   * Returns the process id of the process.
+   */
+  int get pid;
+
+  /**
    * Returns a [:Future:] which completes with the exit code of the process
    * when the process completes.
    *
@@ -162,6 +173,11 @@
    * Standard error from the process as a string.
    */
   String get stderr;
+
+  /**
+   * Process id from the process.
+   */
+  int get pid;
 }
 
 
diff --git a/sdk/lib/io/secure_socket.dart b/sdk/lib/io/secure_socket.dart
index bff54c8..26bbf12 100644
--- a/sdk/lib/io/secure_socket.dart
+++ b/sdk/lib/io/secure_socket.dart
@@ -144,6 +144,78 @@
   }
 
   /**
+   * Takes an already connected [socket] and starts client side TLS
+   * handshake to make the communication secure. When the returned
+   * future completes the [RawSecureSocket] has completed the TLS
+   * handshake. Using this function requires that the other end of the
+   * connection is prepared for TLS handshake.
+   *
+   * If the [socket] already has a subscription, pass the existing
+   * subscription in the [subscription] parameter. The secure socket
+   * will take over the subscription and process any subsequent
+   * events.
+   *
+   * See [connect] for more information on the arguments.
+   *
+   */
+  static Future<RawSecureSocket> secure(
+      RawSocket socket,
+      {StreamSubscription subscription,
+       bool sendClientCertificate: false,
+       String certificateName,
+       bool onBadCertificate(X509Certificate certificate)}) {
+    return  _RawSecureSocket.connect(
+        socket.host,
+        socket.port,
+        certificateName,
+        is_server: false,
+        socket: socket,
+        subscription: subscription,
+        sendClientCertificate: sendClientCertificate,
+        onBadCertificate: onBadCertificate);
+  }
+
+  /**
+   * Takes an already connected [socket] and starts server side TLS
+   * handshake to make the communication secure. When the returned
+   * future completes the [RawSecureSocket] has completed the TLS
+   * handshake. Using this function requires that the other end of the
+   * connection is going to start the TLS handshake.
+   *
+   * If the [socket] already has a subscription, pass the existing
+   * subscription in the [subscription] parameter. The secure socket
+   * will take over the subscription and process any subsequent
+   * events.
+   *
+   * If some of the data of the TLS handshake has already been read
+   * from the socket this data can be passed in the [carryOverData]
+   * parameter. This data will be processed before any other data
+   * available on the socket.
+   *
+   * See [RawSecureServerSocket.bind] for more information on the
+   * arguments.
+   *
+   */
+  static Future<RawSecureSocket> secureServer(
+      RawSocket socket,
+      String certificateName,
+      {StreamSubscription subscription,
+       List<int> carryOverData,
+       bool requestClientCertificate: false,
+       bool requireClientCertificate: false}) {
+    return _RawSecureSocket.connect(
+        socket.remoteHost,
+        socket.remotePort,
+        certificateName,
+        is_server: true,
+        socket: socket,
+        subscription: subscription,
+        carryOverData: carryOverData,
+        requestClientCertificate: requestClientCertificate,
+        requireClientCertificate: requireClientCertificate);
+  }
+
+  /**
    * Get the peer certificate for a connected RawSecureSocket.  If this
    * RawSecureSocket is the server end of a secure socket connection,
    * [peerCertificate] will return the client certificate, or null, if no
@@ -192,6 +264,8 @@
   StreamController<RawSocketEvent> _controller;
   Stream<RawSocketEvent> _stream;
   StreamSubscription<RawSocketEvent> _socketSubscription;
+  List<int> _carryOverData;
+  int _carryOverDataIndex = 0;
   final String host;
   final bool is_server;
   final String certificateName;
@@ -218,6 +292,8 @@
       String certificateName,
       {bool is_server,
        RawSocket socket,
+       StreamSubscription subscription,
+       List<int> carryOverData,
        bool requestClientCertificate: false,
        bool requireClientCertificate: false,
        bool sendClientCertificate: false,
@@ -227,6 +303,8 @@
                                  certificateName,
                                  is_server,
                                  socket,
+                                 subscription,
+                                 carryOverData,
                                  requestClientCertificate,
                                  requireClientCertificate,
                                  sendClientCertificate,
@@ -240,6 +318,8 @@
       String this.certificateName,
       bool this.is_server,
       RawSocket socket,
+      StreamSubscription this._socketSubscription,
+      List<int> this._carryOverData,
       bool this.requestClientCertificate,
       bool this.requireClientCertificate,
       bool this.sendClientCertificate,
@@ -254,6 +334,7 @@
     // errors will be reported through the future or the stream.
     _verifyFields();
     _secureFilter.init();
+    if (_carryOverData != null) _readFromCarryOver();
     _secureFilter.registerHandshakeCompleteCallback(
         _secureHandshakeCompleteHandler);
     if (onBadCertificate != null) {
@@ -266,11 +347,20 @@
       futureSocket = new Future.value(socket);
     }
     futureSocket.then((rawSocket) {
-      rawSocket.writeEventsEnabled = false;
       _socket = rawSocket;
-      _socketSubscription = _socket.listen(_eventDispatcher,
-                                           onError: _errorHandler,
-                                           onDone: _doneHandler);
+      _socket.readEventsEnabled = true;
+      _socket.writeEventsEnabled = false;
+      if (_socketSubscription == null) {
+        // If a current subscription is provided use this otherwise
+        // create a new one.
+        _socketSubscription = _socket.listen(_eventDispatcher,
+                                             onError: _errorHandler,
+                                             onDone: _doneHandler);
+      } else {
+        _socketSubscription.onData(_eventDispatcher);
+        _socketSubscription.onError(_errorHandler);
+        _socketSubscription.onDone(_doneHandler);
+      }
       _connectPending = true;
       _secureFilter.connect(host,
                             port,
@@ -526,6 +616,22 @@
     }
   }
 
+  void _readFromCarryOver() {
+    assert(_carryOverData != null);
+    var encrypted = _secureFilter.buffers[READ_ENCRYPTED];
+    var bytes = _carryOverData.length - _carryOverDataIndex;
+    int startIndex = encrypted.start + encrypted.length;
+    encrypted.data.setRange(startIndex,
+                            startIndex + bytes,
+                            _carryOverData,
+                            _carryOverDataIndex);
+    encrypted.length += bytes;
+    _carryOverDataIndex += bytes;
+    if (_carryOverData.length == _carryOverDataIndex) {
+      _carryOverData = null;
+    }
+  }
+
   void _readHandler() {
     if (_status == CLOSED) {
       return;
@@ -660,13 +766,18 @@
         }
       }
       if (!_socketClosedRead && encrypted.free > 0) {
-        List<int> data = _socket.read(encrypted.free);
-        if (data != null) {
-          int bytes = data.length;
-          int startIndex = encrypted.start + encrypted.length;
-          encrypted.data.setRange(startIndex, startIndex + bytes, data);
-          encrypted.length += bytes;
+        if (_carryOverData != null) {
+          _readFromCarryOver();
           progress = true;
+        } else {
+          List<int> data = _socket.read(encrypted.free);
+          if (data != null) {
+            int bytes = data.length;
+            int startIndex = encrypted.start + encrypted.length;
+            encrypted.data.setRange(startIndex, startIndex + bytes, data);
+            encrypted.length += bytes;
+            progress = true;
+          }
         }
       }
     }
diff --git a/sdk/lib/io/socket.dart b/sdk/lib/io/socket.dart
index 48c8640..b8be4d6 100644
--- a/sdk/lib/io/socket.dart
+++ b/sdk/lib/io/socket.dart
@@ -16,12 +16,20 @@
    * completes the server socket is bound to the given [address] and
    * [port] and has started listening on it.
    *
+   * The default value for [address] is 127.0.0.1, which will allow
+   * only incoming connections from the local host. To allow for
+   * incoming connection from the network use either the value 0.0.0.0
+   * to bind to all interfaces or the IP address of a specific
+   * interface.
+   *
    * If [port] has the value [:0:] (the default) an ephemeral port will
    * be chosen by the system. The actual port used can be retrieved
    * using the [:port:] getter.
    *
-   * If [backlog] has the value of [:0:] a reasonable value will be
-   * chosen by the system.
+   * The optional argument [backlog] can be used to specify the listen
+   * backlog for the underlying OS listen setup. If [backlog] has the
+   * value of [:0:] (the default) a reasonable value will be chosen by
+   * the system.
    */
   external static Future<RawServerSocket> bind([String address = "127.0.0.1",
                                                int port = 0,
@@ -51,12 +59,20 @@
    * completes the server socket is bound to the given [address] and
    * [port] and has started listening on it.
    *
+   * The default value for [address] is 127.0.0.1, which will allow
+   * only incoming connections from the local host. To allow for
+   * incoming connection from the network use either the value 0.0.0.0
+   * to bind to all interfaces or the IP address of a specific
+   * interface.
+   *
    * If [port] has the value [:0:] (the default) an ephemeral port will
    * be chosen by the system. The actual port used can be retrieved
    * using the [port] getter.
    *
-   * If [backlog] has the value of [:0:] a reasonable value will be
-   * chosen by the system.
+   * The optional argument [backlog] can be used to specify the listen
+   * backlog for the underlying OS listen setup. If [backlog] has the
+   * value of [:0:] (the default) a reasonable value will be chosen by
+   * the system.
    */
   external static Future<ServerSocket> bind([String address = "127.0.0.1",
                                              int port = 0,
@@ -165,6 +181,11 @@
   int get remotePort;
 
   /**
+   * Returns the host used to connect this socket.
+   */
+  String get host;
+
+  /**
    * Returns the remote host connected to by this socket.
    */
   String get remoteHost;
@@ -238,9 +259,25 @@
    */
   bool setOption(SocketOption option, bool enabled);
 
+  /**
+   * Returns the port used by this socket.
+   */
   int get port;
-  String get remoteHost;
+
+  /**
+   * Returns the remote port connected to by this socket.
+   */
   int get remotePort;
+
+  /**
+   * Returns the host used to connect this socket.
+   */
+  String get host;
+
+  /**
+   * Returns the remote host connected to by this socket.
+   */
+  String get remoteHost;
 }
 
 
diff --git a/sdk/lib/io/websocket.dart b/sdk/lib/io/websocket.dart
index 65249f1..5cbe278 100644
--- a/sdk/lib/io/websocket.dart
+++ b/sdk/lib/io/websocket.dart
@@ -80,7 +80,7 @@
  * messages received. A text message will be of type [:String:] and a
  * binary message will be of type [:List<int>:].
  */
-abstract class WebSocket implements Stream {
+abstract class WebSocket implements Stream, StreamSink {
   /**
    * Possible states of the connection.
    */
@@ -131,15 +131,25 @@
   String get closeReason;
 
   /**
-   * Closes the web socket connection.
+   * Closes the web socket connection. Set the optional [code] and [reason]
+   * arguments to send close information to the remote peer. If they are
+   * omitted, the peer will see [WebSocketStatus.NO_STATUS_RECEIVED] code
+   * with no reason.
    */
-  void close([int code, String reason]);
+  Future close([int code, String reason]);
 
   /**
    * Sends data on the web socket connection. The data in [data] must
    * be either a [:String:], or a [:List<int>:] holding bytes.
    */
-  void send(data);
+  void add(data);
+
+  /**
+   * Sends data from a stream on web socket connection. Each data event from
+   * [stream] will be send as a single WebSocket frame. The data from [stream]
+   * must be either [:String:]s, or [:List<int>:]s holding bytes.
+   */
+  Future addStream(Stream stream);
 }
 
 
diff --git a/sdk/lib/io/websocket_impl.dart b/sdk/lib/io/websocket_impl.dart
index c7d9e10..52587ed 100644
--- a/sdk/lib/io/websocket_impl.dart
+++ b/sdk/lib/io/websocket_impl.dart
@@ -277,11 +277,7 @@
           sink.add(_buffer.toString());
           break;
         case _WebSocketMessageType.BINARY:
-          if (_buffer.length == 0) {
-            sink.add(const []);
-          } else {
-            sink.add(_buffer.readBytes(_buffer.length));
-          }
+          sink.add(_buffer.readBytes());
           break;
       }
       _buffer = null;
@@ -432,8 +428,175 @@
 }
 
 
+class _WebSocketOutgoingTransformer extends StreamEventTransformer {
+  final _WebSocketImpl webSocket;
+
+  _WebSocketOutgoingTransformer(_WebSocketImpl this.webSocket);
+
+  void handleData(message, EventSink<List<int>> sink) {
+    List<int> data;
+    int opcode;
+    if (message != null) {
+      if (message is String) {
+        opcode = _WebSocketOpcode.TEXT;
+        data = _encodeString(message);
+      } else {
+        if (message is !List<int>) {
+          throw new ArgumentError(message);
+        }
+        opcode = _WebSocketOpcode.BINARY;
+        data = message;
+      }
+    } else {
+      opcode = _WebSocketOpcode.TEXT;
+    }
+    addFrame(opcode, data, sink);
+  }
+
+  void handleDone(EventSink<List<int>> sink) {
+    int code = webSocket._outCloseCode;
+    String reason = webSocket._outCloseReason;
+    List<int> data;
+    if (code != null) {
+      data = new List<int>();
+      data.add((code >> 8) & 0xFF);
+      data.add(code & 0xFF);
+      if (reason != null) {
+        data.addAll(_encodeString(reason));
+      }
+    }
+    addFrame(_WebSocketOpcode.CLOSE, data, sink);
+    sink.close();
+  }
+
+  void addFrame(int opcode, List<int> data, EventSink<List<int>> sink) {
+    bool mask = !webSocket._serverSide;  // Masking not implemented for server.
+    int dataLength = data == null ? 0 : data.length;
+    // Determine the header size.
+    int headerSize = (mask) ? 6 : 2;
+    if (dataLength > 65535) {
+      headerSize += 8;
+    } else if (dataLength > 125) {
+      headerSize += 2;
+    }
+    List<int> header = new List<int>(headerSize);
+    int index = 0;
+    // Set FIN and opcode.
+    header[index++] = 0x80 | opcode;
+    // Determine size and position of length field.
+    int lengthBytes = 1;
+    int firstLengthByte = 1;
+    if (dataLength > 65535) {
+      header[index++] = 127;
+      lengthBytes = 8;
+    } else if (dataLength > 125) {
+      header[index++] = 126;
+      lengthBytes = 2;
+    }
+    // Write the length in network byte order into the header.
+    for (int i = 0; i < lengthBytes; i++) {
+      header[index++] = dataLength >> (((lengthBytes - 1) - i) * 8) & 0xFF;
+    }
+    if (mask) {
+      header[1] |= 1 << 7;
+      var maskBytes = _IOCrypto.getRandomBytes(4);
+      header.setRange(index, index + 4, maskBytes);
+      index += 4;
+      if (data != null) {
+        var list = new Uint8List(data.length);
+        for (int i = 0; i < data.length; i++) {
+          list[i] = data[i] ^ maskBytes[i % 4];
+        }
+        data = list;
+      }
+    }
+    assert(index == headerSize);
+    sink.add(header);
+    if (data != null) {
+      sink.add(data);
+    }
+  }
+}
+
+
+class _WebSocketConsumer implements StreamConsumer {
+  final _WebSocketImpl webSocket;
+  final Socket socket;
+  StreamController _controller;
+  StreamSubscription _subscription;
+  Completer _closeCompleter = new Completer();
+  Completer _completer;
+
+  _WebSocketConsumer(_WebSocketImpl this.webSocket, Socket this.socket);
+
+  void _onListen() {
+    if (_subscription != null) {
+      _subscription.cancel();
+    }
+  }
+
+  _ensureController() {
+    if (_controller != null) return;
+    _controller = new StreamController(onPause: () => _subscription.pause(),
+                                       onResume: () => _subscription.resume(),
+                                       onCancel: _onListen);
+    var stream = _controller.stream.transform(
+        new _WebSocketOutgoingTransformer(webSocket));
+    socket.addStream(stream)
+        .then((_) {
+                _done();
+                _closeCompleter.complete(webSocket);
+              },
+              onError: (error) {
+                if (!_done(error)) {
+                  _closeCompleter.completeError(error);
+                }
+              });
+  }
+
+  bool _done([error]) {
+    if (_completer == null) return false;
+    var tmp = _completer;
+    _completer = null;
+    if (error != null) {
+      tmp.completeError(error);
+    } else {
+      tmp.complete(webSocket);
+    }
+    return true;
+  }
+
+  Future addStream(var stream) {
+    _ensureController();
+    _completer = new Completer();
+    _subscription = stream.listen(
+        (data) {
+          _controller.add(data);
+        },
+        onDone: () {
+          _done();
+        },
+        onError: (error) {
+          _done(error);
+        },
+        cancelOnError: true);
+    return _completer.future;
+  }
+
+  Future close() {
+    Future closeSocket() {
+      return socket.close().then((_) => webSocket);
+    }
+    if (_controller == null) return closeSocket();
+    _controller.close();
+    return _closeCompleter.future.then((_) => closeSocket());
+  }
+}
+
+
 class _WebSocketImpl extends Stream implements WebSocket {
   final StreamController _controller = new StreamController();
+  StreamSink _sink;
 
   final Socket _socket;
   final bool _serverSide;
@@ -442,6 +605,9 @@
   int _closeCode;
   String _closeReason;
 
+  int _outCloseCode;
+  String _outCloseReason;
+
   static final HttpClient _httpClient = new HttpClient();
 
   static Future<WebSocket> connect(String url, [protocols]) {
@@ -516,51 +682,33 @@
 
   _WebSocketImpl._fromSocket(Socket this._socket,
                              [bool this._serverSide = false]) {
+    _sink = new _StreamSinkImpl(new _WebSocketConsumer(this, _socket));
     _readyState = WebSocket.OPEN;
 
-    bool closed = false;
     var transformer = new _WebSocketProtocolTransformer(_serverSide);
     _socket.transform(transformer).listen(
         (data) {
           _controller.add(data);
         },
         onError: (error) {
-          if (closed) return;
-          closed = true;
           _controller.addError(error);
           _controller.close();
         },
         onDone: () {
-          if (closed) return;
-          closed = true;
           if (_readyState == WebSocket.OPEN) {
             _readyState = WebSocket.CLOSING;
             if (transformer.closeCode != WebSocketStatus.NO_STATUS_RECEIVED) {
-              _close(transformer.closeCode);
+              close(transformer.closeCode);
             } else {
-              _close();
+              close();
             }
             _readyState = WebSocket.CLOSED;
           }
           _closeCode = transformer.closeCode;
           _closeReason = transformer.closeReason;
           _controller.close();
-          if (_writeClosed) _socket.destroy();
         },
         cancelOnError: true);
-
-    _socket.done
-        .catchError((error) {
-          if (closed) return;
-          closed = true;
-          _readyState = WebSocket.CLOSED;
-          _closeCode = WebSocketStatus.ABNORMAL_CLOSURE;
-          _controller.addError(error);
-          _controller.close();
-        })
-        .whenComplete(() {
-          _writeClosed = true;
-        });
   }
 
   StreamSubscription listen(void onData(message),
@@ -580,117 +728,22 @@
   int get closeCode => _closeCode;
   String get closeReason => _closeReason;
 
-  void close([int code, String reason]) {
-    if (_readyState < WebSocket.CLOSING) _readyState = WebSocket.CLOSING;
-    if (code == WebSocketStatus.RESERVED_1004 ||
-        code == WebSocketStatus.NO_STATUS_RECEIVED ||
-        code == WebSocketStatus.RESERVED_1015) {
-      throw new WebSocketException("Reserved status code $code");
-    }
-    _close(code, reason);
-  }
+  void add(data) => _sink.add(data);
+  void addError(error) => _sink.addError(error);
+  Future addStream(Stream stream) => _sink.addStream(stream);
+  Future get done => _sink.done;
 
-  void _close([int code, String reason]) {
-    List<int> data;
-    if (code != null) {
-      data = new List<int>();
-      data.add((code >> 8) & 0xFF);
-      data.add(code & 0xFF);
-      if (reason != null) {
-        data.addAll(_encodeString(reason));
+  Future close([int code, String reason]) {
+    if (!_writeClosed) {
+      if (code == WebSocketStatus.RESERVED_1004 ||
+          code == WebSocketStatus.NO_STATUS_RECEIVED ||
+          code == WebSocketStatus.RESERVED_1015) {
+        throw new WebSocketException("Reserved status code $code");
       }
-    }
-    _sendFrame(_WebSocketOpcode.CLOSE, data);
-
-    if (_readyState == WebSocket.CLOSED) {
-      // Close the socket when the close frame has been sent - if it
-      // does not take too long.
-      // TODO(ajohnsen): Honor comment.
-      _socket.destroy();
-    } else {
-      // Half close the socket and expect a close frame in response
-      // before closing the socket. If a close frame does not arrive
-      // within a reasonable amount of time just close the socket.
-      // TODO(ajohnsen): Honor comment.
-      _socket.close();
-    }
-  }
-
-  void send(message) {
-    if (readyState != WebSocket.OPEN) {
-      throw new StateError("Connection not open");
-    }
-    List<int> data;
-    int opcode;
-    if (message != null) {
-      if (message is String) {
-        opcode = _WebSocketOpcode.TEXT;
-        data = _encodeString(message);
-      } else {
-        if (message is !List<int>) {
-          throw new ArgumentError(message);
-        }
-        opcode = _WebSocketOpcode.BINARY;
-        data = message;
-      }
-    } else {
-      opcode = _WebSocketOpcode.TEXT;
-    }
-    _sendFrame(opcode, data);
-  }
-
-  void _sendFrame(int opcode, [List<int> data]) {
-    if (_writeClosed) return;
-    bool mask = !_serverSide;  // Masking not implemented for server.
-    int dataLength = data == null ? 0 : data.length;
-    // Determine the header size.
-    int headerSize = (mask) ? 6 : 2;
-    if (dataLength > 65535) {
-      headerSize += 8;
-    } else if (dataLength > 125) {
-      headerSize += 2;
-    }
-    List<int> header = new List<int>(headerSize);
-    int index = 0;
-    // Set FIN and opcode.
-    header[index++] = 0x80 | opcode;
-    // Determine size and position of length field.
-    int lengthBytes = 1;
-    int firstLengthByte = 1;
-    if (dataLength > 65535) {
-      header[index++] = 127;
-      lengthBytes = 8;
-    } else if (dataLength > 125) {
-      header[index++] = 126;
-      lengthBytes = 2;
-    }
-    // Write the length in network byte order into the header.
-    for (int i = 0; i < lengthBytes; i++) {
-      header[index++] = dataLength >> (((lengthBytes - 1) - i) * 8) & 0xFF;
-    }
-    if (mask) {
-      header[1] |= 1 << 7;
-      var maskBytes = _IOCrypto.getRandomBytes(4);
-      header.setRange(index, index + 4, maskBytes);
-      index += 4;
-      if (data != null) {
-        var list = new Uint8List(data.length);
-        for (int i = 0; i < data.length; i++) {
-          list[i] = data[i] ^ maskBytes[i % 4];
-        }
-        data = list;
-      }
-    }
-    assert(index == headerSize);
-    try {
-      _socket.add(header);
-      if (data != null) {
-        _socket.add(data);
-      }
-    } catch (_) {
-      // The socket can be closed before _socket.done have a chance
-      // to complete.
+      _outCloseCode = code;
+      _outCloseReason = reason;
       _writeClosed = true;
     }
+    return _sink.close();
   }
 }
diff --git a/sdk/lib/json/json.dart b/sdk/lib/json/json.dart
index 8568d13..e30dc57 100644
--- a/sdk/lib/json/json.dart
+++ b/sdk/lib/json/json.dart
@@ -21,8 +21,8 @@
   final unsupportedObject;
   /** The exception thrown by object's [:toJson:] method, if any. */
   final cause;
-  JsonUnsupportedObjectError(this.unsupportedObject) : cause = null;
-  JsonUnsupportedObjectError.withCause(this.unsupportedObject, this.cause);
+
+  JsonUnsupportedObjectError(this.unsupportedObject, { this.cause });
 
   String toString() {
     if (cause != null) {
@@ -35,6 +35,19 @@
 
 
 /**
+ * Reports that an object could not be stringified due to cyclic references.
+ *
+ * An object that references itself cannot be serialized by [stringify].
+ * When the cycle is detected, a [JsonCyclicError] is thrown.
+ */
+class JsonCyclicError extends JsonUnsupportedObjectError {
+  /** The first object that was detected as part of a cycle. */
+  JsonCyclicError(Object object): super(object);
+  String toString() => "Cyclic error in JSON stringify";
+}
+
+
+/**
  * Parses [json] and build the corresponding parsed JSON value.
  *
  * Parsed JSON values are of the types [num], [String], [bool], [Null],
@@ -65,20 +78,26 @@
 /**
  * Serializes [object] into a JSON string.
  *
- * Directly serializable types are [num], [String], [bool], [Null], [List]
- * and [Map].
+ * Directly serializable values are [num], [String], [bool], and [Null], as well
+ * as some [List] and [Map] values.
  * For [List], the elements must all be serializable.
  * For [Map], the keys must be [String] and the values must be serializable.
+ *
  * If a value is any other type is attempted serialized, a "toJson()" method
  * is invoked on the object and the result, which must be a directly
- * serializable type, is serialized instead of the original value.
+ * serializable value, is serialized instead of the original value.
+ *
  * If the object does not support this method, throws, or returns a
  * value that is not directly serializable, a [JsonUnsupportedObjectError]
  * exception is thrown. If the call throws (including the case where there
  * is no nullary "toJson" method, the error is caught and stored in the
  * [JsonUnsupportedObjectError]'s [:cause:] field.
- *Json
- * Objects should not change during serialization.
+ *
+ * If a [List] or [Map] contains a reference to itself, directly or through
+ * other lists or maps, it cannot be serialized and a [JsonCyclicError] is
+ * thrown.
+ *
+ * Json Objects should not change during serialization.
  * If an object is serialized more than once, [stringify] is allowed to cache
  * the JSON text for it. I.e., if an object changes after it is first
  * serialized, the new values may or may not be reflected in the result.
@@ -717,7 +736,7 @@
     // TODO: use Iterables.
     for (int i = 0; i < seen.length; i++) {
       if (identical(seen[i], object)) {
-        throw 'Cyclic structure';
+        throw new JsonCyclicError(object);
       }
     }
     seen.add(object);
@@ -736,7 +755,7 @@
         }
         seen.removeLast();
       } catch (e) {
-        throw new JsonUnsupportedObjectError.withCause(object, e);
+        throw new JsonUnsupportedObjectError(object, cause: e);
       }
     }
   }
diff --git a/sdk/lib/mirrors/mirrors.dart b/sdk/lib/mirrors/mirrors.dart
index b5b971a..12c06a2 100644
--- a/sdk/lib/mirrors/mirrors.dart
+++ b/sdk/lib/mirrors/mirrors.dart
@@ -76,6 +76,14 @@
 external InstanceMirror reflect(Object reflectee);
 
 /**
+ * Returns a [ClassMirror] for the class represented by a Dart
+ * Type object.
+ *
+ * This only works with objects local to the current isolate.
+ */
+external ClassMirror reflectClass(Type key);
+
+/**
  * A [Mirror] reflects some Dart language entity.
  *
  * Every [Mirror] originates from some [MirrorSystem].
@@ -175,6 +183,36 @@
  * See [InstanceMirror], [ClassMirror], and [LibraryMirror].
  */
 abstract class ObjectMirror implements Mirror {
+
+  /**
+   * Invokes the named function and returns a mirror on the result.
+   * The arguments are objects local to the current isolate.
+   */
+  /* TODO(turnidge): Properly document.
+   * TODO(turnidge): Handle ambiguous names.
+   * TODO(turnidge): Handle optional & named arguments.
+   */
+  InstanceMirror invoke(Symbol memberName,
+                        List positionalArguments,
+                        [Map<Symbol,dynamic> namedArguments]);
+
+  /**
+   * Invokes a getter and returns a mirror on the result. The getter
+   * can be the implicit getter for a field or a user-defined getter
+   * method.
+   */
+  /* TODO(turnidge): Handle ambiguous names.*/
+  InstanceMirror getField(Symbol fieldName);
+
+  /**
+   * Invokes a setter and returns a mirror on the result. The setter
+   * may be either the implicit setter for a non-final field or a
+   * user-defined setter method.
+   * The argument is an object local to the current isolate.
+   */
+  /* TODO(turnidge): Handle ambiguous names.*/
+  InstanceMirror setField(Symbol fieldName, Object arg);
+
   /**
    * Invokes the named function and returns a mirror on the result.
    * The arguments must be instances of [InstanceMirror], [num],
@@ -239,6 +277,15 @@
    * exception is thrown.
    */
   get reflectee;
+
+  /**
+   * Perform [invocation] on [reflectee].
+   *
+   * If [reflectee] doesn't support the invocation, its [noSuchMethod]
+   * method will be called with either [invocation] or another
+   * equivalent instance of [Invocation].
+   */
+  delegate(Invocation invocation);
 }
 
 /**
@@ -262,6 +309,13 @@
 
   /**
    * Executes the closure.
+   * The arguments are objects local to the current isolate. 
+   */
+  InstanceMirror apply(List<Object> positionalArguments,
+                       [Map<Symbol,Object> namedArguments]);
+
+  /**
+   * Executes the closure.
    * The arguments must be instances of [InstanceMirror], [num],
    * [String], or [bool].
    */
@@ -437,8 +491,17 @@
 
   /**
    * Invokes the named constructor and returns a mirror on the result.
+   * The arguments are objects local to the current isolate 
+   */
+  /* TODO(turnidge): Properly document.*/
+  InstanceMirror newInstance(Symbol constructorName,
+                             List positionalArguments,
+                             [Map<Symbol,dynamic> namedArguments]);
+
+  /**
+   * Invokes the named constructor and returns a mirror on the result.
    * The arguments must be instances of [InstanceMirror], [num],
-   * [String], or [bool].
+   * [String] or [bool].
    */
   /* TODO(turnidge): Properly document.*/
   Future<InstanceMirror> newInstanceAsync(Symbol constructorName,
diff --git a/sdk/lib/typeddata/typeddata.dart b/sdk/lib/typeddata/typeddata.dart
index 7a39f22..e90f3ce 100644
--- a/sdk/lib/typeddata/typeddata.dart
+++ b/sdk/lib/typeddata/typeddata.dart
@@ -49,6 +49,23 @@
 
 
 /**
+ * Describes endianness to be used when accessing or updating a
+ * sequence of bytes.
+ */
+class Endianness {
+  const Endianness._(this._littleEndian);
+
+  static const Endianness BIG_ENDIAN = const Endianness._(false);
+  static const Endianness LITTLE_ENDIAN = const Endianness._(true);
+  static final Endianness HOST_ENDIAN =
+    (new ByteData.view(new Uint16List.fromList([1]).buffer)).getInt8(0) == 1 ?
+    LITTLE_ENDIAN : BIG_ENDIAN;
+
+  final bool _littleEndian;
+}
+
+
+/**
  * A fixed-length, random-access sequence of bytes that also provides random
  * and unaligned access to the fixed-width integers and floating point
  * numbers represented by those bytes.
@@ -141,7 +158,7 @@
    * Throws [RangeError] if [byteOffset] is negative, or
    * `byteOffset + 2` is greater than the length of this object.
    */
-  int getInt16(int byteOffset);
+  int getInt16(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]);
 
   /**
    * Sets the two bytes starting at the specified [byteOffset] in this
@@ -152,7 +169,9 @@
    * Throws [RangeError] if [byteOffset] is negative, or
    * `byteOffset + 2` is greater than the length of this object.
    */
-  void setInt16(int byteOffset, int value);
+  void setInt16(int byteOffset,
+                int value,
+                [Endianness endian = Endianness.BIG_ENDIAN]);
 
   /**
    * Returns the positive integer represented by the two bytes starting
@@ -163,7 +182,7 @@
    * Throws [RangeError] if [byteOffset] is negative, or
    * `byteOffset + 2` is greater than the length of this object.
    */
-  int getUint16(int byteOffset);
+  int getUint16(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]);
 
   /**
    * Sets the two bytes starting at the specified [byteOffset] in this object
@@ -174,7 +193,9 @@
    * Throws [RangeError] if [byteOffset] is negative, or
    * `byteOffset + 2` is greater than the length of this object.
    */
-  void setUint16(int byteOffset, int value);
+  void setUint16(int byteOffset,
+                 int value,
+                 [Endianness endian = Endianness.BIG_ENDIAN]);
 
   /**
    * Returns the (possibly negative) integer represented by the four bytes at
@@ -186,7 +207,7 @@
    * Throws [RangeError] if [byteOffset] is negative, or
    * `byteOffset + 4` is greater than the length of this object.
    */
-  int getInt32(int byteOffset);
+  int getInt32(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]);
 
   /**
    * Sets the four bytes starting at the specified [byteOffset] in this
@@ -197,7 +218,9 @@
    * Throws [RangeError] if [byteOffset] is negative, or
    * `byteOffset + 4` is greater than the length of this object.
    */
-  void setInt32(int byteOffset, int value);
+  void setInt32(int byteOffset,
+                int value,
+                [Endianness endian = Endianness.BIG_ENDIAN]);
 
   /**
    * Returns the positive integer represented by the four bytes starting
@@ -206,7 +229,7 @@
    * The return value will be between 0 and  2<sup>32</sup> - 1, inclusive.
    *
    */
-  int getUint32(int byteOffset);
+  int getUint32(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]);
 
   /**
    * Sets the four bytes starting at the specified [byteOffset] in this object
@@ -217,7 +240,9 @@
    * Throws [RangeError] if [byteOffset] is negative, or
    * `byteOffset + 4` is greater than the length of this object.
    */
-  void setUint32(int byteOffset, int value);
+  void setUint32(int byteOffset,
+                 int value,
+                 [Endianness endian = Endianness.BIG_ENDIAN]);
 
   /**
    * Returns the (possibly negative) integer represented by the eight bytes at
@@ -229,7 +254,7 @@
    * Throws [RangeError] if [byteOffset] is negative, or
    * `byteOffset + 8` is greater than the length of this object.
    */
-  int getInt64(int byteOffset);
+  int getInt64(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]);
 
   /**
    * Sets the eight bytes starting at the specified [byteOffset] in this
@@ -240,7 +265,9 @@
    * Throws [RangeError] if [byteOffset] is negative, or
    * `byteOffset + 8` is greater than the length of this object.
    */
-  void setInt64(int byteOffset, int value);
+  void setInt64(int byteOffset,
+                int value,
+                [Endianness endian = Endianness.BIG_ENDIAN]);
 
   /**
    * Returns the positive integer represented by the eight bytes starting
@@ -251,7 +278,7 @@
    * Throws [RangeError] if [byteOffset] is negative, or
    * `byteOffset + 8` is greater than the length of this object.
    */
-  int getUint64(int byteOffset);
+  int getUint64(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]);
 
   /**
    * Sets the eight bytes starting at the specified [byteOffset] in this object
@@ -262,7 +289,9 @@
    * Throws [RangeError] if [byteOffset] is negative, or
    * `byteOffset + 8` is greater than the length of this object.
    */
-  void setUint64(int byteOffset, int value);
+  void setUint64(int byteOffset,
+                 int value,
+                 [Endianness endian = Endianness.BIG_ENDIAN]);
 
   /**
    * Returns the floating point number represented by the four bytes at
@@ -272,7 +301,8 @@
    * Throws [RangeError] if [byteOffset] is negative, or
    * `byteOffset + 4` is greater than the length of this object.
    */
-  double getFloat32(int byteOffset);
+  double getFloat32(int byteOffset,
+                    [Endianness endian = Endianness.BIG_ENDIAN]);
 
   /**
    * Sets the four bytes starting at the specified [byteOffset] in this
@@ -291,7 +321,9 @@
    * Throws [RangeError] if [byteOffset] is negative, or
    * `byteOffset + 4` is greater than the length of this object.
    */
-  void setFloat32(int byteOffset, double value);
+  void setFloat32(int byteOffset,
+                  double value,
+                  [Endianness endian = Endianness.BIG_ENDIAN]);
 
   /**
    * Returns the floating point number represented by the eight bytes at
@@ -301,7 +333,8 @@
    * Throws [RangeError] if [byteOffset] is negative, or
    * `byteOffset + 8` is greater than the length of this object.
    */
-  double getFloat64(int byteOffset);
+  double getFloat64(int byteOffset,
+                    [Endianness endian = Endianness.BIG_ENDIAN]);
 
   /**
    * Sets the eight bytes starting at the specified [byteOffset] in this
@@ -311,7 +344,9 @@
    * Throws [RangeError] if [byteOffset] is negative, or
    * `byteOffset + 8` is greater than the length of this object.
    */
-  void setFloat64(int byteOffset, double value);
+  void setFloat64(int byteOffset,
+                  double value,
+                  [Endianness endian = Endianness.BIG_ENDIAN]);
 }
 
 
diff --git a/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart b/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
index c1eacb9..1e0794b 100644
--- a/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
+++ b/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
@@ -31,14 +31,6 @@
 // WARNING: Do not edit - generated code.
 
 
-typedef void DatabaseCallback(database);
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
 typedef void SqlStatementCallback(SqlTransaction transaction, SqlResultSet resultSet);
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -441,18 +433,6 @@
 
 
 @DocsEditable
-@DomName('DatabaseSync')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Experimental
-abstract class _DatabaseSync native "*DatabaseSync" {
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
 @DomName('SQLTransactionSync')
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.SAFARI)
diff --git a/sdk/lib/web_sql/dartium/web_sql_dartium.dart b/sdk/lib/web_sql/dartium/web_sql_dartium.dart
index 29dcea9..474d36b 100644
--- a/sdk/lib/web_sql/dartium/web_sql_dartium.dart
+++ b/sdk/lib/web_sql/dartium/web_sql_dartium.dart
@@ -30,14 +30,6 @@
 // WARNING: Do not edit - generated code.
 
 
-typedef void DatabaseCallback(database);
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
 typedef void SqlStatementCallback(SqlTransaction transaction, SqlResultSet resultSet);
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -458,22 +450,6 @@
 
 
 @DocsEditable
-@DomName('DatabaseSync')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Experimental
-abstract class _DatabaseSync extends NativeFieldWrapperClass1 {
-  _DatabaseSync.internal();
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
 @DomName('SQLTransactionSync')
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.SAFARI)
diff --git a/tests/co19/co19-dart2dart.status b/tests/co19/co19-dart2dart.status
index cdf7ed9..2a65929 100644
--- a/tests/co19/co19-dart2dart.status
+++ b/tests/co19/co19-dart2dart.status
@@ -191,7 +191,6 @@
 Language/07_Classes/6_Constructors_A01_t05: Fail # Inherited from dart2js
 Language/07_Classes/6_Constructors_A01_t06: Fail # Inherited from dart2js
 Language/07_Classes/6_Constructors_A02_t01: Fail # http://dartbug.com/5519
-Language/11_Expressions/01_Constants_A03_t01: Fail # Inherited from dart2js
 Language/11_Expressions/01_Constants_A03_t02: Fail # http://dartbug.com/5519
 Language/11_Expressions/01_Constants_A03_t03: Fail # http://dartbug.com/5519
 Language/11_Expressions/01_Constants_A03_t04: Fail # http://dartbug.com/5519
@@ -199,7 +198,6 @@
 Language/11_Expressions/01_Constants_A05_t02: Fail # http://dartbug.com/5519
 Language/11_Expressions/01_Constants_A05_t03: Fail # http://dartbug.com/5810
 Language/11_Expressions/01_Constants_A05_t04: Fail # http://dartbug.com/5519
-Language/11_Expressions/01_Constants_A06_t01: Fail # inherited from VM
 Language/11_Expressions/01_Constants_A08_t02: Fail # http://dartbug.com/5519
 Language/11_Expressions/01_Constants_A09_t02: Fail # http://dartbug.com/5519
 Language/11_Expressions/01_Constants_A10_t02: Fail # http://dartbug.com/5519
@@ -213,8 +211,6 @@
 Language/11_Expressions/01_Constants_A13_t03: Fail # http://dartbug.com/5519
 Language/11_Expressions/01_Constants_A13_t04: Fail # http://dartbug.com/5519
 Language/11_Expressions/01_Constants_A13_t05: Fail # http://dartbug.com/5519
-Language/11_Expressions/01_Constants_A14_t01: Fail # inherited from VM
-Language/11_Expressions/01_Constants_A14_t01: Fail # inherited from dart2js
 Language/11_Expressions/01_Constants_A14_t02: Fail # http://dartbug.com/5810
 Language/11_Expressions/01_Constants_A15_t06: Fail # http://dartbug.com/5519
 Language/11_Expressions/01_Constants_A15_t07: Fail # http://dartbug.com/5519
@@ -413,6 +409,15 @@
 
 LibTest/core/StringBuffer/isEmpty_A01_t01:  Fail, OK # co19 issue 355
 
+Language/11_Expressions/14_Function_Invocation/4_Function_Expression_Invocation_A01_t02: Fail, OK # co19 issue 409
+Language/11_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A05_t02: Fail, OK # co19 issue 409
+Language/11_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A05_t03: Fail, OK # co19 issue 409
+Language/11_Expressions/17_Getter_Invocation_A02_t01: Fail, OK # co19 issue 409
+Language/11_Expressions/18_Assignment_A05_t02: Fail, OK # co19 issue 409
+Language/11_Expressions/18_Assignment_A05_t05: Fail, OK # co19 issue 409
+Language/11_Expressions/18_Assignment_A08_t04: Fail, OK # co19 issue 409
+
+
 [ $compiler == dart2dart && $minified ]
 Language/11_Expressions/33_Argument_Definition_Test_A03_t01: Fail # TODO(dart2dart-team): Please triage this failure.
 Language/11_Expressions/33_Argument_Definition_Test_A03_t02: Fail # TODO(dart2dart-team): Please triage this failure.
diff --git a/tests/co19/co19-dart2js.status b/tests/co19/co19-dart2js.status
index 763f31f..e5020a4 100644
--- a/tests/co19/co19-dart2js.status
+++ b/tests/co19/co19-dart2js.status
@@ -2,7 +2,6 @@
 # for details. All rights reserved. Use of this source code is governed by a
 # BSD-style license that can be found in the LICENSE file.
 
-
 [ $compiler == dart2js && $runtime == jsshell ]
 LibTest/isolate/isolate_api/spawnUri_A02_t01: Crash # TODO(ahe): Please triage this crash.
 
@@ -545,6 +544,13 @@
 LibTest/async/Future/Future.immediateError_A01_t01: Fail # No AsyncError anymore. Issue 407
 LibTest/async/Future/catchError_A02_t01: Fail # No AsyncError anymore. Issue 407
 
+Language/11_Expressions/14_Function_Invocation/4_Function_Expression_Invocation_A01_t02: Fail, OK # co19 issue 409
+Language/11_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A05_t02: Fail, OK # co19 issue 409
+Language/11_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A05_t03: Fail, OK # co19 issue 409
+Language/11_Expressions/18_Assignment_A05_t04: Fail, OK # co19 issue 409
+Language/11_Expressions/18_Assignment_A08_t04: Fail, OK # co19 issue 409
+
+
 [ $compiler == dart2js && $unchecked ]
 LibTest/core/List/setRange_A05_t01: Fail # setRange throws StateError if there aren't enough elements in the iterable. Issue 402
 
diff --git a/tests/co19/co19-runtime.status b/tests/co19/co19-runtime.status
index 0f7c3ee..4e265b3 100644
--- a/tests/co19/co19-runtime.status
+++ b/tests/co19/co19-runtime.status
@@ -110,9 +110,6 @@
 Language/07_Classes/6_Constructors/3_Constant_Constructors_A04_t03: Fail # Dart issue 811
 Language/07_Classes/6_Constructors/3_Constant_Constructors_A05_t01: Fail # Dart issue 811
 Language/07_Classes/6_Constructors/3_Constant_Constructors_A05_t02: Fail # Dart issue 811
-Language/11_Expressions/01_Constants_A03_t01: Fail # Dart issue 5214
-Language/11_Expressions/01_Constants_A06_t01: Fail # Dart issue 5214
-Language/11_Expressions/01_Constants_A14_t01: Fail # Dart issue 5214
 Language/11_Expressions/05_Strings/1_String_Interpolation_A01_t04: Fail # Dart issue 7246
 Language/11_Expressions/05_Strings/1_String_Interpolation_A01_t05: Fail # Dart issue 7246
 Language/11_Expressions/05_Strings/1_String_Interpolation_A01_t06: Fail # Dart issue 7246
@@ -225,6 +222,16 @@
 LibTest/async/Future/Future.immediateError_A01_t01: Fail # Future constructors have changed # issue 408
 LibTest/async/Future/asStream_A02_t01: Fail # Future constructors have changed # issue 408
 
+Language/11_Expressions/14_Function_Invocation/4_Function_Expression_Invocation_A01_t02: Fail, OK # co19 issue 409
+Language/11_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A05_t02: Fail, OK # co19 issue 409
+Language/11_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A05_t03: Fail, OK # co19 issue 409
+Language/11_Expressions/17_Getter_Invocation_A02_t01: Fail, OK # co19 issue 409
+Language/11_Expressions/18_Assignment_A05_t02: Fail, OK # co19 issue 409
+Language/11_Expressions/18_Assignment_A05_t04: Fail, OK # co19 issue 409
+Language/11_Expressions/18_Assignment_A05_t05: Fail, OK # co19 issue 409
+Language/11_Expressions/18_Assignment_A08_t04: Fail, OK # co19 issue 409
+
+
 [ $compiler == none && $runtime == vm && $checked ]
 Language/12_Statements/09_Switch_A05_t01: Fail # TODO(vm-team): Please triage this failure.
 
diff --git a/tests/compiler/dart2js/call_site_simple_type_inferer_test.dart b/tests/compiler/dart2js/call_site_simple_type_inferer_test.dart
index b9c2b23..28d2995 100644
--- a/tests/compiler/dart2js/call_site_simple_type_inferer_test.dart
+++ b/tests/compiler/dart2js/call_site_simple_type_inferer_test.dart
@@ -221,7 +221,8 @@
       var signature = element.computeSignature(inferrer.compiler);
       int index = 0;
       signature.forEachParameter((Element element) {
-        Expect.equals(expectedTypes[index++], inferrer.typeOf[element]);
+        Expect.equals(expectedTypes[index++],
+                      inferrer.internal.typeOf[element]);
       });
       Expect.equals(index, expectedTypes.length);
   });
diff --git a/tests/compiler/dart2js/cpa_inference_test.dart b/tests/compiler/dart2js/cpa_inference_test.dart
index 98d743e..0cf252f 100644
--- a/tests/compiler/dart2js/cpa_inference_test.dart
+++ b/tests/compiler/dart2js/cpa_inference_test.dart
@@ -49,7 +49,7 @@
   BaseType nullType;
 
   AnalysisResult(MockCompiler compiler) : this.compiler = compiler {
-    inferrer = compiler.typesTask.typesInferrer;
+    inferrer = compiler.typesTask.concreteTypesInferrer;
     int = inferrer.baseTypes.intBaseType;
     double = inferrer.baseTypes.doubleBaseType;
     num = inferrer.baseTypes.numBaseType;
@@ -159,7 +159,7 @@
   class Object {}
   class Function {}
   abstract class List<E> {
-    factory List([int length]);
+    factory List([int length]) {}
     E operator [](int index);
     void operator []=(int index, E value);
   }
@@ -177,7 +177,7 @@
       enableConcreteTypeInference: true,
       maxConcreteTypeSize: maxConcreteTypeSize);
   compiler.sourceFiles[uri.toString()] = new SourceFile(uri.toString(), code);
-  compiler.typesTask.typesInferrer.testMode = true;
+  compiler.typesTask.concreteTypesInferrer.testMode = true;
   compiler.runCompiler(uri);
   return new AnalysisResult(compiler);
 }
diff --git a/tests/compiler/dart2js/dart_backend_test.dart b/tests/compiler/dart2js/dart_backend_test.dart
index 9e21cba..c024dc6 100644
--- a/tests/compiler/dart2js/dart_backend_test.dart
+++ b/tests/compiler/dart2js/dart_backend_test.dart
@@ -34,6 +34,7 @@
   static double parseDouble(String s) => 1.0;
 }
 print(x) {}
+identical(a, b) => true;
 ''';
 
 const ioLib = r'''
diff --git a/tests/compiler/dart2js/field_type_simple_inferer_test.dart b/tests/compiler/dart2js/field_type_simple_inferer_test.dart
index eae9261..6964206 100644
--- a/tests/compiler/dart2js/field_type_simple_inferer_test.dart
+++ b/tests/compiler/dart2js/field_type_simple_inferer_test.dart
@@ -428,6 +428,19 @@
   }
 """;
 
+const String TEST_25 = r"""
+  class A {
+    var f1 = 42;
+  }
+  class B {
+    var f1 = '42';
+  }
+  main() {
+    new B();
+    new A().f1 = new A().f1;
+  }
+""";
+
 void doTest(String test, bool disableInlining, Map<String, Function> fields) {
   fields.forEach((String name, Function f) {
     compileAndFind(
@@ -437,7 +450,7 @@
       disableInlining,
       (inferrer, field) {
         TypeMask type = f(inferrer);
-        TypeMask inferredType = inferrer.typeOf[field];
+        TypeMask inferredType = inferrer.internal.typeOf[field];
         Expect.equals(type, inferredType, name);
     });
   });
@@ -513,6 +526,8 @@
                     'f4': (inferrer) => inferrer.intType,
                     'f5': (inferrer) => inferrer.numType.nullable(),
                     'f6': (inferrer) => inferrer.stringType.nullable()});
+
+  runTest(TEST_25, {'f1': (inferrer) => inferrer.intType });
 }
 
 void main() {
diff --git a/tests/compiler/dart2js/mock_compiler.dart b/tests/compiler/dart2js/mock_compiler.dart
index 5a7952e..f7c8f7e 100644
--- a/tests/compiler/dart2js/mock_compiler.dart
+++ b/tests/compiler/dart2js/mock_compiler.dart
@@ -62,6 +62,7 @@
   unwrapException(e) {}
   assertHelper(a){}
   createRuntimeType(a) {}
+  createInvocationMirror(a0, a1, a2, a3, a4, a5) {}
   throwNoSuchMethod(obj, name, arguments, expectedArgumentNames) {}
   throwAbstractClassInstantiationError(className) {}''';
 
@@ -74,6 +75,7 @@
   class Interceptor {
     toString() {}
     bool operator==(other) => identical(this, other);
+    noSuchMethod(im) { throw im; }
   }
   class JSIndexable {}
   class JSArray extends Interceptor implements List, JSIndexable {
@@ -138,8 +140,9 @@
   class bool {}
   class String implements Pattern {}
   class Object {
-    operator ==(other) {}
+    operator ==(other) { return true; }
     String toString() { return null; }
+    noSuchMethod(im) { throw im; }
   }
   class Type {}
   class Function {}
@@ -150,7 +153,7 @@
     DateTime.utc(year);
   }
   abstract class Pattern {}
-  bool identical(Object a, Object b) { return null; }''';
+  bool identical(Object a, Object b) { return true; }''';
 
 const String DEFAULT_ISOLATE_HELPERLIB = r'''
   class _WorkerBase {}''';
@@ -196,6 +199,7 @@
     libraryLoader.importLibrary(isolateHelperLibrary, coreLibrary, null);
 
     assertMethod = jsHelperLibrary.find(buildSourceString('assert'));
+    identicalFunction = coreLibrary.find(buildSourceString('identical'));
 
     mainApp = mockLibrary(this, "");
     initializeSpecialClasses();
diff --git a/tests/compiler/dart2js/simple_inferrer_and_or_test.dart b/tests/compiler/dart2js/simple_inferrer_and_or_test.dart
index ae7cfd3..14ef2d3 100644
--- a/tests/compiler/dart2js/simple_inferrer_and_or_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_and_or_test.dart
@@ -62,7 +62,7 @@
 
   checkReturn(String name, type) {
     var element = findElement(compiler, name);
-    Expect.equals(type, typesInferrer.returnTypeOf[element]);
+    Expect.equals(type, typesInferrer.internal.returnTypeOf[element]);
   }
 
   var subclassOfInterceptor =
diff --git a/tests/compiler/dart2js/simple_inferrer_closure_test.dart b/tests/compiler/dart2js/simple_inferrer_closure_test.dart
index c54bdce..f731839 100644
--- a/tests/compiler/dart2js/simple_inferrer_closure_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_closure_test.dart
@@ -87,7 +87,7 @@
 
   checkReturn(String name, type) {
     var element = findElement(compiler, name);
-    Expect.equals(type, typesInferrer.returnTypeOf[element]);
+    Expect.equals(type, typesInferrer.internal.returnTypeOf[element]);
   }
 
   checkReturn('returnInt1', typesInferrer.intType);
diff --git a/tests/compiler/dart2js/simple_inferrer_final_field2_test.dart b/tests/compiler/dart2js/simple_inferrer_final_field2_test.dart
index e563e16..a374e9c 100644
--- a/tests/compiler/dart2js/simple_inferrer_final_field2_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_final_field2_test.dart
@@ -32,7 +32,7 @@
   checkFieldTypeInClass(String className, String fieldName, type) {
     var cls = findElement(compiler, className);
     var element = cls.lookupLocalMember(buildSourceString(fieldName));
-    Expect.equals(type, typesInferrer.typeOf[element]);
+    Expect.equals(type, typesInferrer.internal.typeOf[element]);
   }
 
   checkFieldTypeInClass('A', 'intField', typesInferrer.intType);
diff --git a/tests/compiler/dart2js/simple_inferrer_final_field3_test.dart b/tests/compiler/dart2js/simple_inferrer_final_field3_test.dart
index 6853374..cf1b4aa 100644
--- a/tests/compiler/dart2js/simple_inferrer_final_field3_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_final_field3_test.dart
@@ -31,7 +31,7 @@
   checkFieldTypeInClass(String className, String fieldName, type) {
     var cls = findElement(compiler, className);
     var element = cls.lookupLocalMember(buildSourceString(fieldName));
-    Expect.equals(type, typesInferrer.typeOf[element]);
+    Expect.equals(type, typesInferrer.internal.typeOf[element]);
   }
 
   checkFieldTypeInClass('A', 'dynamicField',
diff --git a/tests/compiler/dart2js/simple_inferrer_final_field_test.dart b/tests/compiler/dart2js/simple_inferrer_final_field_test.dart
index d3b6107..2e24c53 100644
--- a/tests/compiler/dart2js/simple_inferrer_final_field_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_final_field_test.dart
@@ -34,7 +34,7 @@
   checkFieldTypeInClass(String className, String fieldName, type) {
     var cls = findElement(compiler, className);
     var element = cls.lookupLocalMember(buildSourceString(fieldName));
-    Expect.equals(type, typesInferrer.typeOf[element]);
+    Expect.equals(type, typesInferrer.internal.typeOf[element]);
   }
 
   checkFieldTypeInClass('A', 'intField', typesInferrer.intType);
diff --git a/tests/compiler/dart2js/simple_inferrer_no_such_method_test.dart b/tests/compiler/dart2js/simple_inferrer_no_such_method_test.dart
new file mode 100644
index 0000000..5297520
--- /dev/null
+++ b/tests/compiler/dart2js/simple_inferrer_no_such_method_test.dart
@@ -0,0 +1,134 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+import 'compiler_helper.dart';
+import 'parser_helper.dart';
+
+const String TEST1 = """
+class A {
+  noSuchMethod(im) => 42;
+}
+
+class B extends A {
+  foo();
+}
+
+class C extends B {
+  foo() => {};
+}
+
+var a;
+test1() => new A().foo();
+test2() => a.foo();
+test3() => new B().foo();
+test4() => new C().foo();
+test5() => (a ? new A() : new B()).foo();
+test6() => (a ? new B() : new C()).foo();
+
+main() {
+  test1();
+  test2();
+  test3();
+  test4();
+  test5();
+  test6();
+}
+""";
+
+const String TEST2 = """
+abstract class A {
+  noSuchMethod(im) => 42;
+}
+
+class B extends A {
+  foo() => {};
+}
+
+class C extends B {
+  foo() => {};
+}
+
+class D implements A {
+  foo() => {};
+  noSuchMethod(im) => 42.5;
+}
+
+var a;
+test1() => a.foo();
+test2() => new B().foo();
+test3() => new C().foo();
+test4() => (a ? new B() : new C()).foo();
+test5() => (a ? new B() : new D()).foo();
+
+// Can hit A.noSuchMethod, D.noSuchMethod and Object.noSuchMethod.
+test6() => a.bar();
+
+// Can hit A.noSuchMethod.
+test7() => new B().bar();
+test8() => new C().bar();
+test9() => (a ? new B() : new C()).bar();
+
+// Can hit A.noSuchMethod, D.noSuchMethod and Object.noSuchMethod.
+test10() => (a ? new B() : new D()).bar();
+
+// Can hit D.noSuchMethod.
+test11() => new D().bar();
+
+main() {
+  test1();
+  test2();
+  test3();
+  test4();
+  test5();
+  test6();
+  test7();
+  test8();
+  test9();
+  test10();
+  test11();
+}
+""";
+
+main() {
+  Uri uri = new Uri.fromComponents(scheme: 'source');
+
+  var compiler = compilerFor(TEST1, uri);
+  compiler.runCompiler(uri);
+  var typesInferrer = compiler.typesTask.typesInferrer;
+
+  checkReturn(String name, type) {
+    var element = findElement(compiler, name);
+    Expect.equals(type, typesInferrer.internal.returnTypeOf[element], name);
+  }
+
+  checkReturn('test1', typesInferrer.intType);
+  checkReturn('test2', typesInferrer.dynamicType);
+  checkReturn('test3', typesInferrer.intType);
+  checkReturn('test4', typesInferrer.mapType);
+  checkReturn('test5', typesInferrer.dynamicType);
+  checkReturn('test6', typesInferrer.dynamicType);
+
+  compiler = compilerFor(TEST2, uri);
+  compiler.runCompiler(uri);
+  typesInferrer = compiler.typesTask.typesInferrer;
+
+  checkReturn('test1', typesInferrer.dynamicType);
+  checkReturn('test2', typesInferrer.mapType);
+  checkReturn('test3', typesInferrer.mapType);
+  checkReturn('test4', typesInferrer.mapType);
+  checkReturn('test5', typesInferrer.mapType);
+
+  // TODO(ngeoffray): The reason for nullablity is because the
+  // inferrer thinks Object.noSuchMethod return null. Once we track
+  // aborting control flow in the analysis, we won't get the nullable
+  // anymore.
+  checkReturn('test6', typesInferrer.numType.nullable());
+  checkReturn('test7', typesInferrer.intType);
+  checkReturn('test8', typesInferrer.intType);
+  checkReturn('test9', typesInferrer.intType);
+  checkReturn('test10', typesInferrer.numType.nullable());
+  checkReturn('test11', typesInferrer.doubleType);
+}
diff --git a/tests/compiler/dart2js/simple_inferrer_postfix_prefix_test.dart b/tests/compiler/dart2js/simple_inferrer_postfix_prefix_test.dart
index 4a15908..a879e29 100644
--- a/tests/compiler/dart2js/simple_inferrer_postfix_prefix_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_postfix_prefix_test.dart
@@ -69,7 +69,7 @@
   checkReturnInClass(String className, String methodName, type) {
     var cls = findElement(compiler, className);
     var element = cls.lookupLocalMember(buildSourceString(methodName));
-    Expect.equals(type, typesInferrer.returnTypeOf[element]);
+    Expect.equals(type, typesInferrer.internal.returnTypeOf[element]);
   }
 
   var subclassOfInterceptor =
diff --git a/tests/compiler/dart2js/simple_inferrer_relations_test.dart b/tests/compiler/dart2js/simple_inferrer_relations_test.dart
new file mode 100644
index 0000000..205b01a
--- /dev/null
+++ b/tests/compiler/dart2js/simple_inferrer_relations_test.dart
@@ -0,0 +1,57 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+import
+    '../../../sdk/lib/_internal/compiler/implementation/types/types.dart'
+    show TypeMask;
+
+import 'compiler_helper.dart';
+import 'parser_helper.dart';
+
+// Test that if (x == y) where we know nothing about x and y will get optimized
+// to if ($.$eq(x, y)) and not
+// to if ($.$eq(x, y) == true)
+// This is an optimization based on seeing that all the relational operators,
+// ==, <, >, <=, >= only have implementations that return bool.
+
+const String TEST = """
+int inscrutable(int x) => x == 0 ? 0 : x | inscrutable(x & (x - 1));
+
+class A {
+  A(this.foo);
+  int foo;
+  operator==(other) {
+    // Make the source size and AST size bigger so that it is not analyzed
+    // first.
+    1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+11+1+1+1+11+1+1+11+1+1;
+    return this.foo == other.foo;
+  }
+}
+
+class B extends A {
+  B(int foo, this.bar) : super(foo);
+  int bar;
+  operator==(other) {
+    if (other.bar != bar) return false;
+    return other.foo == foo;
+  }
+}
+
+main() {
+  var both = [new A(inscrutable(0) == 0 ? 42 : "fish"),
+              new B(0, inscrutable(0) == 0 ? 2 : "horse")];
+  if (both[1] == both[0]) {
+    print("hestfisk");
+  }
+}
+""";
+
+void main() {
+  String generated = compileAll(TEST);
+  if (!generated.contains(r'if ($.$eq(both[1], both[0]))')) {
+    print(generated);
+    Expect.fail("missing elision of '=== true'");
+  }
+}
diff --git a/tests/compiler/dart2js/simple_inferrer_test.dart b/tests/compiler/dart2js/simple_inferrer_test.dart
index 35efedb..0b4c37b 100644
--- a/tests/compiler/dart2js/simple_inferrer_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_test.dart
@@ -137,7 +137,7 @@
 
   checkReturn(String name, type) {
     var element = findElement(compiler, name);
-    Expect.equals(type, typesInferrer.returnTypeOf[element], name);
+    Expect.equals(type, typesInferrer.internal.returnTypeOf[element], name);
   }
   var interceptorType =
       findTypeMask(compiler, 'Interceptor', 'nonNullSubclass');
@@ -158,7 +158,7 @@
   checkReturnInClass(String className, String methodName, type) {
     var cls = findElement(compiler, className);
     var element = cls.lookupLocalMember(buildSourceString(methodName));
-    Expect.equals(type, typesInferrer.returnTypeOf[element]);
+    Expect.equals(type, typesInferrer.internal.returnTypeOf[element]);
   }
 
   checkReturnInClass('A', 'returnNum1', typesInferrer.numType);
@@ -182,7 +182,7 @@
     var cls = findElement(compiler, className);
     var element = cls.localLookup(buildSourceString(className));
     Expect.equals(new TypeMask.nonNullExact(cls.rawType),
-                  typesInferrer.returnTypeOf[element]);
+                  typesInferrer.internal.returnTypeOf[element]);
   }
   checkFactoryConstructor('A');
 }
diff --git a/tests/compiler/dart2js/simple_inferrer_try_catch_test.dart b/tests/compiler/dart2js/simple_inferrer_try_catch_test.dart
index 257bdd3..a080d4d 100644
--- a/tests/compiler/dart2js/simple_inferrer_try_catch_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_try_catch_test.dart
@@ -161,7 +161,7 @@
 
   checkReturn(String name, type) {
     var element = findElement(compiler, name);
-    Expect.equals(type, typesInferrer.returnTypeOf[element]);
+    Expect.equals(type, typesInferrer.internal.returnTypeOf[element]);
   }
 
   checkReturn('returnInt1', typesInferrer.intType);
diff --git a/tests/compiler/dart2js/size_test.dart b/tests/compiler/dart2js/size_test.dart
index ccf0556..cfc318c 100644
--- a/tests/compiler/dart2js/size_test.dart
+++ b/tests/compiler/dart2js/size_test.dart
@@ -18,6 +18,7 @@
   class Function {}
   class Type {}
   class Map {}
+  identical(a, b) => true;
 ''';
 
 main() {
diff --git a/tests/compiler/dart2js_native/core_type_check_native_test.dart b/tests/compiler/dart2js_native/core_type_check_native_test.dart
index cdfc737..de64aef 100644
--- a/tests/compiler/dart2js_native/core_type_check_native_test.dart
+++ b/tests/compiler/dart2js_native/core_type_check_native_test.dart
@@ -4,12 +4,7 @@
 
 import "package:expect/expect.dart";
 
-check(value, expectComparable, expectPattern) {
-  Expect.equals(expectComparable, value is Comparable);
-  Expect.equals(expectPattern, value is Pattern);
-}
-
-int inscrutable(int x) => x == 0 ? 0 : x | inscrutable(x & (x - 1));
+var inscrutable = (int x) => x == 0 ? 0 : x | inscrutable(x & (x - 1));
 
 class A native "*A" {
 }
@@ -39,18 +34,44 @@
 makeD = function() { return new D; }
 """;
 
+
+checkTest(value, expectComparable, expectPattern) {
+  Expect.equals(expectComparable, value is Comparable);
+  Expect.equals(expectPattern, value is Pattern);
+}
+
+checkCast(value, expectComparable, expectPattern) {
+  if (expectComparable) {
+    Expect.identical(value, value as Comparable);
+  } else {
+    Expect.throws(() => value as Comparable);
+  }
+  if (expectPattern) {
+    Expect.identical(value, value as Pattern);
+  } else {
+    Expect.throws(() => value as Pattern);
+  }
+}
+
+checkAll(check) {
+  var things =
+      [[], 4, 4.2, 'foo', new Object(), makeA(), makeB(), makeC(), makeD()];
+  value(i) => things[inscrutable(i)];
+
+  check(value(0), false, false);  // List
+  check(value(1), true, false);   // int
+  check(value(2), true, false);   // num
+  check(value(3), true, true);    // String
+  check(value(4), false, false);  // Object
+  check(value(5), false, false);  // A
+  check(value(6), true, false);   // B
+  check(value(7), false, true);   // C
+  check(value(8), true, true);    // D
+}
+
 main() {
   setup();
-  var things = [[], 4, 4.2, 'foo', new Object(), makeA(), makeB(),
-                makeC(), makeD()];
 
-  check(things[inscrutable(0)], false, false); // List
-  check(things[inscrutable(1)], true, false); // int
-  check(things[inscrutable(2)], true, false); // num
-  check(things[inscrutable(3)], true, true); // string
-  check(things[inscrutable(4)], false, false); // Object
-  check(things[inscrutable(5)], false, false); // A
-  check(things[inscrutable(6)], true, false); // B
-  check(things[inscrutable(7)], false, true); // C
-  check(things[inscrutable(8)], true, true); // D
+  checkAll(checkTest);
+  checkAll(checkCast);
 }
diff --git a/tests/compiler/dart2js_native/dart2js_native.status b/tests/compiler/dart2js_native/dart2js_native.status
index 9af392c..1315cac 100644
--- a/tests/compiler/dart2js_native/dart2js_native.status
+++ b/tests/compiler/dart2js_native/dart2js_native.status
@@ -9,3 +9,6 @@
 native_null_closure_frog_test: Fail
 native_no_such_method_exception4_frog_test: Fail  # Issue 9631
 native_no_such_method_exception5_frog_test: Fail  # Issue 9631
+
+[ $compiler == dart2js && $checked ]
+native_no_such_method_exception3_frog_test: Fail # TODO(ahe): investigate.
diff --git a/tests/compiler/dart2js_native/native_method_inlining_test.dart b/tests/compiler/dart2js_native/native_method_inlining_test.dart
index b6da43a..c22f3a7 100644
--- a/tests/compiler/dart2js_native/native_method_inlining_test.dart
+++ b/tests/compiler/dart2js_native/native_method_inlining_test.dart
@@ -7,14 +7,19 @@
 
 import "package:expect/expect.dart";
 
+typedef int Int2Int(int x);
+
 class A native "*A" {
   int foo([x, y, z]) native;
+
+  // Calls can be inlined provided they don't pass an argument.
+  int callFun([Int2Int fn]) native;
 }
 
 class B {
   static var g;
-  work(a) {
-    g = 'Sandwich';  // Tag to identify compiled JavaScript method.
+  method1(a) {
+    g = '(Method1Tag)';  // Tag to identify compiled JavaScript method.
     A x = makeA();
     // Call sites that are searched for in compiled JavaScript.
     x.foo();
@@ -22,6 +27,20 @@
     x.foo(2, 10);
     return x.foo(3, 10, 30);
   }
+  method2() {
+    g = '(Method2Tag)';
+    A x = makeA();
+    var r1 = x.callFun();  // Can be inlined.
+    var r2 = x.callFun();
+    return r1 + r2;
+  }
+  method3() {
+    g = '(Method3Tag)';
+    A x = makeA();
+    var r1 = x.callFun((x) => x * 2);   // Can't ne inlined due to conversion.
+    var r2 = x.callFun((x) => x * 0);
+    return r1 + r2;
+  }
 }
 
 A makeA() native;
@@ -31,6 +50,7 @@
 void setup() native r"""
 function A() {}
 A.prototype.foo = function () { return arguments.length; };
+A.prototype.callFun = function (fn) { return fn ? fn(123) : 1; };
 
 makeA = function(){return new A;};
 
@@ -60,10 +80,34 @@
 void match(String s, String pattern1) {
   var pattern2 = pattern1.replaceAll(' ', '');
   Expect.isTrue(s.contains(pattern1) || s.contains(pattern2),
-      "$pattern1 or $pattern2");
+      "expected $pattern1 or $pattern2");
 }
 
-test() {
+void nomatch(String s, String pattern1) {
+  var pattern2 = pattern1.replaceAll(' ', '');
+  Expect.isFalse(s.contains(pattern1) || s.contains(pattern2),
+      "should not have $pattern1 or $pattern2");
+}
+
+test1() {
+  String method1 = findMethodTextContaining(new B(), '(Method1Tag)');
+  Expect.isNotNull(method1, 'No method found containing "(Method1Tag)"');
+
+  if (isCheckedMode) {
+    match(method1, r'foo()');
+    // TODO: inlining in checked mode.
+    nomatch(method1, r'foo(1)');
+    //  t1.foo$3(x, 3, 10, 30)  or  y.EL(z,3,10,30)
+    match(method1, r', 3, 10, 30)');
+  } else {
+    // Direct (inlined) calls don't have $3 or minified names.
+    match(method1, r'.foo()');
+    match(method1, r'.foo(1)');
+    match(method1, r'.foo(2, 10)');
+    match(method1, r'.foo(3, 10, 30)');
+  }
+
+  // Ensure the methods are compiled by calling them.
   var a = makeA();
 
   Expect.equals(0, a.foo());
@@ -72,26 +116,33 @@
   Expect.equals(3, a.foo(10, 20, 30));
 
   var b = new B();
-  var r = b.work(a);
+  var r = b.method1(a);
   Expect.equals(3, r);
+}
 
-  String text = findMethodTextContaining(b, 'Sandwich');
-  Expect.isNotNull(text, 'No method found containing "Sandwich"');
+test2() {
+  String method2 = findMethodTextContaining(new B(), '(Method2Tag)');
+  Expect.isNotNull(method2, 'No method found containing "(Method2Tag)"');
+  // Can always inline the zero-arg call.
+  match(method2, r'.callFun()');
 
-  if (isCheckedMode) {
-    // TODO: inlining in checked mode.
-    //  t1.foo$3(x, 3, 10, 30)  or  y.EL(z,3,10,30)
-    match(text, r', 3, 10, 30)');
-  } else {
-    // Direct (inlined) calls don't have $3 or minified names.
-    match(text, r'.foo()');
-    match(text, r'.foo(1)');
-    match(text, r'.foo(2, 10)');
-    match(text, r'.foo(3, 10, 30)');
-  }
+  String method3 = findMethodTextContaining(new B(), '(Method3Tag)');
+  Expect.isNotNull(method3, 'No method found containing "(Method3Tag)"');
+  // Don't inline native method with a function argument - should call a stub
+  // containing the conversion.
+  nomatch(method3, r'.callFun(');
+
+  // Ensure the methods are compiled by calling them.
+  var a = makeA();
+  Expect.equals(369, a.callFun((i) => 3 * i));
+
+  var b = new B();
+  Expect.equals(2, b.method2());
+  Expect.equals(246, b.method3());
 }
 
 main() {
   setup();
-  test();
+  test1();
+  test2();
 }
diff --git a/tests/compiler/dart2js_native/native_no_such_method_exception3_frog_test.dart b/tests/compiler/dart2js_native/native_no_such_method_exception3_frog_test.dart
index 1ea9de0..d052f43 100644
--- a/tests/compiler/dart2js_native/native_no_such_method_exception3_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_no_such_method_exception3_frog_test.dart
@@ -2,13 +2,14 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+import "dart:mirrors" show reflect;
 import "package:expect/expect.dart";
 
 class GetName {
   foo(x, y, [z]) => "foo";
 }
 
-String getName(im) => im.invokeOn(new GetName());
+String getName(im) => reflect(new GetName()).delegate(im);
 
 class A native "*A" {
   bar() => 42;
diff --git a/tests/compiler/dart2js_native/native_no_such_method_exception4_frog_test.dart b/tests/compiler/dart2js_native/native_no_such_method_exception4_frog_test.dart
index aff196e..1cad00c 100644
--- a/tests/compiler/dart2js_native/native_no_such_method_exception4_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_no_such_method_exception4_frog_test.dart
@@ -2,6 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+import "dart:mirrors" show reflect;
 import "package:expect/expect.dart";
 
 class GetName {
@@ -9,7 +10,7 @@
   baz(x, y, z) => "baz";
 }
 
-String getName(im) => im.invokeOn(new GetName());
+String getName(im) => reflect(new GetName()).delegate(im);;
 
 class A native "*A" {
   bar() => 42;
diff --git a/tests/compiler/dart2js_native/native_no_such_method_exception5_frog_test.dart b/tests/compiler/dart2js_native/native_no_such_method_exception5_frog_test.dart
index 26fe5c8..117e156 100644
--- a/tests/compiler/dart2js_native/native_no_such_method_exception5_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_no_such_method_exception5_frog_test.dart
@@ -2,6 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+import "dart:mirrors" show reflect;
 import "package:expect/expect.dart";
 
 class GetName {
@@ -9,7 +10,7 @@
   baz(x, y, z) => "baz";
 }
 
-String getName(im) => im.invokeOn(new GetName());
+String getName(im) => reflect(new GetName()).delegate(im);
 
 class A native "*A" {
   bar() => 42;
diff --git a/tests/corelib/corelib.status b/tests/corelib/corelib.status
index f83568c..38e940d 100644
--- a/tests/corelib/corelib.status
+++ b/tests/corelib/corelib.status
@@ -54,14 +54,6 @@
 
 string_replace_func_test: Skip # Bug 6554 - doesn't terminate.
 
-symbol_test/none: Fail
-symbol_test/02: Fail
-symbol_test/03: Fail
-
-
-[ $compiler == dart2js && $unchecked ]
-symbol_test/01: Fail # This passes for the wrong reason in checked mode.
-
 
 [ $compiler == dart2js && $runtime == none ]
 *: Fail, Pass # TODO(ahe): Triage these tests.
@@ -75,10 +67,6 @@
 compare_to2_test: Fail # inherited from VM
 unicode_test: Fail # inherited from VM
 
-symbol_test/01: Fail
-symbol_test/02: Fail
-symbol_test/03: Fail
-
 
 # Library changes
 [ $compiler == none || $compiler == dart2js || $compiler == dart2dart ]
diff --git a/tests/corelib/symbol_test.dart b/tests/corelib/symbol_test.dart
index a160244..0bdb094 100644
--- a/tests/corelib/symbol_test.dart
+++ b/tests/corelib/symbol_test.dart
@@ -10,8 +10,8 @@
 
   try {
     print(const Symbol(0)); /// 01: compile-time error
-  } on ArgumentError {
-    print('Caught ArgumentError');
+  } on NoSuchMethodError {
+    print('Caught NoSuchMethodError');
   } on TypeError {
     print('Caught TypeError');
   }
@@ -31,9 +31,9 @@
   try {
     var y = 0;
     print(new Symbol(y));
-    throw 'Expected an ArgumentError or a TypeError';
-  } on ArgumentError {
-    print('Caught ArgumentError');
+    throw 'Expected a NoSuchMethodError or a TypeError';
+  } on NoSuchMethodError {
+    print('Caught NoSuchMethodError');
   } on TypeError {
     print('Caught TypeError');
   }
diff --git a/tests/html/html.status b/tests/html/html.status
index dde8605..8ad255a 100644
--- a/tests/html/html.status
+++ b/tests/html/html.status
@@ -9,6 +9,9 @@
 custom_elements_test: Skip # Not yet implemented.
 interactive_test: Skip # Must be run manually.
 
+[ $compiler == none && $runtime == drt && $system == windows ]
+worker_test/functional: Pass, Crash # Issue 9929.
+
 [ $compiler == dart2js]
 dom_isolates_test: Skip # Need to migrate to new spawnDomFunction.
 
diff --git a/tests/html/svgelement_test.dart b/tests/html/svgelement_test.dart
index c5134cf..256e766 100644
--- a/tests/html/svgelement_test.dart
+++ b/tests/html/svgelement_test.dart
@@ -243,7 +243,7 @@
   });
 
   group('constructors', () {
-    test('supported', () {
+    group('supported', () {
       testConstructor('a', (e) => e is svg.AElement);
       testConstructor('circle', (e) => e is svg.CircleElement);
       testConstructor('clipPath', (e) => e is svg.ClipPathElement);
diff --git a/tests/html/transferables_test.dart b/tests/html/transferables_test.dart
index a00a6e4..7162fab 100644
--- a/tests/html/transferables_test.dart
+++ b/tests/html/transferables_test.dart
@@ -14,7 +14,7 @@
       predicate((x) => x is ArrayBuffer, 'is an ArrayBuffer');
 
   test('TransferableTest', () {
-    if (!ArrayBuffer.supported) {
+    if (!Platform.supportsTypedData) {
       return;
     }
 
diff --git a/tests/html/typed_arrays_1_test.dart b/tests/html/typed_arrays_1_test.dart
index 12bd9f6..52cd41b 100644
--- a/tests/html/typed_arrays_1_test.dart
+++ b/tests/html/typed_arrays_1_test.dart
@@ -12,11 +12,11 @@
 
   var isnumList = predicate((x) => x is List<num>, 'is a List<num>');
   var isStringList = predicate((x) => x is List<String>, 'is a List<String>');
-  var expectation = ArrayBuffer.supported ? returnsNormally : throws;
+  var expectation = Platform.supportsTypedData ? returnsNormally : throws;
 
   group('supported', () {
     test('supported', () {
-      expect(ArrayBuffer.supported, true);
+      expect(Platform.supportsTypedData, true);
     });
   });
 
diff --git a/tests/html/typed_arrays_2_test.dart b/tests/html/typed_arrays_2_test.dart
index 021de8c..b0a82eb 100644
--- a/tests/html/typed_arrays_2_test.dart
+++ b/tests/html/typed_arrays_2_test.dart
@@ -12,7 +12,7 @@
   useHtmlConfiguration();
 
   // Only perform tests if ArrayBuffer is supported.
-  if (!ArrayBuffer.supported) {
+  if (!Platform.supportsTypedData) {
     return;
   }
 
diff --git a/tests/html/typed_arrays_3_test.dart b/tests/html/typed_arrays_3_test.dart
index 682b09e..a11287a 100644
--- a/tests/html/typed_arrays_3_test.dart
+++ b/tests/html/typed_arrays_3_test.dart
@@ -11,7 +11,7 @@
   useHtmlConfiguration();
 
   // Only perform tests if ArrayBuffer is supported.
-  if (!ArrayBuffer.supported) {
+  if (!Platform.supportsTypedData) {
     return;
   }
 
diff --git a/tests/html/typed_arrays_4_test.dart b/tests/html/typed_arrays_4_test.dart
index 45852d0..7a7fcdf 100644
--- a/tests/html/typed_arrays_4_test.dart
+++ b/tests/html/typed_arrays_4_test.dart
@@ -11,7 +11,7 @@
   useHtmlConfiguration();
 
   // Only perform tests if ArrayBuffer is supported.
-  if (!ArrayBuffer.supported) {
+  if (!Platform.supportsTypedData) {
     return;
   }
 
diff --git a/tests/html/typed_arrays_5_test.dart b/tests/html/typed_arrays_5_test.dart
index f755d31..4f7372a 100644
--- a/tests/html/typed_arrays_5_test.dart
+++ b/tests/html/typed_arrays_5_test.dart
@@ -11,7 +11,7 @@
   useHtmlConfiguration();
 
   // Only perform tests if ArrayBuffer is supported.
-  if (!ArrayBuffer.supported) {
+  if (!Platform.supportsTypedData) {
     return;
   }
 
diff --git a/tests/html/typed_arrays_arraybuffer_test.dart b/tests/html/typed_arrays_arraybuffer_test.dart
index 21fbc7a..1a2bd21 100644
--- a/tests/html/typed_arrays_arraybuffer_test.dart
+++ b/tests/html/typed_arrays_arraybuffer_test.dart
@@ -11,7 +11,7 @@
   useHtmlConfiguration();
 
   // Only perform tests if ArrayBuffer is supported.
-  if (!ArrayBuffer.supported) {
+  if (!Platform.supportsTypedData) {
     return;
   }
 
diff --git a/tests/html/typed_arrays_dataview_test.dart b/tests/html/typed_arrays_dataview_test.dart
index ebadb1a..798b732 100644
--- a/tests/html/typed_arrays_dataview_test.dart
+++ b/tests/html/typed_arrays_dataview_test.dart
@@ -11,7 +11,7 @@
   useHtmlConfiguration();
 
   // Only perform tests if ArrayBuffer is supported.
-  if (!ArrayBuffer.supported) {
+  if (!Platform.supportsTypedData) {
     return;
   }
 
diff --git a/tests/html/typed_arrays_range_checks_test.dart b/tests/html/typed_arrays_range_checks_test.dart
index 7c1debf..5707dce 100644
--- a/tests/html/typed_arrays_range_checks_test.dart
+++ b/tests/html/typed_arrays_range_checks_test.dart
@@ -11,7 +11,7 @@
   useHtmlConfiguration();
 
   // Only perform tests if ArrayBuffer is supported.
-  if (!ArrayBuffer.supported) {
+  if (!Platform.supportsTypedData) {
     return;
   }
 
diff --git a/tests/html/xhr_test.dart b/tests/html/xhr_test.dart
index 0087b74..4758a8a 100644
--- a/tests/html/xhr_test.dart
+++ b/tests/html/xhr_test.dart
@@ -143,7 +143,7 @@
     });
 
     test('XHR.request responseType arraybuffer', () {
-      if (ArrayBuffer.supported) {
+      if (Platform.supportsTypedData) {
         HttpRequest.request(url, responseType: 'arraybuffer').then(
           expectAsync1((xhr) {
             expect(xhr.status, equals(200));
@@ -166,7 +166,7 @@
 
   group('xhr_requestBlob', () {
     test('XHR.request responseType blob', () {
-      if (ArrayBuffer.supported) {
+      if (Platform.supportsTypedData) {
         return HttpRequest.request(url, responseType: 'blob').then(
           (xhr) {
             expect(xhr.status, equals(200));
diff --git a/tests/isolate/isolate.status b/tests/isolate/isolate.status
index 13a11b8..10337b4 100644
--- a/tests/isolate/isolate.status
+++ b/tests/isolate/isolate.status
@@ -34,9 +34,6 @@
 serialization_test: Skip  # tests dart2js-specific serialization code
 spawn_uri_test: Skip # uses a .js extension (not for dartium)
 spawn_uri_negative_test: Skip # ditto
-spawn_uri_vm_test: Skip # not implemented in dartium yet.
-spawn_uri_nested_vm_test: Skip # not implemented in dartium yet.
-spawn_uri_vm_negative_test: Skip
 
 [ $compiler == dartc ]
 isolate_negative_test: Fail    # status change with --check-only
@@ -92,8 +89,6 @@
 unresolved_ports_negative_test: Skip # See Issue 6839
 
 [ $compiler == dart2js && $browser ]
-spawn_uri_test: Skip # dart2js does not support spawnUri yet
-spawn_uri_negative_test: Skip # ditto
 spawn_uri_vm_test: Skip # test uses a ".dart" suffix that only works in vm.
 spawn_uri_nested_vm_test: Skip # test uses a ".dart" suffix that only works in vm.
 spawn_uri_vm_negative_test: Skip # ditto above.
@@ -106,6 +101,9 @@
 spawn_uri_vm_test: Skip # test uses a ".dart" suffix that only works in vm.
 spawn_uri_nested_vm_test: Skip # test uses a ".dart" suffix that only works in vm.
 
+[ $compiler == dart2js && $runtime == ie9 ]
+spawn_uri_test: Fail
+
 [ $compiler == dart2js && $runtime == none ]
 *: Fail, Pass # TODO(ahe): Triage these tests.
 
diff --git a/tests/isolate/spawn_uri_nested_child1_vm_isolate.dart b/tests/isolate/spawn_uri_nested_child1_vm_isolate.dart
index e1e709d..26c6617 100644
--- a/tests/isolate/spawn_uri_nested_child1_vm_isolate.dart
+++ b/tests/isolate/spawn_uri_nested_child1_vm_isolate.dart
@@ -7,7 +7,6 @@
 // other isolate's code.
 library NestedSpawnUriChild1Library;
 import 'dart:isolate';
-import '../../pkg/unittest/lib/unittest.dart';
 
 main() {
   ReceivePort port2 = new ReceivePort();
diff --git a/tests/isolate/spawn_uri_nested_vm_test.dart b/tests/isolate/spawn_uri_nested_vm_test.dart
index e292789..e48483e 100644
--- a/tests/isolate/spawn_uri_nested_vm_test.dart
+++ b/tests/isolate/spawn_uri_nested_vm_test.dart
@@ -5,7 +5,7 @@
 // Example of nested spawning of isolates from a URI
 // Note: the following comment is used by test.dart to additionally compile the
 // other isolate's code.
-// OtherScripts=spawn_uri_nested_child1_vm_isolate.dart, spawn_uri_nested_child2_vm_isolate.dart
+// OtherScripts=spawn_uri_nested_child1_vm_isolate.dart spawn_uri_nested_child2_vm_isolate.dart
 library NestedSpawnUriLibrary;
 import 'dart:isolate';
 import '../../pkg/unittest/lib/unittest.dart';
@@ -13,7 +13,7 @@
 main() {
   test('isolate fromUri - nested send and reply', () {
     var port = spawnUri('spawn_uri_nested_child1_vm_isolate.dart');
-  
+
     port.call([1, 2]).then((result) => print(result));
   });
 }
diff --git a/tests/isolate/stacktrace_message_test.dart b/tests/isolate/stacktrace_message_test.dart
new file mode 100644
index 0000000..e0e05ec
--- /dev/null
+++ b/tests/isolate/stacktrace_message_test.dart
@@ -0,0 +1,25 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:isolate';
+
+main() {
+  spawnFunction(runTest).call(null);
+}
+
+runTest() {
+  port.receive((param, sendport) {
+    try {
+      throw 'sorry';
+    } catch (e, stack) {
+      try {
+        sendport.send(stack);
+        print("Stacktrace sent");
+      } catch (e) {
+        print("Stacktrace not sent");
+        sendport.send(null);
+      }
+    }
+  });
+}
diff --git a/tests/json/json_test.dart b/tests/json/json_test.dart
index af68004..ca21451 100644
--- a/tests/json/json_test.dart
+++ b/tests/json/json_test.dart
@@ -71,6 +71,7 @@
                    '"z":"hi","w":{"c":null,"d":true}, "v":null}'),
         equals({"x": {"a":3, "b": -4.5}, "y":[{}],
                    "z":"hi","w":{"c":null,"d":true}, "v":null}));
+  });
 
   test('stringify', () {
     // Scalars.
@@ -134,7 +135,6 @@
      * we try to stringify something that cannot be converted to json.
      */
     expect(() => json.stringify(new TestClass()), throws);
-    });
   });
 }
 
diff --git a/tests/language/bootstrap_test.dart b/tests/language/bootstrap_test.dart
index 444e5ed..747dbf9 100644
--- a/tests/language/bootstrap_test.dart
+++ b/tests/language/bootstrap_test.dart
@@ -1,8 +1,8 @@
-// Copyright (c) 2011, the Dart project authors.  Please see the AUTHORS file
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 // Dart test for testing binary operations.
-// VMOptions=--verify_implements
+// VMOptions=--verify_implements  --check-function-fingerprints
 
 class BootstrapTest {
 
diff --git a/tests/language/field_increment_bailout_test.dart b/tests/language/field_increment_bailout_test.dart
index 2dc2fe6..4685513 100644
--- a/tests/language/field_increment_bailout_test.dart
+++ b/tests/language/field_increment_bailout_test.dart
@@ -4,6 +4,7 @@
 
 // dart2js regression test for issue 8781.
 
+import "dart:mirrors" show reflect;
 import "package:expect/expect.dart";
 
 class N {
@@ -38,7 +39,7 @@
   final list;
   L(this.list);
   // Use noSuchMethod to defeat type inferencing.
-  noSuchMethod(mirror) => mirror.invokeOn(list);
+  noSuchMethod(mirror) => reflect(list).delegate(mirror);
 }
 
 main () {
diff --git a/tests/language/for_in2_test.dart b/tests/language/for_in2_test.dart
new file mode 100644
index 0000000..bf3e26a
--- /dev/null
+++ b/tests/language/for_in2_test.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Test that using a field or a global variable for a for/in variable
+// works.
+
+import "package:expect/expect.dart";
+
+Set<int> set = new Set.from([1, 2]);
+var x;
+
+class A {
+  var field;
+  test() {
+    int count = 0;
+    for (field in set) {
+      count += field;
+    }
+    Expect.equals(3, count);
+
+    count = 0;
+    for (x in set) {
+      count += x;
+    }
+    Expect.equals(3, count);
+  }
+}
+
+void main() {
+  new A().test();
+}
diff --git a/tests/language/invocation_mirror2_test.dart b/tests/language/invocation_mirror2_test.dart
index f93ac1e..c07330c 100644
--- a/tests/language/invocation_mirror2_test.dart
+++ b/tests/language/invocation_mirror2_test.dart
@@ -2,13 +2,14 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+import "dart:mirrors" show reflect;
 import "package:expect/expect.dart";
 
 class GetName {
   set flif(_) => "flif=";
 }
 
-String getName(im) => im.invokeOn(new GetName());
+String getName(im) => reflect(new GetName()).delegate(im);
 
 class C {
   var im;
diff --git a/tests/language/invocation_mirror_invoke_on2_test.dart b/tests/language/invocation_mirror_invoke_on2_test.dart
index 3b1fc9f..dfa6129 100644
--- a/tests/language/invocation_mirror_invoke_on2_test.dart
+++ b/tests/language/invocation_mirror_invoke_on2_test.dart
@@ -2,12 +2,13 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+import "dart:mirrors" show reflect;
 import "package:expect/expect.dart";
 
 class Proxy {
   final proxied;
   Proxy(this.proxied);
-  noSuchMethod(mirror) => mirror.invokeOn(proxied);
+  noSuchMethod(mirror) => reflect(proxied).delegate(mirror);
 }
 
 main() {
diff --git a/tests/language/invocation_mirror_invoke_on_test.dart b/tests/language/invocation_mirror_invoke_on_test.dart
index 4f84915..fd6722a 100644
--- a/tests/language/invocation_mirror_invoke_on_test.dart
+++ b/tests/language/invocation_mirror_invoke_on_test.dart
@@ -2,9 +2,10 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+import "dart:mirrors" show reflect;
 import "package:expect/expect.dart";
 
-// Testing Invocation.invokeOn method; test of issue 7227.
+// Testing InstanceMirror.delegate method; test of issue 7227.
 
 var reachedSetX = 0;
 var reachedGetX = 0;
@@ -25,7 +26,7 @@
 
 class B {
   final a = new A();
-  noSuchMethod(mirror) => mirror.invokeOn(a);
+  noSuchMethod(mirror) => reflect(a).delegate(mirror);
 }
 
 main () {
diff --git a/tests/language/invocation_mirror_test.dart b/tests/language/invocation_mirror_test.dart
index d1bb2aa..48393e9 100644
--- a/tests/language/invocation_mirror_test.dart
+++ b/tests/language/invocation_mirror_test.dart
@@ -6,6 +6,18 @@
 
 // Invocation and noSuchMethod testing.
 
+Map<Symbol, dynamic> listToNamedArguments(list) {
+  var iterator = list.iterator;
+  var result = new Map<Symbol, dynamic>();
+  while (iterator.moveNext()) {
+    Symbol key = iterator.current;
+    Expect.isTrue(iterator.moveNext());
+    result[key] = iterator.current;
+  }
+  return result;
+}
+
+
 /** Class with noSuchMethod that returns the mirror */
 class N {
   // Storage for the last argument to noSuchMethod.
@@ -33,8 +45,8 @@
  * Call without optionals for getters, with only positional for setters,
  * and with both optionals for everything else.
  */
-testInvocationMirror(Invocation im, String name,
-                     [List positional, Map named]) {
+testInvocationMirror(Invocation im, Symbol name,
+                     [List positional, List named]) {
   Expect.isTrue(im is Invocation, "is Invocation");
   Expect.equals(name, im.memberName, "name");
   if (named == null) {
@@ -55,6 +67,7 @@
     Expect.equals(0, im.namedArguments.length, "$name:#named");
     return;
   }
+  Map<Symbol, dynamic> namedArguments = listToNamedArguments(named);
   Expect.isTrue(im.isMethod, "$name:isMethod");
   Expect.isFalse(im.isAccessor, "$name:isAccessor");
   Expect.isFalse(im.isSetter, "$name:isSetter");
@@ -65,10 +78,12 @@
     Expect.equals(positional[i], im.positionalArguments[i],
                   "$name:positional[$i]");
   }
-  Expect.equals(named.length, im.namedArguments.length, "$name:#named");
-  named.forEach((k, v) {
-    Expect.isTrue(im.namedArguments.containsKey(k), "$name:?named[$k]");
-    Expect.equals(v, im.namedArguments[k], "$name:named[$k]");
+  Expect.equals(namedArguments.length, im.namedArguments.length,
+                "$name:#named");
+  namedArguments.forEach((k, v) {
+    Expect.isTrue(im.namedArguments.containsKey(k),
+                  "$name:?namedArguments[$k]");
+    Expect.equals(v, im.namedArguments[k], "$name:namedArguments[$k]");
   });
 }
 
@@ -79,48 +94,60 @@
   var c = new C();
 
   // Missing property/method access.
-  testInvocationMirror(n.bar, 'bar');
-  testInvocationMirror((n..bar = 42).last, 'bar=', [42]);
-  testInvocationMirror(n.bar(), 'bar', [], {});
-  testInvocationMirror(n.bar(42), 'bar', [42], {});
-  testInvocationMirror(n.bar(x: 42), 'bar', [], {"x": 42});
-  testInvocationMirror(n.bar(37, x: 42), 'bar', [37], {"x": 42});
+  testInvocationMirror(n.bar, const Symbol('bar'));
+  testInvocationMirror((n..bar = 42).last, const Symbol('bar='), [42]);
+  testInvocationMirror(n.bar(), const Symbol('bar'), [], []);
+  testInvocationMirror(n.bar(42), const Symbol('bar'), [42], []);
+  testInvocationMirror(n.bar(x: 42), const Symbol('bar'), [],
+                       [const Symbol("x"),  42]);
+  testInvocationMirror(n.bar(37, x: 42), const Symbol('bar'), [37],
+                       [const Symbol("x"), 42]);
 
   // Missing operator access.
-  testInvocationMirror(n + 4, '+', [4], {});
-  testInvocationMirror(n - 4, '-', [4], {});
-  testInvocationMirror(-n, 'unary-', [], {});
-  testInvocationMirror(n[42], '[]', [42], {});
-  testInvocationMirror((n..[37] = 42).last, '[]=', [37, 42], {});
+  testInvocationMirror(n + 4, const Symbol('+'), [4], []);
+  testInvocationMirror(n - 4, const Symbol('-'), [4], []);
+  testInvocationMirror(-n, const Symbol('unary-'), [], []);
+  testInvocationMirror(n[42], const Symbol('[]'), [42], []);
+  testInvocationMirror((n..[37] = 42).last, const Symbol('[]='), [37, 42], []);
 
   // Calling as function when it's not.
-  testInvocationMirror(n(), 'call', [], {});
-  testInvocationMirror(n(42), 'call', [42], {});
-  testInvocationMirror(n(x: 42), 'call', [], {"x": 42});
-  testInvocationMirror(n(37, x: 42), 'call', [37], {"x": 42});
+  testInvocationMirror(n(), const Symbol('call'), [], []);
+  testInvocationMirror(n(42), const Symbol('call'), [42], []);
+  testInvocationMirror(n(x: 42), const Symbol('call'), [],
+                       [const Symbol("x"), 42]);
+  testInvocationMirror(n(37, x: 42), const Symbol('call'), [37],
+                       [const Symbol("x"), 42]);
 
   // Calling with arguments not matching existing call method.
-  testInvocationMirror(c(), 'call', [], {});
-  testInvocationMirror(c(37, 42), 'call', [37, 42], {});
-  testInvocationMirror(c(x: 42), 'call', [], {"x": 42});
-  testInvocationMirror(c(37, x: 42), 'call', [37], {"x": 42});
+  testInvocationMirror(c(), const Symbol('call'), [], []);
+  testInvocationMirror(c(37, 42), const Symbol('call'), [37, 42], []);
+  testInvocationMirror(c(x: 42), const Symbol('call'), [],
+                       [const Symbol("x"), 42]);
+  testInvocationMirror(c(37, x: 42), const Symbol('call'), [37],
+                       [const Symbol("x"), 42]);
 
   // Wrong arguments to existing function.
-  testInvocationMirror(n.flif(), "flif", [], {});
-  testInvocationMirror(n.flif(37, 42), "flif", [37, 42], {});
-  testInvocationMirror(n.flif(x: 42), "flif", [], {"x": 42});
-  testInvocationMirror(n.flif(37, x: 42), "flif", [37], {"x": 42});
-  testInvocationMirror((n..flif = 42).last, "flif=", [42]);
+  testInvocationMirror(n.flif(), const Symbol("flif"), [], []);
+  testInvocationMirror(n.flif(37, 42), const Symbol("flif"), [37, 42], []);
+  testInvocationMirror(n.flif(x: 42), const Symbol("flif"), [],
+                       [const Symbol("x"), 42]);
+  testInvocationMirror(n.flif(37, x: 42), const Symbol("flif"), [37],
+                       [const Symbol("x"), 42]);
+  testInvocationMirror((n..flif = 42).last, const Symbol("flif="), [42]);
 
-  testInvocationMirror(n.flaf(37, 42), "flaf", [37, 42], {});
-  testInvocationMirror(n.flaf(x: 42), "flaf", [], {"x": 42});
-  testInvocationMirror(n.flaf(37, x: 42), "flaf", [37], {"x": 42});
-  testInvocationMirror((n..flaf = 42).last, "flaf=", [42]);
+  testInvocationMirror(n.flaf(37, 42), const Symbol("flaf"), [37, 42], []);
+  testInvocationMirror(n.flaf(x: 42), const Symbol("flaf"), [],
+                       [const Symbol("x"), 42]);
+  testInvocationMirror(n.flaf(37, x: 42), const Symbol("flaf"), [37],
+                       [const Symbol("x"), 42]);
+  testInvocationMirror((n..flaf = 42).last, const Symbol("flaf="), [42]);
 
-  testInvocationMirror(n.flof(37, 42), "flof", [37, 42], {});
-  testInvocationMirror(n.flof(x: 42), "flof", [], {"x": 42});
-  testInvocationMirror(n.flof(37, y: 42), "flof", [37], {"y": 42});
-  testInvocationMirror((n..flof = 42).last, "flof=", [42]);
+  testInvocationMirror(n.flof(37, 42), const Symbol("flof"), [37, 42], []);
+  testInvocationMirror(n.flof(x: 42), const Symbol("flof"), [],
+                       [const Symbol("x"), 42]);
+  testInvocationMirror(n.flof(37, y: 42), const Symbol("flof"), [37],
+                       [const Symbol("y"), 42]);
+  testInvocationMirror((n..flof = 42).last, const Symbol("flof="), [42]);
 
   // Reading works.
   Expect.isTrue(n.flif is Function);
@@ -128,19 +155,22 @@
   Expect.isTrue(n.flof is Function);
 
   // Writing to read-only fields.
-  testInvocationMirror((n..wut = 42).last, "wut=", [42]);
-  testInvocationMirror((n..plif = 42).last, "plif=", [42]);
-  testInvocationMirror((n..plaf = 42).last, "plaf=", [42]);
+  testInvocationMirror((n..wut = 42).last, const Symbol("wut="), [42]);
+  testInvocationMirror((n..plif = 42).last, const Symbol("plif="), [42]);
+  testInvocationMirror((n..plaf = 42).last, const Symbol("plaf="), [42]);
 
   // Trick call to n.call - wut is a getter returning n again.
-  testInvocationMirror(n.wut(42), "call", [42], {});
+  testInvocationMirror(n.wut(42), const Symbol("call"), [42], []);
 
   // Calling noSuchMethod itself, badly.
-  testInvocationMirror(n.noSuchMethod(), "noSuchMethod", [], {});
-  testInvocationMirror(n.noSuchMethod(37, 42), "noSuchMethod", [37, 42], {});
+  testInvocationMirror(n.noSuchMethod(), const Symbol("noSuchMethod"), [], []);
+  testInvocationMirror(n.noSuchMethod(37, 42), const Symbol("noSuchMethod"),
+                       [37, 42], []);
   testInvocationMirror(n.noSuchMethod(37, x:42),
-                       "noSuchMethod", [37], {"x": 42});
-  testInvocationMirror(n.noSuchMethod(x:42), "noSuchMethod", [], {"x": 42});
+                       const Symbol("noSuchMethod"), [37],
+                       [const Symbol("x"), 42]);
+  testInvocationMirror(n.noSuchMethod(x:42), const Symbol("noSuchMethod"), [],
+                       [const Symbol("x"), 42]);
 
   // Closurizing a method means that calling it badly will not hit the
   // original receivers noSuchMethod, only the one inherited from Object
@@ -156,36 +186,52 @@
 
   testSuperCalls() {
     // Missing property/method access.
-    testInvocationMirror(super.bar, 'bar');
-    testInvocationMirror((){super.bar = 42; return last;}(), 'bar=', [42]);
-    testInvocationMirror(super.bar(), 'bar', [], {});
-    testInvocationMirror(super.bar(42), 'bar', [42], {});
-    testInvocationMirror(super.bar(x: 42), 'bar', [], {"x": 42});
-    testInvocationMirror(super.bar(37, x: 42), 'bar', [37], {"x": 42});
+    testInvocationMirror(super.bar, const Symbol('bar'));
+    testInvocationMirror((){super.bar = 42; return last;}(),
+                         const Symbol('bar='), [42]);
+    testInvocationMirror(super.bar(), const Symbol('bar'), [], []);
+    testInvocationMirror(super.bar(42), const Symbol('bar'), [42], []);
+    testInvocationMirror(super.bar(x: 42), const Symbol('bar'), [],
+                         [const Symbol("x"), 42]);
+    testInvocationMirror(super.bar(37, x: 42), const Symbol('bar'), [37],
+                         [const Symbol("x"), 42]);
 
     // Missing operator access.
-    testInvocationMirror(super + 4, '+', [4], {});
-    testInvocationMirror(super - 4, '-', [4], {});
-    testInvocationMirror(-super, 'unary-', [], {});
-    testInvocationMirror(super[42], '[]', [42], {});
-    testInvocationMirror((){super[37] = 42; return last;}(), '[]=', [37, 42], {});
+    testInvocationMirror(super + 4, const Symbol('+'), [4], []);
+    testInvocationMirror(super - 4, const Symbol('-'), [4], []);
+    testInvocationMirror(-super, const Symbol('unary-'), [], []);
+    testInvocationMirror(super[42], const Symbol('[]'), [42], []);
+    testInvocationMirror((){super[37] = 42; return last;}(),
+                         const Symbol('[]='), [37, 42], []);
 
     // Wrong arguments to existing function.
-    testInvocationMirror(super.flif(), "flif", [], {});
-    testInvocationMirror(super.flif(37, 42), "flif", [37, 42], {});
-    testInvocationMirror(super.flif(x: 42), "flif", [], {"x": 42});
-    testInvocationMirror(super.flif(37, x: 42), "flif", [37], {"x": 42});
-    testInvocationMirror((){super.flif = 42; return last;}(), "flif=", [42]);
+    testInvocationMirror(super.flif(), const Symbol("flif"), [], []);
+    testInvocationMirror(super.flif(37, 42), const Symbol("flif"), [37, 42],
+                         []);
+    testInvocationMirror(super.flif(x: 42), const Symbol("flif"), [],
+                         [const Symbol("x"), 42]);
+    testInvocationMirror(super.flif(37, x: 42), const Symbol("flif"), [37],
+                         [const Symbol("x"), 42]);
+    testInvocationMirror((){super.flif = 42; return last;}(),
+                         const Symbol("flif="), [42]);
 
-    testInvocationMirror(super.flaf(37, 42), "flaf", [37, 42], {});
-    testInvocationMirror(super.flaf(x: 42), "flaf", [], {"x": 42});
-    testInvocationMirror(super.flaf(37, x: 42), "flaf", [37], {"x": 42});
-    testInvocationMirror((){super.flaf = 42; return last;}(), "flaf=", [42]);
+    testInvocationMirror(super.flaf(37, 42), const Symbol("flaf"), [37, 42],
+                         []);
+    testInvocationMirror(super.flaf(x: 42), const Symbol("flaf"), [],
+                         [const Symbol("x"), 42]);
+    testInvocationMirror(super.flaf(37, x: 42), const Symbol("flaf"), [37],
+                         [const Symbol("x"), 42]);
+    testInvocationMirror((){super.flaf = 42; return last;}(),
+                         const Symbol("flaf="), [42]);
 
-    testInvocationMirror(super.flof(37, 42), "flof", [37, 42], {});
-    testInvocationMirror(super.flof(x: 42), "flof", [], {"x": 42});
-    testInvocationMirror(super.flof(37, y: 42), "flof", [37], {"y": 42});
-    testInvocationMirror((){super.flof = 42; return last;}(), "flof=", [42]);
+    testInvocationMirror(super.flof(37, 42), const Symbol("flof"), [37, 42],
+                         []);
+    testInvocationMirror(super.flof(x: 42), const Symbol("flof"), [],
+                         [const Symbol("x"), 42]);
+    testInvocationMirror(super.flof(37, y: 42), const Symbol("flof"), [37],
+                         [const Symbol("y"), 42]);
+    testInvocationMirror((){super.flof = 42; return last;}(),
+                         const Symbol("flof="), [42]);
 
     // Reading works.
     Expect.isTrue(super.flif is Function);
@@ -193,18 +239,24 @@
     Expect.isTrue(super.flof is Function);
 
     // Writing to read-only fields.
-    testInvocationMirror((){super.wut = 42; return last;}(), "wut=", [42]);
-    testInvocationMirror((){super.plif = 42; return last;}(), "plif=", [42]);
-    testInvocationMirror((){super.plaf = 42; return last;}(), "plaf=", [42]);
+    testInvocationMirror((){super.wut = 42; return last;}(),
+                         const Symbol("wut="), [42]);
+    testInvocationMirror((){super.plif = 42; return last;}(),
+                         const Symbol("plif="), [42]);
+    testInvocationMirror((){super.plaf = 42; return last;}(),
+                         const Symbol("plaf="), [42]);
 
     // Calling noSuchMethod itself, badly.
-    testInvocationMirror(super.noSuchMethod(), "noSuchMethod", [], {});
+    testInvocationMirror(super.noSuchMethod(), const Symbol("noSuchMethod"), [],
+                         []);
     testInvocationMirror(super.noSuchMethod(37, 42),
-                         "noSuchMethod", [37, 42], {});
+                         const Symbol("noSuchMethod"), [37, 42], []);
     testInvocationMirror(super.noSuchMethod(37, x:42),
-                         "noSuchMethod", [37], {"x": 42});
+                         const Symbol("noSuchMethod"), [37],
+                         [const Symbol("x"), 42]);
     testInvocationMirror(super.noSuchMethod(x:42),
-                         "noSuchMethod", [], {"x": 42});
+                         const Symbol("noSuchMethod"), [],
+                         [const Symbol("x"), 42]);
 
     // Closurizing a method means that calling it badly will not hit the
     // original receivers noSuchMethod, only the one inherited from Object
diff --git a/tests/language/issue9687_test.dart b/tests/language/issue9687_test.dart
new file mode 100644
index 0000000..4f19d54
--- /dev/null
+++ b/tests/language/issue9687_test.dart
@@ -0,0 +1,51 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Regression test for dart2js code generation in checked mode. See
+// last part of https://code.google.com/p/dart/issues/detail?id=9687.
+
+import "package:expect/expect.dart";
+
+class A {
+  final finalField;
+  final otherFinalField;
+
+  A() : finalField = 42, otherFinalField = 54;
+
+  expectFinalField(arg1, arg2) {
+    Expect.equals(arg1, arg2);
+    Expect.equals(finalField, arg1);
+  }
+
+  expectOtherFinalField(_, arg1, arg2) {
+    Expect.equals(arg1, arg2);
+    Expect.equals(otherFinalField, arg1);
+  }
+}
+
+var array = [new A()];
+
+main() {
+  // [untypedReceiver] is made so that the compiler does not know
+  // what it is.
+  var untypedReceiver = array[0];
+
+  // [typedReceiver] is made so that the compiler knows what it is.
+  var typedReceiver = new A();
+
+  // Using [: finalField :] twice will make the compiler want to
+  // allocate one temporary for it.
+  var a = untypedReceiver.expectFinalField(
+      typedReceiver.finalField, typedReceiver.finalField);
+
+  // Having a check instruction in between two allocations of
+  // temporary variables used to trigger a bug in the compiler.
+  int b = a;
+
+  // Using [: otherFinalField :] twice will make the compiler want to
+  // allocate one temporary for it. The compiler used to assign the
+  // same temporary for [: otherFinalField :] and [: finalField :].
+  untypedReceiver.expectOtherFinalField(
+      b, typedReceiver.otherFinalField, typedReceiver.otherFinalField);
+}
diff --git a/tests/language/issue9939_test.dart b/tests/language/issue9939_test.dart
new file mode 100644
index 0000000..1a3c705
--- /dev/null
+++ b/tests/language/issue9939_test.dart
@@ -0,0 +1,43 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// dart2js was generating incorrect code for the [A] constructor, by
+// using a temporary variable for two instructions, even though they
+// are both live at the same time.
+
+import "package:expect/expect.dart";
+
+var globalVar = [1, 2];
+
+class A {
+  final field1;
+  final field2;
+  var field3;
+
+  A(this.field1, this.field2) {
+    bool entered = false;
+    // We use [field1] twice to ensure it will have a temporary.
+    for (var a in field1) {
+      try {
+        entered = true;
+        // We use [field2] twice to ensure it will have a temporary.
+        print(field2);
+        print(field2);
+      } catch (e) {
+        // Because the catch is aborting, the SSA graph we used to
+        // generate thought that the whole try/catch was aborting, and
+        // therefore it could not reach the code after the loop.
+        throw e;
+      }
+    }
+    Expect.isTrue(entered);
+    // dart2js used to overwrite the temporary for [field1] with
+    // [field2].
+    Expect.equals(globalVar, field1);
+  }
+}
+
+main() {
+  new A(globalVar, null);
+}
diff --git a/tests/language/language_dart2js.status b/tests/language/language_dart2js.status
index 360ffc3..946cec3 100644
--- a/tests/language/language_dart2js.status
+++ b/tests/language/language_dart2js.status
@@ -150,7 +150,6 @@
 function_type_alias2_test: Fail
 named_parameters_type_test: Fail
 positional_parameters_type_test: Fail
-named_parameters_with_object_property_names_test: Fail
 
 # Compilation errors.
 default_factory3_test: Fail # type arguments on redirecting factory not implemented
@@ -326,6 +325,7 @@
 
 assign_top_method_test: Fail
 
+
 [ $compiler == dart2js && $runtime == none ]
 *: Fail, Pass # TODO(ahe): Triage these tests.
 
diff --git a/tests/language/many_overridden_no_such_method_test.dart b/tests/language/many_overridden_no_such_method_test.dart
index cb9416c..f772998 100644
--- a/tests/language/many_overridden_no_such_method_test.dart
+++ b/tests/language/many_overridden_no_such_method_test.dart
@@ -3,7 +3,10 @@
 // BSD-style license that can be found in the LICENSE file.
 
 library ManyOverriddenNoSuchMethodTest.dart;
+
+import "dart:mirrors" show reflect;
 import "package:expect/expect.dart";
+
 part "overridden_no_such_method.dart";
 
 class ManyOverriddenNoSuchMethodTest {
diff --git a/tests/language/no_such_method3_test.dart b/tests/language/no_such_method3_test.dart
new file mode 100644
index 0000000..dfc7206
--- /dev/null
+++ b/tests/language/no_such_method3_test.dart
@@ -0,0 +1,36 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Test that a static type inferrer takes [noSuchMethod] into account.
+
+import "package:expect/expect.dart";
+
+class A {
+  B foobarbaz() {
+    return new B();
+  }
+}
+
+class B {
+  noSuchMethod(im) {
+    return 42;
+  }
+}
+
+bar() {
+  var b;
+  for (int i = 0; i < 500; ++i)
+    if (i % 2 == 0)
+      b = new A();
+    else
+      b = new B();
+  return b;
+}
+
+void main() {
+  var x = bar();
+  var y = x.foobarbaz();
+  Expect.equals(42, y);
+  Expect.isFalse(y is B);
+}
diff --git a/tests/language/no_such_method_test.dart b/tests/language/no_such_method_test.dart
index 39f1417..77e4894 100644
--- a/tests/language/no_such_method_test.dart
+++ b/tests/language/no_such_method_test.dart
@@ -3,6 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 // Dart test program testing that NoSuchMethod is properly called.
 
+import "dart:mirrors" show reflect;
 import "package:expect/expect.dart";
 
 class GetName {
@@ -10,7 +11,7 @@
   moo({b}) => "moo";
 }
 
-String getName(im) => im.invokeOn(new GetName());
+String getName(im) => reflect(new GetName()).delegate(im);
 
 class NoSuchMethodTest {
 
@@ -22,7 +23,7 @@
     Expect.equals("moo", getName(im));
     Expect.equals(0, im.positionalArguments.length);
     Expect.equals(1, im.namedArguments.length);
-    return foo(b:im.namedArguments["b"]);
+    return foo(b:im.namedArguments[const Symbol("b")]);
   }
 
   static testMain() {
diff --git a/tests/language/overridden_no_such_method.dart b/tests/language/overridden_no_such_method.dart
index 97433e3..d3a87b2 100644
--- a/tests/language/overridden_no_such_method.dart
+++ b/tests/language/overridden_no_such_method.dart
@@ -7,7 +7,7 @@
   foo(a, b) => "foo";
 }
 
-String getName(im) => im.invokeOn(new GetName());
+String getName(im) => reflect(new GetName()).delegate(im);
 
 class OverriddenNoSuchMethod {
 
diff --git a/tests/language/overridden_no_such_method_test.dart b/tests/language/overridden_no_such_method_test.dart
index 3aa37be..9c7fe12 100644
--- a/tests/language/overridden_no_such_method_test.dart
+++ b/tests/language/overridden_no_such_method_test.dart
@@ -5,6 +5,7 @@
 
 library OverriddenNoSuchMethodTest.dart;
 
+import "dart:mirrors" show reflect;
 import "package:expect/expect.dart";
 part "overridden_no_such_method.dart";
 
diff --git a/tests/language/super_call4_test.dart b/tests/language/super_call4_test.dart
index 079b8d2..b61ea8e 100644
--- a/tests/language/super_call4_test.dart
+++ b/tests/language/super_call4_test.dart
@@ -2,6 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+import "dart:mirrors" show reflect;
 import "package:expect/expect.dart";
 
 // Checks that noSuchMethod is resolved in the super class and not in the
@@ -11,25 +12,25 @@
   E e = new E();
 
   bool noSuchMethod(Invocation im) {
-    if (im.memberName == 'foo') {
+    if (im.memberName == const Symbol('foo')) {
       return im.positionalArguments.isEmpty &&
              im.namedArguments.isEmpty &&
-             im.invokeOn(e);
+             reflect(e).delegate(im);
     }
-    if (im.memberName == 'bar') {
+    if (im.memberName == const Symbol('bar')) {
       return im.positionalArguments.length == 1 &&
              im.namedArguments.isEmpty &&
-             im.invokeOn(e);
+             reflect(e).delegate(im);
     }
-    if (im.memberName == 'baz') {
+    if (im.memberName == const Symbol('baz')) {
       return im.positionalArguments.isEmpty &&
              im.namedArguments.length == 1 &&
-             im.invokeOn(e);
+             reflect(e).delegate(im);
     }
-    if (im.memberName == 'boz') {
+    if (im.memberName == const Symbol('boz')) {
       return im.positionalArguments.length == 1 &&
              im.namedArguments.length == 1 &&
-             im.invokeOn(e);
+             reflect(e).delegate(im);
     }
     return false;
   }
diff --git a/tests/language/super_getter_setter_test.dart b/tests/language/super_getter_setter_test.dart
index ac50bbb..551a965 100644
--- a/tests/language/super_getter_setter_test.dart
+++ b/tests/language/super_getter_setter_test.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+import 'dart:mirrors';
+
 import "package:expect/expect.dart";
 
 class A {
@@ -31,15 +33,16 @@
   operator[]=(index, value) { indexField[index] = value; }
 
   noSuchMethod(Invocation im) {
-    if (im.memberName.startsWith('missingSetter')) {
+    String name = MirrorSystem.getName(im.memberName);
+    if (name.startsWith('missingSetter')) {
       Expect.isTrue(im.isSetter);
       missingSetterField = im.positionalArguments[0];
-    } else if (im.memberName.startsWith('missingGetter')) {
+    } else if (name.startsWith('missingGetter')) {
       Expect.isTrue(im.isGetter);
       return missingGetterField;
-    } else if (im.memberName.startsWith('missingAll') && im.isGetter) {
+    } else if (name.startsWith('missingAll') && im.isGetter) {
       return missingAllField;
-    } else if (im.memberName.startsWith('missingAll') && im.isSetter) {
+    } else if (name.startsWith('missingAll') && im.isSetter) {
       missingAllField = im.positionalArguments[0];
     } else {
       Expect.fail('Should not reach here');
diff --git a/tests/language/super_operator_index5_test.dart b/tests/language/super_operator_index5_test.dart
index 1342852..29afbdc 100644
--- a/tests/language/super_operator_index5_test.dart
+++ b/tests/language/super_operator_index5_test.dart
@@ -11,7 +11,7 @@
   operator[](index) => indexField[index];
 
   noSuchMethod(Invocation im) {
-    if (im.memberName == '[]=') {
+    if (im.memberName == const Symbol('[]=')) {
       Expect.equals(2, im.positionalArguments.length);
       indexField[im.positionalArguments[0]] = im.positionalArguments[1];
     } else {
diff --git a/tests/language/super_operator_index6_test.dart b/tests/language/super_operator_index6_test.dart
index 57e3951..dced2c9 100644
--- a/tests/language/super_operator_index6_test.dart
+++ b/tests/language/super_operator_index6_test.dart
@@ -11,7 +11,7 @@
   operator[]=(index, value) { indexField[index] = value; }
 
   noSuchMethod(Invocation im) {
-    if (im.memberName == '[]') {
+    if (im.memberName == const Symbol('[]')) {
       Expect.equals(1, im.positionalArguments.length);
       return indexField[im.positionalArguments[0]];
     } else {
diff --git a/tests/language/super_operator_index7_test.dart b/tests/language/super_operator_index7_test.dart
index fb0b78a..261163d 100644
--- a/tests/language/super_operator_index7_test.dart
+++ b/tests/language/super_operator_index7_test.dart
@@ -10,10 +10,10 @@
   var indexField = new List(2);
 
   noSuchMethod(Invocation im) {
-    if (im.memberName == '[]=') {
+    if (im.memberName == const Symbol('[]=')) {
       Expect.equals(2, im.positionalArguments.length);
       indexField[im.positionalArguments[0]] = im.positionalArguments[1];
-    } else if (im.memberName == '[]') {
+    } else if (im.memberName == const Symbol('[]')) {
       Expect.equals(1, im.positionalArguments.length);
       return indexField[im.positionalArguments[0]];
     } else {
diff --git a/tests/lib/json/json_test.dart b/tests/lib/json/json_test.dart
new file mode 100644
index 0000000..bb171ea
--- /dev/null
+++ b/tests/lib/json/json_test.dart
@@ -0,0 +1,189 @@
+// Copyright (c) 2011, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library json_tests;
+import 'package:unittest/unittest.dart';
+import 'dart:json' as json;
+
+main() {
+  test('Parse', () {
+    // Scalars.
+    expect(json.parse(' 5 '), equals(5));
+    expect(json.parse(' -42 '), equals(-42));
+    expect(json.parse(' 3e0 '), equals(3));
+    expect(json.parse(' 3.14 '), equals(3.14));
+    expect(json.parse('true '), isTrue);
+    expect(json.parse(' false'), isFalse);
+    expect(json.parse(' null '), isNull);
+    expect(json.parse('\n\rnull\t'), isNull);
+    expect(json.parse(' "hi there\\" bob" '), equals('hi there" bob'));
+    expect(json.parse(' "" '), isEmpty);
+
+    // Lists.
+    expect(json.parse(' [] '), isEmpty);
+    expect(json.parse('[ ]'), isEmpty);
+    expect(json.parse(' [3, -4.5, true, "hi", false] '),
+      equals([3, -4.5, true, 'hi', false]));
+    // Nulls are tricky.
+    expect(json.parse('[null]'), orderedEquals([null]));
+    expect(json.parse(' [3, -4.5, null, true, "hi", false] '),
+      equals([3, -4.5, null, true, 'hi', false]));
+    expect(json.parse('[[null]]'), equals([[null]]));
+    expect(json.parse(' [ [3], [], [null], ["hi", true]] '),
+      equals([[3], [], [null], ['hi', true]]));
+
+    // Maps.
+    expect(json.parse(' {} '), isEmpty);
+    expect(json.parse('{ }'), isEmpty);
+
+    expect(json.parse(
+        ' {"x":3, "y": -4.5,  "z" : "hi","u" : true, "v": false } '),
+        equals({"x":3, "y": -4.5,  "z" : "hi", "u" : true, "v": false }));
+
+    expect(json.parse(' {"x":3, "y": -4.5,  "z" : "hi" } '),
+        equals({"x":3, "y": -4.5,  "z" : "hi" }));
+
+    expect(json.parse(' {"y": -4.5,  "z" : "hi" ,"x":3 } '),
+        equals({"y": -4.5,  "z" : "hi" ,"x":3 }));
+
+    expect(json.parse('{ " hi bob " :3, "": 4.5}'),
+        equals({ " hi bob " :3, "": 4.5}));
+
+    expect(json.parse(' { "x" : { } } '), equals({ 'x' : {}}));
+    expect(json.parse('{"x":{}}'), equals({ 'x' : {}}));
+
+    // Nulls are tricky.
+    expect(json.parse('{"w":null}'), equals({ 'w' : null}));
+
+    expect(json.parse('{"x":{"w":null}}'), equals({"x":{"w":null}}));
+
+    expect(json.parse(' {"x":3, "y": -4.5,  "z" : "hi",'
+                   '"w":null, "u" : true, "v": false } '),
+        equals({"x":3, "y": -4.5,  "z" : "hi",
+                   "w":null, "u" : true, "v": false }));
+
+    expect(json.parse('{"x": {"a":3, "b": -4.5}, "y":[{}], '
+                   '"z":"hi","w":{"c":null,"d":true}, "v":null}'),
+        equals({"x": {"a":3, "b": -4.5}, "y":[{}],
+                   "z":"hi","w":{"c":null,"d":true}, "v":null}));
+  });
+
+  test('stringify', () {
+    // Scalars.
+    expect(json.stringify(5), equals('5'));
+    expect(json.stringify(-42), equals('-42'));
+    // Dart does not guarantee a formatting for doubles,
+    // so reparse and compare to the original.
+    validateRoundTrip(3.14);
+    expect(json.stringify(true), equals('true'));
+    expect(json.stringify(false), equals('false'));
+    expect(json.stringify(null), equals('null'));
+    expect(json.stringify(' hi there" bob '), equals('" hi there\\" bob "'));
+    expect(json.stringify('hi\\there'), equals('"hi\\\\there"'));
+    // TODO(devoncarew): these tests break the dartium build
+    //expect(json.stringify('hi\nthere'), equals('"hi\\nthere"'));
+    //expect(json.stringify('hi\r\nthere'), equals('"hi\\r\\nthere"'));
+    expect(json.stringify(''), equals('""'));
+
+    // Lists.
+    expect(json.stringify([]), equals('[]'));
+    expect(json.stringify(new List(0)), equals('[]'));
+    expect(json.stringify(new List(3)), equals('[null,null,null]'));
+    validateRoundTrip([3, -4.5, null, true, 'hi', false]);
+    expect(json.stringify([[3], [], [null], ['hi', true]]),
+      equals('[[3],[],[null],["hi",true]]'));
+
+    // Maps.
+    expect(json.stringify({}), equals('{}'));
+    expect(json.stringify(new Map()), equals('{}'));
+    expect(json.stringify({'x':{}}), equals('{"x":{}}'));
+    expect(json.stringify({'x':{'a':3}}), equals('{"x":{"a":3}}'));
+
+    // Dart does not guarantee an order on the keys
+    // of a map literal, so reparse and compare to the original Map.
+    validateRoundTrip(
+        {'x':3, 'y':-4.5, 'z':'hi', 'w':null, 'u':true, 'v':false});
+    validateRoundTrip({"x":3, "y":-4.5, "z":'hi'});
+    validateRoundTrip({' hi bob ':3, '':4.5});
+    validateRoundTrip(
+        {'x':{'a':3, 'b':-4.5}, 'y':[{}], 'z':'hi', 'w':{'c':null, 'd':true},
+                  'v':null});
+
+    expect(json.stringify(new ToJson(4)), "4");
+    expect(json.stringify(new ToJson([4, "a"])), '[4,"a"]');
+    expect(json.stringify(new ToJson([4, new ToJson({"x":42})])),
+           '[4,{"x":42}]');
+
+    expect(() {
+      json.stringify([new ToJson(new ToJson(4))]);
+    }, throwsJsonError);
+
+    expect(() {
+      json.stringify([new Object()]);
+    }, throwsJsonError);
+
+  });
+
+  test('stringify throws if argument cannot be converted', () {
+    /**
+     * Checks that we get an exception (rather than silently returning null) if
+     * we try to stringify something that cannot be converted to json.
+     */
+    expect(() => json.stringify(new TestClass()), throwsJsonError);
+  });
+
+  test('stringify throws if toJson throws', () {
+    expect(() => json.stringify(new ToJsoner("bad", throws: true)),
+           throwsJsonError);
+  });
+
+  test('stringify throws if toJson returns non-serializable value', () {
+    expect(() => json.stringify(new ToJsoner(new TestClass())),
+           throwsJsonError);
+  });
+
+  test('stringify throws on cyclic values', () {
+    var a = [];
+    var b = a;
+    for (int i = 0; i < 50; i++) {
+      b = [b];
+    }
+    a.add(b);
+    expect(() => json.stringify(a), throwsJsonError);
+  });
+}
+
+class TestClass {
+  int x;
+  String y;
+
+  TestClass() : x = 3, y = 'joe' { }
+}
+
+class ToJsoner {
+  final Object returnValue;
+  final bool throws;
+  ToJsoner(this.returnValue, {this.throws});
+  Object toJson() {
+    if (throws) throw returnValue;
+    return returnValue;
+  }
+}
+
+class ToJson {
+  final object;
+  const ToJson(this.object);
+  toJson() => object;
+}
+
+var throwsJsonError =
+    throwsA(new isInstanceOf<json.JsonUnsupportedObjectError>());
+
+/**
+ * Checks that the argument can be converted to a JSON string and
+ * back, and produce something equivalent to the argument.
+ */
+validateRoundTrip(expected) {
+  expect(json.parse(json.stringify(expected)), equals(expected));
+}
diff --git a/tests/lib/lib.status b/tests/lib/lib.status
index b7f3acb..dafb4d9 100644
--- a/tests/lib/lib.status
+++ b/tests/lib/lib.status
@@ -16,13 +16,10 @@
 
 [ $compiler == dart2js ]
 math/*: Skip
-mirrors/*: Skip
+mirrors/mirrors_test: Fail # TODO(ahe): I'm working on fixing this.
 async/run_async3_test: Fail # _enqueueImmediate runs after Timer. http://dartbug.com/9002
 async/run_async4_test: Pass, Fail # no global exception handler in isolates. http://dartbug.com/9012
 
-[ $compiler == dart2js && ( $runtime == chrome || $runtime == drt ) && ($system == macos || $system == windows)]
-crypto/hmac_sha1_test: Fail # Issue 9471
-
 [ $compiler == dart2js && $checked ]
 async/stream_event_transform_test: Fail # Issue 7733.
 
diff --git a/tests/lib/mirrors/get_symbol_name_test.dart b/tests/lib/mirrors/get_symbol_name_test.dart
new file mode 100644
index 0000000..68b3cb1
--- /dev/null
+++ b/tests/lib/mirrors/get_symbol_name_test.dart
@@ -0,0 +1,16 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:mirrors' show MirrorSystem;
+
+expect(expected, actual) {
+  if (expected != actual) {
+    throw 'Expected: "$expected", but got "$actual"';
+  }
+}
+
+main() {
+  expect('fisk', MirrorSystem.getName(const Symbol('fisk')));
+  expect('fisk', MirrorSystem.getName(new Symbol('fisk')));
+}
diff --git a/tests/lib/mirrors/mirrors_test.dart b/tests/lib/mirrors/mirrors_test.dart
index 5c2c79f..a1bcf20 100644
--- a/tests/lib/mirrors/mirrors_test.dart
+++ b/tests/lib/mirrors/mirrors_test.dart
@@ -16,10 +16,19 @@
   Class.withInitialValue(this.field);
   var field;
   static var staticField;
+  m(a, b, c) => {"a": a, "b": b, "c": c};
 }
 
 typedef Typedef();
 
+testInvoke(mirrors) {
+  var instance = new Class();
+  var instMirror = reflect(instance);
+
+  expect(instMirror.invoke(const Symbol("m"),['A', 'B', instance]).reflectee,
+         equals({"a": 'A', "b":'B', "c": instance}));
+}
+
 testFieldAccess(mirrors) {
   var instance = new Class();
 
@@ -27,6 +36,11 @@
   var classMirror = libMirror.classes[const Symbol("Class")];
   var instMirror = reflect(instance);
 
+  libMirror.setField(const Symbol('topLevelField'), [91]);
+  expect(libMirror.getField(const Symbol('topLevelField')).reflectee,
+         equals([91]));
+  expect(topLevelField, equals([91]));
+
   libMirror.setFieldAsync(new Symbol('topLevelField'), 42);
   var future = libMirror.getFieldAsync(new Symbol('topLevelField'));
   future.then(expectAsync1((resultMirror) {
@@ -59,6 +73,8 @@
   expect(funcMirror is MethodMirror, equals(true));
   expect(funcMirror.parameters.length, equals(3));
 
+  expect(mirror.apply([7, 8, 9]).reflectee, equals(24));
+
   var future = mirror.applyAsync([2, 4, 8]);
   future.then(expectAsync1((resultMirror) {
     expect(resultMirror.reflectee, equals(14));
@@ -69,6 +85,15 @@
   var libMirror = mirrors.libraries[const Symbol("MirrorsTest")];
   var classMirror = libMirror.classes[const Symbol("Class")];
 
+  var instanceMirror = classMirror.newInstance(const Symbol(''),[]);
+  expect(instanceMirror.reflectee is Class, equals(true));
+  expect(instanceMirror.reflectee.field, equals("default value"));
+
+  instanceMirror = classMirror.newInstance(const Symbol('withInitialValue'),
+                                           [45]);
+  expect(instanceMirror.reflectee is Class, equals(true));
+  expect(instanceMirror.reflectee.field, equals(45));
+
   var future = classMirror.newInstanceAsync(new Symbol(''), []);
   future.then(expectAsync1((resultMirror) {
     var instance = resultMirror.reflectee;
@@ -84,6 +109,17 @@
   }));
 }
 
+testReflectClass(mirrors) {
+  var classMirror = reflectClass(Class);
+  expect(classMirror is ClassMirror, equals(true));
+  var symbolClassMirror = reflectClass(Symbol);
+  var symbolMirror = symbolClassMirror.newInstance(const Symbol(''),
+                                                   ['withInitialValue']);
+  var objectMirror = classMirror.newInstance(symbolMirror.reflectee,[1234]);
+  expect(objectMirror.reflectee is Class, equals(true));
+  expect(objectMirror.reflectee.field, equals(1234));
+}
+
 testNames(mirrors) {
   var libMirror = mirrors.libraries[const Symbol('MirrorsTest')];
   var classMirror = libMirror.classes[const Symbol('Class')];
@@ -117,9 +153,10 @@
 
 main() {
   var mirrors = currentMirrorSystem();
-
+  test("Test reflective method invocation", () { testInvoke(mirrors); });
   test("Test field access", () { testFieldAccess(mirrors); });
   test("Test closure mirrors", () { testClosureMirrors(mirrors); });
   test("Test invoke constructor", () { testInvokeConstructor(mirrors); });
+  test("Test reflect type", () { testReflectClass(mirrors); });
   test("Test simple and qualifiedName", () { testNames(mirrors); });
 }
diff --git a/tests/lib/typeddata/float32x4_list_test.dart b/tests/lib/typeddata/float32x4_list_test.dart
index 055b652..4885033 100644
--- a/tests/lib/typeddata/float32x4_list_test.dart
+++ b/tests/lib/typeddata/float32x4_list_test.dart
@@ -116,10 +116,6 @@
     testLoadStore(list);
   }
 
-  list = new Float32x4List.transferable(8);
-  for (int i = 0; i < 3000; i++) {
-    testLoadStore(list);
-  }
   Float32List floatList = new Float32List(32);
   for (int i = 0; i < floatList.length; i++) {
     floatList[i] = i.toDouble();
diff --git a/tests/lib/typeddata/float32x4_unbox_regress_test.dart b/tests/lib/typeddata/float32x4_unbox_regress_test.dart
index 48563e2..dd84dfc 100644
--- a/tests/lib/typeddata/float32x4_unbox_regress_test.dart
+++ b/tests/lib/typeddata/float32x4_unbox_regress_test.dart
@@ -1,6 +1,7 @@
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
+// VMOptions=--deoptimization_counter_threshold=1000
 
 // Library tag to be able to run in html test framework.
 library float32x4_unbox_regress_test;
@@ -12,7 +13,7 @@
   array[index] = value;
 }
 
-main() {
+void testListStoreDeopt() {
   var list;
   var value = new Float32x4(1.0, 2.0, 3.0, 4.0);
   var smi = 12;
@@ -27,3 +28,29 @@
     testListStore(list, 0, smi);
   } catch (_) { }
 }
+
+testAdd(a, b) {
+  var c = a + b;
+  Expect.equals(3.0, c.x);
+  Expect.equals(5.0, c.y);
+  Expect.equals(7.0, c.z);
+  Expect.equals(9.0, c.w);
+}
+
+void testAddDeopt() {
+  var a = new Float32x4(1.0, 2.0, 3.0, 4.0);
+  var b = new Float32x4(2.0, 3.0, 4.0, 5.0);
+  var smi = 12;
+  for (int i = 0; i < 3000; i++) {
+    testAdd(a, b);
+  }
+
+  try {
+    testAdd(a, smi);
+  } catch (_) {}
+}
+
+main() {
+  testListStoreDeopt();
+  testAddDeopt();
+}
diff --git a/tests/standalone/byte_array_view_optimized_test.dart b/tests/standalone/byte_array_view_optimized_test.dart
index 6699d0b..b50e387 100644
--- a/tests/standalone/byte_array_view_optimized_test.dart
+++ b/tests/standalone/byte_array_view_optimized_test.dart
@@ -13,7 +13,7 @@
 li16(v) => v[0];
 
 main() {
-  var a = new Uint8List.transferable(2);
+  var a = new Uint8List(2);
   a[0] = a[1] = 0xff;
   var b = new Int16List.view(a.buffer);
   Expect.equals(-1, li16(b));
diff --git a/tests/standalone/bytedata_test.dart b/tests/standalone/bytedata_test.dart
new file mode 100644
index 0000000..9a69bb8
--- /dev/null
+++ b/tests/standalone/bytedata_test.dart
@@ -0,0 +1,348 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+//
+// Dart test program for testing typed data.
+
+// Library tag to be able to run in html test framework.
+library ByteDataTest;
+
+import "package:expect/expect.dart";
+import 'dart:typeddata';
+
+testGetters() {
+  bool host_is_little_endian = 
+    (new Uint8List.view(new Uint16List.fromList([1]).buffer))[0] == 1;
+
+  var list = new Uint8List(8);
+  list[0] = 0xf1;
+  list[1] = 0xf2;
+  list[2] = 0xf3;
+  list[3] = 0xf4;
+  list[4] = 0xf5;
+  list[5] = 0xf6;
+  list[6] = 0xf7;
+  list[7] = 0xf8;
+  var ba = list.buffer;
+
+  ByteData bd = new ByteData.view(ba);
+  var value;
+  int expected_value_be = -3598;
+  int expected_value_le = -3343;
+
+  value = bd.getInt16(0);  // Default is big endian access.
+  Expect.equals(expected_value_be, value);
+  value = bd.getInt16(0, Endianness.BIG_ENDIAN);
+  Expect.equals(expected_value_be, value);
+  value = bd.getInt16(0, Endianness.LITTLE_ENDIAN);
+  Expect.equals(expected_value_le, value);
+  value = bd.getInt16(0, Endianness.HOST_ENDIAN);
+  if (host_is_little_endian) {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.LITTLE_ENDIAN));
+    Expect.equals(expected_value_le, value);
+  } else {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.BIG_ENDIAN));
+    Expect.equals(expected_value_be, value);
+  }
+
+  value = bd.getUint16(0);  // Default is big endian access.
+  Expect.equals(0xf1f2, value);
+  value = bd.getUint16(0, Endianness.BIG_ENDIAN);
+  Expect.equals(0xf1f2, value);
+  value = bd.getUint16(0, Endianness.LITTLE_ENDIAN);
+  Expect.equals(0xf2f1, value);
+  if (host_is_little_endian) {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.LITTLE_ENDIAN));
+    Expect.equals(0xf2f1, value);
+  } else {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.BIG_ENDIAN));
+    Expect.equals(0xf1f2, value);
+  }
+
+  expected_value_be = -235736076;
+  expected_value_le = -185339151;
+
+  value = bd.getInt32(0);  // Default is big endian access.
+  Expect.equals(expected_value_be, value);
+  value = bd.getInt32(0, Endianness.BIG_ENDIAN);
+  Expect.equals(expected_value_be, value);
+  value = bd.getInt32(0, Endianness.LITTLE_ENDIAN);
+  Expect.equals(expected_value_le, value);
+  if (host_is_little_endian) {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.LITTLE_ENDIAN));
+    Expect.equals(expected_value_le, value);
+  } else {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.BIG_ENDIAN));
+    Expect.equals(expected_value_be, value);
+  }
+
+  value = bd.getUint32(0);  // Default is big endian access.
+  Expect.equals(0xf1f2f3f4, value);
+  value = bd.getUint32(0, Endianness.BIG_ENDIAN);
+  Expect.equals(0xf1f2f3f4, value);
+  value = bd.getUint32(0, Endianness.LITTLE_ENDIAN);
+  Expect.equals(0xf4f3f2f1, value);
+  if (host_is_little_endian) {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.LITTLE_ENDIAN));
+    Expect.equals(0xf4f3f2f1, value);
+  } else {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.BIG_ENDIAN));
+    Expect.equals(0xf1f2f3f4, value);
+  }
+
+  expected_value_be = -1012478732780767240;
+  expected_value_le = -506664896818842895;
+
+  value = bd.getInt64(0);  // Default is big endian access.
+  Expect.equals(expected_value_be, value);
+  value = bd.getInt64(0, Endianness.BIG_ENDIAN);
+  Expect.equals(expected_value_be, value);
+  value = bd.getInt64(0, Endianness.LITTLE_ENDIAN);
+  Expect.equals(expected_value_le, value);
+  if (host_is_little_endian) {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.LITTLE_ENDIAN));
+    Expect.equals(expected_value_le, value);
+  } else {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.BIG_ENDIAN));
+    Expect.equals(expected_value_be, value);
+  }
+
+  value = bd.getUint64(0);  // Default is big endian access.
+  Expect.equals(0xf1f2f3f4f5f6f7f8, value);
+  value = bd.getUint64(0, Endianness.BIG_ENDIAN);
+  Expect.equals(0xf1f2f3f4f5f6f7f8, value);
+  value = bd.getUint64(0, Endianness.LITTLE_ENDIAN);
+  Expect.equals(0xf8f7f6f5f4f3f2f1, value);
+  if (host_is_little_endian) {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.LITTLE_ENDIAN));
+    Expect.equals(0xf8f7f6f5f4f3f2f1, value);
+  } else {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.BIG_ENDIAN));
+    Expect.equals(0xf1f2f3f4f5f6f7f8, value);
+  }
+
+  double expected_be_value = -2.4060893954673178e+30;
+  double expected_le_value = -1.5462104171572421e+32;
+  value = bd.getFloat32(0);  // Default is big endian access.
+  Expect.equals(expected_be_value, value);
+  value = bd.getFloat32(0, Endianness.BIG_ENDIAN);
+  Expect.equals(expected_be_value, value);
+  value = bd.getFloat32(0, Endianness.LITTLE_ENDIAN);
+  Expect.equals(expected_le_value, value);
+  if (host_is_little_endian) {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.LITTLE_ENDIAN));
+    Expect.equals(expected_le_value, value);
+  } else {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.BIG_ENDIAN));
+    Expect.equals(expected_be_value, value);
+  }
+
+
+  expected_be_value = -7.898661740976602e+240;
+  expected_le_value = -5.185705956736366e+274;
+  value = bd.getFloat64(0);  // Default is big endian access.
+  Expect.equals(expected_be_value, value);
+  value = bd.getFloat64(0, Endianness.BIG_ENDIAN);
+  Expect.equals(expected_be_value, value);
+  value = bd.getFloat64(0, Endianness.LITTLE_ENDIAN);
+  Expect.equals(expected_le_value, value);
+  if (host_is_little_endian) {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.LITTLE_ENDIAN));
+    Expect.equals(expected_le_value, value);
+  } else {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.BIG_ENDIAN));
+    Expect.equals(expected_be_value, value);
+  }
+}
+
+
+validate16be(var list) {
+  Expect.equals(0xf1, list[0]);
+  Expect.equals(0xf2, list[1]);
+}
+
+
+validate16le(var list) {
+  Expect.equals(0xf2, list[0]);
+  Expect.equals(0xf1, list[1]);
+}
+
+
+validate32be(var list) {
+  Expect.equals(0xf1, list[0]);
+  Expect.equals(0xf2, list[1]);
+  Expect.equals(0xf3, list[2]);
+  Expect.equals(0xf4, list[3]);
+}
+
+
+validate32le(var list) {
+  Expect.equals(0xf4, list[0]);
+  Expect.equals(0xf3, list[1]);
+  Expect.equals(0xf2, list[2]);
+  Expect.equals(0xf1, list[3]);
+}
+
+
+validate64be(var list) {
+  Expect.equals(0xf1, list[0]);
+  Expect.equals(0xf2, list[1]);
+  Expect.equals(0xf3, list[2]);
+  Expect.equals(0xf4, list[3]);
+  Expect.equals(0xf5, list[4]);
+  Expect.equals(0xf6, list[5]);
+  Expect.equals(0xf7, list[6]);
+  Expect.equals(0xf8, list[7]);
+}
+
+
+validate64le(var list) {
+  Expect.equals(0xf8, list[0]);
+  Expect.equals(0xf7, list[1]);
+  Expect.equals(0xf6, list[2]);
+  Expect.equals(0xf5, list[3]);
+  Expect.equals(0xf4, list[4]);
+  Expect.equals(0xf3, list[5]);
+  Expect.equals(0xf2, list[6]);
+  Expect.equals(0xf1, list[7]);
+}
+
+
+testSetters() {
+  bool host_is_little_endian = 
+    (new Uint8List.view(new Uint16List.fromList([1]).buffer))[0] == 1;
+
+  var list = new Uint8List(8);
+  for (int i = 0; i < list.length; i++) {
+    list[i] = 0;
+  }
+  var ba = list.buffer;
+  ByteData bd = new ByteData.view(ba);
+
+  bd.setInt16(0, 0xf1f2);  // Default is big endian access.
+  validate16be(list);
+  bd.setInt16(0, 0xf1f2, Endianness.BIG_ENDIAN);
+  validate16be(list);
+  bd.setInt16(0, 0xf1f2, Endianness.LITTLE_ENDIAN);
+  validate16le(list);
+  bd.setInt16(0, 0xf1f2, Endianness.HOST_ENDIAN);
+  if (host_is_little_endian) {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.LITTLE_ENDIAN));
+    validate16le(list);
+  } else {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.BIG_ENDIAN));
+    validate16be(list);
+  }
+
+  bd.setUint16(0, 0xf1f2);  // Default is big endian access.
+  validate16be(list);
+  bd.setUint16(0, 0xf1f2, Endianness.BIG_ENDIAN);
+  validate16be(list);
+  bd.setUint16(0, 0xf1f2, Endianness.LITTLE_ENDIAN);
+  validate16le(list);
+  bd.setUint16(0, 0xf1f2, Endianness.HOST_ENDIAN);
+  if (host_is_little_endian) {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.LITTLE_ENDIAN));
+    validate16le(list);
+  } else {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.BIG_ENDIAN));
+    validate16be(list);
+  }
+
+  bd.setInt32(0, 0xf1f2f3f4);  // Default is big endian access.
+  validate32be(list);
+  bd.setInt32(0, 0xf1f2f3f4, Endianness.BIG_ENDIAN);
+  validate32be(list);
+  bd.setInt32(0, 0xf1f2f3f4, Endianness.LITTLE_ENDIAN);
+  validate32le(list);
+  bd.setInt32(0, 0xf1f2f3f4, Endianness.HOST_ENDIAN);
+  if (host_is_little_endian) {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.LITTLE_ENDIAN));
+    validate32le(list);
+  } else {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.BIG_ENDIAN));
+    validate32be(list);
+  }
+
+  bd.setUint32(0, 0xf1f2f3f4);  // Default is big endian access.
+  validate32be(list);
+  bd.setUint32(0, 0xf1f2f3f4, Endianness.BIG_ENDIAN);
+  validate32be(list);
+  bd.setUint32(0, 0xf1f2f3f4, Endianness.LITTLE_ENDIAN);
+  validate32le(list);
+  bd.setUint32(0, 0xf1f2f3f4, Endianness.HOST_ENDIAN);
+  if (host_is_little_endian) {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.LITTLE_ENDIAN));
+    validate32le(list);
+  } else {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.BIG_ENDIAN));
+    validate32be(list);
+  }
+
+  bd.setInt64(0, 0xf1f2f3f4f5f6f7f8);  // Default is big endian access.
+  validate64be(list);
+  bd.setInt64(0, 0xf1f2f3f4f5f6f7f8, Endianness.BIG_ENDIAN);
+  validate64be(list);
+  bd.setInt64(0, 0xf1f2f3f4f5f6f7f8, Endianness.LITTLE_ENDIAN);
+  validate64le(list);
+  bd.setInt64(0, 0xf1f2f3f4f5f6f7f8, Endianness.HOST_ENDIAN);
+  if (host_is_little_endian) {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.LITTLE_ENDIAN));
+    validate64le(list);
+  } else {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.BIG_ENDIAN));
+    validate64be(list);
+  }
+
+  bd.setUint64(0, 0xf1f2f3f4f5f6f7f8);  // Default is big endian access.
+  validate64be(list);
+  bd.setUint64(0, 0xf1f2f3f4f5f6f7f8, Endianness.BIG_ENDIAN);
+  validate64be(list);
+  bd.setUint64(0, 0xf1f2f3f4f5f6f7f8, Endianness.LITTLE_ENDIAN);
+  validate64le(list);
+  bd.setUint64(0, 0xf1f2f3f4f5f6f7f8, Endianness.HOST_ENDIAN);
+  if (host_is_little_endian) {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.LITTLE_ENDIAN));
+    validate64le(list);
+  } else {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.BIG_ENDIAN));
+    validate64be(list);
+  }
+
+  bd.setFloat32(0, -2.4060893954673178e+30);  // Default is big endian access.
+  validate32be(list);
+  bd.setFloat32(0, -2.4060893954673178e+30, Endianness.BIG_ENDIAN);
+  validate32be(list);
+  bd.setFloat32(0, -2.4060893954673178e+30, Endianness.LITTLE_ENDIAN);
+  validate32le(list);
+  bd.setFloat32(0, -2.4060893954673178e+30, Endianness.HOST_ENDIAN);
+  if (host_is_little_endian) {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.LITTLE_ENDIAN));
+    validate32le(list);
+  } else {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.BIG_ENDIAN));
+    validate32be(list);
+  }
+
+  bd.setFloat64(0, -7.898661740976602e+240);  // Default is big endian access.
+  validate64be(list);
+  bd.setFloat64(0, -7.898661740976602e+240, Endianness.BIG_ENDIAN);
+  validate64be(list);
+  bd.setFloat64(0, -7.898661740976602e+240, Endianness.LITTLE_ENDIAN);
+  validate64le(list);
+  bd.setFloat64(0, -7.898661740976602e+240, Endianness.HOST_ENDIAN);
+  if (host_is_little_endian) {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.LITTLE_ENDIAN));
+    validate64le(list);
+  } else {
+    Expect.isTrue(identical(Endianness.HOST_ENDIAN, Endianness.BIG_ENDIAN));
+    validate64be(list);
+  }
+
+}
+
+
+main() {
+  testGetters();
+  testSetters();
+}
diff --git a/tests/standalone/debugger/debug_lib.dart b/tests/standalone/debugger/debug_lib.dart
index 9fa6349..5f5a494 100644
--- a/tests/standalone/debugger/debug_lib.dart
+++ b/tests/standalone/debugger/debug_lib.dart
@@ -341,8 +341,15 @@
         }
       }
     } else if (msg["event"] == "breakpointResolved") {
-      // Ignore the event. We may want to maintain a table of
-      // breakpoints in the future.
+      var bpId = msg["params"]["breakpointId"];
+      assert(bpId != null);
+      var isolateId = msg["params"]["isolateId"];
+      assert(isolateId != null);
+      var location = msg["params"]["location"];
+      assert(location != null);
+      print("Isolate $isolateId: breakpoint $bpId resolved"
+            " at location $location");
+      // We may want to maintain a table of breakpoints in the future.
     } else if (msg["event"] == "paused") {
       isPaused = true;
     } else {
diff --git a/tests/standalone/io/process_pid_test.dart b/tests/standalone/io/process_pid_test.dart
new file mode 100644
index 0000000..c83a6d9
--- /dev/null
+++ b/tests/standalone/io/process_pid_test.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+//
+// Process test program to test process communication.
+
+import "package:expect/expect.dart";
+import "dart:async";
+import "dart:io";
+import "dart:isolate";
+
+main() {
+  var port = new ReceivePort();
+  Expect.isTrue(pid > 0);
+  var futures = [];
+  futures.add(Process.start(new Options().executable,['--version']));
+  futures.add(Process.run(new Options().executable,['--version']));
+  Future.wait(futures).then((results) {
+    Expect.isTrue(results[0].pid > 0);
+    Expect.isTrue(results[1].pid > 0);
+    Expect.equals(0, results[1].exitCode);
+    results[0].exitCode.then((exitCode) {
+      Expect.equals(0, exitCode);
+      port.close();
+    });
+  });
+}
diff --git a/tests/standalone/io/raw_secure_server_socket_test.dart b/tests/standalone/io/raw_secure_server_socket_test.dart
index cc8a86e..873cfba 100644
--- a/tests/standalone/io/raw_secure_server_socket_test.dart
+++ b/tests/standalone/io/raw_secure_server_socket_test.dart
@@ -132,14 +132,49 @@
   });
 }
 
-void testSimpleReadWrite() {
-  // This test creates a server and a client connects. The client then
-  // writes and the server echos. When the server has finished its
-  // echo it half-closes. When the client gets the close event is
-  // closes fully.
+// This test creates a server and a client connects. The client then
+// writes and the server echos. When the server has finished its echo
+// it half-closes. When the client gets the close event is closes
+// fully.
+//
+// The test can be run in different configurations based on
+// the boolean arguments:
+//
+// listenSecure
+// When this argument is true a secure server is used. When this is false
+// a non-secure server is used and the connections are secured after beeing
+// connected.
+//
+// connectSecure
+// When this argument is true a secure client connection is used. When this
+// is false a non-secure client connection is used and the connection is
+// secured after being connected.
+//
+// handshakeBeforeSecure
+// When this argument is true some initial clear text handshake is done
+// between client and server before the connection is secured. This argument
+// only makes sense when both listenSecure and connectSecure are false.
+//
+// postponeSecure
+// When this argument is false the securing of the server end will
+// happen as soon as the last byte of the handshake before securing
+// has been written. When this argument is true the securing of the
+// server will not happen until the first TLS handshake data has been
+// received from the client. This argument only takes effect when
+// handshakeBeforeSecure is true.
+void testSimpleReadWrite(bool listenSecure,
+                         bool connectSecure,
+                         bool handshakeBeforeSecure,
+                         [bool postponeSecure = false]) {
+  if (handshakeBeforeSecure == true &&
+      (listenSecure == true || connectSecure == true)) {
+    Expect.fails("Invalid arguments to testSimpleReadWrite");
+  }
+
   ReceivePort port = new ReceivePort();
 
   const messageSize = 1000;
+  const handshakeMessageSize = 100;
 
   List<int> createTestData() {
     List<int> data = new List<int>(messageSize);
@@ -149,6 +184,14 @@
     return data;
   }
 
+  List<int> createHandshakeTestData() {
+    List<int> data = new List<int>(handshakeMessageSize);
+    for (int i = 0; i < handshakeMessageSize; i++) {
+      data[i] = i & 0xff;
+    }
+    return data;
+  }
+
   void verifyTestData(List<int> data) {
     Expect.equals(messageSize, data.length);
     List<int> expected = createTestData();
@@ -157,91 +200,251 @@
     }
   }
 
-  RawSecureServerSocket.bind(SERVER_ADDRESS, 0, 5, CERTIFICATE).then((server) {
-    server.listen((client) {
-      int bytesRead = 0;
-      int bytesWritten = 0;
-      List<int> data = new List<int>(messageSize);
+  void verifyHandshakeTestData(List<int> data) {
+    Expect.equals(handshakeMessageSize, data.length);
+    List<int> expected = createHandshakeTestData();
+    for (int i = 0; i < handshakeMessageSize; i++) {
+      Expect.equals(expected[i], data[i]);
+    }
+  }
 
-      client.writeEventsEnabled = false;
-      client.listen((event) {
-        switch (event) {
-          case RawSocketEvent.READ:
+  Future runServer(RawSocket client) {
+    var completer = new Completer();
+    int bytesRead = 0;
+    int bytesWritten = 0;
+    List<int> data = new List<int>(messageSize);
+    client.writeEventsEnabled = false;
+    var subscription;
+    subscription = client.listen((event) {
+      switch (event) {
+        case RawSocketEvent.READ:
+          Expect.isTrue(bytesWritten == 0);
+          Expect.isTrue(client.available() > 0);
+          var buffer = client.read();
+          if (buffer != null) {
+            data.setRange(bytesRead, bytesRead + buffer.length, buffer);
+            bytesRead += buffer.length;
+            for (var value in buffer) {
+              Expect.isTrue(value is int);
+              Expect.isTrue(value < 256 && value >= 0);
+            }
+          }
+          if (bytesRead == data.length) {
+            verifyTestData(data);
+            client.writeEventsEnabled = true;
+          }
+          break;
+        case RawSocketEvent.WRITE:
+          Expect.isFalse(client.writeEventsEnabled);
+          Expect.equals(bytesRead, data.length);
+          for (int i = bytesWritten; i < data.length; ++i) {
+            Expect.isTrue(data[i] is int);
+            Expect.isTrue(data[i] < 256 && data[i] >= 0);
+          }
+          bytesWritten += client.write(
+              data, bytesWritten, data.length - bytesWritten);
+          if (bytesWritten < data.length) {
+            client.writeEventsEnabled = true;
+          }
+          if (bytesWritten == data.length) {
+            client.shutdown(SocketDirection.SEND);
+          }
+          break;
+        case RawSocketEvent.READ_CLOSED:
+          completer.complete(null);
+          break;
+        default: throw "Unexpected event $event";
+      }
+    });
+    return completer.future;
+  }
+
+  Future<RawSocket> runClient(RawSocket socket) {
+    var completer = new Completer();
+    int bytesRead = 0;
+    int bytesWritten = 0;
+    List<int> dataSent = createTestData();
+    List<int> dataReceived = new List<int>(dataSent.length);
+    socket.listen((event) {
+      switch (event) {
+        case RawSocketEvent.READ:
+          Expect.isTrue(socket.available() > 0);
+          var buffer = socket.read();
+          if (buffer != null) {
+            dataReceived.setRange(bytesRead, bytesRead + buffer.length, buffer);
+            bytesRead += buffer.length;
+          }
+          break;
+        case RawSocketEvent.WRITE:
+          Expect.isTrue(bytesRead == 0);
+          Expect.isFalse(socket.writeEventsEnabled);
+          bytesWritten += socket.write(
+              dataSent, bytesWritten, dataSent.length - bytesWritten);
+          if (bytesWritten < dataSent.length) {
+            socket.writeEventsEnabled = true;
+          }
+          break;
+        case RawSocketEvent.READ_CLOSED:
+          verifyTestData(dataReceived);
+          completer.complete(socket);
+          break;
+        default: throw "Unexpected event $event";
+      }
+    });
+    return completer.future;
+  }
+
+  Future runServerHandshake(RawSocket client) {
+    var completer = new Completer();
+    int bytesRead = 0;
+    int bytesWritten = 0;
+    List<int> data = new List<int>(handshakeMessageSize);
+    client.writeEventsEnabled = false;
+    var subscription;
+    subscription = client.listen((event) {
+      switch (event) {
+        case RawSocketEvent.READ:
+          if (bytesRead < data.length) {
             Expect.isTrue(bytesWritten == 0);
-            Expect.isTrue(client.available() > 0);
-            var buffer = client.read();
-            if (buffer != null) {
-              data.setRange(bytesRead, bytesRead + buffer.length, buffer);
-              bytesRead += buffer.length;
-              for (var value in buffer) {
-                Expect.isTrue(value is int);
-                Expect.isTrue(value < 256 && value >= 0);
-              }
-            }
+          }
+          Expect.isTrue(client.available() > 0);
+          var buffer = client.read();
+          if (buffer != null) {
             if (bytesRead == data.length) {
-              verifyTestData(data);
-              client.writeEventsEnabled = true;
+              // Read first part of TLS handshake from client.
+              Expect.isTrue(postponeSecure);
+              completer.complete([subscription, buffer]);
+              client.readEventsEnabled = false;
+              return;
             }
-            break;
-          case RawSocketEvent.WRITE:
-            Expect.isFalse(client.writeEventsEnabled);
-            Expect.equals(bytesRead, data.length);
-            for (int i = bytesWritten; i < data.length; ++i) {
-              Expect.isTrue(data[i] is int);
-              Expect.isTrue(data[i] < 256 && data[i] >= 0);
+            data.setRange(bytesRead, bytesRead + buffer.length, buffer);
+            bytesRead += buffer.length;
+            for (var value in buffer) {
+              Expect.isTrue(value is int);
+              Expect.isTrue(value < 256 && value >= 0);
             }
-            bytesWritten += client.write(
-                data, bytesWritten, data.length - bytesWritten);
-            if (bytesWritten < data.length) {
-              client.writeEventsEnabled = true;
+          }
+          if (bytesRead == data.length) {
+            verifyHandshakeTestData(data);
+            client.writeEventsEnabled = true;
+          }
+        if (bytesRead > data.length) print("XXX");
+          break;
+        case RawSocketEvent.WRITE:
+          Expect.isFalse(client.writeEventsEnabled);
+          Expect.equals(bytesRead, data.length);
+          for (int i = bytesWritten; i < data.length; ++i) {
+            Expect.isTrue(data[i] is int);
+            Expect.isTrue(data[i] < 256 && data[i] >= 0);
+          }
+          bytesWritten += client.write(
+              data, bytesWritten, data.length - bytesWritten);
+          if (bytesWritten < data.length) {
+            client.writeEventsEnabled = true;
+          }
+          if (bytesWritten == data.length) {
+            if (!postponeSecure) {
+              completer.complete([subscription, null]);
             }
-            if (bytesWritten == data.length) {
-              client.shutdown(SocketDirection.SEND);
+          }
+          break;
+        case RawSocketEvent.READ_CLOSED:
+          Expect.fail("Unexpected close");
+          break;
+        default: throw "Unexpected event $event";
+      }
+    });
+    return completer.future;
+  }
+
+  Future<RawSocket> runClientHandshake(RawSocket socket) {
+    var completer = new Completer();
+    int bytesRead = 0;
+    int bytesWritten = 0;
+    List<int> dataSent = createHandshakeTestData();
+    List<int> dataReceived = new List<int>(dataSent.length);
+    var subscription;
+    subscription = socket.listen((event) {
+      switch (event) {
+        case RawSocketEvent.READ:
+          Expect.isTrue(socket.available() > 0);
+          var buffer = socket.read();
+          if (buffer != null) {
+            dataReceived.setRange(bytesRead, bytesRead + buffer.length, buffer);
+            bytesRead += buffer.length;
+            if (bytesRead == dataSent.length) {
+              verifyHandshakeTestData(dataReceived);
+              completer.complete(subscription);
             }
-            break;
-          case RawSocketEvent.READ_CLOSED:
-            server.close();
-            break;
-          default: throw "Unexpected event $event";
-        }
+          }
+          break;
+        case RawSocketEvent.WRITE:
+          Expect.isTrue(bytesRead == 0);
+          Expect.isFalse(socket.writeEventsEnabled);
+          bytesWritten += socket.write(
+              dataSent, bytesWritten, dataSent.length - bytesWritten);
+          if (bytesWritten < dataSent.length) {
+            socket.writeEventsEnabled = true;
+          }
+          break;
+        case RawSocketEvent.READ_CLOSED:
+          Expect.fail("Unexpected close");
+          break;
+        default: throw "Unexpected event $event";
+      }
+    });
+    return completer.future;
+  }
+
+  Future<RawSecureSocket> connectClient(int port) {
+    if (connectSecure) {
+      return RawSecureSocket.connect(HOST_NAME, port);
+    } else if (!handshakeBeforeSecure) {
+      return RawSocket.connect(HOST_NAME, port).then((socket) {
+        return RawSecureSocket.secure(socket);
       });
+    } else {
+      return RawSocket.connect(HOST_NAME, port).then((socket) {
+        return runClientHandshake(socket).then((subscription) {
+            return RawSecureSocket.secure(socket, subscription: subscription);
+        });
+      });
+    }
+  }
+
+  serverReady(server) {
+    server.listen((client) {
+      if (listenSecure) {
+        runServer(client).then((_) => server.close());
+      } else if (!handshakeBeforeSecure) {
+        RawSecureSocket.secureServer(client, CERTIFICATE).then((client) {
+          runServer(client).then((_) => server.close());
+        });
+      } else {
+        runServerHandshake(client).then((secure) {
+            RawSecureSocket.secureServer(
+                client,
+                CERTIFICATE,
+                subscription: secure[0],
+                carryOverData: secure[1]).then((client) {
+            runServer(client).then((_) => server.close());
+          });
+        });
+      }
     });
 
-    RawSecureSocket.connect(HOST_NAME, server.port).then((socket) {
-      int bytesRead = 0;
-      int bytesWritten = 0;
-      List<int> dataSent = createTestData();
-      List<int> dataReceived = new List<int>(dataSent.length);
-      socket.listen((event) {
-        switch (event) {
-          case RawSocketEvent.READ:
-            Expect.isTrue(socket.available() > 0);
-            var buffer = socket.read();
-            if (buffer != null) {
-              int endIndex = bytesRead + buffer.length;
-              dataReceived.setRange(bytesRead, endIndex, buffer);
-              bytesRead += buffer.length;
-            }
-            break;
-          case RawSocketEvent.WRITE:
-            Expect.isTrue(bytesRead == 0);
-            Expect.isFalse(socket.writeEventsEnabled);
-            bytesWritten += socket.write(
-                dataSent, bytesWritten, dataSent.length - bytesWritten);
-            if (bytesWritten < dataSent.length) {
-              socket.writeEventsEnabled = true;
-            }
-            break;
-          case RawSocketEvent.READ_CLOSED:
-            verifyTestData(dataReceived);
-            socket.close();
-            port.close();
-            break;
-          default: throw "Unexpected event $event";
-        }
-      });
+    connectClient(server.port).then(runClient).then((socket) {
+      socket.close();
+      port.close();
     });
-  });
+  }
+
+  if (listenSecure) {
+    RawSecureServerSocket.bind(
+        SERVER_ADDRESS, 0, 5, CERTIFICATE).then(serverReady);
+  } else {
+    RawServerSocket.bind(SERVER_ADDRESS, 0, 5).then(serverReady);
+  }
 }
 
 main() {
@@ -258,5 +461,10 @@
   testSimpleConnectFail("not_a_nickname");
   testSimpleConnectFail("CN=notARealDistinguishedName");
   testServerListenAfterConnect();
-  testSimpleReadWrite();
+  testSimpleReadWrite(true, true, false);
+  testSimpleReadWrite(true, false, false);
+  testSimpleReadWrite(false, true, false);
+  testSimpleReadWrite(false, false, false);
+  testSimpleReadWrite(false, false, true, true);
+  testSimpleReadWrite(false, false, true, false);
 }
diff --git a/tests/standalone/io/regress_10026_test.dart b/tests/standalone/io/regress_10026_test.dart
new file mode 100644
index 0000000..44f2e54
--- /dev/null
+++ b/tests/standalone/io/regress_10026_test.dart
@@ -0,0 +1,124 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+import 'dart:async';
+import 'dart:io';
+import 'dart:isolate';
+
+void testZLibInflate_regress10026() {
+  test(data, expect) {
+    var port = new ReceivePort();
+    var controller = new StreamController();
+    controller.stream
+        .transform(new ZLibInflater())
+        .transform(new StringDecoder())
+        .fold(new StringBuffer(), (buffer, s) {
+          buffer.write(s);
+          return buffer;
+        })
+        .then((out) {
+          Expect.equals(out.toString(), expect);
+          port.close();
+        });
+    controller.add(data);
+    controller.close();
+  }
+  test([
+      31, 139, 8, 0, 140, 39, 113, 81, 2, 255, 125, 84, 205, 142, 211, 48, 16,
+      62, 55, 79, 49, 132, 11, 72, 77, 211, 101, 1, 85, 217, 52, 2, 1, 18, 23,
+      224, 0, 23, 142, 211, 120, 210, 142, 54, 177, 131, 237, 164, 173, 16, 239,
+      206, 216, 105, 187, 133, 21, 168, 145, 26, 207, 196, 223, 159, 39, 41,
+      159, 40, 83, 251, 99, 79, 176, 243, 93, 91, 37, 229, 249, 143, 80, 85,
+      201, 172, 244, 236, 91, 170, 62, 28, 176, 235, 91, 130, 247, 166, 67, 214,
+      101, 62, 85, 19, 233, 119, 228, 17, 234, 29, 90, 71, 126, 157, 14, 190,
+      201, 86, 41, 228, 213, 185, 179, 243, 190, 207, 232, 199, 192, 227, 58,
+      125, 103, 180, 39, 237, 179, 192, 150, 66, 61, 173, 214, 169, 167, 131,
+      207, 3, 235, 221, 5, 231, 17, 140, 198, 142, 214, 233, 200, 180, 239, 141,
+      245, 87, 155, 247, 172, 252, 110, 173, 104, 228, 154, 178, 184, 152, 3,
+      107, 246, 140, 109, 230, 106, 108, 105, 125, 115, 194, 113, 254, 40, 6, 2,
+      247, 137, 178, 118, 46, 149, 198, 198, 168, 35, 252, 76, 102, 179, 13,
+      214, 247, 91, 107, 6, 173, 178, 218, 180, 198, 22, 240, 180, 89, 202, 239,
+      197, 157, 52, 59, 180, 91, 214, 5, 44, 195, 162, 71, 165, 88, 111, 79,
+      171, 70, 180, 100, 13, 118, 220, 30, 11, 72, 191, 244, 164, 225, 43, 106,
+      151, 206, 33, 253, 72, 237, 72, 158, 107, 132, 207, 52, 144, 84, 46, 133,
+      57, 188, 181, 162, 113, 14, 78, 30, 205, 28, 89, 110, 2, 86, 50, 251, 149,
+      204, 20, 143, 81, 80, 180, 83, 192, 235, 229, 178, 63, 92, 107, 120, 69,
+      29, 224, 224, 205, 31, 82, 110, 169, 187, 251, 135, 137, 38, 66, 111, 140,
+      85, 100, 51, 139, 138, 7, 87, 192, 77, 124, 94, 216, 176, 104, 89, 223,
+      207, 1, 139, 145, 29, 123, 82, 145, 251, 188, 249, 118, 245, 114, 181,
+      138, 251, 67, 102, 153, 162, 218, 88, 244, 108, 68, 134, 54, 154, 38, 136,
+      55, 29, 41, 70, 120, 214, 225, 33, 187, 22, 253, 124, 202, 245, 28, 240,
+      127, 196, 9, 200, 197, 246, 217, 247, 217, 226, 67, 246, 15, 165, 191,
+      204, 196, 115, 120, 200, 98, 242, 22, 64, 229, 42, 243, 120, 242, 213, 44,
+      41, 243, 105, 168, 147, 50, 72, 146, 25, 23, 198, 48, 25, 187, 155, 71,
+      243, 45, 37, 105, 244, 213, 183, 29, 59, 80, 177, 8, 114, 71, 206, 227,
+      166, 101, 183, 147, 148, 188, 129, 13, 193, 224, 228, 182, 49, 22, 184,
+      109, 7, 231, 67, 54, 35, 1, 77, 112, 78, 70, 81, 118, 215, 67, 39, 179,
+      234, 22, 240, 221, 12, 178, 148, 224, 60, 104, 138, 16, 49, 105, 241, 194,
+      26, 61, 129, 192, 160, 187, 143, 112, 61, 217, 142, 157, 147, 160, 3, 145,
+      176, 128, 191, 150, 162, 47, 20, 114, 112, 90, 1, 251, 32, 47, 0, 227,
+      136, 220, 138, 72, 10, 48, 2, 111, 105, 203, 147, 46, 163, 23, 101, 222,
+      79, 190, 74, 121, 51, 45, 53, 235, 52, 188, 159, 69, 158, 239, 247, 251,
+      5, 163, 198, 133, 177, 219, 124, 34, 113, 185, 235, 169, 150, 25, 77, 171,
+      79, 198, 146, 112, 10, 96, 55, 225, 44, 4, 9, 171, 136, 86, 230, 49, 197,
+      50, 63, 101, 154, 79, 223, 143, 223, 163, 237, 129, 168, 87, 4, 0, 0],
+      '''<!doctype html>
+<html>
+<head>
+	<title>Example Domain</title>
+
+	<meta charset="utf-8" />
+	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+	<meta name="viewport" content="width=device-width, initial-scale=1" />
+	<style type="text/css">
+	body {
+		background-color: #f0f0f2;
+		margin: 0;
+		padding: 0;
+		font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
+		
+	}
+	div {
+		width: 600px;
+		margin: 5em auto;
+		padding: 3em;
+		background-color: #fff;
+		border-radius: 1em;
+	}
+	a:link, a:visited {
+		color: #38488f;
+		text-decoration: none;
+	}
+	@media (max-width: 600px) {
+		body {
+			background-color: #fff;
+		}
+		div {
+			width: auto;
+			margin: 0 auto;
+			border-radius: 0;
+			padding: 1em;
+		}
+	}
+	</style>	
+</head>
+
+<body>
+<div>
+	<h1>Example Domain</h1>
+	<p>This domain is established to be used for illustrative examples in documents. You do not need to
+		coordinate or ask for permission to use this domain in examples, and it is not available for
+		registration.</p>
+	<p><a href="http://www.iana.org/domains/special">More information...</a></p>
+</div>
+</body>
+</html>
+''');
+}
+
+void main() {
+  testZLibInflate_regress10026();
+}
+
diff --git a/tests/standalone/io/web_socket_test.dart b/tests/standalone/io/web_socket_test.dart
index 9a126f4..2bee0d8 100644
--- a/tests/standalone/io/web_socket_test.dart
+++ b/tests/standalone/io/web_socket_test.dart
@@ -44,7 +44,7 @@
     createServer().then((server) {
       server.transform(new WebSocketTransformer()).listen((webSocket) {
         webSocket.listen(
-            webSocket.send,
+            webSocket.add,
             onDone: () {
               Expect.equals(closeStatus == null
                             ? WebSocketStatus.NO_STATUS_RECEIVED
@@ -58,13 +58,13 @@
       for (int i = 0; i < totalConnections; i++) {
         int messageCount = 0;
         createClient(server.port).then((webSocket) {
-          webSocket.send(messageText);
+          webSocket.add(messageText);
           webSocket.listen(
               (message) {
                 messageCount++;
                 if (messageCount < 1 ) {
                   Expect.equals(messageText, message);
-                  webSocket.send(message);
+                  webSocket.add(message);
                 } else {
                   webSocket.close(closeStatus, closeReason);
                 }
@@ -97,7 +97,7 @@
               messageCount++;
               if (messageCount < 10) {
                 Expect.equals(messageText, message);
-                webSocket.send(message);
+                webSocket.add(message);
               } else {
                 webSocket.close(closeStatus, closeReason);
               }
@@ -112,13 +112,13 @@
                 server.close();
               }
             });
-        webSocket.send(messageText);
+        webSocket.add(messageText);
       });
 
       for (int i = 0; i < totalConnections; i++) {
         createClient(server.port).then((webSocket) {
             webSocket.listen(
-                webSocket.send,
+                webSocket.add,
                 onDone: () {
                   Expect.equals(closeStatus == null
                                 ? WebSocketStatus.NO_STATUS_RECEIVED
@@ -140,7 +140,7 @@
         webSocket.listen(
             (message) {
               Expect.listEquals(originalMessage, message);
-              webSocket.send(message);
+              webSocket.add(message);
             });
       });
 
@@ -151,7 +151,7 @@
               webSocket.close();
             },
             onDone: server.close);
-        webSocket.send(originalMessage);
+        webSocket.add(originalMessage);
       });
     });
   }
@@ -273,7 +273,7 @@
               messageCount++;
               if (messageCount < 10) {
                 Expect.equals(messageText, message);
-                webSocket.send(message);
+                webSocket.add(message);
               } else {
                 webSocket.close(closeStatus, closeReason);
               }
@@ -286,7 +286,7 @@
                 server.close();
               }
             });
-        webSocket.send(messageText);
+        webSocket.add(messageText);
       });
 
       void webSocketConnection() {
@@ -306,7 +306,7 @@
                 Expect.isTrue(onopenCalled);
                 Expect.isFalse(oncloseCalled);
                 Expect.equals(WebSocket.OPEN, webSocket.readyState);
-                webSocket.send(message);
+                webSocket.add(message);
               },
               onDone: () {
                 Expect.isTrue(onopenCalled);
@@ -332,7 +332,7 @@
           if (WebSocketTransformer.isUpgradeRequest(request)) {
             WebSocketTransformer.upgrade(request).then((webSocket) {
                 webSocket.listen((_) { webSocket.close(); });
-                webSocket.send("Hello");
+                webSocket.add("Hello");
             });
           } else {
             Expect.isFalse(WebSocketTransformer.isUpgradeRequest(request));
diff --git a/tests/standalone/standalone.status b/tests/standalone/standalone.status
index b67e5bf..d4b3002 100644
--- a/tests/standalone/standalone.status
+++ b/tests/standalone/standalone.status
@@ -10,7 +10,6 @@
 
 [ $runtime == vm && ( $system == windows ) ]
 io/raw_socket_test: Pass, Fail # Issue 8901
-io/http_shutdown_test: Pass, Fail # Issue  9101
 
 [ $runtime == vm ]
 package/package_isolate_test: Fail # http://dartbug.com/7520.
@@ -79,13 +78,14 @@
 
 [ $compiler == dart2js ]
 number_identity_test: Skip # Bigints and int/double diff. not supported.
-typed_data_test: Skip # This is a VM test
-typed_data_view_test: Skip # This is a VM test
-typed_data_isolate_test: Skip # This is a VM test
-typed_array_test: Skip # This is a VM test
-float_array_test: Skip # This is a VM test
-int_array_test: Skip  # This is a VM test
-byte_array_view_optimized_test: Skip # This is a VM test
+typed_data_test: Skip # dart:typeddata support needed.
+bytedata_test: Skip # dart:typeddata support needed.
+typed_data_view_test: Skip # dart:typeddata support needed.
+typed_data_isolate_test: Skip # dart:typeddata support needed.
+typed_array_test: Skip # dart:typeddata support needed.
+float_array_test: Skip # dart:typeddata support needed.
+int_array_test: Skip  # dart:typeddata support needed.
+byte_array_view_optimized_test: Skip # dart:typeddata support needed.
 io/web_socket_protocol_processor_test: Skip  # Importing code with external keyword
 int_array_load_elimination_test: Skip  # This is a VM test
 medium_integer_test: Fail, OK # Test fails with JS number semantics: issue 1533.
diff --git a/tests/standalone/typed_data_test.dart b/tests/standalone/typed_data_test.dart
index 11e3366..141a082 100644
--- a/tests/standalone/typed_data_test.dart
+++ b/tests/standalone/typed_data_test.dart
@@ -41,32 +41,6 @@
   }
 }
 
-void testCreateExternalClampedUint8TypedData() {
-  List typed_data;
-
-  typed_data = new Uint8ClampedList.transferable(0);
-  Expect.isTrue(typed_data is Uint8ClampedList);
-  Expect.isFalse(typed_data is Uint8List);
-  Expect.equals(0, typed_data.length);
-  Expect.equals(0, typed_data.lengthInBytes);
-
-  typed_data = new Uint8ClampedList.transferable(10);
-  Expect.equals(10, typed_data.length);
-  for (int i = 0; i < 10; i++) {
-    Expect.equals(0, typed_data[i]);
-  }
-
-  typed_data[0] = -1;
-  Expect.equals(0, typed_data[0]);
-
-  for (int i = 0; i < 10; i++) {
-    typed_data[i] = i + 250;
-  }
-  for (int i = 0; i < 10; i++) {
-    Expect.equals(i + 250 > 255 ? 255 : i + 250, typed_data[i]);
-  }
-}
-
 void testTypedDataRange(bool check_throws) {
   Int8List typed_data;
   typed_data = new Int8List(10);
@@ -141,11 +115,6 @@
                                           check_throws);
 }
 
-void testExternalClampedUnsignedTypedDataRange(bool check_throws) {
-  testClampedUnsignedTypedDataRangeHelper(new Uint8ClampedList.transferable(10),
-                                          check_throws);
-}
-
 void testSetRangeHelper(typed_data) {
   List<int> list = [10, 11, 12];
   typed_data.setRange(0, 3, list);
@@ -169,9 +138,7 @@
 
 void testSetRange() {
   testSetRangeHelper(new Uint8List(3));
-  testSetRangeHelper(new Uint8List.transferable(3));
   testSetRangeHelper(new Uint8ClampedList(3));
-  testSetRangeHelper(new Uint8ClampedList.transferable(3));
 }
 
 void testIndexOutOfRangeHelper(typed_data) {
@@ -188,9 +155,7 @@
 
 void testIndexOutOfRange() {
   testIndexOutOfRangeHelper(new Uint8List(3));
-  testIndexOutOfRangeHelper(new Uint8List.transferable(3));
   testIndexOutOfRangeHelper(new Uint8ClampedList(3));
-  testIndexOutOfRangeHelper(new Uint8ClampedList.transferable(3));
 }
 
 void testIndexOfHelper(list) {
@@ -213,9 +178,8 @@
 }
 
 void testIndexOf() {
-  testIndexOfHelper(new Uint8List.transferable(10));
+  testIndexOfHelper(new Uint8List(10));
   testIndexOfHelper(new Uint8ClampedList(10));
-  testIndexOfHelper(new Uint8ClampedList.transferable(10));
 }
 
 void testGetAtIndex(TypedData list, num initial_value) {
@@ -225,18 +189,22 @@
     Expect.equals(42, bdata.getInt8(i));
   }
   for (int i = 0; i < bdata.lengthInBytes-1; i+=2) {
-    Expect.equals(10794, bdata.getUint16(i));
-    Expect.equals(10794, bdata.getInt16(i));
+    Expect.equals(10794, bdata.getUint16(i, Endianness.LITTLE_ENDIAN));
+    Expect.equals(10794, bdata.getInt16(i, Endianness.LITTLE_ENDIAN));
   }
   for (int i = 0; i < bdata.lengthInBytes-3; i+=4) {
-    Expect.equals(707406378, bdata.getUint32(i));
-    Expect.equals(707406378, bdata.getInt32(i));
-    Expect.equals(1.511366173271439e-13, bdata.getFloat32(i));
+    Expect.equals(707406378, bdata.getUint32(i, Endianness.LITTLE_ENDIAN));
+    Expect.equals(707406378, bdata.getInt32(i, Endianness.LITTLE_ENDIAN));
+    Expect.equals(1.511366173271439e-13,
+                  bdata.getFloat32(i, Endianness.LITTLE_ENDIAN));
   }
   for (int i = 0; i < bdata.lengthInBytes-7; i+=8) {
-    Expect.equals(3038287259199220266, bdata.getUint64(i));
-    Expect.equals(3038287259199220266, bdata.getInt64(i));
-    Expect.equals(1.4260258159703532e-105, bdata.getFloat64(i));
+    Expect.equals(3038287259199220266,
+                  bdata.getUint64(i, Endianness.LITTLE_ENDIAN));
+    Expect.equals(3038287259199220266,
+                  bdata.getInt64(i, Endianness.LITTLE_ENDIAN));
+    Expect.equals(1.4260258159703532e-105,
+                  bdata.getFloat64(i, Endianness.LITTLE_ENDIAN));
   }
 }
 
@@ -249,33 +217,44 @@
     }
   }
   var bdata = new ByteData.view(list.buffer);
-  for (int i = 0; i < bdata.lengthInBytes; i++) bdata.setUint8(i, 42);
+  for (int i = 0; i < bdata.lengthInBytes; i++) {
+    bdata.setUint8(i, 42);
+  }
   validate();
-  for (int i = 0; i < bdata.lengthInBytes; i++) bdata.setInt8(i, 42);
+  for (int i = 0; i < bdata.lengthInBytes; i++) {
+    bdata.setInt8(i, 42);
+  }
   validate();
-  for (int i = 0; i < bdata.lengthInBytes-1; i+=2) bdata.setUint16(i, 10794);
+  for (int i = 0; i < bdata.lengthInBytes-1; i+=2) {
+    bdata.setUint16(i, 10794, Endianness.LITTLE_ENDIAN);
+  }
   validate();
-  for (int i = 0; i < bdata.lengthInBytes-1; i+=2) bdata.setInt16(i, 10794);
-  validate();
-  for (int i = 0; i < bdata.lengthInBytes-3; i+=4)
-    bdata.setUint32(i, 707406378);
-  validate();
-  for (int i = 0; i < bdata.lengthInBytes-3; i+=4) bdata.setInt32(i, 707406378);
+  for (int i = 0; i < bdata.lengthInBytes-1; i+=2) {
+    bdata.setInt16(i, 10794, Endianness.LITTLE_ENDIAN);
+  }
   validate();
   for (int i = 0; i < bdata.lengthInBytes-3; i+=4) {
-    bdata.setFloat32(i, 1.511366173271439e-13);
+    bdata.setUint32(i, 707406378, Endianness.LITTLE_ENDIAN);
+  }
+  validate();
+  for (int i = 0; i < bdata.lengthInBytes-3; i+=4) {
+    bdata.setInt32(i, 707406378, Endianness.LITTLE_ENDIAN);
+  }
+  validate();
+  for (int i = 0; i < bdata.lengthInBytes-3; i+=4) {
+    bdata.setFloat32(i, 1.511366173271439e-13, Endianness.LITTLE_ENDIAN);
   }
   validate();
   for (int i = 0; i < bdata.lengthInBytes-7; i+=8) {
-    bdata.setUint64(i, 3038287259199220266);
+    bdata.setUint64(i, 3038287259199220266, Endianness.LITTLE_ENDIAN);
   }
   validate();
   for (int i = 0; i < bdata.lengthInBytes-7; i+=8) {
-    bdata.setInt64(i, 3038287259199220266);
+    bdata.setInt64(i, 3038287259199220266, Endianness.LITTLE_ENDIAN);
   }
   validate();
   for (int i = 0; i < bdata.lengthInBytes-7; i+=8) {
-    bdata.setFloat64(i, 1.4260258159703532e-105);
+    bdata.setFloat64(i, 1.4260258159703532e-105, Endianness.LITTLE_ENDIAN);
   }
   validate(false);
 }
@@ -343,11 +322,9 @@
   for (int i = 0; i < 2000; i++) {
     testCreateUint8TypedData();
     testCreateClampedUint8TypedData();
-    testCreateExternalClampedUint8TypedData();
     testTypedDataRange(false);
     testUnsignedTypedDataRange(false);
     testClampedUnsignedTypedDataRange(false);
-    testExternalClampedUnsignedTypedDataRange(false);
     testSetRange();
     testIndexOutOfRange();
     testIndexOf();
@@ -394,7 +371,6 @@
   }
   testTypedDataRange(true);
   testUnsignedTypedDataRange(true);
-  testExternalClampedUnsignedTypedDataRange(true);
   testViewCreation();
   testWhere();
   testCreationFromList();
diff --git a/tests/standalone/typed_data_view_test.dart b/tests/standalone/typed_data_view_test.dart
index 5e046ec..dbdab31 100644
--- a/tests/standalone/typed_data_view_test.dart
+++ b/tests/standalone/typed_data_view_test.dart
@@ -51,30 +51,34 @@
   blist.setUint8(0, 0xffff);
   Expect.equals(0xff, blist.getUint8(0));
   blist.setInt16(0, 0xffffffff);
-  Expect.equals(-1, blist.getInt16(0));
-  blist.setUint16(0, 0xffffffff);
-  Expect.equals(0xffff, blist.getUint16(0));
-  blist.setInt32(0, 0xffffffffffff);
-  Expect.equals(-1, blist.getInt32(0));
-  blist.setUint32(0, 0xffffffffffff);
-  Expect.equals(0xffffffff, blist.getUint32(0));
-  blist.setInt64(0, 0xffffffffffffffffff);
-  Expect.equals(-1, blist.getInt64(0));
-  blist.setUint64(0, 0xffffffffffffffffff);
-  Expect.equals(0xffffffffffffffff, blist.getUint64(0));
-  blist.setInt32(0, 18446744073709551614);
-  Expect.equals(-2, blist.getInt32(0));
-  blist.setUint32(0, 18446744073709551614);
-  Expect.equals(0xfffffffe, blist.getUint32(0));
-  blist.setInt64(0, 18446744073709551614);
-  Expect.equals(-2, blist.getInt64(0));
-  blist.setUint64(0, 18446744073709551614);
-  Expect.equals(0xfffffffffffffffe, blist.getUint64(0));
+  Expect.equals(-1, blist.getInt16(0, Endianness.LITTLE_ENDIAN));
+  blist.setUint16(0, 0xffffffff, Endianness.LITTLE_ENDIAN);
+  Expect.equals(0xffff, blist.getUint16(0, Endianness.LITTLE_ENDIAN));
+  blist.setInt32(0, 0xffffffffffff, Endianness.LITTLE_ENDIAN);
+  Expect.equals(-1, blist.getInt32(0, Endianness.LITTLE_ENDIAN));
+  blist.setUint32(0, 0xffffffffffff, Endianness.LITTLE_ENDIAN);
+  Expect.equals(0xffffffff, blist.getUint32(0, Endianness.LITTLE_ENDIAN));
+  blist.setInt64(0, 0xffffffffffffffffff, Endianness.LITTLE_ENDIAN);
+  Expect.equals(-1, blist.getInt64(0, Endianness.LITTLE_ENDIAN));
+  blist.setUint64(0, 0xffffffffffffffffff, Endianness.LITTLE_ENDIAN);
+  Expect.equals(0xffffffffffffffff,
+                blist.getUint64(0, Endianness.LITTLE_ENDIAN));
+  blist.setInt32(0, 18446744073709551614, Endianness.LITTLE_ENDIAN);
+  Expect.equals(-2, blist.getInt32(0, Endianness.LITTLE_ENDIAN));
+  blist.setUint32(0, 18446744073709551614, Endianness.LITTLE_ENDIAN);
+  Expect.equals(0xfffffffe, blist.getUint32(0, Endianness.LITTLE_ENDIAN));
+  blist.setInt64(0, 18446744073709551614, Endianness.LITTLE_ENDIAN);
+  Expect.equals(-2, blist.getInt64(0, Endianness.LITTLE_ENDIAN));
+  blist.setUint64(0, 18446744073709551614, Endianness.LITTLE_ENDIAN);
+  Expect.equals(0xfffffffffffffffe,
+                blist.getUint64(0, Endianness.LITTLE_ENDIAN));
 
-  blist.setFloat32(0, 18446744073709551614.0);
-  Expect.equals(18446744073709551614.0, blist.getFloat32(0));
-  blist.setFloat64(0, 18446744073709551614.0);
-  Expect.equals(18446744073709551614.0, blist.getFloat64(0));
+  blist.setFloat32(0, 18446744073709551614.0, Endianness.LITTLE_ENDIAN);
+  Expect.equals(18446744073709551614.0,
+                blist.getFloat32(0, Endianness.LITTLE_ENDIAN));
+  blist.setFloat64(0, 18446744073709551614.0, Endianness.LITTLE_ENDIAN);
+  Expect.equals(18446744073709551614.0,
+                blist.getFloat64(0, Endianness.LITTLE_ENDIAN));
 }
 
 main() {
diff --git a/tests/utils/dummy_compiler_test.dart b/tests/utils/dummy_compiler_test.dart
index 87f1b4e..7f145cb 100644
--- a/tests/utils/dummy_compiler_test.dart
+++ b/tests/utils/dummy_compiler_test.dart
@@ -34,6 +34,7 @@
                   class Dynamic_ {}
                   class Null {}
                   class LinkedHashMap {}
+                  identical(a, b) => true;
                   getRuntimeTypeInfo(o) {}
                   setRuntimeTypeInfo(o, i) {}
                   eqNull(a) {}
diff --git a/tests/utils/utils.status b/tests/utils/utils.status
index 376aa7e..c1aab5a 100644
--- a/tests/utils/utils.status
+++ b/tests/utils/utils.status
@@ -6,9 +6,6 @@
 dummy_compiler_test: Slow, Pass
 recursive_import_test: Slow, Pass
 
-[ $compiler == dart2js && $checked]
-dummy_compiler_test: Slow, Fail # http://dartbug.com/9687
-
 [ $compiler == none && $runtime == drt ]
 dummy_compiler_test: Skip # http://dartbug.com/7233
 dart2js_test: Skip # Uses dart:io.
diff --git a/tools/VERSION b/tools/VERSION
index 9d1e241..e1d42d1 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -1,4 +1,4 @@
 MAJOR 0
-MINOR 4
-BUILD 7
-PATCH 5
+MINOR 5
+BUILD 0
+PATCH 0
diff --git a/tools/dom/idl/dart/dart.idl b/tools/dom/idl/dart/dart.idl
index 0b17457..def76c9c 100644
--- a/tools/dom/idl/dart/dart.idl
+++ b/tools/dom/idl/dart/dart.idl
@@ -33,7 +33,7 @@
 
 [Supplemental]
 interface CanvasRenderingContext2D {
-  [DartName=createImageDataFromImageData] ImageData createImageData(in ImageData imagedata) raises (DOMException);
+  [DartName=createImageDataFromImageData] ImageData createImageData(in ImageData imagedata);
 };
 
 [Supplemental]
@@ -43,8 +43,8 @@
 };
 
 interface HTMLCanvasElement {
-  [Suppressed] DOMString toDataURL([TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] in DOMString type) raises(DOMException);
-  [Custom] DOMString toDataURL([TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] in DOMString type, [Optional] in float quality) raises(DOMException);
+  [Suppressed] DOMString toDataURL([TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] in DOMString type);
+  [Custom] DOMString toDataURL([TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] in DOMString type, [Optional] in float quality);
 
   [Suppressed] any getContext(in DOMString contextId);
   [Custom] CanvasRenderingContext getContext(in DOMString contextId, [Optional] in Dictionary attrs);
@@ -106,23 +106,23 @@
   //void         compressedTexImage2D(in unsigned long target, in long level, in unsigned long internalformat, in unsigned long width, in unsigned long height, in long border, in unsigned long imageSize, const void* data);
   //void         compressedTexSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset, in unsigned long width, in unsigned long height, in unsigned long format, in unsigned long imageSize, const void* data);
 
-  [Custom] any getBufferParameter(in unsigned long target, in unsigned long pname) raises(DOMException);
+  [Custom] any getBufferParameter(in unsigned long target, in unsigned long pname);
   [Suppressed, StrictTypeChecking, Custom] void getBufferParameter();
 
-  [Custom] any getFramebufferAttachmentParameter(in unsigned long target, in unsigned long attachment, in unsigned long pname) raises(DOMException);
+  [Custom] any getFramebufferAttachmentParameter(in unsigned long target, in unsigned long attachment, in unsigned long pname);
   [Suppressed, StrictTypeChecking, Custom] void getFramebufferAttachmentParameter();
 
-  [Custom] any getParameter(in unsigned long pname) raises(DOMException);
+  [Custom] any getParameter(in unsigned long pname);
   [Suppressed, StrictTypeChecking, Custom] void getParameter();
 
-  [Custom] any getProgramParameter(in WebGLProgram program, in unsigned long pname) raises(DOMException);
+  [Custom] any getProgramParameter(in WebGLProgram program, in unsigned long pname);
   [Suppressed, StrictTypeChecking, Custom] void getProgramParameter();
 
-  [Custom] any getRenderbufferParameter(in unsigned long target, in unsigned long pname) raises(DOMException);
+  [Custom] any getRenderbufferParameter(in unsigned long target, in unsigned long pname);
   [Suppressed, StrictTypeChecking, Custom] void getRenderbufferParameter();
 
-  [Custom] any getShaderParameter(in WebGLShader shader, in unsigned long pname) raises(DOMException);
-  [Suppressed, StrictTypeChecking, Custom] void getShaderParameter() raises(DOMException);
+  [Custom] any getShaderParameter(in WebGLShader shader, in unsigned long pname);
+  [Suppressed, StrictTypeChecking, Custom] void getShaderParameter();
 
   // TBD
   // void glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
@@ -132,16 +132,15 @@
   [Custom] DOMString[] getSupportedExtensions();
   [Suppressed, StrictTypeChecking, Custom] void getSupportedExtensions();
 
-  [Custom] any getTexParameter(in unsigned long target, in unsigned long pname) raises(DOMException);
+  [Custom] any getTexParameter(in unsigned long target, in unsigned long pname);
   [Suppressed, StrictTypeChecking, Custom] void getTexParameter();
 
-  [Custom] any getUniform(in WebGLProgram program, in WebGLUniformLocation location) raises(DOMException);
+  [Custom] any getUniform(in WebGLProgram program, in WebGLUniformLocation location);
   [Suppressed, StrictTypeChecking, Custom] void getUniform();
 
-  [Custom] any getVertexAttrib(in unsigned long index, in unsigned long pname) raises(DOMException);
+  [Custom] any getVertexAttrib(in unsigned long index, in unsigned long pname);
   [Suppressed, StrictTypeChecking, Custom] void getVertexAttrib();
 };
-
 [Supplemental]
 interface CSSStyleDeclaration {
   void setProperty(in DOMString propertyName, in DOMString value, [Optional] in DOMString priority);
@@ -214,20 +213,16 @@
   // uint8_t getUint8(in unsigned long byteOffset);
   [Suppressed] any getInt8();
   [Suppressed] any getUint8();
-  byte getInt8(in unsigned long byteOffset)
-      raises (DOMException);
-  octet getUint8(in unsigned long byteOffset)
-      raises (DOMException);
+  [RaisesException] byte getInt8(in unsigned long byteOffset);
+  [RaisesException] octet getUint8(in unsigned long byteOffset);
 
   // We have to use custom code because our code generator does not support uint8_t type.
   // void setInt8(in unsigned long byteOffset, in int8_t value);
   // void setUint8(in unsigned long byteOffset, in uint8_t value);
   [Suppressed] void setInt8();
   [Suppressed] void setUint8();
-  void setInt8(in unsigned long byteOffset, in byte value)
-      raises (DOMException);
-  void setUint8(in unsigned long byteOffset, in octet value)
-      raises (DOMException);
+  [RaisesException] void setInt8(in unsigned long byteOffset, in byte value);
+  [RaisesException] void setUint8(in unsigned long byteOffset, in octet value);
 };
 
 // TODO(vsm): Define new names for these (see b/4436830).
@@ -239,20 +234,17 @@
 interface IDBDatabase {
   // These variants are slated for removal from WebKit.  Suppress to bring our
   // API in line with the most recent spec.
-  [Suppressed, CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMStringList storeNames, in unsigned short mode)
-      raises (IDBDatabaseException);
-  [Suppressed, CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString[] storeNames, in unsigned short mode)
-      raises (IDBDatabaseException);
-  [Suppressed, CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString storeName, in unsigned short mode)
-      raises (IDBDatabaseException);
+  [Suppressed, CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMStringList storeNames, in unsigned short mode);
+  [Suppressed, CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString[] storeNames, in unsigned short mode);
+  [Suppressed, CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString storeName, in unsigned short mode);
 };
 
 [Supplemental]
 interface IDBKeyRange {
-  [DartName=only_] static IDBKeyRange only(in any value) raises (IDBDatabaseException);
-  [DartName=lowerBound_] static IDBKeyRange lowerBound(in any bound, [Optional] in boolean open) raises (IDBDatabaseException);
-  [DartName=upperBound_] static IDBKeyRange upperBound(in any bound, [Optional] in boolean open) raises (IDBDatabaseException);
-  [DartName=bound_] static IDBKeyRange bound(in any lower, in any upper, [Optional] in boolean lowerOpen, [Optional] in boolean upperOpen) raises (IDBDatabaseException);
+  [DartName=only_] static IDBKeyRange only(in any value);
+  [DartName=lowerBound_] static IDBKeyRange lowerBound(in any bound, [Optional] in boolean open);
+  [DartName=upperBound_] static IDBKeyRange upperBound(in any bound, [Optional] in boolean open);
+  [DartName=bound_] static IDBKeyRange bound(in any lower, in any upper, [Optional] in boolean lowerOpen, [Optional] in boolean upperOpen);
 };
 
 interface EntrySync {
@@ -273,7 +265,7 @@
 [Supplemental,
   Constructor(float x, float y)
 ]
-interface WebKitPoint {
+interface DOMPoint {
 };
 
 [Supplemental, Callback] // Add missing Callback attribute.
@@ -298,8 +290,7 @@
 interface MutationObserver {
   // Rename 'observe' so we can define a new 'observe' API that calls the
   // original.
-  [DartName=_observe] void observe(in Node target, in Dictionary options)
-      raises(DOMException);
+  [DartName=_observe] void observe(in Node target, in Dictionary options);
 };
 
   [Supplemental,
@@ -324,35 +315,44 @@
 interface WebSocket {
   // Suppress the default since it has non-standard return type and add
   // overrides.
-  [Suppressed] boolean send(in ArrayBuffer data) raises(DOMException);
-  [Suppressed] boolean send(in ArrayBufferView data) raises(DOMException);
-  [Suppressed] boolean send(in Blob data) raises(DOMException);
-  [Suppressed] boolean send(in DOMString data) raises(DOMException);
+  [Suppressed] boolean send(in ArrayBuffer data);
+  [Suppressed] boolean send(in ArrayBufferView data);
+  [Suppressed] boolean send(in Blob data);
+  [Suppressed] boolean send(in DOMString data);
 
-  [Custom] void send(DOMString data) raises(DOMException);
-  [Custom] void send(Blob data) raises(DOMException);
-  [Custom] void send(ArrayBuffer data) raises(DOMException);
-  [Custom] void send(ArrayBufferView data) raises(DOMException);
+  [Custom] void send(DOMString data);
+  [Custom] void send(Blob data);
+  [Custom] void send(ArrayBuffer data);
+  [Custom] void send(ArrayBufferView data);
 };
 
 [Supplemental]
 interface XMLHttpRequest {
-   [Custom] void send()
-       raises(DOMException);
-   [Custom] void send(in ArrayBuffer data) // FIXME: this should be eventually deprecated.
-       raises(DOMException);
-   [Custom] void send(in ArrayBufferView data)
-       raises(DOMException);
-   [Conditional=BLOB, Custom] void send(in Blob data)
-       raises(DOMException);
-   [Custom] void send(in Document data)
-       raises(DOMException);
-   [Custom] void send([StrictTypeChecking] in DOMString data)
-       raises(DOMException);
-   [Custom] void send(in DOMFormData data)
-       raises(DOMException);
+   [Custom] void send();
+   [Custom] void send(in ArrayBuffer data); // FIXME: this should be eventually deprecated.
+   [Custom] void send(in ArrayBufferView data);
+   [Custom] void send(in Blob data);
+   [Custom] void send(in Document data);
+   [Custom] void send([StrictTypeChecking] in DOMString data);
+   [Custom] void send(in DOMFormData data);
 };
 
 
 [Suppressed]
+interface AbstractView {};
+
+
+[Suppressed]
+interface InjectedScriptHost {};
+
+
+[Suppressed]
+interface InspectorFrontendHost {};
+
+
+[Suppressed]
+interface JavaScriptCallFrame {};
+
+
+[Suppressed]
 interface Entity {};
diff --git a/tools/dom/scripts/dartgenerator.py b/tools/dom/scripts/dartgenerator.py
index fdac363..4fd476c 100755
--- a/tools/dom/scripts/dartgenerator.py
+++ b/tools/dom/scripts/dartgenerator.py
@@ -165,10 +165,6 @@
         continue
       interfaces.append(interface)
 
-    # TODO(sra): Use this list of exception names to generate information to
-    # tell dart2js which exceptions can be passed from JS to Dart code.
-    exceptions = self._CollectExceptions(interfaces)
-
     # Render all interfaces into Dart and save them in files.
     for interface in self._PreOrderInterfaces(interfaces):
       interface_name = interface.id
@@ -201,21 +197,6 @@
       visit(interface)
     return ordered
 
-  def _CollectExceptions(self, interfaces):
-    """Returns the names of all exception classes raised."""
-    exceptions = set()
-    for interface in interfaces:
-      for attribute in interface.attributes:
-        if attribute.get_raises:
-          exceptions.add(attribute.get_raises.id)
-        if attribute.set_raises:
-          exceptions.add(attribute.set_raises.id)
-      for operation in interface.operations:
-        if operation.raises:
-          exceptions.add(operation.raises.id)
-    return exceptions
-
-
   def FixEventTargets(self, database):
     for interface in database.GetInterfaces():
       # Create fake EventTarget parent interface for interfaces that have
diff --git a/tools/dom/scripts/fremontcutbuilder.py b/tools/dom/scripts/fremontcutbuilder.py
index 6ccfefb..27865fb 100755
--- a/tools/dom/scripts/fremontcutbuilder.py
+++ b/tools/dom/scripts/fremontcutbuilder.py
@@ -16,7 +16,6 @@
     'ENABLE_CSS_DEVICE_ADAPTATION',
     'ENABLE_CUSTOM_SCHEME_HANDLER',
     'ENABLE_ENCRYPTED_MEDIA_V2',
-    'ENABLE_INSPECTOR', # Internal DevTools API.
     'ENABLE_MEDIA_CAPTURE', # Only enabled on Android.
     'ENABLE_MICRODATA',
     'ENABLE_ORIENTATION_EVENTS', # Only enabled on Android.
@@ -27,58 +26,33 @@
 ]
 
 FEATURE_DEFINES = [
-    'ENABLE_BLOB',
     'ENABLE_CALENDAR_PICKER',
-    'ENABLE_CANVAS_PATH',
     'ENABLE_CANVAS_PROXY',
     'ENABLE_CSS_FILTERS',
     'ENABLE_CSS_REGIONS',
-    'ENABLE_CSS_SHADERS',
     'ENABLE_CUSTOM_ELEMENTS',
     'ENABLE_DATALIST_ELEMENT',
     'ENABLE_DETAILS_ELEMENT',
-    'ENABLE_DEVICE_ORIENTATION',
     'ENABLE_DIALOG_ELEMENT',
     'ENABLE_DIRECTORY_UPLOAD',
-    'ENABLE_DOWNLOAD_ATTRIBUTE',
     'ENABLE_ENCRYPTED_MEDIA',
-    'ENABLE_FILE_SYSTEM',
-    'ENABLE_FILTERS',
     'ENABLE_FONT_LOAD_EVENTS',
     'ENABLE_GAMEPAD',
-    'ENABLE_GEOLOCATION',
     'ENABLE_INPUT_SPEECH',
-    'ENABLE_JAVASCRIPT_DEBUGGER',
     'ENABLE_LEGACY_NOTIFICATIONS',
-    'ENABLE_MEDIA_STATISTICS',
     'ENABLE_MEDIA_STREAM',
-    'ENABLE_METER_ELEMENT',
     'ENABLE_NAVIGATOR_CONTENT_UTILS',
     'ENABLE_NOTIFICATIONS',
     'ENABLE_PAGE_POPUP',
-    'ENABLE_PERFORMANCE_TIMELINE',
-    'ENABLE_POINTER_LOCK',
-    'ENABLE_PROGRESS_ELEMENT',
-    'ENABLE_QUOTA',
-    'ENABLE_REQUEST_ANIMATION_FRAME',
-    'ENABLE_REQUEST_AUTOCOMPLETE',
-    'ENABLE_RESOURCE_TIMING',
     'ENABLE_SCRIPTED_SPEECH',
-    'ENABLE_SHADOW_DOM',
     'ENABLE_SHARED_WORKERS',
-    'ENABLE_SQL_DATABASE',
-    'ENABLE_STYLE_SCOPED',
     'ENABLE_SVG',
     'ENABLE_SVG_FONTS',
     'ENABLE_TOUCH_EVENTS',
-    'ENABLE_USER_TIMING',
     'ENABLE_VIDEO',
     'ENABLE_VIDEO_TRACK',
     'ENABLE_WEB_AUDIO',
     'ENABLE_WEBGL',
-    'ENABLE_WEB_SOCKETS',
-    'ENABLE_WEB_TIMING',
-    'ENABLE_WORKERS',
     'ENABLE_XSLT',
 ]
 
@@ -153,10 +127,6 @@
 def main(parallel=False):
   current_dir = os.path.dirname(__file__)
 
-  ignored_idls = [
-    'AbstractView.idl',
-    ]
-
   idl_files = []
 
   webcore_dir = os.path.join(current_dir, '..', '..', '..', 'third_party',
@@ -177,7 +147,7 @@
     for name in names:
       file_name = os.path.join(dir_name, name)
       (interface, ext) = os.path.splitext(file_name)
-      if ext == '.idl' and name not in ignored_idls:
+      if ext == '.idl':
         idl_files.append(file_name)
 
   os.path.walk(webcore_dir, visitor, webcore_dir)
diff --git a/tools/dom/scripts/generator.py b/tools/dom/scripts/generator.py
index 630a034..74da08d9 100644
--- a/tools/dom/scripts/generator.py
+++ b/tools/dom/scripts/generator.py
@@ -1409,7 +1409,6 @@
     'void': TypeData(clazz='Primitive', dart_type='void'),
 
     'CSSRule': TypeData(clazz='Interface', conversion_includes=['CSSImportRule']),
-    'DOMException': TypeData(clazz='Interface', native_type='DOMCoreException'),
     'DOMStringMap': TypeData(clazz='Interface', dart_type='Map<String, String>'),
     'DOMWindow': TypeData(clazz='Interface', custom_to_dart=True),
     'Element': TypeData(clazz='Interface', merged_interface='HTMLElement',
diff --git a/tools/dom/scripts/htmlrenamer.py b/tools/dom/scripts/htmlrenamer.py
index 2604dd9..998cbed 100644
--- a/tools/dom/scripts/htmlrenamer.py
+++ b/tools/dom/scripts/htmlrenamer.py
@@ -15,6 +15,7 @@
     'DOMCoreException': 'DomException',
     'DOMFileSystem': 'FileSystem',
     'DOMFormData': 'FormData',
+    'DOMPoint': '_DomPoint',
     'DOMURL': 'Url',
     'DOMWindow': 'Window',
     'EntryCallback': '_EntryCallback',
@@ -42,12 +43,9 @@
     'SVGGradientElement': '_GradientElement',
     'SVGSVGElement': 'SvgSvgElement', # Manual to avoid name conflicts.
     'WebGLVertexArrayObjectOES': 'VertexArrayObject',
-    'WebKitAnimationEvent': 'AnimationEvent',
     'WebKitCSSKeyframeRule': 'CssKeyframeRule',
     'WebKitCSSKeyframesRule': 'CssKeyframesRule',
     'WebKitCSSTransformValue': 'CssTransformValue',
-    'WebKitPoint': '_DomPoint',
-    'WebKitTransitionEvent': '_WebKitTransitionEvent',
     'XMLHttpRequest': 'HttpRequest',
     'XMLHttpRequestException': 'HttpRequestException',
     'XMLHttpRequestProgressEvent': 'HttpRequestProgressEvent',
@@ -359,8 +357,6 @@
     'CanvasRenderingContext2D.setMiterLimit',
     'CanvasRenderingContext2D.setShadow',
     'CanvasRenderingContext2D.setStrokeColor',
-    'CanvasRenderingContext2D.webkitLineDash',
-    'CanvasRenderingContext2D.webkitLineDashOffset',
     'CharacterData.remove',
     'DOMWindow.call:blur',
     'DOMWindow.call:focus',
@@ -621,6 +617,7 @@
 # Manual dart: library name lookup.
 _library_names = monitored.Dict('htmlrenamer._library_names', {
   'DOMWindow': 'html',
+  'Database': 'web_sql',
   'Navigator': 'html',
   'WorkerContext': 'html',
 })
@@ -708,6 +705,8 @@
     # so we can no longer determine the library based on the conditionals.
     if interface.id.startswith("IDB"):
       return 'indexed_db'
+    if interface.id.startswith("SQL"):
+      return 'web_sql'
 
     if 'Conditional' in interface.ext_attrs:
       if 'WEB_AUDIO' in interface.ext_attrs['Conditional']:
diff --git a/tools/dom/scripts/idlnode.py b/tools/dom/scripts/idlnode.py
index dc57042..953d274 100755
--- a/tools/dom/scripts/idlnode.py
+++ b/tools/dom/scripts/idlnode.py
@@ -468,7 +468,6 @@
     IDLMember.__init__(self, ast, doc_js_interface_name)
     self.type = self._convert_first(ast, 'ReturnType', IDLType)
     self.arguments = self._convert_all(ast, 'Argument', IDLArgument)
-    self.raises = self._convert_first(ast, 'Raises', IDLType)
     self.specials = self._find_all(ast, 'Special')
     self.is_stringifier = self._has(ast, 'Stringifier')
   def _extra_repr(self):
@@ -481,15 +480,9 @@
     IDLMember.__init__(self, ast, doc_js_interface_name)
     self.is_read_only = self._has(ast, 'ReadOnly')
     # There are various ways to define exceptions for attributes:
-    self.raises = self._convert_first(ast, 'Raises', IDLType)
-    self.get_raises = self.raises \
-      or self._convert_first(ast, 'GetRaises', IDLType)
-    self.set_raises = self.raises \
-      or self._convert_first(ast, 'SetRaises', IDLType)
   def _extra_repr(self):
     extra = []
     if self.is_read_only: extra.append('readonly')
-    if self.raises: extra.append('raises')
     return extra
 
 class IDLConstant(IDLMember):
diff --git a/tools/dom/scripts/idlparser.py b/tools/dom/scripts/idlparser.py
index 3535360..637d7d4 100755
--- a/tools/dom/scripts/idlparser.py
+++ b/tools/dom/scripts/idlparser.py
@@ -175,23 +175,16 @@
       return syntax_switch(
         # Web IDL:
         [MAYBE(ExtAttrs), MAYBE(Stringifier), MAYBE(ReadOnly),
-         'attribute', Type, Id, MAYBE(_AttrRaises), ';'],
+         'attribute', Type, Id, ';'],
         # WebKit:
         [
           MAYBE(Stringifier),
           MAYBE(ExtAttrs), MAYBE(Static), MAYBE(ReadOnly), 'attribute', MAYBE(ExtAttrs),
-          Type, Id, MAYBE(_AttrRaises), ';'],
+          Type, Id, ';'],
         # FremontCut:
         [MAYBE(_Annotations), MAYBE(ExtAttrs),
          MAYBE(_AttrGetterSetter), MAYBE(Stringifier), MAYBE(ReadOnly),
-         'attribute', Type, Id, MAYBE(_AttrRaises), ';'])
-
-    def _AttrRaises():
-      return syntax_switch(
-        # Web IDL:
-        MANY(OR(GetRaises, SetRaises)),
-        # WebKit:
-        MANY(OR(GetRaises, SetRaises, Raises), separator=','))
+         'attribute', Type, Id, ';'])
 
     # Special fremontcut feature:
     def _AttrGetterSetter():
@@ -206,35 +199,18 @@
     def ReadOnly():
       return 'readonly'
 
-    def GetRaises():
-      return syntax_switch(
-        # Web IDL:
-        ['getraises', '(', _ScopedNames, ')'],
-        # WebKit:
-        ['getter', 'raises', '(', _ScopedNames, ')'])
-
-    def SetRaises():
-      return syntax_switch(
-        # Web IDL:
-        ['setraises', '(', _ScopedNames, ')'],
-        # WebKit:
-        ['setter', 'raises', '(', _ScopedNames, ')'])
-
     # Operation:
     def Operation():
       return syntax_switch(
         # Web IDL:
         [MAYBE(ExtAttrs), MAYBE(Static), MAYBE(Stringifier), MAYBE(_Specials),
-         ReturnType, MAYBE(Id), '(', _Arguments, ')', MAYBE(Raises),
-         ';'],
+         ReturnType, MAYBE(Id), '(', _Arguments, ')', ';'],
         # WebKit:
         [MAYBE(ExtAttrs), MAYBE(Static),
-         ReturnType, MAYBE(Id), '(', _Arguments, ')',
-         MAYBE(Raises), ';'],
+         ReturnType, MAYBE(Id), '(', _Arguments, ')', ';'],
         # FremontCut:
         [MAYBE(_Annotations), MAYBE(ExtAttrs), MAYBE(Static), MAYBE(Stringifier),
-         MAYBE(_Specials), ReturnType, MAYBE(Id), '(', _Arguments, ')',
-         MAYBE(Raises), ';'])
+         MAYBE(_Specials), ReturnType, MAYBE(Id), '(', _Arguments, ')', ';'])
 
     def Static():
       return 'static'
@@ -248,9 +224,6 @@
     def Stringifier():
       return 'stringifier'
 
-    def Raises():
-      return ['raises', '(', _ScopedNames, ')']
-
     # Operation arguments:
     def _Arguments():
       return MAYBE(MANY(Argument, ','))
diff --git a/tools/dom/scripts/idlparser_test.py b/tools/dom/scripts/idlparser_test.py
index 7155da7..840cd72 100755
--- a/tools/dom/scripts/idlparser_test.py
+++ b/tools/dom/scripts/idlparser_test.py
@@ -91,7 +91,7 @@
     self._run_test(
       idlparser.WEBKIT_SYNTAX,
       '''interface I {
-        attribute boolean A setter raises (E), getter raises (E);
+        attribute boolean A;
       };''',
       [('Interface', [('Id', 'I'), ('Attribute', [('Type', [('BooleanType', None)]), ('Id', 'A'), ('SetRaises', [('ScopedName', 'E')]), ('GetRaises', [('ScopedName', 'E')])])])])
 
diff --git a/tools/dom/scripts/idlrenderer.py b/tools/dom/scripts/idlrenderer.py
index 78661e7..3eda1d9 100755
--- a/tools/dom/scripts/idlrenderer.py
+++ b/tools/dom/scripts/idlrenderer.py
@@ -153,13 +153,6 @@
         w('?')
       w(' ')
       w(node.id)
-      if node.raises:
-        w(' raises (%s)' % node.raises.id)
-      else:
-        if node.get_raises:
-          w(' getraises (%s)' % node.get_raises.id)
-        if node.set_raises:
-          w(' setraises (%s)' % node.set_raises.id)
       wln(';')
     elif isinstance(node, IDLConstant):
       wsp(node.annotations)
@@ -181,8 +174,6 @@
       w('(')
       w(node.arguments, ', ')
       w(')')
-      if node.raises:
-        w(' raises (%s)' % node.raises.id)
       wln(';')
     elif isinstance(node, IDLArgument):
       wsp(node.ext_attrs)
diff --git a/tools/dom/scripts/idlsync.py b/tools/dom/scripts/idlsync.py
index 43c88d7..50af305 100755
--- a/tools/dom/scripts/idlsync.py
+++ b/tools/dom/scripts/idlsync.py
@@ -31,6 +31,7 @@
 WEBKIT_URL_PATTERN = r'"dartium_webkit_trunk": "(\S+)",'
 WEBKIT_REV_PATTERN = r'"dartium_webkit_revision": "(\d+)",'
 WEBCORE_SUBPATH = 'Source/WebCore'
+MODULES_SUBPATH = 'Source/modules'
 LOCAL_WEBKIT_IDL_PATH = os.path.join(DART_PATH, 'third_party', 'WebCore')
 LOCAL_WEBKIT_README = """\
 This directory contains a copy of WebKit/WebCore IDL files.
@@ -89,6 +90,8 @@
     # WebKit IDL.
     ('webkit', WEBCORE_SUBPATH, LOCAL_WEBKIT_IDL_PATH, LOCAL_WEBKIT_README,
      DEPTH_INFINITY),
+    ('webkit', MODULES_SUBPATH, os.path.join(LOCAL_WEBKIT_IDL_PATH, 'modules'), LOCAL_WEBKIT_README,
+     DEPTH_INFINITY),
     # Chrome IDL.
     ('chrome', CHROME_IDL_SUBPATH, LOCAL_CHROME_IDL_PATH, LOCAL_CHROME_README,
      DEPTH_INFINITY),
diff --git a/tools/dom/scripts/systemhtml.py b/tools/dom/scripts/systemhtml.py
index 3cb9d4b..b36ddcb 100644
--- a/tools/dom/scripts/systemhtml.py
+++ b/tools/dom/scripts/systemhtml.py
@@ -369,7 +369,6 @@
 js_support_checks = dict({
     'AudioContext': "JS('bool', '!!(window.AudioContext ||"
         " window.webkitAudioContext)')",
-    'ArrayBuffer': "JS('bool', 'typeof window.ArrayBuffer != \"undefined\"')",
     'Crypto':
         "JS('bool', '!!(window.crypto && window.crypto.getRandomValues)')",
     'Database': "JS('bool', '!!(window.openDatabase)')",
diff --git a/tools/dom/scripts/systemnative.py b/tools/dom/scripts/systemnative.py
index 25d3370..a8672db 100644
--- a/tools/dom/scripts/systemnative.py
+++ b/tools/dom/scripts/systemnative.py
@@ -231,7 +231,7 @@
         arguments,
         self._interface.id,
         False,
-        'ConstructorRaisesException' in ext_attrs)
+        'ConstructorRaisesException' in ext_attrs or 'RaisesException' in ext_attrs)
 
   def HasSupportCheck(self):
     # Need to omit a support check if it is conditional in JS.
@@ -357,7 +357,7 @@
         [],
         attr.type.id,
         attr.type.nullable,
-        attr.get_raises)
+        'GetterRaisesException' in attr.ext_attrs)
 
   def _AddSetter(self, attr, html_name):
     type_info = self._TypeInfo(attr.type.id)
@@ -387,7 +387,7 @@
         [attr],
         'void',
         False,
-        attr.set_raises)
+        'SetterRaisesException' in attr.ext_attrs)
 
   def AddIndexer(self, element_type):
     """Adds all the methods required to complete implementation of List."""
@@ -531,7 +531,7 @@
         arguments,
         operation.type.id,
         operation.type.nullable,
-        operation.raises)
+        'RaisesException' in operation.ext_attrs)
 
   def _GenerateNativeCallback(self,
       callback_name,
diff --git a/tools/dom/src/dart2js_Platform.dart b/tools/dom/src/dart2js_Platform.dart
new file mode 100644
index 0000000..90570f0
--- /dev/null
+++ b/tools/dom/src/dart2js_Platform.dart
@@ -0,0 +1,9 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of html;
+
+class Platform {
+  static final supportsTypedData = JS('bool', '!!(window.ArrayBuffer)');
+}
diff --git a/tools/dom/src/dartium_Platform.dart b/tools/dom/src/dartium_Platform.dart
new file mode 100644
index 0000000..1db313d
--- /dev/null
+++ b/tools/dom/src/dartium_Platform.dart
@@ -0,0 +1,9 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of html;
+
+class Platform {
+  static final supportsTypedData = true;
+}
diff --git a/tools/dom/templates/html/dart2js/html_dart2js.darttemplate b/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
index d3055a3..bc4077d 100644
--- a/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
+++ b/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
@@ -54,6 +54,7 @@
 part '$AUXILIARY_DIR/dart2js_KeyEvent.dart';
 part '$AUXILIARY_DIR/dart2js_FactoryProviders.dart';
 part '$AUXILIARY_DIR/dart2js_LocationWrapper.dart';
+part '$AUXILIARY_DIR/dart2js_Platform.dart';
 part '$AUXILIARY_DIR/dart2js_TypedArrayFactoryProvider.dart';
 part '$AUXILIARY_DIR/_ListIterators.dart';
 
diff --git a/tools/dom/templates/html/dartium/cpp_header.template b/tools/dom/templates/html/dartium/cpp_header.template
index ee4ef1f..bbe5835 100644
--- a/tools/dom/templates/html/dartium/cpp_header.template
+++ b/tools/dom/templates/html/dartium/cpp_header.template
@@ -8,7 +8,6 @@
 #define Dart$(INTERFACE)_h
 
 #include "DartDOMWrapper.h"
-#include "DartWrapperTypeInfo.h"
 $WEBCORE_INCLUDES
 #include <dart_api.h>
 
@@ -21,7 +20,6 @@
     static const bool isNode = $IS_NODE;
     static const bool isActive = $IS_ACTIVE;
     static const bool isEventTarget = $IS_EVENT_TARGET;
-    static DartWrapperTypeInfo info;
 
 $TO_NATIVE
 $TO_DART
@@ -33,12 +31,6 @@
     static Dart_NativeFunction resolver(Dart_Handle name, int argumentCount);
 };
 
-template<>
-class DartWrapperTypeTraits<$WEBCORE_CLASS_NAME > {
-public:
-    static DartWrapperTypeInfo* info() { return &Dart$INTERFACE::info; }
-};
-
 namespace Dart$(INTERFACE)Internal {
 $DECLARATIONS
 }
diff --git a/tools/dom/templates/html/dartium/cpp_implementation.template b/tools/dom/templates/html/dartium/cpp_implementation.template
index 7c9e45c..d06cb8d 100644
--- a/tools/dom/templates/html/dartium/cpp_implementation.template
+++ b/tools/dom/templates/html/dartium/cpp_implementation.template
@@ -24,6 +24,5 @@
 
 const char* const Dart$(INTERFACE)::dartImplementationClassName = "$DART_IMPLEMENTATION_CLASS";
 const char* const Dart$(INTERFACE)::dartImplementationLibraryName = "$DART_IMPLEMENTATION_LIBRARY";
-DartWrapperTypeInfo Dart$(INTERFACE)::info;
 
 }
diff --git a/tools/dom/templates/html/dartium/html_dartium.darttemplate b/tools/dom/templates/html/dartium/html_dartium.darttemplate
index eb2d73c..414ae05 100644
--- a/tools/dom/templates/html/dartium/html_dartium.darttemplate
+++ b/tools/dom/templates/html/dartium/html_dartium.darttemplate
@@ -46,6 +46,7 @@
 part '$AUXILIARY_DIR/shared_FactoryProviders.dart';
 part '$AUXILIARY_DIR/dartium_KeyEvent.dart';
 part '$AUXILIARY_DIR/dartium_FactoryProviders.dart';
+part '$AUXILIARY_DIR/dartium_Platform.dart';
 part '$AUXILIARY_DIR/Isolates.dart';
 part '$AUXILIARY_DIR/Microtask.dart';
 part '$AUXILIARY_DIR/Serialization.dart';
diff --git a/tools/dom/templates/html/impl/impl_WebKitTransitionEvent.darttemplate b/tools/dom/templates/html/impl/impl_WebKitTransitionEvent.darttemplate
deleted file mode 100644
index 511cebf..0000000
--- a/tools/dom/templates/html/impl/impl_WebKitTransitionEvent.darttemplate
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of $LIBRARYNAME;
-
-// This class maps WebKitTransitionEvent to TransitionEvent for older Chrome
-// browser versions.
-$(ANNOTATIONS)class $CLASSNAME$EXTENDS implements TransitionEvent $NATIVESPEC {
-$!MEMBERS}
diff --git a/tools/test.dart b/tools/test.dart
index 1d78bbc..354c7946 100755
--- a/tools/test.dart
+++ b/tools/test.dart
@@ -232,11 +232,51 @@
   }
 }
 
-void main() {
-  var optionsParser = new TestOptionsParser();
-  var configurations = optionsParser.parse(new Options().arguments);
-  if (configurations != null && configurations.length > 0) {
-    testConfigurations(configurations);
+Future deleteTemporaryDartDirectories() {
+  var completer = new Completer();
+  var environment = Platform.environment;
+  if (environment['DART_TESTING_DELETE_TEMPORARY_DIRECTORIES'] == '1') {
+    Directory getTempDir() {
+      // dir will be located in the system temporary directory.
+      var dir = new Directory('').createTempSync();
+      var path = new Path(dir.path).directoryPath;
+      dir.deleteSync();
+      return new Directory.fromPath(path);
+    }
+
+    // These are the patterns of temporary directory names created by
+    // 'Directory.createTempSync()' on linux/macos and windows.
+    var regExp;
+    if (['macos', 'linux'].contains(Platform.operatingSystem)) {
+      regExp = new RegExp(r'^temp_dir1_......$');
+    } else {
+      regExp = new RegExp(r'tempdir-........-....-....-....-............$');
+    }
+
+    getTempDir().list().listen((directoryEntry) {
+      if (directoryEntry is Directory) {
+        if (regExp.hasMatch(new Path(directoryEntry.path).filename)) {
+          try {
+            directoryEntry.deleteSync(recursive: true);
+          } catch (error) {
+            DebugLogger.error(error);
+          }
+        }
+      }
+    }, onDone: completer.complete());
+  } else {
+    completer.complete();
   }
+  return completer.future;
+}
+
+void main() {
+  deleteTemporaryDartDirectories().then((_) {
+    var optionsParser = new TestOptionsParser();
+    var configurations = optionsParser.parse(new Options().arguments);
+    if (configurations != null && configurations.length > 0) {
+      testConfigurations(configurations);
+    }
+  });
 }
 
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index 3a3de41..e888996 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -920,19 +920,6 @@
         _createWrapperFile(dartWrapperFilename, filePath);
       } else {
         dartWrapperFilename = filename;
-        // TODO(whesse): Once test.py is retired, adjust the relative path in
-        // the client/samples/dartcombat test to its css file, remove the
-        // "../../" from this path, and move this out of the isWebTest guard.
-        // Also remove getHtmlName, and just use test.html.
-        // TODO(efortuna): this shortening of htmlFilename is a band-aid until
-        // the above TODO gets fixed. Windows cannot have paths that are longer
-        // than 260 characters, and without this hack, we were running past the
-        // the limit.
-        String htmlFilename = getHtmlName(filename);
-        while ('$tempDir/../$htmlFilename'.length >= 260) {
-          htmlFilename = htmlFilename.substring(htmlFilename.length~/2);
-        }
-        htmlPath = '$tempDir/../$htmlFilename';
       }
       String scriptPath = (compiler == 'none') ?
           dartWrapperFilename : compiledDartWrapperFilename;
@@ -966,18 +953,27 @@
         commands.add(_compileCommand(
             dartWrapperFilename, compiledDartWrapperFilename,
             compiler, tempDir, vmOptions, optionsFromFile));
+      }
 
-        // some tests require compiling multiple input scripts.
-        List<String> otherScripts = optionsFromFile['otherScripts'];
-        for (String name in otherScripts) {
-          Path namePath = new Path(name);
+      // some tests require compiling multiple input scripts.
+      List<String> otherScripts = optionsFromFile['otherScripts'];
+      for (String name in otherScripts) {
+        Path namePath = new Path(name);
+        String baseName = namePath.filenameWithoutExtension;
+        Path fromPath = filePath.directoryPath.join(namePath);
+        if (compiler != 'none') {
           assert(namePath.extension == 'dart');
-          String baseName = namePath.filenameWithoutExtension;
-          Path fromPath = filePath.directoryPath.join(namePath);
           commands.add(_compileCommand(
               fromPath.toNativePath(), '$tempDir/$baseName.js',
               compiler, tempDir, vmOptions, optionsFromFile));
         }
+        if (compiler == 'none') {
+          // For the tests that require multiple input scripts but are not
+          // compiled, move the input scripts over with the script so they can
+          // be accessed.
+          String result = new File.fromPath(fromPath).readAsStringSync();
+          new File('$tempDir/$baseName.dart').writeAsStringSync(result);
+        }
       }
 
       // Variables for browser multi-tests.
@@ -1173,15 +1169,6 @@
     }
   }
 
-  String getHtmlName(String filename) {
-    var cleanFilename =  filename.replaceAll('/', '_')
-                                 .replaceAll(':', '_')
-                                 .replaceAll('\\', '_');
-
-    return "$cleanFilename"
-        "${configuration['compiler']}-${configuration['runtime']}.html";
-  }
-
   String get dumpRenderTreeFilename {
     if (configuration['drt'] != '') {
       return configuration['drt'];
diff --git a/utils/pub/command_install.dart b/utils/pub/command_install.dart
index 4297031..7497a27 100644
--- a/utils/pub/command_install.dart
+++ b/utils/pub/command_install.dart
@@ -17,7 +17,6 @@
 
   Future onRun() {
     return entrypoint.installDependencies()
-        .then((_) => log.message("Dependencies installed!"))
-        .then((_) => entrypoint.validateSdkConstraints());
+        .then((_) => log.message("Dependencies installed!"));
   }
 }
diff --git a/utils/pub/command_lish.dart b/utils/pub/command_lish.dart
index 8fa94df..1f767c9 100644
--- a/utils/pub/command_lish.dart
+++ b/utils/pub/command_lish.dart
@@ -90,7 +90,7 @@
         // TODO(nweiz): the response may have XML-formatted information about
         // the error. Try to parse that out once we have an easily-accessible
         // XML parser.
-        throw 'Failed to upload the package.';
+        throw new Exception('Failed to upload the package.');
       } else if (urisEqual(Uri.parse(url.origin), Uri.parse(server.origin))) {
         handleJsonError(error.response);
       } else {
diff --git a/utils/pub/command_update.dart b/utils/pub/command_update.dart
index 5c556ce..b54cb64 100644
--- a/utils/pub/command_update.dart
+++ b/utils/pub/command_update.dart
@@ -24,7 +24,6 @@
       future = entrypoint.updateDependencies(commandOptions.rest);
     }
     return future
-        .then((_) => log.message("Dependencies updated!"))
-        .then((_) => entrypoint.validateSdkConstraints());
+        .then((_) => log.message("Dependencies updated!"));
   }
 }
diff --git a/utils/pub/entrypoint.dart b/utils/pub/entrypoint.dart
index fe058c4..e8fa70e 100644
--- a/utils/pub/entrypoint.dart
+++ b/utils/pub/entrypoint.dart
@@ -17,7 +17,7 @@
 import 'system_cache.dart';
 import 'utils.dart';
 import 'version.dart';
-import 'version_solver.dart';
+import 'solver/version_solver.dart';
 
 /// Pub operates over a directed graph of dependencies that starts at a root
 /// "entrypoint" package. This is typically the package where the current
@@ -87,8 +87,7 @@
       } else {
         return id.source.install(id, packageDir).then((found) {
           if (found) return null;
-          // TODO(nweiz): More robust error-handling.
-          throw 'Package ${id.name} not found in source "${id.source.name}".';
+          fail('Package ${id.name} not found in source "${id.source.name}".');
         });
       }
     }).then((_) => id.resolved);
@@ -103,7 +102,7 @@
   /// completes when all dependencies are installed.
   Future installDependencies() {
     return new Future.sync(() {
-      return resolveVersions(cache.sources, root, loadLockFile());
+      return resolveVersions(cache.sources, root, lockFile: loadLockFile());
     }).then(_installDependencies);
   }
 
@@ -111,8 +110,7 @@
   /// package to its "package" directory, writing a new [LockFile]. Returns a
   /// [Future] that completes when all dependencies are installed.
   Future updateAllDependencies() {
-    return resolveVersions(cache.sources, root, new LockFile.empty())
-        .then(_installDependencies);
+    return resolveVersions(cache.sources, root).then(_installDependencies);
   }
 
   /// Installs the latest available versions of [dependencies], while leaving
@@ -120,20 +118,19 @@
   /// [Future] that completes when all dependencies are installed.
   Future updateDependencies(List<String> dependencies) {
     return new Future.sync(() {
-      var solver = new VersionSolver(cache.sources, root, loadLockFile());
-      for (var dependency in dependencies) {
-        solver.useLatestVersion(dependency);
-      }
-      return solver.solve();
+      return resolveVersions(cache.sources, root,
+          lockFile: loadLockFile(), useLatest: dependencies);
     }).then(_installDependencies);
   }
 
   /// Removes the old packages directory, installs all dependencies listed in
-  /// [packageVersions], and writes a [LockFile].
-  Future _installDependencies(List<PackageId> packageVersions) {
+  /// [result], and writes a [LockFile].
+  Future _installDependencies(SolveResult result) {
     return new Future.sync(() {
+      if (!result.succeeded) throw result.error;
+
       cleanDir(packagesDir);
-      return Future.wait(packageVersions.map((id) {
+      return Future.wait(result.packages.map((id) {
         if (id.isRoot) return new Future.value(id);
         return install(id);
       }).toList());
@@ -144,70 +141,6 @@
     });
   }
 
-  /// Traverses the root's package dependency graph and loads each of the
-  /// reached packages. This should only be called after the lockfile has been
-  /// successfully generated.
-  Future<List<Pubspec>> walkDependencies() {
-    return new Future.sync(() {
-      var lockFile = loadLockFile();
-      var group = new FutureGroup<Pubspec>();
-      var visited = new Set<String>();
-
-      // Include the root package in the results.
-      group.add(new Future.value(root.pubspec));
-
-      visitPackage(Pubspec pubspec) {
-        for (var ref in pubspec.dependencies) {
-          if (visited.contains(ref.name)) continue;
-
-          // Look up the concrete version.
-          var id = lockFile.packages[ref.name];
-
-          visited.add(ref.name);
-          var future;
-          if (ref.name == root.name) {
-            future = new Future<Pubspec>.value(root.pubspec);
-          } else {
-            future = cache.describe(id);
-          }
-          group.add(future.then(visitPackage));
-        }
-
-        return pubspec;
-      }
-
-      visited.add(root.name);
-      visitPackage(root.pubspec);
-      return group.future;
-    });
-  }
-
-  /// Validates that the current Dart SDK version matches the SDK constraints
-  /// of every package in the dependency graph. If a package's constraint does
-  /// not match, prints an error.
-  Future validateSdkConstraints() {
-    return walkDependencies().then((pubspecs) {
-      var errors = [];
-
-      for (var pubspec in pubspecs) {
-        var sdkConstraint = pubspec.environment.sdkVersion;
-        if (!sdkConstraint.allows(sdk.version)) {
-          errors.add("- '${pubspec.name}' requires ${sdkConstraint}");
-        }
-      }
-
-      if (errors.length > 0) {
-        log.error("Some packages that were installed are not compatible with "
-                "your SDK version ${sdk.version} and may not work:\n"
-            "${errors.join('\n')}\n\n"
-            "You may be able to resolve this by upgrading to the latest Dart "
-                "SDK\n"
-            "or adding a version constraint to use an older version of a "
-                "package.");
-      }
-    });
-  }
-
   /// Loads the list of concrete package versions from the `pubspec.lock`, if it
   /// exists. If it doesn't, this completes to an empty [LockFile].
   LockFile loadLockFile() {
diff --git a/utils/pub/hosted_source.dart b/utils/pub/hosted_source.dart
index 5a4106e..bd017e6 100644
--- a/utils/pub/hosted_source.dart
+++ b/utils/pub/hosted_source.dart
@@ -133,16 +133,16 @@
   void _throwFriendlyError(error, package, url) {
     if (error is PubHttpException &&
         error.response.statusCode == 404) {
-      throw 'Could not find package "$package" at $url.';
+      fail('Could not find package "$package" at $url.');
     }
 
     if (error is TimeoutException) {
-      throw 'Timed out trying to find package "$package" at $url.';
+      fail('Timed out trying to find package "$package" at $url.');
     }
 
     if (error is io.SocketIOException) {
-      throw 'Got socket error trying to find package "$package" at $url.\n'
-          '${error.osError}';
+      fail('Got socket error trying to find package "$package" at $url.\n'
+          '${error.osError}');
     }
 
     // Otherwise re-throw the original exception.
diff --git a/utils/pub/http.dart b/utils/pub/http.dart
index 8df0575..8a98313 100644
--- a/utils/pub/http.dart
+++ b/utils/pub/http.dart
@@ -69,10 +69,10 @@
             error.osError.errorCode == -5 ||
             error.osError.errorCode == 11001 ||
             error.osError.errorCode == 11004) {
-          throw 'Could not resolve URL "${request.url.origin}".';
+          fail('Could not resolve URL "${request.url.origin}".');
         } else if (error.osError.errorCode == -12276) {
-          throw 'Unable to validate SSL certificate for '
-              '"${request.url.origin}".';
+          fail('Unable to validate SSL certificate for '
+              '"${request.url.origin}".');
         }
       }
       throw error;
@@ -187,9 +187,8 @@
 }
 
 /// Throws an error describing an invalid response from the server.
-void invalidServerResponse(http.Response response) {
-  throw 'Invalid server response:\n${response.body}';
-}
+void invalidServerResponse(http.Response response) =>
+  fail('Invalid server response:\n${response.body}');
 
 /// Exception thrown when an HTTP operation fails.
 class PubHttpException implements Exception {
diff --git a/utils/pub/io.dart b/utils/pub/io.dart
index 32c4574..12121e7 100644
--- a/utils/pub/io.dart
+++ b/utils/pub/io.dart
@@ -144,29 +144,19 @@
 
     log.io("Listing directory $dir.");
 
-    var children = [];
-    for (var entity in new Directory(dir).listSync(followLinks: false)) {
-      var entityPath = entity.path;
-      if (!includeHidden && path.basename(entityPath).startsWith('.')) continue;
-
-      // TODO(nweiz): remove this when issue 9832 is fixed.
-      if (entity is Link) {
-        // We treat broken symlinks as files, in that we don't want to recurse
-        // into them.
-        entity = dirExists(entityPath)
-            ? new Directory(entityPath)
-            : new File(entityPath);
+    var children = <String>[];
+    for (var entity in new Directory(dir).listSync()) {
+      if (!includeHidden && path.basename(entity.path).startsWith('.')) {
+        continue;
       }
 
-      if (entity is File) {
-        contents.add(entityPath);
-      } else if (entity is Directory) {
-        contents.add(entityPath);
+      contents.add(entity.path);
+      if (entity is Directory) {
         // TODO(nweiz): don't manually recurse once issue 4794 is fixed.
         // Note that once we remove the manual recursion, we'll need to
         // explicitly filter out files in hidden directories.
         if (recursive) {
-          children.addAll(doList(entityPath, listedDirectories));
+          children.addAll(doList(entity.path, listedDirectories));
         }
       }
     }
@@ -272,39 +262,15 @@
   var utilDir = path.dirname(scriptPath);
   while (path.basename(utilDir) != 'utils' &&
          path.basename(utilDir) != 'util') {
-    if (path.basename(utilDir) == '') throw 'Could not find path to pub.';
+    if (path.basename(utilDir) == '') {
+      throw new Exception('Could not find path to pub.');
+    }
     utilDir = path.dirname(utilDir);
   }
 
   return path.normalize(path.join(utilDir, 'pub', target));
 }
 
-// TODO(nweiz): add a ByteSink wrapper to make writing strings to stdout/stderr
-// nicer.
-
-/// A sink that writes to standard output. Errors piped to this stream will be
-/// surfaced to the top-level error handler.
-// TODO: Unrequired wrapper, stdout is now an EventSink<List<int>>.
-final EventSink<List<int>> stdoutSink = _wrapStdio(stdout, "stdout");
-
-/// A sink that writes to standard error. Errors piped to this stream will be
-/// surfaced to the top-level error handler.
-// TODO: Unrequired wrapper, stdout is now an EventSink<List<int>>.
-final EventSink<List<int>> stderrSink = _wrapStdio(stderr, "stderr");
-
-/// Wrap the standard output or error [stream] in a [EventSink]. Any errors are
-/// logged, and then the program is terminated. [name] is used for debugging.
-EventSink<List<int>> _wrapStdio(IOSink sink, String name) {
-  var pair = consumerToSink(sink);
-  pair.last.catchError((e) {
-    // This log may or may not work, depending on how the stream failed. Not
-    // much we can do about that.
-    log.error("Error writing to $name", e);
-    exit(exit_codes.IO);
-  });
-  return pair.first;
-}
-
 /// A line-by-line stream of standard input.
 final Stream<String> stdinLines = streamToLines(
     new ByteStream(stdin).toStringStream());
@@ -317,7 +283,7 @@
 /// should just be a fragment like, "Are you sure you want to proceed".
 Future<bool> confirm(String message) {
   log.fine('Showing confirm message: $message');
-  stdoutSink.add("$message (y/n)? ".codeUnits);
+  stdout.write("$message (y/n)? ");
   return streamFirst(stdinLines)
       .then((line) => new RegExp(r"^[yY]").hasMatch(line));
 }
@@ -571,8 +537,8 @@
     // Ignore errors on process.std{out,err}. They'll be passed to
     // process.exitCode, and we don't want them being top-levelled by
     // std{out,err}Sink.
-    store(process.stdout.handleError((_) {}), stdoutSink, closeSink: false);
-    store(process.stderr.handleError((_) {}), stderrSink, closeSink: false);
+    store(process.stdout.handleError((_) {}), stdout, closeSink: false);
+    store(process.stderr.handleError((_) {}), stderr, closeSink: false);
     return Future.wait([
       store(stream, process.stdin),
       process.exitCode
@@ -580,8 +546,8 @@
   }).then((results) {
     var exitCode = results[1];
     if (exitCode != 0) {
-      throw "Failed to extract .tar.gz stream to $destination (exit code "
-        "$exitCode).";
+      throw new Exception("Failed to extract .tar.gz stream to $destination "
+          "(exit code $exitCode).");
     }
     log.fine("Extracted .tar.gz stream to $destination. Exit code $exitCode.");
   });
@@ -612,25 +578,27 @@
       return runProcess(command, ['e', 'data.tar.gz'], workingDir: tempDir);
     }).then((result) {
       if (result.exitCode != 0) {
-        throw 'Could not un-gzip (exit code ${result.exitCode}). Error:\n'
+        throw new Exception('Could not un-gzip (exit code ${result.exitCode}). '
+                'Error:\n'
             '${result.stdout.join("\n")}\n'
-            '${result.stderr.join("\n")}';
+            '${result.stderr.join("\n")}');
       }
 
       // Find the tar file we just created since we don't know its name.
       var tarFile = listDir(tempDir).firstWhere(
           (file) => path.extension(file) == '.tar',
           orElse: () {
-        throw 'The gzip file did not contain a tar file.';
+        throw new FormatException('The gzip file did not contain a tar file.');
       });
 
       // Untar the archive into the destination directory.
       return runProcess(command, ['x', tarFile], workingDir: destination);
     }).then((result) {
       if (result.exitCode != 0) {
-        throw 'Could not un-tar (exit code ${result.exitCode}). Error:\n'
+        throw new Exception('Could not un-tar (exit code ${result.exitCode}). '
+                'Error:\n'
             '${result.stdout.join("\n")}\n'
-            '${result.stderr.join("\n")}';
+            '${result.stderr.join("\n")}');
       }
       return true;
     });
@@ -654,7 +622,7 @@
   contents = contents.map((entry) {
     entry = path.absolute(entry);
     if (!isBeneath(entry, baseDir)) {
-      throw 'Entry $entry is not inside $baseDir.';
+      throw new ArgumentError('Entry $entry is not inside $baseDir.');
     }
     return path.relative(entry, from: baseDir);
   }).toList();
diff --git a/utils/pub/log.dart b/utils/pub/log.dart
index 891ba7d..e01425b 100644
--- a/utils/pub/log.dart
+++ b/utils/pub/log.dart
@@ -5,6 +5,7 @@
 /// Message logging.
 library log;
 
+import 'dart:io';
 import 'dart:async';
 
 import 'io.dart';
@@ -36,6 +37,9 @@
   /// operation, process spawning, or file IO.
   static const IO = const Level._("IO  ");
 
+  /// Incremental output during pub's version constraint solver.
+  static const SOLVER = const Level._("SLVR");
+
   /// Fine-grained and verbose additional information. Can be used to provide
   /// program state context for other logs (such as what pub was doing when an
   /// IO operation occurred) or just more detail for an operation.
@@ -77,6 +81,9 @@
 /// Logs [message] at [Level.IO].
 void io(message) => write(Level.IO, message);
 
+/// Logs [message] at [Level.SOLVER].
+void solver(message) => write(Level.SOLVER, message);
+
 /// Logs [message] at [Level.FINE].
 void fine(message) => write(Level.FINE, message);
 
@@ -164,11 +171,11 @@
 void dumpTranscript() {
   if (_transcript == null) return;
 
-  stderrSink.add('---- Log transcript ----\n'.codeUnits);
+  stderr.writeln('---- Log transcript ----');
   for (var entry in _transcript) {
     _logToStderrWithLabel(entry);
   }
-  stderrSink.add('---- End log transcript ----\n'.codeUnits);
+  stderr.writeln('---- End log transcript ----');
 }
 
 /// Sets the verbosity to "normal", which shows errors, warnings, and messages.
@@ -177,6 +184,7 @@
   _loggers[Level.WARNING] = _logToStderr;
   _loggers[Level.MESSAGE] = _logToStdout;
   _loggers[Level.IO]      = null;
+  _loggers[Level.SOLVER]  = null;
   _loggers[Level.FINE]    = null;
 }
 
@@ -187,6 +195,18 @@
   _loggers[Level.WARNING] = _logToStderrWithLabel;
   _loggers[Level.MESSAGE] = _logToStdoutWithLabel;
   _loggers[Level.IO]      = _logToStderrWithLabel;
+  _loggers[Level.SOLVER]  = null;
+  _loggers[Level.FINE]    = null;
+}
+
+/// Sets the verbosity to "solver", which shows errors, warnings, messages, and
+/// solver logs.
+void showSolver() {
+  _loggers[Level.ERROR]   = _logToStderr;
+  _loggers[Level.WARNING] = _logToStderr;
+  _loggers[Level.MESSAGE] = _logToStdout;
+  _loggers[Level.IO]      = null;
+  _loggers[Level.SOLVER]  = _logToStdout;
   _loggers[Level.FINE]    = null;
 }
 
@@ -196,43 +216,42 @@
   _loggers[Level.WARNING] = _logToStderrWithLabel;
   _loggers[Level.MESSAGE] = _logToStdoutWithLabel;
   _loggers[Level.IO]      = _logToStderrWithLabel;
+  _loggers[Level.SOLVER]  = _logToStderrWithLabel;
   _loggers[Level.FINE]    = _logToStderrWithLabel;
 }
 
 /// Log function that prints the message to stdout.
 void _logToStdout(Entry entry) {
-  _logToStream(stdoutSink, entry, showLabel: false);
+  _logToStream(stdout, entry, showLabel: false);
 }
 
 /// Log function that prints the message to stdout with the level name.
 void _logToStdoutWithLabel(Entry entry) {
-  _logToStream(stdoutSink, entry, showLabel: true);
+  _logToStream(stdout, entry, showLabel: true);
 }
 
 /// Log function that prints the message to stderr.
 void _logToStderr(Entry entry) {
-  _logToStream(stderrSink, entry, showLabel: false);
+  _logToStream(stderr, entry, showLabel: false);
 }
 
 /// Log function that prints the message to stderr with the level name.
 void _logToStderrWithLabel(Entry entry) {
-  _logToStream(stderrSink, entry, showLabel: true);
+  _logToStream(stderr, entry, showLabel: true);
 }
 
-void _logToStream(EventSink<List<int>> sink, Entry entry, {bool showLabel}) {
+void _logToStream(IOSink sink, Entry entry, {bool showLabel}) {
   bool firstLine = true;
   for (var line in entry.lines) {
     if (showLabel) {
       if (firstLine) {
-        sink.add(entry.level.name.codeUnits);
-        sink.add(': '.codeUnits);
+        sink.write('${entry.level.name}: ');
       } else {
-        sink.add('    | '.codeUnits);
+        sink.write('    | ');
       }
     }
 
-    sink.add(line.codeUnits);
-    sink.add('\n'.codeUnits);
+    sink.writeln(line);
 
     firstLine = false;
   }
diff --git a/utils/pub/package.dart b/utils/pub/package.dart
index 883b01b1..f1f65d3 100644
--- a/utils/pub/package.dart
+++ b/utils/pub/package.dart
@@ -46,7 +46,7 @@
   String get readmePath {
     var readmes = listDir(dir).map(path.basename).
         where((entry) => entry.contains(_README_REGEXP));
-    if (readmes.isEmpty) return;
+    if (readmes.isEmpty) return null;
 
     return path.join(dir, readmes.reduce((readme1, readme2) {
       var extensions1 = ".".allMatches(readme1).length;
@@ -103,6 +103,13 @@
 
   PackageId(this.name, this.source, this.version, this.description);
 
+  /// Creates an ID for the given root package.
+  PackageId.root(Package package)
+      : name = package.name,
+        source = null,
+        version = package.version,
+        description = package.name;
+
   /// Whether this ID identifies the root package.
   bool get isRoot => source == null;
 
@@ -143,6 +150,17 @@
 
   /// Returns a future that completes to the resovled [PackageId] for this id.
   Future<PackageId> get resolved => source.resolveId(this);
+
+  /// Returns a [PackageRef] that references this package and constrains its
+  /// version to exactly match [version].
+  PackageRef toRef() {
+    return new PackageRef(name, source, version, description);
+  }
+
+  /// Returns `true` if this id's description matches [other]'s.
+  bool descriptionEquals(PackageRef other) {
+    return source.descriptionsEqual(description, other.description);
+  }
 }
 
 /// A reference to a package. Unlike a [PackageId], a PackageRef may not
@@ -165,6 +183,7 @@
 
   PackageRef(this.name, this.source, this.constraint, this.description);
 
+  // TODO(rnystrom): Remove this if the old version solver is removed.
   /// Creates a reference to the given root package.
   PackageRef.root(Package package)
       : name = package.name,
@@ -184,6 +203,11 @@
   /// concrete version.
   PackageId atVersion(Version version) =>
     new PackageId(name, source, version, description);
+
+  /// Returns `true` if this reference's description matches [other]'s.
+  bool descriptionEquals(PackageRef other) {
+    return source.descriptionsEqual(description, other.description);
+  }
 }
 
 class PubspecNotFoundException implements Exception {
diff --git a/utils/pub/path_source.dart b/utils/pub/path_source.dart
index e4d1f02..c103c1b 100644
--- a/utils/pub/path_source.dart
+++ b/utils/pub/path_source.dart
@@ -33,10 +33,18 @@
   }
 
   bool descriptionsEqual(description1, description2) {
-    // Compare real paths after normalizing and resolving symlinks.
-    var path1 = new File(description1["path"]).fullPathSync();
-    var path2 = new File(description2["path"]).fullPathSync();
-    return path1 == path2;
+    try {
+      // Compare real paths after normalizing and resolving symlinks.
+      var path1 = new File(description1["path"]).fullPathSync();
+      var path2 = new File(description2["path"]).fullPathSync();
+      return path1 == path2;
+    } on FileIOException catch (ex) {
+      // If either of the files couldn't be found, fall back to just comparing
+      // the normalized paths.
+      var path1 = path.normalize(path.absolute(description1["path"]));
+      var path2 = path.normalize(path.absolute(description2["path"]));
+      return path1 == path2;
+    }
   }
 
   Future<bool> install(PackageId id, String destination) {
diff --git a/utils/pub/pub.dart b/utils/pub/pub.dart
index 9af9c27..4f1b632 100644
--- a/utils/pub/pub.dart
+++ b/utils/pub/pub.dart
@@ -64,11 +64,12 @@
        help: 'Print debugging information when an error occurs.');
   parser.addOption('verbosity',
       help: 'Control output verbosity.',
-      allowed: ['normal', 'io', 'all'],
+      allowed: ['normal', 'io', 'solver', 'all'],
       allowedHelp: {
-        'normal': 'Errors, warnings, and user messages are shown.',
-        'io':     'IO operations are also shown.',
-        'all':    'All output including internal tracing messages are shown.'
+        'normal': 'Show errors, warnings, and user messages.',
+        'io':     'Also show IO operations.',
+        'solver': 'Show steps during version resolution.',
+        'all':    'Show all output including internal tracing messages.'
       });
   parser.addFlag('verbose', abbr: 'v', negatable: false,
       help: 'Shortcut for "--verbosity=all"');
@@ -102,6 +103,7 @@
   switch (globalOptions['verbosity']) {
     case 'normal': log.showNormal(); break;
     case 'io': log.showIO(); break;
+    case 'solver': log.showSolver(); break;
     case 'all': log.showAll(); break;
     default:
       // No specific verbosity given, so check for the shortcut.
@@ -257,11 +259,25 @@
       }
 
       log.error(message);
-      if (globalOptions['trace'] && trace != null) {
-        log.error(trace);
+
+      if (trace != null) {
+        if (globalOptions['trace'] || !isUserFacingException(error)) {
+          log.error(trace);
+        } else {
+          log.fine(trace);
+        }
+      }
+
+      if (globalOptions['trace']) {
         log.dumpTranscript();
-      } else {
-        log.fine(trace);
+      } else if (!isUserFacingException(error)) {
+        log.error("""
+This is an unexpected error. Please run
+
+    pub --trace ${new Options().arguments.map((arg) => "'$arg'").join(' ')}
+
+and include the results in a bug report on http://dartbug.com/new.
+""");
       }
 
       exit(_chooseExitCode(error));
diff --git a/utils/pub/pubspec.dart b/utils/pub/pubspec.dart
index de3f155..a5c67ac 100644
--- a/utils/pub/pubspec.dart
+++ b/utils/pub/pubspec.dart
@@ -54,7 +54,7 @@
 
       return pubspec;
     } on FormatException catch (ex) {
-      throw 'Could not parse $pubspecPath:\n${ex.message}';
+      fail('Could not parse $pubspecPath:\n${ex.message}');
     }
   }
 
diff --git a/utils/pub/safe_http_server.dart b/utils/pub/safe_http_server.dart
index 79417bc..b6e1c83 100644
--- a/utils/pub/safe_http_server.dart
+++ b/utils/pub/safe_http_server.dart
@@ -135,7 +135,9 @@
     _inner.addStream(stream);
   Future close() => _inner.close();
   void write(Object obj) => _inner.write(obj);
-  void writeAll(Iterable objects) => _inner.writeAll(objects);
+  void writeAll(Iterable objects, [String separator = ""]) =>
+    _inner.writeAll(objects, separator);
   void writeCharCode(int charCode) => _inner.writeCharCode(charCode);
   void writeln([Object obj = ""]) => _inner.writeln(obj);
+  void addError(error) => _inner.addError(error);
 }
diff --git a/utils/pub/solver/backtracking_solver.dart b/utils/pub/solver/backtracking_solver.dart
new file mode 100644
index 0000000..4e5baa0
--- /dev/null
+++ b/utils/pub/solver/backtracking_solver.dart
@@ -0,0 +1,597 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// A back-tracking depth-first solver. Attempts to find the best solution for
+/// a root package's transitive dependency graph, where a "solution" is a set
+/// of concrete package versions. A valid solution will select concrete
+/// versions for every package reached from the root package's dependency graph,
+/// and each of those packages will fit the version constraints placed on it.
+///
+/// The solver builds up a solution incrementally by traversing the dependency
+/// graph starting at the root package. When it reaches a new package, it gets
+/// the set of versions that meet the current constraint placed on it. It
+/// *speculatively* selects one version from that set and adds it to the
+/// current solution and then proceeds. If it fully traverses the dependency
+/// graph, the solution is valid and it stops.
+///
+/// If it reaches an error because:
+///
+/// - A new dependency is placed on a package that's already been selected in
+///   the solution and the selected version doesn't match the new constraint.
+///
+/// - There are no versions available that meet the constraint placed on a
+///   package.
+///
+/// - etc.
+///
+/// then the current solution is invalid. It will then backtrack to the most
+/// recent speculative version choice and try the next one. That becomes the
+/// new in-progress solution and it tries to proceed from there. It will keep
+/// doing this, traversing and then backtracking when it meets a failure until
+/// a valid solution has been found or until all possible options for all
+/// speculative choices have been exhausted.
+library solver.backtracking_solver;
+
+import 'dart:async';
+import 'dart:collection' show Queue;
+
+import '../lock_file.dart';
+import '../log.dart' as log;
+import '../package.dart';
+import '../pubspec.dart';
+import '../sdk.dart' as sdk;
+import '../source.dart';
+import '../source_registry.dart';
+import '../utils.dart';
+import '../version.dart';
+import 'version_solver.dart';
+
+/// The top-level solver. Keeps track of the current potential solution, and
+/// the other possible versions for speculative package selections. Backtracks
+/// and advances to the next potential solution in the case of a failure.
+class BacktrackingSolver {
+  final SourceRegistry sources;
+  final Package root;
+  final LockFile lockFile;
+  final PubspecCache cache;
+
+  /// The set of packages that are being explicitly updated. The solver will
+  /// only allow the very latest version for each of these packages.
+  final _forceLatest = new Set<String>();
+
+  /// Every time a package is encountered when traversing the dependency graph,
+  /// the solver must select a version for it, sometimes when multiple versions
+  /// are valid. This keeps track of which versions have been selected so far
+  /// and which remain to be tried.
+  ///
+  /// Each entry in the list is an ordered [Queue] of versions to try for a
+  /// single package. The first item in the queue is the currently selected
+  /// version for that package. When a new dependency is encountered, a queue
+  /// of versions of that dependency is pushed onto the end of the list. A
+  /// queue is removed from the list once it's empty, indicating that none of
+  /// the versions provided a solution.
+  ///
+  /// The solver tries versions in depth-first order, so only the last queue in
+  /// the list will have items removed from it. When a new constraint is placed
+  /// on an already-selected package, and that constraint doesn't match the
+  /// selected version, that will cause the current solution to fail and
+  /// trigger backtracking.
+  final _selected = <Queue<PackageId>>[];
+
+  /// The number of solutions the solver has tried so far.
+  int get attemptedSolutions => _attemptedSolutions;
+  var _attemptedSolutions = 1;
+
+  BacktrackingSolver(SourceRegistry sources, this.root, this.lockFile,
+                     List<String> useLatest)
+      : sources = sources,
+        cache = new PubspecCache(sources) {
+    for (var package in useLatest) {
+      forceLatestVersion(package);
+      lockFile.packages.remove(package);
+    }
+  }
+
+  /// Run the solver. Completes with a list of specific package versions if
+  /// successful or an error if it failed to find a solution.
+  Future<SolveResult> solve() {
+    var stopwatch = new Stopwatch();
+
+    return new Future(() {
+      stopwatch.start();
+
+      // Pre-cache the root package's known pubspec.
+      cache.cache(new PackageId.root(root), root.pubspec);
+
+      _validateSdkConstraint(root.pubspec);
+      return _traverseSolution();
+    }).then((packages) {
+      return new SolveResult(packages, null, attemptedSolutions);
+    }).catchError((error) {
+      if (error is! SolveFailure) throw error;
+
+      // Wrap a failure in a result so we can attach some other data.
+      return new SolveResult(null, error, attemptedSolutions);
+    }).whenComplete(() {
+      // Gather some solving metrics.
+      var buffer = new StringBuffer();
+      buffer.writeln('${runtimeType} took ${stopwatch.elapsed} seconds.');
+      buffer.writeln(
+          '- Requested ${cache.versionCacheMisses} version lists');
+      buffer.writeln(
+          '- Looked up ${cache.versionCacheHits} cached version lists');
+      buffer.writeln(
+          '- Requested ${cache.pubspecCacheMisses} pubspecs');
+      buffer.writeln(
+          '- Looked up ${cache.pubspecCacheHits} cached pubspecs');
+      log.solver(buffer);
+    });
+  }
+
+  void forceLatestVersion(String package) {
+    _forceLatest.add(package);
+  }
+
+  /// Adds [versions], which is the list of all allowed versions of a given
+  /// package, to the set of versions to consider for solutions. The first item
+  /// in the list will be the currently selected version of that package.
+  /// Subsequent items will be tried if it the current selection fails. Returns
+  /// the first selected version.
+  PackageId select(Iterable<PackageId> versions) {
+    _selected.add(new Queue<PackageId>.from(versions));
+    logSolve();
+    return versions.first;
+  }
+
+  /// Returns the the currently selected id for the package [name] or `null` if
+  /// no concrete version has been selected for that package yet.
+  PackageId getSelected(String name) {
+    // Always prefer the root package.
+    if (root.name == name) return new PackageId.root(root);
+
+    // Look through the current selections.
+    for (var i = _selected.length - 1; i >= 0; i--) {
+      if (_selected[i].first.name == name) return _selected[i].first;
+    }
+
+    return null;
+  }
+
+  /// Gets the version of [package] currently locked in the lock file. Returns
+  /// `null` if it isn't in the lockfile (or has been unlocked).
+  PackageId getLocked(String package) => lockFile.packages[package];
+
+  /// Traverses the root package's dependency graph using the current potential
+  /// solution. If successful, completes to the solution. If not, backtracks
+  /// to the most recently selected version of a package and tries the next
+  /// version of it. If there are no more versions, continues to backtrack to
+  /// previous selections, and so on. If there is nothing left to backtrack to,
+  /// completes to the last failure that occurred.
+  Future<List<PackageId>> _traverseSolution() {
+    return new Traverser(this).traverse().catchError((error) {
+      if (error is! SolveFailure) throw error;
+
+      if (_backtrack(error)) {
+        _attemptedSolutions++;
+        return _traverseSolution();
+      }
+
+      // All out of solutions, so fail.
+      throw error;
+    });
+  }
+
+  /// Backtracks from the current failed solution and determines the next
+  /// solution to try. If possible, it will backjump based on the cause of the
+  /// [failure] to minize backtracking. Otherwise, it will simply backtrack to
+  /// the next possible solution.
+  ///
+  /// Returns `true` if there is a new solution to try.
+  bool _backtrack(SolveFailure failure) {
+    var dependers = failure.dependencies.map((dep) => dep.depender).toSet();
+
+    while (!_selected.isEmpty) {
+      // Look for a relevant selection to jump back to.
+      for (var i = _selected.length - 1; i >= 0; i--) {
+        // Can't jump to a package that has no more alternatives.
+        if (_selected[i].length == 1) continue;
+
+        var selected = _selected[i].first;
+
+        // If we find the package itself that failed, jump to it.
+        if (selected.name == failure.package) {
+          logSolve('jump to selected package ${failure.package}');
+          _selected.removeRange(i + 1, _selected.length);
+          break;
+        }
+
+        // See if this package directly or indirectly depends on [package].
+        var path = _getDependencyPath(selected, failure.package);
+        if (path != null) {
+          logSolve('backjump to ${selected.name} because it depends on '
+                   '${failure.package}  by $path');
+          _selected.removeRange(i + 1, _selected.length);
+          break;
+        }
+      }
+
+      // Advance past the current version of the leaf-most package.
+      var previous = _selected.last.removeFirst();
+      if (!_selected.last.isEmpty) {
+        logSolve();
+        return true;
+      }
+
+      logSolve('$previous is last version, backtracking');
+
+      // That package has no more versions, so pop it and try the next one.
+      _selected.removeLast();
+    }
+
+    return false;
+  }
+
+  /// Determines if [depender] has a direct or indirect dependency on
+  /// [dependent] based on the currently selected versions of all packages.
+  /// Returns a string describing the dependency chain if it does, or `null` if
+  /// there is no dependency.
+  String _getDependencyPath(PackageId depender, String dependent) {
+    // TODO(rnystrom): This is O(n^2) where n is the number of selected
+    // packages. Could store the reverse dependency graph to address that. If
+    // we do that, we need to make sure it gets correctly rolled back when
+    // backtracking occurs.
+    var visited = new Set<String>();
+
+    walkDeps(PackageId package, String currentPath) {
+      if (visited.contains(package.name)) return null;
+      visited.add(package.name);
+
+      var pubspec = cache.getCachedPubspec(package);
+      if (pubspec == null) return null;
+
+      for (var dep in pubspec.dependencies) {
+        if (dep.name == dependent) return currentPath;
+
+        var selected = getSelected(dep.name);
+        // Ignore unselected dependencies. We haven't traversed into them yet,
+        // so they can't affect backjumping.
+        if (selected == null) continue;
+
+        var depPath = walkDeps(selected, '$currentPath -> ${dep.name}');
+        if (depPath != null) return depPath;
+      }
+
+      return null;
+    }
+
+    return walkDeps(depender, depender.name);
+  }
+
+  /// Logs [message] in the context of the current selected packages. If
+  /// [message] is omitted, just logs a description of leaf-most selection.
+  void logSolve([String message]) {
+    if (message == null) {
+      if (_selected.isEmpty) {
+        message = "* start at root";
+      } else {
+        var count = _selected.last.length;
+        message = "* select ${_selected.last.first} ($count versions)";
+      }
+    } else {
+      // Otherwise, indent it under the current selected package.
+      message = "| $message";
+    }
+
+    // Indent for the previous selections.
+    var buffer = new StringBuffer();
+    buffer.writeAll(_selected.skip(1).map((_) => '| '));
+    buffer.write(message);
+    log.solver(buffer);
+  }
+}
+
+/// Given the solver's current set of selected package versions, this tries to
+/// traverse the dependency graph and see if a complete set of valid versions
+/// has been chosen. If it reaches a conflict, it will fail and stop
+/// traversing. If it reaches a package that isn't selected it will refine the
+/// solution by adding that package's set of allowed versions to the solver and
+/// then select the best one and continue.
+class Traverser {
+  final BacktrackingSolver _solver;
+
+  /// The queue of packages left to traverse. We do a breadth-first traversal
+  /// using an explicit queue just to avoid the code complexity of a recursive
+  /// asynchronous traversal.
+  final _packages = new Queue<PackageId>();
+
+  /// The packages we have already traversed. Used to avoid traversing the same
+  /// package multiple times, and to build the complete solution results.
+  final _visited = new Set<PackageId>();
+
+  /// The dependencies visited so far in the traversal. For each package name
+  /// (the map key) we track the list of dependencies that other packages have
+  /// placed on it so that we can calculate the complete constraint for shared
+  /// dependencies.
+  final _dependencies = <String, List<Dependency>>{};
+
+  Traverser(this._solver);
+
+  /// Walks the dependency graph starting at the root package and validates
+  /// that each reached package has a valid version selected.
+  Future<List<PackageId>> traverse() {
+    // Start at the root.
+    _packages.add(new PackageId.root(_solver.root));
+    return _traversePackage();
+  }
+
+  /// Traverses the next package in the queue. Completes to a list of package
+  /// IDs if the traversal completed successfully and found a solution.
+  /// Completes to an error if the traversal failed. Otherwise, recurses to the
+  /// next package in the queue, etc.
+  Future<List<PackageId>> _traversePackage() {
+    if (_packages.isEmpty) {
+      // We traversed the whole graph. If we got here, we successfully found
+      // a solution.
+      return new Future<List<PackageId>>.value(_visited.toList());
+    }
+
+    var id = _packages.removeFirst();
+
+    // Don't visit the same package twice.
+    if (_visited.contains(id)) {
+      return _traversePackage();
+    }
+    _visited.add(id);
+
+    return _solver.cache.getPubspec(id).then((pubspec) {
+      _validateSdkConstraint(pubspec);
+
+      var refs = pubspec.dependencies.toList();
+
+      // Include dev dependencies of the root package.
+      if (id.isRoot) refs.addAll(pubspec.devDependencies);
+
+      // Given a package ref, returns a future that completes to a pair of the
+      // ref and the number of versions available for it.
+      getNumVersions(PackageRef ref) {
+        // There is only ever one version of the root package.
+        if (ref.isRoot) {
+          return new Future.value(new Pair<PackageRef, int>(ref, 1));
+        }
+
+        return _solver.cache.getVersions(ref.name, ref.source, ref.description)
+            .then((versions) {
+          return new Pair<PackageRef, int>(ref, versions.length);
+        }).catchError((error) {
+          // If it fails for any reason, just treat that as no versions. This
+          // will sort this reference higher so that we can traverse into it
+          // and report the error more properly.
+          log.solver("Could not get versions for $ref:\n$error\n\n"
+              "${getAttachedStackTrace(error)}");
+          return new Pair<PackageRef, int>(ref, 0);
+        });
+      }
+
+      return Future.wait(refs.map(getNumVersions)).then((pairs) {
+        // Future.wait() returns an immutable list, so make a copy.
+        pairs = pairs.toList();
+
+        // Sort in best-first order to minimize backtracking.
+        pairs.sort((a, b) {
+          // Traverse into packages we've already selected first.
+          var aIsSelected = _solver.getSelected(a.first.name) != null;
+          var bIsSelected = _solver.getSelected(b.first.name) != null;
+          if (aIsSelected && !bIsSelected) return -1;
+          if (!aIsSelected && bIsSelected) return 1;
+
+          // Traverse into packages with fewer versions since they will lead to
+          // less backtracking.
+          if (a.last != b.last) return a.last.compareTo(b.last);
+
+          // Otherwise, just sort by name so that it's deterministic.
+          return a.first.name.compareTo(b.first.name);
+        });
+
+        var queue = new Queue<PackageRef>.from(pairs.map((pair) => pair.first));
+        return _traverseRefs(id.name, queue);
+      });
+    });
+  }
+
+  /// Traverses the references that [depender] depends on, stored in [refs].
+  /// Desctructively modifies [refs]. Completes to a list of packages if the
+  /// traversal is complete. Completes it to an error if a failure occurred.
+  /// Otherwise, recurses.
+  Future<List<PackageId>> _traverseRefs(String depender,
+      Queue<PackageRef> refs) {
+    // Move onto the next package if we've traversed all of these references.
+    if (refs.isEmpty) return _traversePackage();
+
+    // Pump the event loop to flatten the stack trace and workaround #9583.
+    // If that bug is fixed, this can be Future.sync() instead.
+    return new Future(() {
+      var ref = refs.removeFirst();
+
+      _validateDependency(ref, depender);
+      var constraint = _addConstraint(ref, depender);
+
+      var selected = _validateSelected(ref, constraint);
+      if (selected != null) {
+        // The selected package version is good, so enqueue it to traverse into
+        // it.
+        _packages.add(selected);
+        return _traverseRefs(depender, refs);
+      }
+
+      // We haven't selected a version. Get all of the versions that match the
+      // constraints we currently have for this package and add them to the
+      // set of solutions to try.
+      return _selectPackage(ref, constraint).then(
+          (_) => _traverseRefs(depender, refs));
+    });
+  }
+
+  /// Ensures that dependency [ref] from [depender] is consistent with the
+  /// other dependencies on the same package. Throws a [SolverFailure]
+  /// exception if not. Only validates sources and descriptions, not the
+  /// version.
+  void _validateDependency(PackageRef ref, String depender) {
+    // Make sure the dependencies agree on source and description.
+    var required = _getRequired(ref.name);
+    if (required == null) return;
+
+    // Make sure all of the existing sources match the new reference.
+    if (required.ref.source.name != ref.source.name) {
+      _solver.logSolve('source mismatch on ${ref.name}: ${required.ref.source} '
+                       '!= ${ref.source}');
+      throw new SourceMismatchException(ref.name,
+          [required, new Dependency(depender, ref)]);
+    }
+
+    // Make sure all of the existing descriptions match the new reference.
+    if (!ref.descriptionEquals(required.ref)) {
+      _solver.logSolve('description mismatch on ${ref.name}: '
+                       '${required.ref.description} != ${ref.description}');
+      throw new DescriptionMismatchException(ref.name,
+          [required, new Dependency(depender, ref)]);
+    }
+  }
+
+  /// Adds the version constraint that [depender] places on [ref] to the
+  /// overall constraint that all shared dependencies place on [ref]. Throws a
+  /// [SolverFailure] if that results in an unsolvable constraints.
+  ///
+  /// Returns the combined [VersionConstraint] that all dependers place on the
+  /// package.
+  VersionConstraint _addConstraint(PackageRef ref, String depender) {
+    // Add the dependency.
+    var dependencies = _getDependencies(ref.name);
+    dependencies.add(new Dependency(depender, ref));
+
+    // Determine the overall version constraint.
+    var constraint = dependencies
+        .map((dep) => dep.ref.constraint)
+        .fold(VersionConstraint.any, (a, b) => a.intersect(b));
+
+    // See if it's possible for a package to match that constraint.
+    if (constraint.isEmpty) {
+      _solver.logSolve('disjoint constraints on ${ref.name}');
+      throw new DisjointConstraintException(ref.name, dependencies);
+    }
+
+    return constraint;
+  }
+
+  /// Validates the currently selected package against the new dependency that
+  /// [ref] and [constraint] place on it. Returns `null` if there is no
+  /// currently selected package, throws a [SolverFailure] if the new reference
+  /// it not does not allow the previously selected version, or returns the
+  /// selected package if successful.
+  PackageId _validateSelected(PackageRef ref, VersionConstraint constraint) {
+    var selected = _solver.getSelected(ref.name);
+    if (selected == null) return null;
+
+    // Make sure it meets the constraint.
+    if (!ref.constraint.allows(selected.version)) {
+      _solver.logSolve('selection $selected does not match $constraint');
+      throw new NoVersionException(ref.name, constraint,
+                                   _getDependencies(ref.name));
+    }
+
+    return selected;
+  }
+
+  /// Tries to select a package that matches [ref] and [constraint]. Updates
+  /// the solver state so that we can backtrack from this decision if it turns
+  /// out wrong, but continues traversing with the new selection.
+  ///
+  /// Returns a future that completes with a [SolverFailure] if a version
+  /// could not be selected or that completes successfully if a package was
+  /// selected and traversing should continue.
+  Future _selectPackage(PackageRef ref, VersionConstraint constraint) {
+    return _solver.cache.getVersions(ref.name, ref.source, ref.description)
+        .then((versions) {
+      var allowed = versions.where((id) => constraint.allows(id.version));
+
+      // See if it's in the lockfile. If so, try that version first. If the
+      // locked version doesn't match our constraint, just ignore it.
+      var locked = _getValidLocked(ref.name, constraint);
+      if (locked != null) {
+        allowed = allowed.where((ref) => ref.version != locked.version)
+            .toList();
+        allowed.insert(0, locked);
+      }
+
+      if (allowed.isEmpty) {
+        _solver.logSolve('no versions for ${ref.name} match $constraint');
+        throw new NoVersionException(ref.name, constraint,
+                                     _getDependencies(ref.name));
+      }
+
+      // If we're doing an upgrade on this package, only allow the latest
+      // version.
+      if (_solver._forceLatest.contains(ref.name)) allowed = [allowed.first];
+
+      // Try the first package in the allowed set and keep track of the list of
+      // other possible versions in case that fails.
+      _packages.add(_solver.select(allowed));
+    });
+  }
+
+  /// Gets the list of dependencies for package [name]. Will create an empty
+  /// list if needed.
+  List<Dependency> _getDependencies(String name) {
+    return _dependencies.putIfAbsent(name, () => <Dependency>[]);
+  }
+
+  /// Gets a "required" reference to the package [name]. This is the first
+  /// non-root dependency on that package. All dependencies on a package must
+  /// agree on source and description, except for references to the root
+  /// package. This will return a reference to that "canonical" source and
+  /// description, or `null` if there is no required reference yet.
+  ///
+  /// This is required because you may have a circular dependency back onto the
+  /// root package. That second dependency won't be a root dependency and it's
+  /// *that* one that other dependencies need to agree on. In other words, you
+  /// can have a bunch of dependencies back onto the root package as long as
+  /// they all agree with each other.
+  Dependency _getRequired(String name) {
+    return _getDependencies(name)
+        .firstWhere((dep) => !dep.ref.isRoot, orElse: () => null);
+  }
+
+  /// Gets the package [name] that's currently contained in the lockfile if it
+  /// meets [constraint] and has the same source and description as other
+  /// references to that package. Returns `null` otherwise.
+  PackageId _getValidLocked(String name, VersionConstraint constraint) {
+    var package = _solver.getLocked(name);
+    if (package == null) return null;
+
+    if (!constraint.allows(package.version)) {
+      _solver.logSolve('$package is locked but does not match $constraint');
+      return null;
+    } else {
+      _solver.logSolve('$package is locked');
+    }
+
+    var required = _getRequired(name);
+    if (required != null) {
+      if (package.source.name != required.ref.source.name) return null;
+      if (!package.descriptionEquals(required.ref)) return null;
+    }
+
+    return package;
+  }
+}
+
+/// Ensures that if [pubspec] has an SDK constraint, then it is compatible
+/// with the current SDK. Throws a [SolverFailure] if not.
+void _validateSdkConstraint(Pubspec pubspec) {
+  if (pubspec.environment.sdkVersion.allows(sdk.version)) return;
+
+  throw new CouldNotSolveException(
+      'Package ${pubspec.name} requires SDK version '
+      '${pubspec.environment.sdkVersion} but the current SDK is '
+      '${sdk.version}.');
+}
diff --git a/utils/pub/version_solver.dart b/utils/pub/solver/greedy_solver.dart
similarity index 64%
rename from utils/pub/version_solver.dart
rename to utils/pub/solver/greedy_solver.dart
index 36569ba..e664ea2 100644
--- a/utils/pub/version_solver.dart
+++ b/utils/pub/solver/greedy_solver.dart
@@ -33,66 +33,42 @@
 /// that happens, we find the new best version that meets the updated constraint
 /// and then the change the package to use that version. That cycles back up to
 /// the beginning again.
-library version_solver;
+library version_solver1;
 
 import 'dart:async';
 import 'dart:collection' show Queue;
-import 'dart:json' as json;
-import 'dart:math';
-import 'lock_file.dart';
-import 'log.dart' as log;
-import 'package.dart';
-import 'pubspec.dart';
-import 'source.dart';
-import 'source_registry.dart';
-import 'utils.dart';
-import 'version.dart';
+import 'dart:math' as math;
 
-/// Attempts to select the best concrete versions for all of the transitive
-/// dependencies of [root] taking into account all of the [VersionConstraint]s
-/// that those dependencies place on each other and the requirements imposed by
-/// [lockFile]. If successful, completes to a [Map] that maps package names to
-/// the selected version for that package. If it fails, the future will complete
-/// with a [NoVersionException], [DisjointConstraintException], or
-/// [CouldNotSolveException].
-Future<List<PackageId>> resolveVersions(SourceRegistry sources, Package root,
-    LockFile lockFile) {
-  log.message('Resolving dependencies...');
-  return new VersionSolver(sources, root, lockFile).solve();
-}
+import '../lock_file.dart';
+import '../log.dart' as log;
+import '../package.dart';
+import '../source.dart';
+import '../source_registry.dart';
+import '../version.dart';
+import 'version_solver.dart';
 
-class VersionSolver {
-  final SourceRegistry _sources;
-  final Package _root;
-  final LockFile lockFile;
-  final PubspecCache _pubspecs;
-  final Map<String, Dependency> _packages;
-  final Queue<WorkItem> _work;
+class GreedyVersionSolver extends VersionSolver {
+  final _packages = <String, DependencyNode>{};
+  final _work = new Queue<WorkItem>();
   int _numIterations = 0;
 
-  VersionSolver(SourceRegistry sources, this._root, this.lockFile)
-      : _sources = sources,
-        _pubspecs = new PubspecCache(sources),
-        _packages = <String, Dependency>{},
-        _work = new Queue<WorkItem>();
+  GreedyVersionSolver(SourceRegistry sources, Package root, LockFile lockFile,
+                      List<String> useLatest)
+      : super(sources, root, lockFile, useLatest);
 
-  /// Tell the version solver to use the most recent version of [package] that
-  /// exists in whatever source it's installed from. If that version violates
-  /// constraints imposed by other dependencies, an error will be raised when
-  /// solving the versions, even if an earlier compatible version exists.
-  void useLatestVersion(String package) {
+  /// The non-backtracking solver always only tries one solution.
+  int get attemptedSolutions => 1;
+
+  void forceLatestVersion(String package) {
     // TODO(nweiz): How do we want to detect and handle unknown dependencies
     // here?
     getDependency(package).useLatestVersion = true;
-    lockFile.packages.remove(package);
   }
 
-  Future<List<PackageId>> solve() {
+  Future<List<PackageId>> runSolver() {
     // Kick off the work by adding the root package at its concrete version to
     // the dependency graph.
-    var ref = new PackageRef.root(_root);
-    enqueue(new AddConstraint('(entrypoint)', ref));
-    _pubspecs.cache(ref.atVersion(_root.version), _root.pubspec);
+    enqueue(new AddConstraint('(entrypoint)', new PackageRef.root(root)));
 
     Future processNextWorkItem(_) {
       while (true) {
@@ -106,7 +82,7 @@
         // TODO(rnystrom): These numbers here are magic and arbitrary. Tune
         // when we have a better picture of real-world package topologies.
         _numIterations++;
-        if (_numIterations > max(50, _packages.length * 5)) {
+        if (_numIterations > math.max(50, _packages.length * 5)) {
           throw new CouldNotSolveException();
         }
 
@@ -128,10 +104,10 @@
     _work.add(work);
   }
 
-  Dependency getDependency(String package) {
+  DependencyNode getDependency(String package) {
     // There can be unused dependencies in the graph, so just create an empty
     // one if needed.
-    _packages.putIfAbsent(package, () => new Dependency(package));
+    _packages.putIfAbsent(package, () => new DependencyNode(package));
     return _packages[package];
   }
 
@@ -142,13 +118,14 @@
 
   /// Returns the most recent version of [dependency] that satisfies all of its
   /// version constraints.
-  Future<Version> getBestVersion(Dependency dependency) {
-    return dependency.getVersions().then((versions) {
+  Future<Version> getBestVersion(DependencyNode dependency) {
+    return cache.getVersions(dependency.name,
+        dependency.source, dependency.description).then((versions) {
       var best = null;
-      for (var version in versions) {
+      for (var ref in versions) {
         if (dependency.useLatestVersion ||
-            dependency.constraint.allows(version)) {
-          if (best == null || version > best) best = version;
+            dependency.constraint.allows(ref.version)) {
+          if (best == null || ref.version > best) best = ref.version;
         }
       }
 
@@ -156,7 +133,7 @@
       if (best == null) {
         if (tryUnlockDepender(dependency)) return null;
         throw new NoVersionException(dependency.name, dependency.constraint,
-            dependency._refs);
+            dependency.toList());
       } else if (!dependency.constraint.allows(best)) {
         if (tryUnlockDepender(dependency)) return null;
         throw new CouldNotUpdateException(
@@ -174,7 +151,7 @@
   ///
   /// This does a breadth-first search; immediate dependers will be unlocked
   /// first, followed by transitive dependers.
-  bool tryUnlockDepender(Dependency dependency, [Set<String> seen]) {
+  bool tryUnlockDepender(DependencyNode dependency, [Set<String> seen]) {
     if (seen == null) seen = new Set();
     // Avoid an infinite loop if there are circular dependencies.
     if (seen.contains(dependency.name)) return false;
@@ -195,22 +172,26 @@
   }
 
   List<PackageId> buildResults() {
-    return _packages.values.where((dep) => dep.isDependedOn).map((dep) {
-      var description = dep.description;
+    return _packages.values
+        .where((dep) => dep.isDependedOn)
+        .map(_dependencyToPackageId)
+        .toList();
+  }
 
-      // If the lockfile contains a fully-resolved description for the package,
-      // use that. This allows e.g. Git to ensure that the same commit is used.
-      var lockedPackage = lockFile.packages[dep.name];
-      if (lockedPackage != null && lockedPackage.version == dep.version &&
-          lockedPackage.source.name == dep.source.name &&
-          dep.source.descriptionsEqual(
-              description, lockedPackage.description)) {
-        description = lockedPackage.description;
-      }
+  PackageId _dependencyToPackageId(DependencyNode dep) {
+    var description = dep.description;
 
-      return new PackageId(dep.name, dep.source, dep.version, description);
-    })
-    .toList();
+    // If the lockfile contains a fully-resolved description for the package,
+    // use that. This allows e.g. Git to ensure that the same commit is used.
+    var lockedPackage = lockFile.packages[dep.name];
+    if (lockedPackage != null && lockedPackage.version == dep.version &&
+        lockedPackage.source.name == dep.source.name &&
+        dep.source.descriptionsEqual(
+            description, lockedPackage.description)) {
+      description = lockedPackage.description;
+    }
+
+    return new PackageId(dep.name, dep.source, dep.version, description);
   }
 }
 
@@ -222,7 +203,7 @@
   /// Processes this work item. Returns a future that completes when the work is
   /// done. If `null` is returned, that means the work has completed
   /// synchronously and the next item can be started immediately.
-  Future process(VersionSolver solver);
+  Future process(GreedyVersionSolver solver);
 }
 
 /// The best selected version for a package has changed to [version]. If the
@@ -243,7 +224,7 @@
 
   ChangeVersion(this.package, this.source, this.description, this.version);
 
-  Future process(VersionSolver solver) {
+  Future process(GreedyVersionSolver solver) {
     log.fine("Changing $package to version $version.");
 
     var dependency = solver.getDependency(package);
@@ -288,7 +269,7 @@
     }
 
     var id = new PackageId(package, source, version, description);
-    return solver._pubspecs.load(id).then((pubspec) {
+    return solver.cache.getPubspec(id).then((pubspec) {
       var dependencies = <String, PackageRef>{};
       for (var dependency in pubspec.dependencies) {
         dependencies[dependency.name] = dependency;
@@ -313,12 +294,13 @@
 /// graph once a dependency has changed. Changing the dependency is the
 /// responsibility of subclasses.
 abstract class ChangeConstraint implements WorkItem {
-  Future process(VersionSolver solver);
+  Future process(GreedyVersionSolver solver);
 
-  void undo(VersionSolver solver);
+  void undo(GreedyVersionSolver solver);
 
-  Future _processChange(VersionSolver solver, Dependency oldDependency,
-      Dependency newDependency) {
+  Future _processChange(GreedyVersionSolver solver,
+                        DependencyNode oldDependency,
+                        DependencyNode newDependency) {
     var name = newDependency.name;
     var source = oldDependency.source != null ?
       oldDependency.source : newDependency.source;
@@ -336,7 +318,7 @@
         return null;
       }
 
-      throw new DisjointConstraintException(name, newDependency._refs);
+      throw new DisjointConstraintException(name, newDependency.toList());
     }
 
     // If this constraint change didn't cause the overall constraint on the
@@ -351,9 +333,9 @@
 
     // If the dependency is on the root package, then we don't need to do
     // anything since it's already at the best version.
-    if (name == solver._root.name) {
+    if (name == solver.root.name) {
       solver.enqueue(new ChangeVersion(
-          name, source, description, solver._root.version));
+          name, source, description, solver.root.version));
       return null;
     }
 
@@ -393,7 +375,7 @@
 
   AddConstraint(this.depender, this.ref);
 
-  Future process(VersionSolver solver) {
+  Future process(GreedyVersionSolver solver) {
     log.fine("Adding $depender's constraint $ref.");
 
     var dependency = solver.getDependency(ref.name);
@@ -402,7 +384,7 @@
     return _processChange(solver, oldDependency, dependency);
   }
 
-  void undo(VersionSolver solver) {
+  void undo(GreedyVersionSolver solver) {
     solver.getDependency(ref.name).removeConstraint(depender);
   }
 }
@@ -420,7 +402,7 @@
 
   RemoveConstraint(this.depender, this.dependent);
 
-  Future process(VersionSolver solver) {
+  Future process(GreedyVersionSolver solver) {
     log.fine("Removing $depender's constraint ($_removed) on $dependent.");
 
     var dependency = solver.getDependency(dependent);
@@ -429,7 +411,7 @@
     return _processChange(solver, oldDependency, dependency);
   }
 
-  void undo(VersionSolver solver) {
+  void undo(GreedyVersionSolver solver) {
     solver.getDependency(dependent).placeConstraint(depender, _removed);
   }
 }
@@ -437,11 +419,11 @@
 /// [package]'s version is no longer constrained by the lockfile.
 class UnlockPackage implements WorkItem {
   /// The package being unlocked.
-  Dependency package;
+  DependencyNode package;
 
   UnlockPackage(this.package);
 
-  Future process(VersionSolver solver) {
+  Future process(GreedyVersionSolver solver) {
     log.fine("Unlocking ${package.name}.");
 
     solver.lockFile.packages.remove(package.name);
@@ -453,41 +435,9 @@
   }
 }
 
-// TODO(rnystrom): Instead of always pulling from the source (which will mean
-// hitting a server), we should consider caching pubspecs of uninstalled
-// packages in the system cache.
-/// Maintains a cache of previously-loaded pubspecs. Used to avoid requesting
-/// the same pubspec from the server repeatedly.
-class PubspecCache {
-  final SourceRegistry _sources;
-  final Map<PackageId, Pubspec> _pubspecs;
-
-  PubspecCache(this._sources)
-      : _pubspecs = new Map<PackageId, Pubspec>();
-
-  /// Caches [pubspec] as the [Pubspec] for the package identified by [id].
-  void cache(PackageId id, Pubspec pubspec) {
-    _pubspecs[id] = pubspec;
-  }
-
-  /// Loads the pubspec for the package identified by [id].
-  Future<Pubspec> load(PackageId id) {
-    // Complete immediately if it's already cached.
-    if (_pubspecs.containsKey(id)) {
-      return new Future<Pubspec>.value(_pubspecs[id]);
-    }
-
-    return id.describe().then((pubspec) {
-      // Cache it.
-      _pubspecs[id] = pubspec;
-      return pubspec;
-    });
-  }
-}
-
 /// Describes one [Package] in the [DependencyGraph] and keeps track of which
 /// packages depend on it and what constraints they place on it.
-class Dependency {
+class DependencyNode {
   /// The name of the this dependency's package.
   final String name;
 
@@ -545,19 +495,16 @@
     return refs.first;
   }
 
-  Dependency(this.name)
+  DependencyNode(this.name)
       : _refs = <String, PackageRef>{};
 
-  Dependency._clone(Dependency other)
+  DependencyNode._clone(DependencyNode other)
       : name = other.name,
         version = other.version,
         _refs = new Map<String, PackageRef>.from(other._refs);
 
   /// Creates a copy of this dependency.
-  Dependency clone() => new Dependency._clone(this);
-
-  /// Return a list of available versions for this dependency.
-  Future<List<Version>> getVersions() => source.getVersions(name, description);
+  DependencyNode clone() => new DependencyNode._clone(this);
 
   /// Places [ref] as a constraint from [package] onto this.
   void placeConstraint(String package, PackageRef ref) {
@@ -565,12 +512,13 @@
     if (requiredDepender != null) {
       var required = _refs[requiredDepender];
       if (required.source.name != ref.source.name) {
-        throw new SourceMismatchException(name,
-            requiredDepender, required.source, package, ref.source);
-      } else if (!required.source.descriptionsEqual(
-                     required.description, ref.description)) {
-        throw new DescriptionMismatchException(name,
-            requiredDepender, required.description, package, ref.description);
+        throw new SourceMismatchException(name, [
+            new Dependency(requiredDepender, required),
+            new Dependency(package, ref)]);
+      } else if (!required.descriptionEquals(ref)) {
+        throw new DescriptionMismatchException(name, [
+            new Dependency(requiredDepender, required),
+            new Dependency(package, ref)]);
       }
     }
 
@@ -595,120 +543,14 @@
 
   /// Removes the constraint from [package] onto this.
   PackageRef removeConstraint(String package) => _refs.remove(package);
-}
 
-/// Exception thrown when the [VersionConstraint] used to match a package is
-/// valid (i.e. non-empty), but there are no released versions of the package
-/// that fit that constraint.
-class NoVersionException implements Exception {
-  final String package;
-  final VersionConstraint constraint;
-  final Map<String, PackageRef> _dependencies;
-
-  NoVersionException(this.package, this.constraint, this._dependencies);
-
-  String toString() {
-    var buffer = new StringBuffer();
-    buffer.write("Package '$package' has no versions that match $constraint "
-        "derived from:\n");
-
-    var keys = new List.from(_dependencies.keys);
-    keys.sort();
-
-    for (var key in keys) {
-      buffer.write("- '$key' depends on version "
-          "${_dependencies[key].constraint}\n");
-    }
-
-    return buffer.toString();
-  }
-}
-
-// TODO(rnystrom): Report the list of depending packages and their constraints.
-/// Exception thrown when the most recent version of [package] must be selected,
-/// but doesn't match the [VersionConstraint] imposed on the package.
-class CouldNotUpdateException implements Exception {
-  final String package;
-  final VersionConstraint constraint;
-  final Version best;
-
-  CouldNotUpdateException(this.package, this.constraint, this.best);
-
-  String toString() =>
-      "The latest version of '$package', $best, does not match $constraint.";
-}
-
-/// Exception thrown when the [VersionConstraint] used to match a package is
-/// the empty set: in other words, multiple packages depend on it and have
-/// conflicting constraints that have no overlap.
-class DisjointConstraintException implements Exception {
-  final String package;
-  final Map<String, PackageRef> _dependencies;
-
-  DisjointConstraintException(this.package, this._dependencies);
-
-  String toString() {
-    var buffer = new StringBuffer();
-    buffer.write("Incompatible version constraints on '$package':\n");
-
-    var keys = new List.from(_dependencies.keys);
-    keys.sort();
-
-    for (var key in keys) {
-      buffer.write("- '$key' depends on version "
-          "${_dependencies[key].constraint}\n");
-    }
-
-    return buffer.toString();
-  }
-}
-
-/// Exception thrown when the [VersionSolver] fails to find a solution after a
-/// certain number of iterations.
-class CouldNotSolveException implements Exception {
-  CouldNotSolveException();
-
-  String toString() =>
-      "Could not find a solution that met all version constraints.";
-}
-
-/// Exception thrown when two packages with the same name but different sources
-/// are depended upon.
-class SourceMismatchException implements Exception {
-  final String package;
-  final String depender1;
-  final Source source1;
-  final String depender2;
-  final Source source2;
-
-  SourceMismatchException(this.package, this.depender1, this.source1,
-      this.depender2, this.source2);
-
-  String toString() {
-    return "Incompatible dependencies on '$package':\n"
-        "- '$depender1' depends on it from source '$source1'\n"
-        "- '$depender2' depends on it from source '$source2'";
-  }
-}
-
-/// Exception thrown when two packages with the same name and source but
-/// different descriptions are depended upon.
-class DescriptionMismatchException implements Exception {
-  final String package;
-  final String depender1;
-  final description1;
-  final String depender2;
-  final description2;
-
-  DescriptionMismatchException(this.package, this.depender1, this.description1,
-      this.depender2, this.description2);
-
-  String toString() {
-    // TODO(nweiz): Dump descriptions to YAML when that's supported.
-    return "Incompatible dependencies on '$package':\n"
-        "- '$depender1' depends on it with description "
-        "${json.stringify(description1)}\n"
-        "- '$depender2' depends on it with description "
-        "${json.stringify(description2)}";
+  /// Converts this to a list of [Dependency] objects like the error types
+  /// expect.
+  List<Dependency> toList() {
+    var result = <Dependency>[];
+    _refs.forEach((name, ref) {
+      result.add(new Dependency(name, ref));
+    });
+    return result;
   }
 }
diff --git a/utils/pub/solver/version_solver.dart b/utils/pub/solver/version_solver.dart
new file mode 100644
index 0000000..a816262
--- /dev/null
+++ b/utils/pub/solver/version_solver.dart
@@ -0,0 +1,308 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library version_solver;
+
+import 'dart:async';
+import 'dart:json' as json;
+
+import '../lock_file.dart';
+import '../log.dart' as log;
+import '../package.dart';
+import '../pubspec.dart';
+import '../source.dart';
+import '../source_registry.dart';
+import '../version.dart';
+import 'backtracking_solver.dart';
+
+/// Attempts to select the best concrete versions for all of the transitive
+/// dependencies of [root] taking into account all of the [VersionConstraint]s
+/// that those dependencies place on each other and the requirements imposed by
+/// [lockFile].
+///
+/// If [useLatest] is given, then only the latest versions of the referenced
+/// packages will be used. This is for forcing an update to one or more
+/// packages.
+Future<SolveResult> resolveVersions(SourceRegistry sources, Package root,
+    {LockFile lockFile, List<String> useLatest}) {
+  log.message('Resolving dependencies...');
+
+  if (lockFile == null) lockFile = new LockFile.empty();
+  if (useLatest == null) useLatest = [];
+
+  return new BacktrackingSolver(sources, root, lockFile, useLatest).solve();
+}
+
+/// The result of a version resolution.
+class SolveResult {
+  /// Whether the solver found a complete solution or failed.
+  bool get succeeded => error == null;
+
+  /// The list of concrete package versions that were selected for each package
+  /// reachable from the root, or `null` if the solver failed.
+  final List<PackageId> packages;
+
+  /// The error that prevented the solver from finding a solution or `null` if
+  /// it was successful.
+  final SolveFailure error;
+
+  /// The number of solutions that were attempted before either finding a
+  /// successful solution or exhausting all options. In other words, one more
+  /// than the number of times it had to backtrack because it found an invalid
+  /// solution.
+  final int attemptedSolutions;
+
+  SolveResult(this.packages, this.error, this.attemptedSolutions);
+
+  String toString() {
+    if (!succeeded) {
+      return 'Failed to solve after $attemptedSolutions attempts:\n'
+             '$error';
+    }
+
+    return 'Took $attemptedSolutions tries to resolve to\n'
+           '- ${packages.join("\n- ")}';
+  }
+}
+
+/// Maintains a cache of previously-requested data: pubspecs and version lists.
+/// Used to avoid requesting the same pubspec from the server repeatedly.
+class PubspecCache {
+  final SourceRegistry _sources;
+  final _versions = new Map<PackageId, List<PackageId>>();
+  final _pubspecs = new Map<PackageId, Pubspec>();
+
+  /// The number of times a version list was requested and it wasn't cached and
+  /// had to be requested from the source.
+  int versionCacheMisses = 0;
+
+  /// The number of times a version list was requested and the cached version
+  /// was returned.
+  int versionCacheHits = 0;
+
+  /// The number of times a pubspec was requested and it wasn't cached and had
+  /// to be requested from the source.
+  int pubspecCacheMisses = 0;
+
+  /// The number of times a pubspec was requested and the cached version was
+  /// returned.
+  int pubspecCacheHits = 0;
+
+  PubspecCache(this._sources);
+
+  /// Caches [pubspec] as the [Pubspec] for the package identified by [id].
+  void cache(PackageId id, Pubspec pubspec) {
+    _pubspecs[id] = pubspec;
+  }
+
+  /// Loads the pubspec for the package identified by [id].
+  Future<Pubspec> getPubspec(PackageId id) {
+    // Complete immediately if it's already cached.
+    if (_pubspecs.containsKey(id)) {
+      pubspecCacheHits++;
+      return new Future<Pubspec>.value(_pubspecs[id]);
+    }
+
+    pubspecCacheMisses++;
+    return id.describe().then((pubspec) {
+      log.solver('requested $id pubspec');
+
+      // Cache it.
+      _pubspecs[id] = pubspec;
+      return pubspec;
+    });
+  }
+
+  /// Returns the previously cached pubspec for the package identified by [id]
+  /// or returns `null` if not in the cache.
+  Pubspec getCachedPubspec(PackageId id) => _pubspecs[id];
+
+  /// Gets the list of versions for [package] in descending order.
+  Future<List<PackageId>> getVersions(String package, Source source,
+      description) {
+    // Create a fake ID to use as a key.
+    // TODO(rnystrom): Create a separate type for (name, source, description)
+    // without a version.
+    var id = new PackageId(package, source, Version.none, description);
+
+    // See if we have it cached.
+    var versions = _versions[id];
+    if (versions != null) {
+      versionCacheHits++;
+      return new Future.value(versions);
+    }
+
+    versionCacheMisses++;
+    return source.getVersions(package, description).then((versions) {
+      var ids = versions
+          .map((version) => new PackageId(package, source, version,
+              description))
+          .toList();
+
+      // Sort by descending version so we try newer versions first.
+      ids.sort((a, b) => b.version.compareTo(a.version));
+
+      log.solver('requested $package version list');
+      _versions[id] = ids;
+      return ids;
+    });
+  }
+}
+
+/// A reference from a depending package to a package that it depends on.
+class Dependency {
+  /// The name of the package that has this dependency.
+  final String depender;
+
+  /// The referenced dependent package.
+  final PackageRef ref;
+
+  Dependency(this.depender, this.ref);
+
+  String toString() => '$depender -> $ref';
+}
+
+/// Base class for all failures that can occur while trying to resolve versions.
+class SolveFailure implements Exception {
+  /// The name of the package whose version could not be solved. Will be `null`
+  /// if the failure is not specific to one package.
+  final String package;
+
+  /// The known dependencies on [package] at the time of the failure. Will be
+  /// an empty collection if the failure is not specific to one package.
+  final Iterable<Dependency> dependencies;
+
+  SolveFailure(this.package, Iterable<Dependency> dependencies)
+      : dependencies = dependencies != null ? dependencies : <Dependency>[];
+
+  /// Writes [dependencies] to [buffer] as a bullet list. If [describe] is
+  /// passed, it will be called for each dependency and the result will be
+  /// written next to the dependency.
+  void writeDependencies(StringBuffer buffer,
+      [String describe(PackageRef ref)]) {
+    var map = {};
+    for (var dep in dependencies) {
+      map[dep.depender] = dep.ref;
+    }
+
+    var names = map.keys.toList();
+    names.sort();
+
+    for (var name in names) {
+      buffer.writeln("- '$name' ");
+      if (describe != null) {
+        buffer.writeln(describe(map[name]));
+      } else {
+        buffer.writeln("depends on version ${map[name].constraint}");
+      }
+    }
+  }
+
+  String toString() {
+    if (dependencies.isEmpty) return _message;
+
+    var buffer = new StringBuffer();
+    buffer.writeln("$_message:");
+
+    var map = {};
+    for (var dep in dependencies) {
+      map[dep.depender] = dep.ref;
+    }
+
+    var names = map.keys.toList();
+    names.sort();
+
+    for (var name in names) {
+      buffer.writeln("- '$name' ${_describeDependency(map[name])}");
+    }
+
+    return buffer.toString();
+  }
+
+  /// A message describing the specific kind of solve failure.
+  String get _message;
+
+  /// Describes a dependencie's reference in the output message. Override this
+  /// to highlight which aspect of [ref] led to the failure.
+  String _describeDependency(PackageRef ref) =>
+      "depends on version ${ref.constraint}";
+}
+
+/// Exception thrown when the [VersionSolver] fails to find a solution after a
+/// certain number of iterations.
+class CouldNotSolveException extends SolveFailure {
+  CouldNotSolveException([String message])
+      : super(null, null),
+        _message = (message != null) ? message :
+            "Could not find a solution that met all constraints.";
+
+  /// A message describing the specific kind of solve failure.
+  final String _message;
+}
+
+/// Exception thrown when the [VersionConstraint] used to match a package is
+/// valid (i.e. non-empty), but there are no available versions of the package
+/// that fit that constraint.
+class NoVersionException extends SolveFailure {
+  final VersionConstraint constraint;
+
+  NoVersionException(String package, this.constraint,
+      Iterable<Dependency> dependencies)
+      : super(package, dependencies);
+
+  String get _message => "Package '$package' has no versions that match "
+      "$constraint derived from";
+}
+
+// TODO(rnystrom): Report the list of depending packages and their constraints.
+/// Exception thrown when the most recent version of [package] must be selected,
+/// but doesn't match the [VersionConstraint] imposed on the package.
+class CouldNotUpdateException extends SolveFailure {
+  final VersionConstraint constraint;
+  final Version best;
+
+  CouldNotUpdateException(String package, this.constraint, this.best)
+      : super(package, null);
+
+  String get _message =>
+      "The latest version of '$package', $best, does not match $constraint.";
+}
+
+/// Exception thrown when the [VersionConstraint] used to match a package is
+/// the empty set: in other words, multiple packages depend on it and have
+/// conflicting constraints that have no overlap.
+class DisjointConstraintException extends SolveFailure {
+  DisjointConstraintException(String package, Iterable<Dependency> dependencies)
+      : super(package, dependencies);
+
+  String get _message => "Incompatible version constraints on '$package'";
+}
+
+/// Exception thrown when two packages with the same name but different sources
+/// are depended upon.
+class SourceMismatchException extends SolveFailure {
+
+  SourceMismatchException(String package, Iterable<Dependency> dependencies)
+      : super(package, dependencies);
+
+  String get _message => "Incompatible dependencies on '$package'";
+
+  String _describeDependency(PackageRef ref) =>
+      "depends on it from source ${ref.source}";
+}
+
+/// Exception thrown when two packages with the same name and source but
+/// different descriptions are depended upon.
+class DescriptionMismatchException extends SolveFailure {
+  DescriptionMismatchException(String package,
+      Iterable<Dependency> dependencies)
+      : super(package, dependencies);
+
+  String get _message => "Incompatible dependencies on '$package'";
+
+  String _describeDependency(PackageRef ref) {
+    // TODO(nweiz): Dump descriptions to YAML when that's supported.
+    return "depends on it with description ${json.stringify(ref.description)}";
+  }
+}
diff --git a/utils/pub/source.dart b/utils/pub/source.dart
index b5e5d53..ba2afa4 100644
--- a/utils/pub/source.dart
+++ b/utils/pub/source.dart
@@ -80,7 +80,9 @@
   /// pubspec. There is no default implementation for non-cached sources; they
   /// must implement it manually.
   Future<Pubspec> describe(PackageId id) {
-    if (!shouldCache) throw "Source $name must implement describe(id).";
+    if (!shouldCache) {
+      throw new UnimplementedError("Source $name must implement describe(id).");
+    }
     return installToSystemCache(id).then((package) => package.pubspec);
   }
 
@@ -99,8 +101,8 @@
   /// This doesn't need to be implemented if [installToSystemCache] is
   /// implemented.
   Future<bool> install(PackageId id, String path) {
-    throw "Either install or installToSystemCache must be implemented for "
-        "source $name.";
+    throw new UnimplementedError("Either install or installToSystemCache must "
+        "be implemented for source $name.");
   }
 
   /// Installs the package identified by [id] to the system cache. This is only
@@ -122,7 +124,7 @@
       ensureDir(path.dirname(packageDir));
       return install(id, packageDir);
     }).then((found) {
-      if (!found) throw 'Package $id not found.';
+      if (!found) fail('Package $id not found.');
       return new Package.load(id.name, packageDir, systemCache.sources);
     });
   }
@@ -210,7 +212,9 @@
   
   /// Returns the [Package]s that have been installed in the system cache.
   List<Package> getCachedPackages() {
-    if (shouldCache) throw "Source $name must implement this.";
+    if (shouldCache) {
+      throw new UnimplementedError("Source $name must implement this.");
+    }
   }
 
   /// Returns the source's name.
diff --git a/utils/pub/source_registry.dart b/utils/pub/source_registry.dart
index 6bbcec2..a963e1d 100644
--- a/utils/pub/source_registry.dart
+++ b/utils/pub/source_registry.dart
@@ -21,8 +21,7 @@
   /// registered source.
   void setDefault(String name) {
     if (!_map.containsKey(name)) {
-      // TODO(nweiz): Real error-handling system
-      throw 'Default source $name is not in the registry';
+      throw new StateError('Default source $name is not in the registry');
     }
 
     _default = _map[name];
@@ -32,8 +31,8 @@
   /// that's already been registered.
   void register(Source source) {
     if (_map.containsKey(source.name)) {
-      // TODO(nweiz): Real error-handling system
-      throw 'Source registry already has a source named ${source.name}';
+      throw new StateError('Source registry already has a source named '
+          '${source.name}');
     }
 
     _map[source.name] = source;
@@ -47,10 +46,9 @@
   Source operator[](String name) {
     if (name == null) {
       if (defaultSource != null) return defaultSource;
-      // TODO(nweiz): Real error-handling system
-      throw 'No default source has been registered';
+      throw new StateError('No default source has been registered');
     }
     if (_map.containsKey(name)) return _map[name];
-    throw 'No source named $name is registered';
+    throw new ArgumentError('No source named $name is registered');
   }
 }
diff --git a/utils/pub/utils.dart b/utils/pub/utils.dart
index 5e80e57..36cc371 100644
--- a/utils/pub/utils.dart
+++ b/utils/pub/utils.dart
@@ -7,6 +7,7 @@
 
 import 'dart:async';
 import 'dart:crypto';
+import 'dart:io';
 import 'dart:isolate';
 import 'dart:uri';
 
@@ -358,3 +359,34 @@
     return map;
   });
 }
+
+/// An exception class for exceptions that are intended to be seen by the user.
+/// These exceptions won't have any debugging information printed when they're
+/// thrown.
+class ApplicationException implements Exception {
+  final String message;
+
+  ApplicationException(this.message);
+}
+
+/// Throw a [ApplicationException] with [message].
+void fail(String message) {
+  throw new ApplicationException(message);
+}
+
+/// Returns whether [error] is a user-facing error object. This includes both
+/// [ApplicationException] and any dart:io errors.
+bool isUserFacingException(error) {
+  return error is ApplicationException ||
+    // TODO(nweiz): clean up this branch when issue 9955 is fixed.
+    error is DirectoryIOException ||
+    error is FileIOException ||
+    error is HttpException ||
+    error is HttpParserException ||
+    error is LinkIOException ||
+    error is MimeParserException ||
+    error is OSError ||
+    error is ProcessException ||
+    error is SocketIOException ||
+    error is WebSocketException;
+}
diff --git a/utils/tests/pub/command_line_config.dart b/utils/tests/pub/command_line_config.dart
index 2fbc3cd..9a60951 100644
--- a/utils/tests/pub/command_line_config.dart
+++ b/utils/tests/pub/command_line_config.dart
@@ -153,7 +153,9 @@
 
     if (match == null) {
       match = coreRegExp.firstMatch(text);
-      if (match == null) throw "Couldn't parse stack trace line '$text'.";
+      if (match == null) {
+        throw FormatException("Couldn't parse stack trace line '$text'.");
+      }
       isCore = true;
     }
 
diff --git a/utils/tests/pub/descriptor/tar.dart b/utils/tests/pub/descriptor/tar.dart
index 453793d..c4f1d8f 100644
--- a/utils/tests/pub/descriptor/tar.dart
+++ b/utils/tests/pub/descriptor/tar.dart
@@ -42,7 +42,7 @@
   /// Validates that the `.tar.gz` file at [path] contains the expected
   /// contents.
   Future validate([String parent]) {
-    throw "TODO(nweiz): implement this";
+    throw new UnimplementedError("TODO(nweiz): implement this");
   }
 
   Stream<List<int>> read() {
diff --git a/utils/tests/pub/install/pub_install_test.dart b/utils/tests/pub/install/pub_install_test.dart
index ad2370b..d683378 100644
--- a/utils/tests/pub/install/pub_install_test.dart
+++ b/utils/tests/pub/install/pub_install_test.dart
@@ -54,7 +54,7 @@
     ]).validate();
   });
 
-  integration('does not adds itself to the packages if it has no "lib" directory', () {
+  integration('does not add itself to the packages if it has no "lib" directory', () {
     // The symlink should use the name in the pubspec, not the name of the
     // directory.
     d.dir(appPath, [
@@ -86,6 +86,40 @@
         output: new RegExp(r"Dependencies installed!$"));
   });
 
+  integration('reports a solver failure', () {
+    // myapp depends on foo and bar which both depend on baz with mismatched
+    // descriptions.
+    d.dir('deps', [
+      d.dir('foo', [
+        d.pubspec({"name": "foo", "dependencies": {
+          "baz": {"path": "../baz1"}
+        }})
+      ]),
+      d.dir('bar', [
+        d.pubspec({"name": "bar", "dependencies": {
+          "baz": {"path": "../baz2"}
+        }})
+      ]),
+      d.dir('baz1', [
+        d.libPubspec('baz', '0.0.0')
+      ]),
+      d.dir('baz2', [
+        d.libPubspec('baz', '0.0.0')
+      ])
+    ]).create();
+
+    d.dir(appPath, [
+      d.pubspec({"name": "myapp", "dependencies": {
+        "foo": {"path": "../deps/foo"},
+        "bar": {"path": "../deps/bar"}
+      }})
+    ]).create();
+
+    schedulePub(args: ['install'],
+        error: new RegExp(r"^Incompatible dependencies on 'baz':"),
+        exitCode: 1);
+  });
+
   integration('does not warn if the root package lacks a "lib" directory', () {
     d.dir(appPath, [
       d.appPubspec([])
diff --git a/utils/tests/pub/pub_test.dart b/utils/tests/pub/pub_test.dart
index 7e8e349..36071ba 100644
--- a/utils/tests/pub/pub_test.dart
+++ b/utils/tests/pub/pub_test.dart
@@ -22,9 +22,10 @@
         --[no-]trace      Print debugging information when an error occurs.
         --verbosity       Control output verbosity.
 
-              [all]       All output including internal tracing messages are shown.
-              [io]        IO operations are also shown.
-              [normal]    Errors, warnings, and user messages are shown.
+              [all]       Show all output including internal tracing messages.
+              [io]        Also show IO operations.
+              [normal]    Show errors, warnings, and user messages.
+              [solver]    Show steps during version resolution.
 
     -v, --verbose         Shortcut for "--verbosity=all"
 
diff --git a/utils/tests/pub/sdk_constraint_test.dart b/utils/tests/pub/sdk_constraint_test.dart
deleted file mode 100644
index 7a8c87e..0000000
--- a/utils/tests/pub/sdk_constraint_test.dart
+++ /dev/null
@@ -1,146 +0,0 @@
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library check_sdk_test;
-
-import 'package:scheduled_test/scheduled_test.dart';
-
-import 'descriptor.dart' as d;
-import "test_pub.dart";
-
-main() {
-  initConfig();
-
-  for (var command in ["install", "update"]) {
-    var success = new RegExp(r"Dependencies installed!$");
-    if (command == "update") {
-      success = new RegExp(r"Dependencies updated!$");
-    }
-
-    integration("gives a friendly message if there are no constraints", () {
-      d.dir(appPath, [
-        d.pubspec({"name": "myapp"}),
-      ]).create();
-
-      schedulePub(args: [command], output: success);
-    });
-
-    integration("gives an error if the root package does not match", () {
-      d.dir(appPath, [
-        d.pubspec({
-          "name": "myapp",
-          "environment": {"sdk": ">2.0.0"}
-        })
-      ]).create();
-
-      schedulePub(args: [command],
-          error:
-            """
-            Some packages that were installed are not compatible with your SDK version 0.1.2+3 and may not work:
-            - 'myapp' requires >2.0.0
-
-            You may be able to resolve this by upgrading to the latest Dart SDK
-            or adding a version constraint to use an older version of a package.
-            """);
-    });
-
-    integration("gives an error if some dependencies do not match", () {
-      // Using a path source, but this should be true of all sources.
-      d.dir("foo", [
-        d.libPubspec("foo", "0.0.1", sdk: ">0.1.3"),
-        d.libDir("foo")
-      ]).create();
-      d.dir("bar", [
-        d.libPubspec("bar", "0.0.1", sdk: ">0.1.1"),
-        d.libDir("bar")
-      ]).create();
-
-      d.dir(appPath, [
-        d.pubspec({
-          "name": "myapp",
-          "dependencies": {
-            "foo": {"path": "../foo"},
-            "bar": {"path": "../bar"}
-          },
-          "environment": {"sdk": ">2.0.0"}
-        })
-      ]).create();
-
-      schedulePub(args: [command],
-          error:
-            """
-            Some packages that were installed are not compatible with your SDK version 0.1.2+3 and may not work:
-            - 'myapp' requires >2.0.0
-            - 'foo' requires >0.1.3
-
-            You may be able to resolve this by upgrading to the latest Dart SDK
-            or adding a version constraint to use an older version of a package.
-            """);
-    });
-
-    integration("gives an error if a transitive dependency doesn't match", () {
-      // Using a path source, but this should be true of all sources.
-      d.dir("foo", [
-        d.libPubspec("foo", "0.0.1", deps: [
-          {"path": "../bar"}
-        ]),
-        d.libDir("foo")
-      ]).create();
-      d.dir("bar", [
-        d.libPubspec("bar", "0.0.1", sdk: "<0.1.1"),
-        d.libDir("bar")
-      ]).create();
-
-      d.dir(appPath, [
-        d.pubspec({
-          "name": "myapp",
-          "dependencies": {
-            "foo": {"path": "../foo"}
-          }
-        })
-      ]).create();
-
-      schedulePub(args: [command],
-          error:
-            """
-            Some packages that were installed are not compatible with your SDK version 0.1.2+3 and may not work:
-            - 'bar' requires <0.1.1
-
-            You may be able to resolve this by upgrading to the latest Dart SDK
-            or adding a version constraint to use an older version of a package.
-            """);
-    });
-
-    integration("handles a circular dependency on the root package", () {
-      // Using a path source, but this should be true of all sources.
-      d.dir("foo", [
-        d.libPubspec("foo", "0.0.1", sdk: ">3.0.0", deps: [
-          {"path": "../myapp"}
-        ]),
-        d.libDir("foo")
-      ]).create();
-
-      d.dir(appPath, [
-        d.pubspec({
-          "name": "myapp",
-          "dependencies": {
-            "foo": {"path": "../foo"}
-          },
-          "environment": {"sdk": ">2.0.0"}
-        })
-      ]).create();
-
-      schedulePub(args: [command],
-          error:
-            """
-            Some packages that were installed are not compatible with your SDK version 0.1.2+3 and may not work:
-            - 'myapp' requires >2.0.0
-            - 'foo' requires >3.0.0
-
-            You may be able to resolve this by upgrading to the latest Dart SDK
-            or adding a version constraint to use an older version of a package.
-            """);
-    });
-  }
-}
diff --git a/utils/tests/pub/test_pub.dart b/utils/tests/pub/test_pub.dart
index ba04998..d7fdb1d 100644
--- a/utils/tests/pub/test_pub.dart
+++ b/utils/tests/pub/test_pub.dart
@@ -471,7 +471,7 @@
         source = new PathSource();
         break;
       default:
-        throw 'Unknown source "$sourceName"';
+        throw new Exception('Unknown source "$sourceName"');
       }
 
       result[_packageName(sourceName, dependency[sourceName])] = dependency;
diff --git a/utils/tests/pub/version_solver_test.dart b/utils/tests/pub/version_solver_test.dart
index 845f597..d4d85a6 100644
--- a/utils/tests/pub/version_solver_test.dart
+++ b/utils/tests/pub/version_solver_test.dart
@@ -12,67 +12,35 @@
 import '../../pub/lock_file.dart';
 import '../../pub/package.dart';
 import '../../pub/pubspec.dart';
+import '../../pub/sdk.dart' as sdk;
 import '../../pub/source.dart';
 import '../../pub/source_registry.dart';
 import '../../pub/system_cache.dart';
 import '../../pub/utils.dart';
 import '../../pub/version.dart';
-import '../../pub/version_solver.dart';
+import '../../pub/solver/version_solver.dart';
 import 'test_pub.dart';
 
-Matcher noVersion(List<String> packages) {
-  return predicate((x) {
-    if (x is! NoVersionException) return false;
-
-    // Make sure the error string mentions the conflicting dependers.
-    var message = x.toString();
-    return packages.every((package) => message.contains(package));
-  }, "is a NoVersionException");
-}
-
-Matcher disjointConstraint(List<String> packages) {
-  return predicate((x) {
-    if (x is! DisjointConstraintException) return false;
-
-    // Make sure the error string mentions the conflicting dependers.
-    var message = x.toString();
-    return packages.every((package) => message.contains(package));
-  }, "is a DisjointConstraintException");
-}
-
-Matcher descriptionMismatch(String package1, String package2) {
-  return predicate((x) {
-    if (x is! DescriptionMismatchException) return false;
-
-    // Make sure the error string mentions the conflicting dependers.
-    if (!x.toString().contains(package1)) return false;
-    if (!x.toString().contains(package2)) return false;
-
-    return true;
-  }, "is a DescriptionMismatchException");
-}
-
-final couldNotSolve = predicate((x) => x is CouldNotSolveException,
-    "is a CouldNotSolveException");
-
-Matcher sourceMismatch(String package1, String package2) {
-  return predicate((x) {
-    if (x is! SourceMismatchException) return false;
-
-    // Make sure the error string mentions the conflicting dependers.
-    if (!x.toString().contains(package1)) return false;
-    if (!x.toString().contains(package2)) return false;
-
-    return true;
-  }, "is a SourceMismatchException");
-}
-
 MockSource source1;
 MockSource source2;
 
 main() {
   initConfig();
 
+  // Since this test isn't run from the SDK, it can't find the "version" file
+  // to load. Instead, just manually inject a version.
+  sdk.version = new Version(1, 2, 3);
+
+  group('basic graph', basicGraph);
+  group('with lockfile', withLockFile);
+  group('root dependency', rootDependency);
+  group('dev dependency', devDependency);
+  group('unsolvable', unsolvable);
+  group('backtracking', backtracking);
+  group('SDK constraint', sdkConstraint);
+}
+
+void basicGraph() {
   testResolve('no dependencies', {
     'myapp 0.0.0': {}
   }, result: {
@@ -148,8 +116,26 @@
     'foo': '1.0.1',
     'bar': '1.0.0',
     'bang': '1.0.0'
-  });
+  }, maxTries: 2);
 
+  testResolve('circular dependency', {
+    'myapp 1.0.0': {
+      'foo': '1.0.0'
+    },
+    'foo 1.0.0': {
+      'bar': '1.0.0'
+    },
+    'bar 1.0.0': {
+      'foo': '1.0.0'
+    }
+  }, result: {
+    'myapp from root': '1.0.0',
+    'foo': '1.0.0',
+    'bar': '1.0.0'
+  });
+}
+
+withLockFile() {
   testResolve('with compatible locked dependency', {
     'myapp 0.0.0': {
       'foo': 'any'
@@ -205,23 +191,38 @@
     'bar': '1.0.2'
   });
 
-  testResolve('circular dependency', {
-    'myapp 1.0.0': {
-      'foo': '1.0.0'
+  testResolve('unlocks dependencies if necessary to ensure that a new '
+      'dependency is satisfied', {
+    'myapp 0.0.0': {
+      'foo': 'any',
+      'newdep': 'any'
     },
-    'foo 1.0.0': {
-      'bar': '1.0.0'
-    },
-    'bar 1.0.0': {
-      'foo': '1.0.0'
-    }
-  }, result: {
-    'myapp from root': '1.0.0',
+    'foo 1.0.0': { 'bar': '<2.0.0' },
+    'bar 1.0.0': { 'baz': '<2.0.0' },
+    'baz 1.0.0': { 'qux': '<2.0.0' },
+    'qux 1.0.0': {},
+    'foo 2.0.0': { 'bar': '<3.0.0' },
+    'bar 2.0.0': { 'baz': '<3.0.0' },
+    'baz 2.0.0': { 'qux': '<3.0.0' },
+    'qux 2.0.0': {},
+    'newdep 2.0.0': { 'baz': '>=1.5.0' }
+  }, lockfile: {
     'foo': '1.0.0',
-    'bar': '1.0.0'
-  });
+    'bar': '1.0.0',
+    'baz': '1.0.0',
+    'qux': '1.0.0'
+  }, result: {
+    'myapp from root': '0.0.0',
+    'foo': '2.0.0',
+    'bar': '2.0.0',
+    'baz': '2.0.0',
+    'qux': '1.0.0',
+    'newdep': '2.0.0'
+  }, maxTries: 3);
+}
 
-  testResolve('dependency back onto root package', {
+rootDependency() {
+  testResolve('with root source', {
     'myapp 1.0.0': {
       'foo': '1.0.0'
     },
@@ -233,7 +234,7 @@
     'foo': '1.0.0'
   });
 
-  testResolve('dependency back onto root package with different source', {
+  testResolve('with different source', {
     'myapp 1.0.0': {
       'foo': '1.0.0'
     },
@@ -245,7 +246,7 @@
     'foo': '1.0.0'
   });
 
-  testResolve('mismatched dependencies back onto root package', {
+  testResolve('with mismatched sources', {
     'myapp 1.0.0': {
       'foo': '1.0.0',
       'bar': '1.0.0'
@@ -258,15 +259,59 @@
     }
   }, error: sourceMismatch('foo', 'bar'));
 
-  testResolve('dependency back onto root package with wrong version', {
+  testResolve('with wrong version', {
     'myapp 1.0.0': {
       'foo': '1.0.0'
     },
     'foo 1.0.0': {
       'myapp': '<1.0.0'
     }
-  }, error: disjointConstraint(['foo']));
+  }, error: couldNotSolve);
+}
 
+devDependency() {
+  testResolve("includes root package's dev dependencies", {
+    'myapp 1.0.0': {
+      '(dev) foo': '1.0.0',
+      '(dev) bar': '1.0.0'
+    },
+    'foo 1.0.0': {},
+    'bar 1.0.0': {}
+  }, result: {
+    'myapp from root': '1.0.0',
+    'foo': '1.0.0',
+    'bar': '1.0.0'
+  });
+
+  testResolve("includes dev dependency's transitive dependencies", {
+    'myapp 1.0.0': {
+      '(dev) foo': '1.0.0'
+    },
+    'foo 1.0.0': {
+      'bar': '1.0.0'
+    },
+    'bar 1.0.0': {}
+  }, result: {
+    'myapp from root': '1.0.0',
+    'foo': '1.0.0',
+    'bar': '1.0.0'
+  });
+
+  testResolve("ignores transitive dependency's dev dependencies", {
+    'myapp 1.0.0': {
+      'foo': '1.0.0'
+    },
+    'foo 1.0.0': {
+      '(dev) bar': '1.0.0'
+    },
+    'bar 1.0.0': {}
+  }, result: {
+    'myapp from root': '1.0.0',
+    'foo': '1.0.0'
+  });
+}
+
+unsolvable() {
   testResolve('no version that matches requirement', {
     'myapp 0.0.0': {
       'foo': '>=1.0.0 <2.0.0'
@@ -335,7 +380,28 @@
     'shared 1.0.0 from mock2': {}
   }, error: sourceMismatch('foo', 'bar'));
 
-  testResolve('unstable dependency graph', {
+  testResolve('no valid solution', {
+    'myapp 0.0.0': {
+      'a': 'any',
+      'b': 'any'
+    },
+    'a 1.0.0': {
+      'b': '1.0.0'
+    },
+    'a 2.0.0': {
+      'b': '2.0.0'
+    },
+    'b 1.0.0': {
+      'a': '2.0.0'
+    },
+    'b 2.0.0': {
+      'a': '1.0.0'
+    }
+  }, error: couldNotSolve, maxTries: 4);
+}
+
+backtracking() {
+  testResolve('circular dependency on older version', {
     'myapp 0.0.0': {
       'a': '>=1.0.0'
     },
@@ -346,57 +412,211 @@
     'b 1.0.0': {
       'a': '1.0.0'
     }
-  }, error: couldNotSolve);
+  }, result: {
+    'myapp from root': '0.0.0',
+    'a': '1.0.0'
+  }, maxTries: 2);
 
-  group('dev dependencies', () {
-    testResolve("includes root package's dev dependencies", {
-      'myapp 1.0.0': {
-        '(dev) foo': '1.0.0',
-        '(dev) bar': '1.0.0'
-      },
-      'foo 1.0.0': {},
-      'bar 1.0.0': {}
-    }, result: {
-      'myapp from root': '1.0.0',
-      'foo': '1.0.0',
-      'bar': '1.0.0'
-    });
+  // The latest versions of a and b disagree on c. An older version of either
+  // will resolve the problem. This test validates that b, which is farther
+  // in the dependency graph from myapp is downgraded first.
+  testResolve('rolls back leaf versions first', {
+    'myapp 0.0.0': {
+      'a': 'any'
+    },
+    'a 1.0.0': {
+      'b': 'any'
+    },
+    'a 2.0.0': {
+      'b': 'any',
+      'c': '2.0.0'
+    },
+    'b 1.0.0': {},
+    'b 2.0.0': {
+      'c': '1.0.0'
+    },
+    'c 1.0.0': {},
+    'c 2.0.0': {}
+  }, result: {
+    'myapp from root': '0.0.0',
+    'a': '2.0.0',
+    'b': '1.0.0',
+    'c': '2.0.0'
+  }, maxTries: 2);
 
-    testResolve("includes dev dependency's transitive dependencies", {
-      'myapp 1.0.0': {
-        '(dev) foo': '1.0.0'
-      },
-      'foo 1.0.0': {
-        'bar': '1.0.0'
-      },
-      'bar 1.0.0': {}
-    }, result: {
-      'myapp from root': '1.0.0',
-      'foo': '1.0.0',
-      'bar': '1.0.0'
-    });
+  // Only one version of baz, so foo and bar will have to downgrade until they
+  // reach it.
+  testResolve('simple transitive', {
+    'myapp 0.0.0': {'foo': 'any'},
+    'foo 1.0.0': {'bar': '1.0.0'},
+    'foo 2.0.0': {'bar': '2.0.0'},
+    'foo 3.0.0': {'bar': '3.0.0'},
+    'bar 1.0.0': {'baz': 'any'},
+    'bar 2.0.0': {'baz': '2.0.0'},
+    'bar 3.0.0': {'baz': '3.0.0'},
+    'baz 1.0.0': {}
+  }, result: {
+    'myapp from root': '0.0.0',
+    'foo': '1.0.0',
+    'bar': '1.0.0',
+    'baz': '1.0.0'
+  }, maxTries: 3);
 
-    testResolve("ignores transitive dependency's dev dependencies", {
-      'myapp 1.0.0': {
-        'foo': '1.0.0'
-      },
-      'foo 1.0.0': {
-        '(dev) bar': '1.0.0'
-      },
-      'bar 1.0.0': {}
-    }, result: {
-      'myapp from root': '1.0.0',
-      'foo': '1.0.0'
-    });
-  });
+  // This ensures it doesn't exhaustively search all versions of b when it's
+  // a-2.0.0 whose dependency on c-2.0.0-nonexistent led to the problem. We
+  // make sure b has more versions than a so that the solver tries a first
+  // since it sorts sibling dependencies by number of versions.
+  testResolve('backjump to nearer unsatisfied package', {
+    'myapp 0.0.0': {
+      'a': 'any',
+      'b': 'any'
+    },
+    'a 1.0.0': { 'c': '1.0.0' },
+    'a 2.0.0': { 'c': '2.0.0-nonexistent' },
+    'b 1.0.0': {},
+    'b 2.0.0': {},
+    'b 3.0.0': {},
+    'c 1.0.0': {},
+  }, result: {
+    'myapp from root': '0.0.0',
+    'a': '1.0.0',
+    'b': '3.0.0',
+    'c': '1.0.0'
+  }, maxTries: 2);
+
+  // Dependencies are ordered so that packages with fewer versions are tried
+  // first. Here, there are two valid solutions (either a or b must be
+  // downgraded once). The chosen one depends on which dep is traversed first.
+  // Since b has fewer versions, it will be traversed first, which means a will
+  // come later. Since later selections are revised first, a gets downgraded.
+  testResolve('traverse into package with fewer versions first', {
+    'myapp 0.0.0': {
+      'a': 'any',
+      'b': 'any'
+    },
+    'a 1.0.0': {'c': 'any'},
+    'a 2.0.0': {'c': 'any'},
+    'a 3.0.0': {'c': 'any'},
+    'a 4.0.0': {'c': 'any'},
+    'a 5.0.0': {'c': '1.0.0'},
+    'b 1.0.0': {'c': 'any'},
+    'b 2.0.0': {'c': 'any'},
+    'b 3.0.0': {'c': 'any'},
+    'b 4.0.0': {'c': '2.0.0'},
+    'c 1.0.0': {},
+    'c 2.0.0': {},
+  }, result: {
+    'myapp from root': '0.0.0',
+    'a': '4.0.0',
+    'b': '4.0.0',
+    'c': '2.0.0'
+  }, maxTries: 2);
+
+  // This sets up a hundred versions of foo and bar, 0.0.0 through 9.9.0. Each
+  // version of foo depends on a baz with the same major version. Each version
+  // of bar depends on a baz with the same minor version. There is only one
+  // version of baz, 0.0.0, so only older versions of foo and bar will
+  // satisfy it.
+  var map = {
+    'myapp 0.0.0': {
+      'foo': 'any',
+      'bar': 'any'
+    },
+    'baz 0.0.0': {}
+  };
+
+  for (var i = 0; i < 10; i++) {
+    for (var j = 0; j < 10; j++) {
+      map['foo $i.$j.0'] = {'baz': '$i.0.0'};
+      map['bar $i.$j.0'] = {'baz': '0.$j.0'};
+    }
+  }
+
+  testResolve('complex backtrack', map, result: {
+    'myapp from root': '0.0.0',
+    'foo': '0.9.0',
+    'bar': '9.0.0',
+    'baz': '0.0.0'
+  }, maxTries: 100);
+
+  // TODO(rnystrom): More tests. In particular:
+  // - Tests that demonstrate backtracking for every case that can cause a
+  //   solution to fail (no versions, disjoint, etc.)
+  // - Tests where there are multiple valid solutions and "best" is possibly
+  //   ambiguous to nail down which order the backtracker tries solutions.
 }
 
-// TODO(rnystrom): More stuff to test:
-// - Depending on a non-existent package.
-// - Test that only a certain number requests are sent to the mock source so we
-//   can keep track of server traffic.
+sdkConstraint() {
+  var badVersion = '0.0.0-nope';
+  var goodVersion = sdk.version.toString();
 
-testResolve(description, packages, {lockfile, result, Matcher error}) {
+  testResolve('root matches SDK', {
+    'myapp 0.0.0': {'sdk': goodVersion }
+  }, result: {
+    'myapp from root': '0.0.0'
+  });
+
+  testResolve('root does not match SDK', {
+    'myapp 0.0.0': {'sdk': badVersion }
+  }, error: couldNotSolve);
+
+  testResolve('dependency does not match SDK', {
+    'myapp 0.0.0': {'foo': 'any'},
+    'foo 0.0.0': {'sdk': badVersion }
+  }, error: couldNotSolve);
+
+  testResolve('transitive dependency does not match SDK', {
+    'myapp 0.0.0': {'foo': 'any'},
+    'foo 0.0.0': {'bar': 'any'},
+    'bar 0.0.0': {'sdk': badVersion }
+  }, error: couldNotSolve);
+
+  testResolve('selects a dependency version that allows the SDK', {
+    'myapp 0.0.0': {'foo': 'any'},
+    'foo 1.0.0': {'sdk': goodVersion },
+    'foo 2.0.0': {'sdk': goodVersion },
+    'foo 3.0.0': {'sdk': badVersion },
+    'foo 4.0.0': {'sdk': badVersion }
+  }, result: {
+    'myapp from root': '0.0.0',
+    'foo': '2.0.0'
+  }, maxTries: 3);
+
+  testResolve('selects a transitive dependency version that allows the SDK', {
+    'myapp 0.0.0': {'foo': 'any'},
+    'foo 1.0.0': {'bar': 'any'},
+    'bar 1.0.0': {'sdk': goodVersion },
+    'bar 2.0.0': {'sdk': goodVersion },
+    'bar 3.0.0': {'sdk': badVersion },
+    'bar 4.0.0': {'sdk': badVersion }
+  }, result: {
+    'myapp from root': '0.0.0',
+    'foo': '1.0.0',
+    'bar': '2.0.0'
+  }, maxTries: 3);
+
+  testResolve('selects a dependency version that allows a transitive '
+              'dependency that allows the SDK', {
+    'myapp 0.0.0': {'foo': 'any'},
+    'foo 1.0.0': {'bar': '1.0.0'},
+    'foo 2.0.0': {'bar': '2.0.0'},
+    'foo 3.0.0': {'bar': '3.0.0'},
+    'foo 4.0.0': {'bar': '4.0.0'},
+    'bar 1.0.0': {'sdk': goodVersion },
+    'bar 2.0.0': {'sdk': goodVersion },
+    'bar 3.0.0': {'sdk': badVersion },
+    'bar 4.0.0': {'sdk': badVersion }
+  }, result: {
+    'myapp from root': '0.0.0',
+    'foo': '2.0.0',
+    'bar': '2.0.0'
+  }, maxTries: 3);
+}
+
+testResolve(description, packages,
+            {lockfile, result, FailMatcherBuilder error, int maxTries}) {
+  if (maxTries == null) maxTries = 1;
+
   test(description, () {
     var cache = new SystemCache('.');
     source1 = new MockSource('mock1');
@@ -413,14 +633,14 @@
         var name = parts[0];
         var version = parts[1];
 
-        var package = source1.mockPackage(name, version, dependencies);
+        var package = mockPackage(name, version, dependencies);
         if (name == 'myapp') {
           // Don't add the root package to the server, so we can verify that Pub
           // doesn't try to look up information about the local package on the
           // remote server.
           root = package;
         } else {
-          source.addPackage(package);
+          source.addPackage(name, package);
         }
       });
     });
@@ -447,23 +667,182 @@
     }
 
     // Resolve the versions.
-    var future = resolveVersions(cache.sources, root, realLockFile);
+    var future = resolveVersions(cache.sources, root,
+        lockFile: realLockFile);
 
+    var matcher;
     if (result != null) {
-      expect(future, completion(predicate((actualResult) {
-        for (var actualId in actualResult) {
-          if (!result.containsKey(actualId.name)) return false;
-          var expectedId = result.remove(actualId.name);
-          if (actualId != expectedId) return false;
-        }
-        return result.isEmpty;
-      }, 'packages to match $result')));
+      matcher = new SolveSuccessMatcher(result, maxTries);
     } else if (error != null) {
-      expect(future, throwsA(error));
+      matcher = error(maxTries);
     }
+
+    expect(future, completion(matcher));
   });
 }
 
+typedef SolveFailMatcher FailMatcherBuilder(int maxTries);
+
+FailMatcherBuilder noVersion(List<String> packages) {
+  return (maxTries) => new SolveFailMatcher(packages, maxTries,
+      NoVersionException);
+}
+
+FailMatcherBuilder disjointConstraint(List<String> packages) {
+  return (maxTries) => new SolveFailMatcher(packages, maxTries,
+      DisjointConstraintException);
+}
+
+FailMatcherBuilder descriptionMismatch(String package1, String package2) {
+  return (maxTries) => new SolveFailMatcher([package1, package2], maxTries,
+      DescriptionMismatchException);
+}
+
+// If no solution can be found, the solver just reports the last failure that
+// happened during propagation. Since we don't specify the order that solutions
+// are tried, this just validates that *some* failure occurred, but not which.
+SolveFailMatcher couldNotSolve(maxTries) =>
+    new SolveFailMatcher([], maxTries, null);
+
+FailMatcherBuilder sourceMismatch(String package1, String package2) {
+  return (maxTries) => new SolveFailMatcher([package1, package2], maxTries,
+      SourceMismatchException);
+}
+
+class SolveSuccessMatcher implements Matcher {
+  /// The expected concrete package selections.
+  final Map<String, PackageId> _expected;
+
+  /// The maximum number of attempts that should have been tried before finding
+  /// the solution.
+  final int _maxTries;
+
+  SolveSuccessMatcher(this._expected, this._maxTries);
+
+  Description describe(Description description) {
+    return description.add(
+        'Solver to use at most $_maxTries attempts to find:\n'
+        '${_listPackages(_expected.values)}');
+  }
+
+  Description describeMismatch(SolveResult result,
+                               Description description,
+                               MatchState state, bool verbose) {
+    if (!result.succeeded) {
+      description.add('Solver failed with:\n${result.error}');
+      return;
+    }
+
+    description.add('Resolved:\n${_listPackages(result.packages)}\n');
+    description.add(state.state);
+    return description;
+  }
+
+  bool matches(SolveResult result, MatchState state) {
+    if (!result.succeeded) return false;
+
+    var expected = new Map.from(_expected);
+    var failures = new StringBuffer();
+
+    for (var id in result.packages) {
+      if (!expected.containsKey(id.name)) {
+        failures.writeln('Should not have selected $id');
+      } else {
+        var expectedId = expected.remove(id.name);
+        if (id != expectedId) {
+          failures.writeln('Expected $expectedId, not $id');
+        }
+      }
+    }
+
+    if (!expected.isEmpty) {
+      failures.writeln('Missing:\n${_listPackages(expected.values)}');
+    }
+
+    // Allow 1 here because the greedy solver will only make one attempt.
+    if (result.attemptedSolutions != 1 &&
+        result.attemptedSolutions != _maxTries) {
+      failures.writeln('Took ${result.attemptedSolutions} attempts');
+    }
+
+    if (!failures.isEmpty) {
+      state.state = failures.toString();
+      return false;
+    }
+
+    return true;
+  }
+
+  String _listPackages(Iterable<PackageId> packages) {
+    return '- ${packages.join('\n- ')}';
+  }
+}
+
+class SolveFailMatcher implements Matcher {
+  /// The strings that should appear in the resulting error message.
+  // TODO(rnystrom): This seems to always be package names. Make that explicit.
+  final Iterable<String> _expected;
+
+  /// The maximum number of attempts that should be tried before failing.
+  final int _maxTries;
+
+  /// The concrete error type that should be found, or `null` if any
+  /// [SolveFailure] is allowed.
+  final Type _expectedType;
+
+  SolveFailMatcher(this._expected, this._maxTries, this._expectedType);
+
+  Description describe(Description description) {
+    description.add('Solver should fail after at most $_maxTries attempts.');
+    if (!_expected.isEmpty) {
+      var textList = _expected.map((s) => '"$s"').join(", ");
+      description.add(' The error should contain $textList.');
+    }
+    return description;
+  }
+
+  Description describeMismatch(SolveResult result,
+                               Description description,
+                               MatchState state, bool verbose) {
+    description.add(state.state);
+    return description;
+  }
+
+  bool matches(SolveResult result, MatchState state) {
+    var failures = new StringBuffer();
+
+    if (result.succeeded) {
+      failures.writeln('Solver succeeded');
+    } else {
+      if (_expectedType != null && result.error.runtimeType != _expectedType) {
+        failures.writeln('Should have error type $_expectedType, got '
+            '${result.error.runtimeType}');
+      }
+
+      var message = result.error.toString();
+      for (var expected in _expected) {
+        if (!message.contains(expected)) {
+          failures.writeln(
+              'Expected error to contain "$expected", got:\n$message');
+        }
+      }
+
+      // Allow 1 here because the greedy solver will only make one attempt.
+      if (result.attemptedSolutions != 1 &&
+          result.attemptedSolutions != _maxTries) {
+        failures.writeln('Took ${result.attemptedSolutions} attempts');
+      }
+    }
+
+    if (!failures.isEmpty) {
+      state.state = failures.toString();
+      return false;
+    }
+
+    return true;
+  }
+}
+
 /// A source used for testing. This both creates mock package objects and acts
 /// as a source for them.
 ///
@@ -472,56 +851,99 @@
 /// string and stripping off any trailing hyphen followed by non-hyphen
 /// characters.
 class MockSource extends Source {
-  final Map<String, Map<Version, Package>> _packages;
+  final _packages = <String, Map<Version, Package>>{};
+
+  /// Keeps track of which package version lists have been requested. Ensures
+  /// that a source is only hit once for a given package and that pub
+  /// internally caches the results.
+  final _requestedVersions = new Set<String>();
+
+  /// Keeps track of which package pubspecs have been requested. Ensures that a
+  /// source is only hit once for a given package and that pub internally
+  /// caches the results.
+  final _requestedPubspecs = new Map<String, Set<Version>>();
 
   final String name;
   bool get shouldCache => true;
 
-  MockSource(this.name)
-      : _packages = <String, Map<Version, Package>>{};
+  MockSource(this.name);
 
   Future<List<Version>> getVersions(String name, String description) {
-    return new Future.sync(() => _packages[description].keys.toList());
+    return new Future.sync(() {
+      // Make sure the solver doesn't request the same thing twice.
+      if (_requestedVersions.contains(description)) {
+        throw new Exception('Version list for $description was already '
+            'requested.');
+      }
+
+      _requestedVersions.add(description);
+
+      if (!_packages.containsKey(description)){
+        throw new Exception('MockSource does not have a package matching '
+            '"$description".');
+      }
+      return _packages[description].keys.toList();
+    });
   }
 
   Future<Pubspec> describe(PackageId id) {
-    return new Future.sync(() => _packages[id.name][id.version].pubspec);
+    return new Future.sync(() {
+      // Make sure the solver doesn't request the same thing twice.
+      if (_requestedPubspecs.containsKey(id.description) &&
+          _requestedPubspecs[id.description].contains(id.version)) {
+        throw new Exception('Pubspec for $id was already requested.');
+      }
+
+      _requestedPubspecs.putIfAbsent(id.description, () => new Set<Version>());
+      _requestedPubspecs[id.description].add(id.version);
+
+      return _packages[id.description][id.version].pubspec;
+    });
   }
 
   Future<bool> install(PackageId id, String path) {
-    throw 'no';
+    throw new Exception('no');
   }
 
-  Package mockPackage(String description, String version,
-      Map dependencyStrings) {
-    // Build the pubspec dependencies.
-    var dependencies = <PackageRef>[];
-    var devDependencies = <PackageRef>[];
+  void addPackage(String description, Package package) {
+    _packages.putIfAbsent(description, () => new Map<Version, Package>());
+    _packages[description][package.version] = package;
+  }
+}
 
-    dependencyStrings.forEach((name, constraint) {
-      parseSource(name, (isDev, name, source) {
-        var packageName = name.replaceFirst(new RegExp(r"-[^-]+$"), "");
-        var ref = new PackageRef(packageName, source,
-            new VersionConstraint.parse(constraint), name);
+Package mockPackage(String description, String version,
+                    Map dependencyStrings) {
+  var sdkConstraint = null;
 
-        if (isDev) {
-          devDependencies.add(ref);
-        } else {
-          dependencies.add(ref);
-        }
-      });
+  // Build the pubspec dependencies.
+  var dependencies = <PackageRef>[];
+  var devDependencies = <PackageRef>[];
+
+  dependencyStrings.forEach((name, constraint) {
+    parseSource(name, (isDev, name, source) {
+      var packageName = name.replaceFirst(new RegExp(r"-[^-]+$"), "");
+      constraint = new VersionConstraint.parse(constraint);
+
+      if (name == 'sdk') {
+        sdkConstraint = constraint;
+        return;
+      }
+
+      var ref = new PackageRef(packageName, source, constraint, name);
+
+      if (isDev) {
+        devDependencies.add(ref);
+      } else {
+        dependencies.add(ref);
+      }
     });
+  });
 
-    var pubspec = new Pubspec(
-        description, new Version.parse(version), dependencies, devDependencies,
-        new PubspecEnvironment());
-    return new Package.inMemory(pubspec);
-  }
-
-  void addPackage(Package package) {
-    _packages.putIfAbsent(package.name, () => new Map<Version, Package>());
-    _packages[package.name][package.version] = package;
-  }
+  var name = description.replaceFirst(new RegExp(r"-[^-]+$"), "");
+  var pubspec = new Pubspec(
+      name, new Version.parse(version), dependencies, devDependencies,
+      new PubspecEnvironment(sdkConstraint));
+  return new Package.inMemory(pubspec);
 }
 
 void parseSource(String description,