Version 0.5.2.0 .

svn merge -r 22069:22191 https://dart.googlecode.com/svn/branches/bleeding_edge trunk

git-svn-id: http://dart.googlecode.com/svn/trunk@22194 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/pkg/analyzer_experimental/lib/src/generated/ast.dart b/pkg/analyzer_experimental/lib/src/generated/ast.dart
index 6f7fd37..044f2fb 100644
--- a/pkg/analyzer_experimental/lib/src/generated/ast.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/ast.dart
@@ -1478,7 +1478,7 @@
  * cascadeSection ::=
  * '..'  (cascadeSelector arguments*) (assignableSelector arguments*)* (assignmentOperator expressionWithoutCascade)?
  * cascadeSelector ::=
- * '[ ' expression '] '
+ * '\[ ' expression '\] '
  * | identifier
  * </pre>
  * @coverage dart.engine.ast
@@ -1960,7 +1960,7 @@
     this._withClause = becomeParentOf(withClause2);
   }
   void visitChildren(ASTVisitor<Object> visitor) {
-    safelyVisitChild(documentationComment, visitor);
+    super.visitChildren(visitor);
     safelyVisitChild(_name, visitor);
     safelyVisitChild(_typeParameters, visitor);
     safelyVisitChild(_extendsClause, visitor);
@@ -2349,7 +2349,7 @@
  * found within a documentation comment.
  * <pre>
  * commentReference ::=
- * '[' 'new'? {@link Identifier identifier} ']'
+ * '\[' 'new'? {@link Identifier identifier} '\]'
  * </pre>
  * @coverage dart.engine.ast
  */
@@ -5003,7 +5003,7 @@
  * optionalPositionalFormalParameters
  * | namedFormalParameters
  * optionalPositionalFormalParameters ::=
- * '[' {@link DefaultFormalParameter positionalFormalParameter} (',' {@link DefaultFormalParameter positionalFormalParameter})* ']'
+ * '\[' {@link DefaultFormalParameter positionalFormalParameter} (',' {@link DefaultFormalParameter positionalFormalParameter})* '\]'
  * namedFormalParameters ::=
  * '{' {@link DefaultFormalParameter namedFormalParameter} (',' {@link DefaultFormalParameter namedFormalParameter})* '}'
  * </pre>
@@ -5019,11 +5019,11 @@
    */
   NodeList<FormalParameter> _parameters;
   /**
-   * The left square bracket ('[') or left curly brace ('{') introducing the optional parameters.
+   * The left square bracket ('\[') or left curly brace ('{') introducing the optional parameters.
    */
   Token _leftDelimiter;
   /**
-   * The right square bracket (']') or right curly brace ('}') introducing the optional parameters.
+   * The right square bracket ('\]') or right curly brace ('}') introducing the optional parameters.
    */
   Token _rightDelimiter;
   /**
@@ -5072,9 +5072,9 @@
   }
   Token get endToken => _rightParenthesis;
   /**
-   * Return the left square bracket ('[') or left curly brace ('{') introducing the optional
+   * Return the left square bracket ('\[') or left curly brace ('{') introducing the optional
    * parameters.
-   * @return the left square bracket ('[') or left curly brace ('{') introducing the optional
+   * @return the left square bracket ('\[') or left curly brace ('{') introducing the optional
    * parameters
    */
   Token get leftDelimiter => _leftDelimiter;
@@ -5089,9 +5089,9 @@
    */
   NodeList<FormalParameter> get parameters => _parameters;
   /**
-   * Return the right square bracket (']') or right curly brace ('}') introducing the optional
+   * Return the right square bracket ('\]') or right curly brace ('}') introducing the optional
    * parameters.
-   * @return the right square bracket (']') or right curly brace ('}') introducing the optional
+   * @return the right square bracket ('\]') or right curly brace ('}') introducing the optional
    * parameters
    */
   Token get rightDelimiter => _rightDelimiter;
@@ -5101,7 +5101,7 @@
    */
   Token get rightParenthesis => _rightParenthesis;
   /**
-   * Set the left square bracket ('[') or left curly brace ('{') introducing the optional parameters
+   * Set the left square bracket ('\[') or left curly brace ('{') introducing the optional parameters
    * to the given token.
    * @param bracket the left delimiter introducing the optional parameters
    */
@@ -5116,7 +5116,7 @@
     _leftParenthesis = parenthesis;
   }
   /**
-   * Set the right square bracket (']') or right curly brace ('}') introducing the optional
+   * Set the right square bracket ('\]') or right curly brace ('}') introducing the optional
    * parameters to the given token.
    * @param bracket the right delimiter introducing the optional parameters
    */
@@ -5234,6 +5234,16 @@
    */
   TypeName get returnType => _returnType;
   /**
+   * Return {@code true} if this function declares a getter.
+   * @return {@code true} if this function declares a getter
+   */
+  bool isGetter() => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.GET);
+  /**
+   * Return {@code true} if this function declares a setter.
+   * @return {@code true} if this function declares a setter
+   */
+  bool isSetter() => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.SET);
+  /**
    * Set the token representing the 'external' keyword to the given token.
    * @param externalKeyword the token representing the 'external' keyword
    */
@@ -6079,7 +6089,7 @@
 /**
  * Instances of the class {@code IndexExpression} represent an index expression.
  * <pre>
- * indexExpression ::={@link Expression target} '[' {@link Expression index} ']'
+ * indexExpression ::={@link Expression target} '\[' {@link Expression index} '\]'
  * </pre>
  * @coverage dart.engine.ast
  */
@@ -6228,7 +6238,7 @@
    * <p>
    * Note that {@link #inGetterContext()} and {@link #inSetterContext()} are not opposites, nor are
    * they mutually exclusive. In other words, it is possible for both methods to return {@code true}when invoked on the same node.
-   * @return {@code true} if this expression is in a context where the operator '[]' will be invoked
+   * @return {@code true} if this expression is in a context where the operator '\[\]' will be invoked
    */
   bool inGetterContext() {
     ASTNode parent2 = parent;
@@ -6245,7 +6255,7 @@
    * <p>
    * Note that {@link #inGetterContext()} and {@link #inSetterContext()} are not opposites, nor are
    * they mutually exclusive. In other words, it is possible for both methods to return {@code true}when invoked on the same node.
-   * @return {@code true} if this expression is in a context where the operator '[]=' will be
+   * @return {@code true} if this expression is in a context where the operator '\[\]=' will be
    * invoked
    */
   bool inSetterContext() {
@@ -7015,7 +7025,7 @@
  * Instances of the class {@code ListLiteral} represent a list literal.
  * <pre>
  * listLiteral ::=
- * 'const'? ('<' {@link TypeName type} '>')? '[' ({@link Expression expressionList} ','?)? ']'
+ * 'const'? ('<' {@link TypeName type} '>')? '\[' ({@link Expression expressionList} ','?)? '\]'
  * </pre>
  * @coverage dart.engine.ast
  */
@@ -11483,7 +11493,24 @@
   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 visitIdentifier(Identifier node) {
+    ASTNode parent2 = node.parent;
+    if (parent2 is ConstructorDeclaration) {
+      ConstructorDeclaration decl = parent2 as ConstructorDeclaration;
+      Identifier returnType2 = decl.returnType;
+      if (identical(returnType2, node)) {
+        SimpleIdentifier name2 = decl.name;
+        if (name2 != null) {
+          return name2.element;
+        }
+        Element element2 = node.element;
+        if (element2 is ClassElement) {
+          return ((element2 as ClassElement)).unnamedConstructor;
+        }
+      }
+    }
+    return node.element;
+  }
   Element visitImportDirective(ImportDirective node) => node.element;
   Element visitIndexExpression(IndexExpression node) => node.element;
   Element visitInstanceCreationExpression(InstanceCreationExpression node) => node.element;
@@ -13096,134 +13123,134 @@
  * 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));
+  AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => new AdjacentStrings.full(clone3(node.strings));
+  Annotation visitAnnotation(Annotation node) => new Annotation.full(node.atSign, clone2(node.name), node.period, clone2(node.constructorName), clone2(node.arguments));
+  ArgumentDefinitionTest visitArgumentDefinitionTest(ArgumentDefinitionTest node) => new ArgumentDefinitionTest.full(node.question, clone2(node.identifier));
+  ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList.full(node.leftParenthesis, clone3(node.arguments), node.rightParenthesis);
+  AsExpression visitAsExpression(AsExpression node) => new AsExpression.full(clone2(node.expression), node.asOperator, clone2(node.type));
+  ASTNode visitAssertStatement(AssertStatement node) => new AssertStatement.full(node.keyword, node.leftParenthesis, clone2(node.condition), node.rightParenthesis, node.semicolon);
+  AssignmentExpression visitAssignmentExpression(AssignmentExpression node) => new AssignmentExpression.full(clone2(node.leftHandSide), node.operator, clone2(node.rightHandSide));
+  BinaryExpression visitBinaryExpression(BinaryExpression node) => new BinaryExpression.full(clone2(node.leftOperand), node.operator, clone2(node.rightOperand));
+  Block visitBlock(Block node) => new Block.full(node.leftBracket, clone3(node.statements), node.rightBracket);
+  BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockFunctionBody.full(clone2(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);
+  BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement.full(node.keyword, clone2(node.label), node.semicolon);
+  CascadeExpression visitCascadeExpression(CascadeExpression node) => new CascadeExpression.full(clone2(node.target), clone3(node.cascadeSections));
+  CatchClause visitCatchClause(CatchClause node) => new CatchClause.full(node.onKeyword, clone2(node.exceptionType), node.catchKeyword, node.leftParenthesis, clone2(node.exceptionParameter), node.comma, clone2(node.stackTraceParameter), node.rightParenthesis, clone2(node.body));
+  ClassDeclaration visitClassDeclaration(ClassDeclaration node) => new ClassDeclaration.full(clone2(node.documentationComment), clone3(node.metadata), node.abstractKeyword, node.classKeyword, clone2(node.name), clone2(node.typeParameters), clone2(node.extendsClause), clone2(node.withClause), clone2(node.implementsClause), node.leftBracket, clone3(node.members), node.rightBracket);
+  ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias.full(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clone2(node.name), clone2(node.typeParameters), node.equals, node.abstractKeyword, clone2(node.superclass), clone2(node.withClause), clone2(node.implementsClause), node.semicolon);
   Comment visitComment(Comment node) {
     if (node.isDocumentation()) {
-      return Comment.createDocumentationComment2(node.tokens, clone2(node.references));
+      return Comment.createDocumentationComment2(node.tokens, clone3(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));
+  CommentReference visitCommentReference(CommentReference node) => new CommentReference.full(node.newKeyword, clone2(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;
+    CompilationUnit clone = new CompilationUnit.full(node.beginToken, clone2(node.scriptTag), clone3(node.directives), clone3(node.declarations), node.endToken);
+    clone.lineInfo = node.lineInfo;
+    clone.parsingErrors = node.parsingErrors;
+    clone.resolutionErrors = node.resolutionErrors;
+    return clone;
   }
-  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);
+  ConditionalExpression visitConditionalExpression(ConditionalExpression node) => new ConditionalExpression.full(clone2(node.condition), node.question, clone2(node.thenExpression), node.colon, clone2(node.elseExpression));
+  ConstructorDeclaration visitConstructorDeclaration(ConstructorDeclaration node) => new ConstructorDeclaration.full(clone2(node.documentationComment), clone3(node.metadata), node.externalKeyword, node.constKeyword, node.factoryKeyword, clone2(node.returnType), node.period, clone2(node.name), clone2(node.parameters), node.separator, clone3(node.initializers), clone2(node.redirectedConstructor), clone2(node.body));
+  ConstructorFieldInitializer visitConstructorFieldInitializer(ConstructorFieldInitializer node) => new ConstructorFieldInitializer.full(node.keyword, node.period, clone2(node.fieldName), node.equals, clone2(node.expression));
+  ConstructorName visitConstructorName(ConstructorName node) => new ConstructorName.full(clone2(node.type), node.period, clone2(node.name));
+  ContinueStatement visitContinueStatement(ContinueStatement node) => new ContinueStatement.full(node.keyword, clone2(node.label), node.semicolon);
+  DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => new DeclaredIdentifier.full(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clone2(node.type), clone2(node.identifier));
+  DefaultFormalParameter visitDefaultFormalParameter(DefaultFormalParameter node) => new DefaultFormalParameter.full(clone2(node.parameter), node.kind, node.separator, clone2(node.defaultValue));
+  DoStatement visitDoStatement(DoStatement node) => new DoStatement.full(node.doKeyword, clone2(node.body), node.whileKeyword, node.leftParenthesis, clone2(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);
+  ExportDirective visitExportDirective(ExportDirective node) => new ExportDirective.full(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clone2(node.uri), clone3(node.combinators), node.semicolon);
+  ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node) => new ExpressionFunctionBody.full(node.functionDefinition, clone2(node.expression), node.semicolon);
+  ExpressionStatement visitExpressionStatement(ExpressionStatement node) => new ExpressionStatement.full(clone2(node.expression), node.semicolon);
+  ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause.full(node.keyword, clone2(node.superclass));
+  FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => new FieldDeclaration.full(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clone2(node.fields), node.semicolon);
+  FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => new FieldFormalParameter.full(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clone2(node.type), node.thisToken, node.period, clone2(node.identifier));
+  ForEachStatement visitForEachStatement(ForEachStatement node) => new ForEachStatement.full(node.forKeyword, node.leftParenthesis, clone2(node.loopVariable), node.inKeyword, clone2(node.iterator), node.rightParenthesis, clone2(node.body));
+  FormalParameterList visitFormalParameterList(FormalParameterList node) => new FormalParameterList.full(node.leftParenthesis, clone3(node.parameters), node.leftDelimiter, node.rightDelimiter, node.rightParenthesis);
+  ForStatement visitForStatement(ForStatement node) => new ForStatement.full(node.forKeyword, node.leftParenthesis, clone2(node.variables), clone2(node.initialization), node.leftSeparator, clone2(node.condition), node.rightSeparator, clone3(node.updaters), node.rightParenthesis, clone2(node.body));
+  FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => new FunctionDeclaration.full(clone2(node.documentationComment), clone3(node.metadata), node.externalKeyword, clone2(node.returnType), node.propertyKeyword, clone2(node.name), clone2(node.functionExpression));
+  FunctionDeclarationStatement visitFunctionDeclarationStatement(FunctionDeclarationStatement node) => new FunctionDeclarationStatement.full(clone2(node.functionDeclaration));
+  FunctionExpression visitFunctionExpression(FunctionExpression node) => new FunctionExpression.full(clone2(node.parameters), clone2(node.body));
+  FunctionExpressionInvocation visitFunctionExpressionInvocation(FunctionExpressionInvocation node) => new FunctionExpressionInvocation.full(clone2(node.function), clone2(node.argumentList));
+  FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => new FunctionTypeAlias.full(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clone2(node.returnType), clone2(node.name), clone2(node.typeParameters), clone2(node.parameters), node.semicolon);
+  FunctionTypedFormalParameter visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) => new FunctionTypedFormalParameter.full(clone2(node.documentationComment), clone3(node.metadata), clone2(node.returnType), clone2(node.identifier), clone2(node.parameters));
+  HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator.full(node.keyword, clone3(node.hiddenNames));
+  IfStatement visitIfStatement(IfStatement node) => new IfStatement.full(node.ifKeyword, node.leftParenthesis, clone2(node.condition), node.rightParenthesis, clone2(node.thenStatement), node.elseKeyword, clone2(node.elseStatement));
+  ImplementsClause visitImplementsClause(ImplementsClause node) => new ImplementsClause.full(node.keyword, clone3(node.interfaces));
+  ImportDirective visitImportDirective(ImportDirective node) => new ImportDirective.full(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clone2(node.uri), node.asToken, clone2(node.prefix), clone3(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);
+      return new IndexExpression.forTarget_full(clone2(node.array), node.leftBracket, clone2(node.index), node.rightBracket);
     } else {
-      return new IndexExpression.forCascade_full(period2, node.leftBracket, clone(node.index), node.rightBracket);
+      return new IndexExpression.forCascade_full(period2, node.leftBracket, clone2(node.index), node.rightBracket);
     }
   }
-  InstanceCreationExpression visitInstanceCreationExpression(InstanceCreationExpression node) => new InstanceCreationExpression.full(node.keyword, clone(node.constructorName), clone(node.argumentList));
+  InstanceCreationExpression visitInstanceCreationExpression(InstanceCreationExpression node) => new InstanceCreationExpression.full(node.keyword, clone2(node.constructorName), clone2(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);
+  InterpolationExpression visitInterpolationExpression(InterpolationExpression node) => new InterpolationExpression.full(node.leftBracket, clone2(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);
+  IsExpression visitIsExpression(IsExpression node) => new IsExpression.full(clone2(node.expression), node.isOperator, node.notOperator, clone2(node.type));
+  Label visitLabel(Label node) => new Label.full(clone2(node.label), node.colon);
+  LabeledStatement visitLabeledStatement(LabeledStatement node) => new LabeledStatement.full(clone3(node.labels), clone2(node.statement));
+  LibraryDirective visitLibraryDirective(LibraryDirective node) => new LibraryDirective.full(clone2(node.documentationComment), clone3(node.metadata), node.libraryToken, clone2(node.name), node.semicolon);
+  LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) => new LibraryIdentifier.full(clone3(node.components));
+  ListLiteral visitListLiteral(ListLiteral node) => new ListLiteral.full(node.modifier, clone2(node.typeArguments), node.leftBracket, clone3(node.elements), node.rightBracket);
+  MapLiteral visitMapLiteral(MapLiteral node) => new MapLiteral.full(node.modifier, clone2(node.typeArguments), node.leftBracket, clone3(node.entries), node.rightBracket);
+  MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) => new MapLiteralEntry.full(clone2(node.key), node.separator, clone2(node.value));
+  MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => new MethodDeclaration.full(clone2(node.documentationComment), clone3(node.metadata), node.externalKeyword, node.modifierKeyword, clone2(node.returnType), node.propertyKeyword, node.operatorKeyword, clone2(node.name), clone2(node.parameters), clone2(node.body));
+  MethodInvocation visitMethodInvocation(MethodInvocation node) => new MethodInvocation.full(clone2(node.target), node.period, clone2(node.methodName), clone2(node.argumentList));
+  NamedExpression visitNamedExpression(NamedExpression node) => new NamedExpression.full(clone2(node.name), clone2(node.expression));
+  NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => new NativeFunctionBody.full(node.nativeToken, clone2(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));
+  ParenthesizedExpression visitParenthesizedExpression(ParenthesizedExpression node) => new ParenthesizedExpression.full(node.leftParenthesis, clone2(node.expression), node.rightParenthesis);
+  PartDirective visitPartDirective(PartDirective node) => new PartDirective.full(clone2(node.documentationComment), clone3(node.metadata), node.partToken, clone2(node.uri), node.semicolon);
+  PartOfDirective visitPartOfDirective(PartOfDirective node) => new PartOfDirective.full(clone2(node.documentationComment), clone3(node.metadata), node.partToken, node.ofToken, clone2(node.libraryName), node.semicolon);
+  PostfixExpression visitPostfixExpression(PostfixExpression node) => new PostfixExpression.full(clone2(node.operand), node.operator);
+  PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) => new PrefixedIdentifier.full(clone2(node.prefix), node.period, clone2(node.identifier));
+  PrefixExpression visitPrefixExpression(PrefixExpression node) => new PrefixExpression.full(node.operator, clone2(node.operand));
+  PropertyAccess visitPropertyAccess(PropertyAccess node) => new PropertyAccess.full(clone2(node.target), node.operator, clone2(node.propertyName));
+  RedirectingConstructorInvocation visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) => new RedirectingConstructorInvocation.full(node.keyword, node.period, clone2(node.constructorName), clone2(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);
+  ReturnStatement visitReturnStatement(ReturnStatement node) => new ReturnStatement.full(node.keyword, clone2(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));
+  ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator.full(node.keyword, clone3(node.shownNames));
+  SimpleFormalParameter visitSimpleFormalParameter(SimpleFormalParameter node) => new SimpleFormalParameter.full(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clone2(node.type), clone2(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));
+  StringInterpolation visitStringInterpolation(StringInterpolation node) => new StringInterpolation.full(clone3(node.elements));
+  SuperConstructorInvocation visitSuperConstructorInvocation(SuperConstructorInvocation node) => new SuperConstructorInvocation.full(node.keyword, node.period, clone2(node.constructorName), clone2(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);
+  SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase.full(clone3(node.labels), node.keyword, clone2(node.expression), node.colon, clone3(node.statements));
+  SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault.full(clone3(node.labels), node.keyword, node.colon, clone3(node.statements));
+  SwitchStatement visitSwitchStatement(SwitchStatement node) => new SwitchStatement.full(node.keyword, node.leftParenthesis, clone2(node.expression), node.rightParenthesis, node.leftBracket, clone3(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) {
+  ThrowExpression visitThrowExpression(ThrowExpression node) => new ThrowExpression.full(node.keyword, clone2(node.expression));
+  TopLevelVariableDeclaration visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) => new TopLevelVariableDeclaration.full(clone2(node.documentationComment), clone3(node.metadata), clone2(node.variables), node.semicolon);
+  TryStatement visitTryStatement(TryStatement node) => new TryStatement.full(node.tryKeyword, clone2(node.body), clone3(node.catchClauses), node.finallyKeyword, clone2(node.finallyClause));
+  TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => new TypeArgumentList.full(node.leftBracket, clone3(node.arguments), node.rightBracket);
+  TypeName visitTypeName(TypeName node) => new TypeName.full(clone2(node.name), clone2(node.typeArguments));
+  TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter.full(clone2(node.documentationComment), clone3(node.metadata), clone2(node.name), node.keyword, clone2(node.bound));
+  TypeParameterList visitTypeParameterList(TypeParameterList node) => new TypeParameterList.full(node.leftBracket, clone3(node.typeParameters), node.rightBracket);
+  VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => new VariableDeclaration.full(clone2(node.documentationComment), clone3(node.metadata), clone2(node.name), node.equals, clone2(node.initializer));
+  VariableDeclarationList visitVariableDeclarationList(VariableDeclarationList node) => new VariableDeclarationList.full(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clone2(node.type), clone3(node.variables));
+  VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclarationStatement node) => new VariableDeclarationStatement.full(clone2(node.variables), node.semicolon);
+  WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement.full(node.keyword, node.leftParenthesis, clone2(node.condition), node.rightParenthesis, clone2(node.body));
+  WithClause visitWithClause(WithClause node) => new WithClause.full(node.withKeyword, clone3(node.mixinTypes));
+  ASTNode clone2(ASTNode node) {
     if (node == null) {
       return null;
     }
     return node.accept(this) as ASTNode;
   }
-  List clone2(NodeList nodes) {
+  List clone3(NodeList nodes) {
     List clonedNodes = new List();
     for (ASTNode node in nodes) {
       clonedNodes.add((node.accept(this) as ASTNode));
diff --git a/pkg/analyzer_experimental/lib/src/generated/constant.dart b/pkg/analyzer_experimental/lib/src/generated/constant.dart
index 67dfbdb..8d86663 100644
--- a/pkg/analyzer_experimental/lib/src/generated/constant.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/constant.dart
@@ -96,7 +96,7 @@
   List<AnalysisError> _errors;
   /**
    * Initialize a newly created result object with the given state. Clients should use one of the
-   * factory methods: {@link #forErrors(AnalysisError[])} and {@link #forValue(Object)}.
+   * factory methods: {@link #forErrors(AnalysisError\[\])} and {@link #forValue(Object)}.
    * @param value the value of the expression
    * @param errors the errors that should be reported for the expression(s) that were evaluated
    */
@@ -632,9 +632,9 @@
    * @param errorCode the error code for the error to be generated
    */
   ErrorResult.con1(ASTNode node, ErrorCode errorCode) {
-    _jtd_constructor_162_impl(node, errorCode);
+    _jtd_constructor_168_impl(node, errorCode);
   }
-  _jtd_constructor_162_impl(ASTNode node, ErrorCode errorCode) {
+  _jtd_constructor_168_impl(ASTNode node, ErrorCode errorCode) {
     _errors.add(new ErrorResult_ErrorData(node, errorCode));
   }
   /**
@@ -644,9 +644,9 @@
    * @param secondResult the second set of results being merged
    */
   ErrorResult.con2(ErrorResult firstResult, ErrorResult secondResult) {
-    _jtd_constructor_163_impl(firstResult, secondResult);
+    _jtd_constructor_169_impl(firstResult, secondResult);
   }
-  _jtd_constructor_163_impl(ErrorResult firstResult, ErrorResult secondResult) {
+  _jtd_constructor_169_impl(ErrorResult firstResult, ErrorResult secondResult) {
     _errors.addAll(firstResult._errors);
     _errors.addAll(secondResult._errors);
   }
diff --git a/pkg/analyzer_experimental/lib/src/generated/element.dart b/pkg/analyzer_experimental/lib/src/generated/element.dart
index 0dd5369..3f0a671 100644
--- a/pkg/analyzer_experimental/lib/src/generated/element.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/element.dart
@@ -123,6 +123,22 @@
    */
   bool isValidMixin();
   /**
+   * Return the executable element representing the method, getter or setter that results from
+   * looking up the given member in this class with respect to the given library, or {@code null} if
+   * the look up fails. This method is used to determine what member the passed name is inherited
+   * from. The behavior of this method is defined by the Dart Language Specification in section
+   * 8.1.1: Let <i>C</i> be a class declared in library <i>L</i> with superclass <i>S</i> and let
+   * <i>C</i> declare an instance member <i>m</i>, and assume <i>S</i> declares an instance member
+   * </i>m'</i> with the same name as m. Then <i>m</i> overrides m'</i> iff <i>m'</i> is accessible
+   * to <i>L</i>, <i>m</i> has the same name as <i>m'</i> and neither <i>m</i> nor <i>m'</i> are
+   * fields.
+   * @param memberName the name of the member being looked up
+   * @param library the library with respect to which the lookup is being performed
+   * @return the result of looking up the given member in this class with respect to the given
+   * library
+   */
+  ExecutableElement lookUpExecutable(String memberName, LibraryElement library);
+  /**
    * 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:
@@ -283,6 +299,16 @@
    */
   accept(ElementVisitor visitor);
   /**
+   * Return the documentation comment for this element as it appears in the original source
+   * (complete with the beginning and ending delimiters), or {@code null} if this element does not
+   * have a documentation comment associated with it. This can be a long-running operation if the
+   * information needed to access the comment is not cached.
+   * @return this element's documentation comment
+   * @throws AnalysisException if the documentation comment could not be determined because the
+   * analysis could not be performed
+   */
+  String computeDocumentationComment();
+  /**
    * Return the element of the given class that most immediately encloses this element, or{@code null} if there is no enclosing element of the given class.
    * @param elementClass the class of the element to be returned
    * @return the element that encloses this element
@@ -397,11 +423,31 @@
   final String __name;
   final int __ordinal;
   int get ordinal => __ordinal;
+  /**
+   * Return the kind of the given element, or {@link #ERROR} if the element is {@code null}. This is
+   * a utility method that can reduce the need for null checks in other places.
+   * @param element the element whose kind is to be returned
+   * @return the kind of the given element
+   */
+  static ElementKind of(Element element) {
+    if (element == null) {
+      return ERROR;
+    }
+    return element.kind;
+  }
+  /**
+   * The name displayed in the UI for this kind of element.
+   */
   String _displayName;
+  /**
+   * Initialize a newly created element kind to have the given display name.
+   * @param displayName the name displayed in the UI for this kind of element
+   */
   ElementKind(this.__name, this.__ordinal, String displayName) {
     this._displayName = displayName;
   }
   /**
+   * Return the name displayed in the UI for this kind of element.
    * @return the name of this {@link ElementKind} to display in UI.
    */
   String get displayName => _displayName;
@@ -1354,6 +1400,21 @@
   }
   List<ConstructorElement> get constructors => _constructors;
   /**
+   * Return the executable elemement representing the getter, setter or method with the given name
+   * that is declared in this class, or {@code null} if this class does not declare a member with
+   * the given name.
+   * @param memberName the name of the getter to be returned
+   * @return the member declared in this class with the given name
+   */
+  ExecutableElement getExecutable(String memberName) {
+    for (PropertyAccessorElement accessor in _accessors) {
+      if (accessor.name == memberName) {
+        return accessor;
+      }
+    }
+    return getMethod(memberName);
+  }
+  /**
    * 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
@@ -1438,6 +1499,29 @@
   bool isAbstract() => hasModifier(Modifier.ABSTRACT);
   bool isTypedef() => hasModifier(Modifier.TYPEDEF);
   bool isValidMixin() => hasModifier(Modifier.MIXIN);
+  ExecutableElement lookUpExecutable(String memberName, LibraryElement library) {
+    ExecutableElement element = getExecutable(memberName);
+    if (element != null && element.isAccessibleIn(library)) {
+      return element;
+    }
+    for (InterfaceType mixin in _mixins) {
+      ClassElement mixinElement = mixin.element;
+      if (mixinElement != null) {
+        ClassElementImpl mixinElementImpl = mixinElement as ClassElementImpl;
+        element = mixinElementImpl.getExecutable(memberName);
+        if (element != null && element.isAccessibleIn(library)) {
+          return element;
+        }
+      }
+    }
+    if (_supertype != null) {
+      ClassElement supertypeElement = _supertype.element;
+      if (supertypeElement != null) {
+        return supertypeElement.lookUpExecutable(memberName, library);
+      }
+    }
+    return null;
+  }
   PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library) {
     PropertyAccessorElement element = getGetter(getterName);
     if (element != null && element.isAccessibleIn(library)) {
@@ -1455,10 +1539,7 @@
     if (_supertype != null) {
       ClassElement supertypeElement = _supertype.element;
       if (supertypeElement != null) {
-        element = supertypeElement.lookUpGetter(getterName, library);
-        if (element != null && element.isAccessibleIn(library)) {
-          return element;
-        }
+        return supertypeElement.lookUpGetter(getterName, library);
       }
     }
     return null;
@@ -1480,10 +1561,7 @@
     if (_supertype != null) {
       ClassElement supertypeElement = _supertype.element;
       if (supertypeElement != null) {
-        element = supertypeElement.lookUpMethod(methodName, library);
-        if (element != null && element.isAccessibleIn(library)) {
-          return element;
-        }
+        return supertypeElement.lookUpMethod(methodName, library);
       }
     }
     return null;
@@ -1505,10 +1583,7 @@
     if (_supertype != null) {
       ClassElement supertypeElement = _supertype.element;
       if (supertypeElement != null) {
-        element = supertypeElement.lookUpSetter(setterName, library);
-        if (element != null && element.isAccessibleIn(library)) {
-          return element;
-        }
+        return supertypeElement.lookUpSetter(setterName, library);
       }
     }
     return null;
@@ -2021,10 +2096,10 @@
    * @param name the name of this element
    */
   ElementImpl.con1(Identifier name2) {
-    _jtd_constructor_188_impl(name2);
+    _jtd_constructor_189_impl(name2);
   }
-  _jtd_constructor_188_impl(Identifier name2) {
-    _jtd_constructor_189_impl(name2 == null ? "" : name2.name, name2 == null ? -1 : name2.offset);
+  _jtd_constructor_189_impl(Identifier name2) {
+    _jtd_constructor_190_impl(name2 == null ? "" : name2.name, name2 == null ? -1 : name2.offset);
   }
   /**
    * Initialize a newly created element to have the given name.
@@ -2033,12 +2108,19 @@
    * declaration of this element
    */
   ElementImpl.con2(String name2, int nameOffset2) {
-    _jtd_constructor_189_impl(name2, nameOffset2);
+    _jtd_constructor_190_impl(name2, nameOffset2);
   }
-  _jtd_constructor_189_impl(String name2, int nameOffset2) {
+  _jtd_constructor_190_impl(String name2, int nameOffset2) {
     this._name = StringUtilities.intern(name2);
     this._nameOffset = nameOffset2;
   }
+  String computeDocumentationComment() {
+    AnalysisContext context2 = context;
+    if (context2 == null) {
+      return null;
+    }
+    return context2.computeDocumentationComment(this);
+  }
   bool operator ==(Object object) => object != null && object.runtimeType == runtimeType && ((object as Element)).location == location;
   Element getAncestor(Type elementClass) {
     Element ancestor = _enclosingElement;
@@ -2208,9 +2290,9 @@
    * @param element the element whose location is being represented
    */
   ElementLocationImpl.con1(Element element) {
-    _jtd_constructor_190_impl(element);
+    _jtd_constructor_191_impl(element);
   }
-  _jtd_constructor_190_impl(Element element) {
+  _jtd_constructor_191_impl(Element element) {
     List<String> components = new List<String>();
     Element ancestor = element;
     while (ancestor != null) {
@@ -2224,9 +2306,9 @@
    * @param encoding the encoded form of a location
    */
   ElementLocationImpl.con2(String encoding) {
-    _jtd_constructor_191_impl(encoding);
+    _jtd_constructor_192_impl(encoding);
   }
-  _jtd_constructor_191_impl(String encoding) {
+  _jtd_constructor_192_impl(String encoding) {
     this._components = decode(encoding);
   }
   bool operator ==(Object object) {
@@ -2365,9 +2447,9 @@
    * @param name the name of this element
    */
   ExecutableElementImpl.con1(Identifier name) : super.con1(name) {
-    _jtd_constructor_193_impl(name);
+    _jtd_constructor_194_impl(name);
   }
-  _jtd_constructor_193_impl(Identifier name) {
+  _jtd_constructor_194_impl(Identifier name) {
   }
   /**
    * Initialize a newly created executable element to have the given name.
@@ -2376,9 +2458,9 @@
    * declaration of this element
    */
   ExecutableElementImpl.con2(String name, int nameOffset) : super.con2(name, nameOffset) {
-    _jtd_constructor_194_impl(name, nameOffset);
+    _jtd_constructor_195_impl(name, nameOffset);
   }
-  _jtd_constructor_194_impl(String name, int nameOffset) {
+  _jtd_constructor_195_impl(String name, int nameOffset) {
   }
   ElementImpl getChild(String identifier2) {
     for (ExecutableElement function in _functions) {
@@ -2522,6 +2604,7 @@
     builder.append("export ");
     ((_exportedLibrary as LibraryElementImpl)).appendTo(builder);
   }
+  String get identifier => _exportedLibrary.name;
 }
 /**
  * Instances of the class {@code ExternalHtmlScriptElementImpl} implement an{@link ExternalHtmlScriptElement}.
@@ -2563,18 +2646,18 @@
    * @param name the name of this element
    */
   FieldElementImpl.con1(Identifier name) : super.con1(name) {
-    _jtd_constructor_197_impl(name);
+    _jtd_constructor_198_impl(name);
   }
-  _jtd_constructor_197_impl(Identifier name) {
+  _jtd_constructor_198_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_198_impl(name);
+    _jtd_constructor_199_impl(name);
   }
-  _jtd_constructor_198_impl(String name) {
+  _jtd_constructor_199_impl(String name) {
   }
   accept(ElementVisitor visitor) => visitor.visitFieldElement(this);
   ClassElement get enclosingElement => super.enclosingElement as ClassElement;
@@ -2635,9 +2718,9 @@
    * Initialize a newly created synthetic function element.
    */
   FunctionElementImpl() : super.con2("", -1) {
-    _jtd_constructor_200_impl();
+    _jtd_constructor_201_impl();
   }
-  _jtd_constructor_200_impl() {
+  _jtd_constructor_201_impl() {
     synthetic = true;
   }
   /**
@@ -2645,9 +2728,9 @@
    * @param name the name of this element
    */
   FunctionElementImpl.con1(Identifier name) : super.con1(name) {
-    _jtd_constructor_201_impl(name);
+    _jtd_constructor_202_impl(name);
   }
-  _jtd_constructor_201_impl(Identifier name) {
+  _jtd_constructor_202_impl(Identifier name) {
   }
   /**
    * Initialize a newly created function element to have no name and the given offset. This is used
@@ -2656,9 +2739,9 @@
    * declaration of this element
    */
   FunctionElementImpl.con2(int nameOffset) : super.con2("", nameOffset) {
-    _jtd_constructor_202_impl(nameOffset);
+    _jtd_constructor_203_impl(nameOffset);
   }
-  _jtd_constructor_202_impl(int nameOffset) {
+  _jtd_constructor_203_impl(int nameOffset) {
   }
   accept(ElementVisitor visitor) => visitor.visitFunctionElement(this);
   String get identifier => name;
@@ -2979,6 +3062,7 @@
     builder.append("import ");
     ((_importedLibrary as LibraryElementImpl)).appendTo(builder);
   }
+  String get identifier => "${_importedLibrary.name}:${(_prefix == null ? "" : _prefix.name)}";
 }
 /**
  * Instances of the class {@code LabelElementImpl} implement a {@code LabelElement}.
@@ -3103,6 +3187,16 @@
         return part as CompilationUnitElementImpl;
       }
     }
+    for (ImportElement importElement in _imports) {
+      if (((importElement as ImportElementImpl)).identifier == identifier2) {
+        return importElement as ImportElementImpl;
+      }
+    }
+    for (ExportElement exportElement in _exports) {
+      if (((exportElement as ExportElementImpl)).identifier == identifier2) {
+        return exportElement as ExportElementImpl;
+      }
+    }
     return null;
   }
   AnalysisContext get context => _context;
@@ -3317,9 +3411,9 @@
    * @param name the name of this element
    */
   MethodElementImpl.con1(Identifier name) : super.con1(name) {
-    _jtd_constructor_211_impl(name);
+    _jtd_constructor_212_impl(name);
   }
-  _jtd_constructor_211_impl(Identifier name) {
+  _jtd_constructor_212_impl(Identifier name) {
   }
   /**
    * Initialize a newly created method element to have the given name.
@@ -3328,9 +3422,9 @@
    * declaration of this element
    */
   MethodElementImpl.con2(String name, int nameOffset) : super.con2(name, nameOffset) {
-    _jtd_constructor_212_impl(name, nameOffset);
+    _jtd_constructor_213_impl(name, nameOffset);
   }
-  _jtd_constructor_212_impl(String name, int nameOffset) {
+  _jtd_constructor_213_impl(String name, int nameOffset) {
   }
   accept(ElementVisitor visitor) => visitor.visitMethodElement(this);
   ClassElement get enclosingElement => super.enclosingElement as ClassElement;
@@ -3421,6 +3515,7 @@
     _conflictingElements = computeConflictingElements(firstElement, secondElement);
   }
   accept(ElementVisitor visitor) => visitor.visitMultiplyDefinedElement(this);
+  String computeDocumentationComment() => null;
   Element getAncestor(Type elementClass) => null;
   List<Element> get conflictingElements => _conflictingElements;
   AnalysisContext get context => _context;
@@ -3645,9 +3740,9 @@
    * @param name the name of this element
    */
   PropertyAccessorElementImpl.con1(Identifier name) : super.con1(name) {
-    _jtd_constructor_217_impl(name);
+    _jtd_constructor_218_impl(name);
   }
-  _jtd_constructor_217_impl(Identifier name) {
+  _jtd_constructor_218_impl(Identifier name) {
   }
   /**
    * Initialize a newly created synthetic property accessor element to be associated with the given
@@ -3655,9 +3750,9 @@
    * @param variable the variable with which this access is associated
    */
   PropertyAccessorElementImpl.con2(PropertyInducingElementImpl variable2) : super.con2(variable2.name, -1) {
-    _jtd_constructor_218_impl(variable2);
+    _jtd_constructor_219_impl(variable2);
   }
-  _jtd_constructor_218_impl(PropertyInducingElementImpl variable2) {
+  _jtd_constructor_219_impl(PropertyInducingElementImpl variable2) {
     this._variable = variable2;
     synthetic = true;
   }
@@ -3722,18 +3817,18 @@
    * @param name the name of this element
    */
   PropertyInducingElementImpl.con1(Identifier name) : super.con1(name) {
-    _jtd_constructor_219_impl(name);
+    _jtd_constructor_220_impl(name);
   }
-  _jtd_constructor_219_impl(Identifier name) {
+  _jtd_constructor_220_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_220_impl(name);
+    _jtd_constructor_221_impl(name);
   }
-  _jtd_constructor_220_impl(String name) {
+  _jtd_constructor_221_impl(String name) {
     synthetic = true;
   }
   PropertyAccessorElement get getter => _getter;
@@ -3804,18 +3899,18 @@
    * @param name the name of this element
    */
   TopLevelVariableElementImpl.con1(Identifier name) : super.con1(name) {
-    _jtd_constructor_222_impl(name);
+    _jtd_constructor_223_impl(name);
   }
-  _jtd_constructor_222_impl(Identifier name) {
+  _jtd_constructor_223_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_223_impl(name);
+    _jtd_constructor_224_impl(name);
   }
-  _jtd_constructor_223_impl(String name) {
+  _jtd_constructor_224_impl(String name) {
   }
   accept(ElementVisitor visitor) => visitor.visitTopLevelVariableElement(this);
   ElementKind get kind => ElementKind.TOP_LEVEL_VARIABLE;
@@ -3894,9 +3989,9 @@
    * @param name the name of this element
    */
   VariableElementImpl.con1(Identifier name) : super.con1(name) {
-    _jtd_constructor_225_impl(name);
+    _jtd_constructor_226_impl(name);
   }
-  _jtd_constructor_225_impl(Identifier name) {
+  _jtd_constructor_226_impl(Identifier name) {
   }
   /**
    * Initialize a newly created variable element to have the given name.
@@ -3905,9 +4000,9 @@
    * declaration of this element
    */
   VariableElementImpl.con2(String name, int nameOffset) : super.con2(name, nameOffset) {
-    _jtd_constructor_226_impl(name, nameOffset);
+    _jtd_constructor_227_impl(name, nameOffset);
   }
-  _jtd_constructor_226_impl(String name, int nameOffset) {
+  _jtd_constructor_227_impl(String name, int nameOffset) {
   }
   /**
    * Return the result of evaluating this variable's initializer as a compile-time constant
@@ -4081,6 +4176,7 @@
     this._baseElement = baseElement;
     this._definingType = definingType;
   }
+  String computeDocumentationComment() => _baseElement.computeDocumentationComment();
   Element getAncestor(Type elementClass) => baseElement.getAncestor(elementClass);
   /**
    * Return the element on which the parameterized element was created.
@@ -4512,9 +4608,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_290_impl(element);
+    _jtd_constructor_291_impl(element);
   }
-  _jtd_constructor_290_impl(ExecutableElement element) {
+  _jtd_constructor_291_impl(ExecutableElement element) {
   }
   /**
    * Initialize a newly created function type to be declared by the given element and to have the
@@ -4522,9 +4618,9 @@
    * @param element the element representing the declaration of the function type
    */
   FunctionTypeImpl.con2(FunctionTypeAliasElement element) : super(element, element == null ? null : element.name) {
-    _jtd_constructor_291_impl(element);
+    _jtd_constructor_292_impl(element);
   }
-  _jtd_constructor_291_impl(FunctionTypeAliasElement element) {
+  _jtd_constructor_292_impl(FunctionTypeAliasElement element) {
   }
   bool operator ==(Object object) {
     if (object is! FunctionTypeImpl) {
@@ -4805,6 +4901,59 @@
     return set;
   }
   /**
+   * Return the intersection of the given sets of types, where intersection is based on the equality
+   * of the elements of the types rather than on the equality of the types themselves. In cases
+   * where two non-equal types have equal elements, which only happens when the class is
+   * parameterized, the type that is added to the intersection is the base type with type arguments
+   * that are the least upper bound of the type arguments of the two types.
+   * @param first the first set of types to be intersected
+   * @param second the second set of types to be intersected
+   * @return the intersection of the given sets of types
+   */
+  static List<InterfaceType> intersection(Set<InterfaceType> first, Set<InterfaceType> second) {
+    Map<ClassElement, InterfaceType> firstMap = new Map<ClassElement, InterfaceType>();
+    for (InterfaceType firstType in first) {
+      firstMap[firstType.element] = firstType;
+    }
+    Set<InterfaceType> result = new Set<InterfaceType>();
+    for (InterfaceType secondType in second) {
+      InterfaceType firstType = firstMap[secondType.element];
+      if (firstType != null) {
+        javaSetAdd(result, leastUpperBound(firstType, secondType));
+      }
+    }
+    return new List.from(result);
+  }
+  /**
+   * Return the "least upper bound" of the given types under the assumption that the types have the
+   * same element and differ only in terms of the type arguments. The resulting type is composed by
+   * using the least upper bound of the corresponding type arguments.
+   * @param firstType the first type
+   * @param secondType the second type
+   * @return the "least upper bound" of the given types
+   */
+  static InterfaceType leastUpperBound(InterfaceType firstType, InterfaceType secondType) {
+    if (firstType == secondType) {
+      return firstType;
+    }
+    List<Type2> firstArguments = firstType.typeArguments;
+    List<Type2> secondArguments = secondType.typeArguments;
+    int argumentCount = firstArguments.length;
+    if (argumentCount == 0) {
+      return firstType;
+    }
+    List<Type2> lubArguments = new List<Type2>(argumentCount);
+    for (int i = 0; i < argumentCount; i++) {
+      lubArguments[i] = firstArguments[i].getLeastUpperBound(secondArguments[i]);
+      if (lubArguments[i] == null) {
+        lubArguments[i] = DynamicTypeImpl.instance;
+      }
+    }
+    InterfaceTypeImpl lub = new InterfaceTypeImpl.con1(firstType.element);
+    lub.typeArguments = lubArguments;
+    return lub;
+  }
+  /**
    * An array containing the actual types of the type arguments.
    */
   List<Type2> _typeArguments = TypeImpl.EMPTY_ARRAY;
@@ -4813,9 +4962,9 @@
    * @param element the element representing the declaration of the type
    */
   InterfaceTypeImpl.con1(ClassElement element) : super(element, element.name) {
-    _jtd_constructor_292_impl(element);
+    _jtd_constructor_293_impl(element);
   }
-  _jtd_constructor_292_impl(ClassElement element) {
+  _jtd_constructor_293_impl(ClassElement element) {
   }
   /**
    * Initialize a newly created type to have the given name. This constructor should only be used in
@@ -4823,9 +4972,9 @@
    * @param name the name of the type
    */
   InterfaceTypeImpl.con2(String name) : super(null, name) {
-    _jtd_constructor_293_impl(name);
+    _jtd_constructor_294_impl(name);
   }
-  _jtd_constructor_293_impl(String name) {
+  _jtd_constructor_294_impl(String name) {
   }
   bool operator ==(Object object) {
     if (object is! InterfaceTypeImpl) {
@@ -4850,27 +4999,25 @@
     }
     return typedInterfaces;
   }
-  Type2 getLeastUpperBound(Type2 type2) {
+  Type2 getLeastUpperBound(Type2 type) {
     Type2 dynamicType = DynamicTypeImpl.instance;
-    if (identical(this, dynamicType) || identical(type2, dynamicType)) {
+    if (identical(this, dynamicType) || identical(type, dynamicType)) {
       return dynamicType;
     }
-    if (type2 == null || type2 is! InterfaceType) {
+    if (type is! InterfaceType) {
       return null;
     }
     InterfaceType i = this;
-    InterfaceType j = type2 as InterfaceType;
+    InterfaceType j = type as InterfaceType;
     Set<InterfaceType> si = computeSuperinterfaceSet(i);
     Set<InterfaceType> sj = computeSuperinterfaceSet(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);
-    List<int> depths = new List<int>.filled(sn.length, 0);
+    javaSetAdd(si, i);
+    javaSetAdd(sj, j);
+    List<InterfaceType> s = intersection(si, sj);
+    List<int> depths = new List<int>.filled(s.length, 0);
     int maxDepth = 0;
-    for (int n = 0; n < sn.length; n++) {
-      depths[n] = computeLongestInheritancePathToObject(sn[n]);
+    for (int n = 0; n < s.length; n++) {
+      depths[n] = computeLongestInheritancePathToObject(s[n]);
       if (depths[n] > maxDepth) {
         maxDepth = depths[n];
       }
@@ -4885,7 +5032,7 @@
         }
       }
       if (numberOfTypesAtMaxDepth == 1) {
-        return sn[indexOfLeastUpperBound];
+        return s[indexOfLeastUpperBound];
       }
     }
     return null;
@@ -5052,6 +5199,12 @@
       if (element != null && element.isAccessibleIn(library)) {
         return element;
       }
+      for (InterfaceType mixin in supertype.mixins) {
+        element = mixin.getGetter(getterName);
+        if (element != null && element.isAccessibleIn(library)) {
+          return element;
+        }
+      }
       supertype = supertype.superclass;
     }
     return null;
@@ -5073,6 +5226,12 @@
       if (element != null && element.isAccessibleIn(library)) {
         return element;
       }
+      for (InterfaceType mixin in supertype.mixins) {
+        element = mixin.getMethod(methodName);
+        if (element != null && element.isAccessibleIn(library)) {
+          return element;
+        }
+      }
       supertype = supertype.superclass;
     }
     return null;
@@ -5094,6 +5253,12 @@
       if (element != null && element.isAccessibleIn(library)) {
         return element;
       }
+      for (InterfaceType mixin in supertype.mixins) {
+        element = mixin.getSetter(setterName);
+        if (element != null && element.isAccessibleIn(library)) {
+          return element;
+        }
+      }
       supertype = supertype.superclass;
     }
     return null;
@@ -5281,7 +5446,7 @@
  * <li>The types of functions that only have required parameters. These have the general form
  * <i>(T<sub>1</sub>, &hellip;, T<sub>n</sub>) &rarr; T</i>.</li>
  * <li>The types of functions with optional positional parameters. These have the general form
- * <i>(T<sub>1</sub>, &hellip;, T<sub>n</sub>, [T<sub>n+1</sub>, &hellip;, T<sub>n+k</sub>]) &rarr;
+ * <i>(T<sub>1</sub>, &hellip;, T<sub>n</sub>, \[T<sub>n+1</sub>, &hellip;, T<sub>n+k</sub>\]) &rarr;
  * T</i>.</li>
  * <li>The types of functions with named positional parameters. These have the general form
  * <i>(T<sub>1</sub>, &hellip;, T<sub>n</sub>, {T<sub>x1</sub> x1, &hellip;, T<sub>xk</sub> xk})
@@ -5341,9 +5506,9 @@
    * </li>
    * <li>For all <i>i</i>, 1 <= <i>i</i> <= <i>n</i>, <i>T<sub>i</sub> &hArr; S<sub>i</sub></i>.</li>
    * </ul>
-   * A function type <i>(T<sub>1</sub>, &hellip;, T<sub>n</sub>, [T<sub>n+1</sub>, &hellip;,
-   * T<sub>n+k</sub>]) &rarr; T</i> is a subtype of the function type <i>(S<sub>1</sub>, &hellip;,
-   * S<sub>n</sub>, [S<sub>n+1</sub>, &hellip;, S<sub>n+m</sub>]) &rarr; S</i>, if all of the
+   * A function type <i>(T<sub>1</sub>, &hellip;, T<sub>n</sub>, \[T<sub>n+1</sub>, &hellip;,
+   * T<sub>n+k</sub>\]) &rarr; T</i> is a subtype of the function type <i>(S<sub>1</sub>, &hellip;,
+   * S<sub>n</sub>, \[S<sub>n+1</sub>, &hellip;, S<sub>n+m</sub>\]) &rarr; S</i>, if all of the
    * following conditions are met:
    * <ul>
    * <li>Either
@@ -5374,14 +5539,14 @@
    * </ul>
    * In addition, the following subtype rules apply:
    * <p>
-   * <i>(T<sub>1</sub>, &hellip;, T<sub>n</sub>, []) &rarr; T <: (T<sub>1</sub>, &hellip;,
+   * <i>(T<sub>1</sub>, &hellip;, T<sub>n</sub>, \[\]) &rarr; T <: (T<sub>1</sub>, &hellip;,
    * T<sub>n</sub>) &rarr; T.</i><br>
    * <i>(T<sub>1</sub>, &hellip;, T<sub>n</sub>) &rarr; T <: (T<sub>1</sub>, &hellip;,
    * T<sub>n</sub>, {}) &rarr; T.</i><br>
    * <i>(T<sub>1</sub>, &hellip;, T<sub>n</sub>, {}) &rarr; T <: (T<sub>1</sub>, &hellip;,
    * T<sub>n</sub>) &rarr; T.</i><br>
    * <i>(T<sub>1</sub>, &hellip;, T<sub>n</sub>) &rarr; T <: (T<sub>1</sub>, &hellip;,
-   * T<sub>n</sub>, []) &rarr; T.</i>
+   * T<sub>n</sub>, \[\]) &rarr; T.</i>
    * <p>
    * All functions implement the class {@code Function}. However not all function types are a
    * subtype of {@code Function}. If an interface type <i>I</i> includes a method named{@code call()}, and the type of {@code call()} is the function type <i>F</i>, then <i>I</i> is
@@ -5512,7 +5677,7 @@
   /**
    * Return {@code true} if this type is a subtype of the given type. An interface type <i>T</i> is
    * a subtype of an interface type <i>S</i>, written <i>T</i> <: <i>S</i>, iff
-   * <i>[bottom/dynamic]T</i> &laquo; <i>S</i> (<i>T</i> is more specific than <i>S</i>). If an
+   * <i>\[bottom/dynamic\]T</i> &laquo; <i>S</i> (<i>T</i> is more specific than <i>S</i>). If an
    * interface type <i>I</i> includes a method named <i>call()</i>, and the type of <i>call()</i> is
    * the function type <i>F</i>, then <i>I</i> is considered to be a subtype of <i>F</i>.
    * @param type the type being compared with this type
@@ -5660,7 +5825,7 @@
   /**
    * Return the type resulting from substituting the given arguments for the given parameters in
    * this type. The specification defines this operation in section 2: <blockquote> The notation
-   * <i>[x<sub>1</sub>, ..., x<sub>n</sub>/y<sub>1</sub>, ..., y<sub>n</sub>]E</i> denotes a copy of
+   * <i>\[x<sub>1</sub>, ..., x<sub>n</sub>/y<sub>1</sub>, ..., y<sub>n</sub>\]E</i> denotes a copy of
    * <i>E</i> in which all occurrences of <i>y<sub>i</sub>, 1 <= i <= n</i> have been replaced with
    * <i>x<sub>i</sub></i>.</blockquote> Note that, contrary to the specification, this method will
    * not create a copy of this type if no substitutions were required, but will return this type
diff --git a/pkg/analyzer_experimental/lib/src/generated/engine.dart b/pkg/analyzer_experimental/lib/src/generated/engine.dart
index 66f945b..fca4fef 100644
--- a/pkg/analyzer_experimental/lib/src/generated/engine.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/engine.dart
@@ -143,6 +143,17 @@
    */
   void applyChanges(ChangeSet changeSet);
   /**
+   * Return the documentation comment for the given element as it appears in the original source
+   * (complete with the beginning and ending delimiters), or {@code null} if the element does not
+   * have a documentation comment associated with it. This can be a long-running operation if the
+   * information needed to access the comment is not cached.
+   * @param element the element whose documentation comment is to be returned
+   * @return the element's documentation comment
+   * @throws AnalysisException if the documentation comment could not be determined because the
+   * analysis could not be performed
+   */
+  String computeDocumentationComment(Element element);
+  /**
    * Return an array containing all of the errors associated with the given source. If the errors
    * are not already known then the source will be analyzed in order to determine the errors
    * associated with it.
@@ -602,6 +613,989 @@
   }
 }
 /**
+ * The interface {@code DartEntry} defines the behavior of objects that maintain the information
+ * cached by an analysis context about an individual Dart file.
+ * @coverage dart.engine
+ */
+abstract class DartEntry implements SourceEntry {
+  /**
+   * The data descriptor representing the library element for the library. This data is only
+   * available for Dart files that are the defining compilation unit of a library.
+   */
+  static DataDescriptor<LibraryElement> ELEMENT = new DataDescriptor<LibraryElement>("DartEntry.ELEMENT");
+  /**
+   * The data descriptor representing the list of included parts. This data is only available for
+   * Dart files that are the defining compilation unit of a library.
+   */
+  static DataDescriptor<List<Source>> INCLUDED_PARTS = new DataDescriptor<List<Source>>("DartEntry.INCLUDED_PARTS");
+  /**
+   * The data descriptor representing the client flag. This data is only available for Dart files
+   * that are the defining compilation unit of a library.
+   */
+  static DataDescriptor<bool> IS_CLIENT = new DataDescriptor<bool>("DartEntry.IS_CLIENT");
+  /**
+   * The data descriptor representing the launchable flag. This data is only available for Dart
+   * files that are the defining compilation unit of a library.
+   */
+  static DataDescriptor<bool> IS_LAUNCHABLE = new DataDescriptor<bool>("DartEntry.IS_LAUNCHABLE");
+  /**
+   * The data descriptor representing the errors resulting from parsing the source.
+   */
+  static DataDescriptor<List<AnalysisError>> PARSE_ERRORS = new DataDescriptor<List<AnalysisError>>("DartEntry.PARSE_ERRORS");
+  /**
+   * The data descriptor representing the parsed AST structure.
+   */
+  static DataDescriptor<CompilationUnit> PARSED_UNIT = new DataDescriptor<CompilationUnit>("DartEntry.PARSED_UNIT");
+  /**
+   * The data descriptor representing the public namespace of the library. This data is only
+   * available for Dart files that are the defining compilation unit of a library.
+   */
+  static DataDescriptor<Namespace> PUBLIC_NAMESPACE = new DataDescriptor<Namespace>("DartEntry.PUBLIC_NAMESPACE");
+  /**
+   * The data descriptor representing the errors resulting from resolving the source.
+   */
+  static DataDescriptor<List<AnalysisError>> RESOLUTION_ERRORS = new DataDescriptor<List<AnalysisError>>("DartEntry.RESOLUTION_ERRORS");
+  /**
+   * The data descriptor representing the resolved AST structure.
+   */
+  static DataDescriptor<CompilationUnit> RESOLVED_UNIT = new DataDescriptor<CompilationUnit>("DartEntry.RESOLVED_UNIT");
+  /**
+   * The data descriptor representing the source kind.
+   */
+  static DataDescriptor<SourceKind> SOURCE_KIND = new DataDescriptor<SourceKind>("DartEntry.SOURCE_KIND");
+  /**
+   * Return all of the errors associated with the compilation unit that are currently cached.
+   * @return all of the errors associated with the compilation unit
+   */
+  List<AnalysisError> get allErrors;
+  /**
+   * Return a valid parsed compilation unit, either an unresolved AST structure or the result of
+   * resolving the AST structure in the context of some library, or {@code null} if there is no
+   * parsed compilation unit available.
+   * @return a valid parsed compilation unit
+   */
+  CompilationUnit get anyParsedCompilationUnit;
+  /**
+   * Return the result of resolving the compilation unit as part of any library, or {@code null} if
+   * there is no cached resolved compilation unit.
+   * @return any resolved compilation unit
+   */
+  CompilationUnit get anyResolvedCompilationUnit;
+  /**
+   * Return the state of the data represented by the given descriptor in the context of the given
+   * library.
+   * @param descriptor the descriptor representing the data whose state is to be returned
+   * @param librarySource the source of the defining compilation unit of the library that is the
+   * context for the data
+   * @return the value of the data represented by the given descriptor and library
+   */
+  CacheState getState2(DataDescriptor<Object> descriptor, Source librarySource);
+  /**
+   * Return the value of the data represented by the given descriptor in the context of the given
+   * library, or {@code null} if the data represented by the descriptor is not in the cache.
+   * @param descriptor the descriptor representing which data is to be returned
+   * @param librarySource the source of the defining compilation unit of the library that is the
+   * context for the data
+   * @return the value of the data represented by the given descriptor and library
+   */
+  Object getValue2(DataDescriptor descriptor, Source librarySource);
+  DartEntryImpl get writableCopy;
+}
+/**
+ * Instances of the class {@code DartEntryImpl} implement a {@link DartEntry}.
+ * @coverage dart.engine
+ */
+class DartEntryImpl extends SourceEntryImpl implements DartEntry {
+  /**
+   * The state of the cached source kind.
+   */
+  CacheState _sourceKindState = CacheState.INVALID;
+  /**
+   * The kind of this source.
+   */
+  SourceKind _sourceKind = SourceKind.UNKNOWN;
+  /**
+   * The state of the cached parsed compilation unit.
+   */
+  CacheState _parsedUnitState = CacheState.INVALID;
+  /**
+   * The parsed compilation unit, or {@code null} if the parsed compilation unit is not currently
+   * cached.
+   */
+  CompilationUnit _parsedUnit;
+  /**
+   * The state of the cached parse errors.
+   */
+  CacheState _parseErrorsState = CacheState.INVALID;
+  /**
+   * The errors produced while scanning and parsing the compilation unit, or {@code null} if the
+   * errors are not currently cached.
+   */
+  List<AnalysisError> _parseErrors = AnalysisError.NO_ERRORS;
+  /**
+   * The state of the cached list of included parts.
+   */
+  CacheState _includedPartsState = CacheState.INVALID;
+  /**
+   * The list of parts included in the library, or {@code null} if the list is not currently cached.
+   * The list will be empty if the Dart file is a part rather than a library.
+   */
+  List<Source> _includedParts = Source.EMPTY_ARRAY;
+  /**
+   * The source for the defining compilation unit of the library that contains this unit, or{@code null} if this unit is contained in multiple libraries. (If this unit is the defining
+   * compilation unit for it's library, then this will be the source for this unit.)
+   */
+  Source _librarySource;
+  /**
+   * The information known as a result of resolving this compilation unit as part of the library
+   * that contains this unit, or {@code null} if this unit is contained in multiple libraries.
+   */
+  DartEntryImpl_ResolutionState _resolutionState = new DartEntryImpl_ResolutionState();
+  /**
+   * A table mapping the sources of the libraries containing this compilation unit to the
+   * information known as a result of resolving this compilation unit as part of the library, or{@code null} if this unit is contained in a single library.
+   */
+  Map<Source, DartEntryImpl_ResolutionState> _resolutionMap;
+  /**
+   * The state of the cached library element.
+   */
+  CacheState _elementState = CacheState.INVALID;
+  /**
+   * The element representing the library, or {@code null} if the element is not currently cached.
+   */
+  LibraryElement _element;
+  /**
+   * The state of the cached public namespace.
+   */
+  CacheState _publicNamespaceState = CacheState.INVALID;
+  /**
+   * The public namespace of the library, or {@code null} if the namespace is not currently cached.
+   */
+  Namespace _publicNamespace;
+  /**
+   * The state of the cached client/ server flag.
+   */
+  CacheState _clientServerState = CacheState.INVALID;
+  /**
+   * The state of the cached launchable flag.
+   */
+  CacheState _launchableState = CacheState.INVALID;
+  /**
+   * An integer holding bit masks such as {@link #LAUNCHABLE} and {@link #CLIENT_CODE}.
+   */
+  int _bitmask = 0;
+  /**
+   * Mask indicating that this library is launchable: that the file has a main method.
+   */
+  static int _LAUNCHABLE = 1 << 1;
+  /**
+   * Mask indicating that the library is client code: that the library depends on the html library.
+   * If the library is not "client code", then it is referenced as "server code".
+   */
+  static int _CLIENT_CODE = 1 << 2;
+  /**
+   * Initialize a newly created cache entry to be empty.
+   */
+  DartEntryImpl() : super() {
+  }
+  /**
+   * Record the fact that we are about to parse the compilation unit by marking the results of
+   * parsing as being in progress.
+   */
+  void aboutToParse() {
+    setState(SourceEntry.LINE_INFO, CacheState.IN_PROCESS);
+    _parsedUnitState = CacheState.IN_PROCESS;
+    _parseErrorsState = CacheState.IN_PROCESS;
+  }
+  List<AnalysisError> get allErrors {
+    List<AnalysisError> errors = new List<AnalysisError>();
+    for (AnalysisError error in _parseErrors) {
+      errors.add(error);
+    }
+    if (_resolutionMap == null) {
+      for (AnalysisError error in _resolutionState._resolutionErrors) {
+        errors.add(error);
+      }
+    } else {
+      for (DartEntryImpl_ResolutionState state in _resolutionMap.values) {
+        for (AnalysisError error in state._resolutionErrors) {
+          errors.add(error);
+        }
+      }
+    }
+    if (errors.length == 0) {
+      return AnalysisError.NO_ERRORS;
+    }
+    return new List.from(errors);
+  }
+  CompilationUnit get anyParsedCompilationUnit {
+    if (identical(_parsedUnitState, CacheState.VALID)) {
+      return _parsedUnit;
+    }
+    if (_resolutionMap == null) {
+      return _resolutionState._resolvedUnit;
+    } else {
+      for (DartEntryImpl_ResolutionState state in _resolutionMap.values) {
+        if (identical(state._resolvedUnitState, CacheState.VALID)) {
+          return state._resolvedUnit;
+        }
+      }
+    }
+    return null;
+  }
+  CompilationUnit get anyResolvedCompilationUnit {
+    for (DartEntryImpl_ResolutionState state in _resolutionMap.values) {
+      if (identical(state._resolvedUnitState, CacheState.VALID)) {
+        return state._resolvedUnit;
+      }
+    }
+    return null;
+  }
+  SourceKind get kind => _sourceKind;
+  CacheState getState(DataDescriptor<Object> descriptor) {
+    if (identical(descriptor, DartEntry.ELEMENT)) {
+      return _elementState;
+    } else if (identical(descriptor, DartEntry.INCLUDED_PARTS)) {
+      return _includedPartsState;
+    } else if (identical(descriptor, DartEntry.IS_CLIENT)) {
+      return _clientServerState;
+    } else if (identical(descriptor, DartEntry.IS_LAUNCHABLE)) {
+      return _launchableState;
+    } else if (identical(descriptor, DartEntry.PARSE_ERRORS)) {
+      return _parseErrorsState;
+    } else if (identical(descriptor, DartEntry.PARSED_UNIT)) {
+      return _parsedUnitState;
+    } else if (identical(descriptor, DartEntry.PUBLIC_NAMESPACE)) {
+      return _publicNamespaceState;
+    } else if (identical(descriptor, DartEntry.SOURCE_KIND)) {
+      return _sourceKindState;
+    } else {
+      return super.getState(descriptor);
+    }
+  }
+  CacheState getState2(DataDescriptor<Object> descriptor, Source librarySource) {
+    if (identical(descriptor, DartEntry.RESOLUTION_ERRORS)) {
+      if (_resolutionMap == null) {
+        return _resolutionState._resolutionErrorsState;
+      } else {
+        DartEntryImpl_ResolutionState state = _resolutionMap[librarySource];
+        if (state != null) {
+          return state._resolutionErrorsState;
+        }
+      }
+    } else if (identical(descriptor, DartEntry.RESOLVED_UNIT)) {
+      if (_resolutionMap == null) {
+        return _resolutionState._resolvedUnitState;
+      } else {
+        DartEntryImpl_ResolutionState state = _resolutionMap[librarySource];
+        if (state != null) {
+          return state._resolvedUnitState;
+        }
+      }
+    } else {
+      throw new IllegalArgumentException("Invalid descriptor: ${descriptor}");
+    }
+    return CacheState.INVALID;
+  }
+  Object getValue(DataDescriptor descriptor) {
+    if (identical(descriptor, DartEntry.ELEMENT)) {
+      return _element as Object;
+    } else if (identical(descriptor, DartEntry.INCLUDED_PARTS)) {
+      return _includedParts as Object;
+    } else if (identical(descriptor, DartEntry.IS_CLIENT)) {
+      return ((_bitmask & _CLIENT_CODE) != 0 ? true : false) as Object;
+    } else if (identical(descriptor, DartEntry.IS_LAUNCHABLE)) {
+      return ((_bitmask & _LAUNCHABLE) != 0 ? true : false) as Object;
+    } else if (identical(descriptor, DartEntry.PARSE_ERRORS)) {
+      return _parseErrors as Object;
+    } else if (identical(descriptor, DartEntry.PARSED_UNIT)) {
+      return _parsedUnit as Object;
+    } else if (identical(descriptor, DartEntry.PUBLIC_NAMESPACE)) {
+      return _publicNamespace as Object;
+    } else if (identical(descriptor, DartEntry.SOURCE_KIND)) {
+      return _sourceKind as Object;
+    }
+    return super.getValue(descriptor);
+  }
+  Object getValue2(DataDescriptor descriptor, Source librarySource2) {
+    if (identical(descriptor, DartEntry.RESOLUTION_ERRORS)) {
+      if (_resolutionMap == null) {
+        if (librarySource2 == this._librarySource) {
+          return _resolutionState._resolutionErrors as Object;
+        } else {
+          return AnalysisError.NO_ERRORS as Object;
+        }
+      } else {
+        DartEntryImpl_ResolutionState state = _resolutionMap[librarySource2];
+        if (state != null) {
+          return state._resolutionErrors as Object;
+        }
+      }
+    } else if (identical(descriptor, DartEntry.RESOLVED_UNIT)) {
+      if (_resolutionMap == null) {
+        if (librarySource2 == this._librarySource) {
+          return _resolutionState._resolvedUnit as Object;
+        } else {
+          return null;
+        }
+      } else {
+        DartEntryImpl_ResolutionState state = _resolutionMap[librarySource2];
+        if (state != null) {
+          return state._resolvedUnit as Object;
+        }
+      }
+    } else {
+      throw new IllegalArgumentException("Invalid descriptor: ${descriptor}");
+    }
+    return null;
+  }
+  DartEntryImpl get writableCopy {
+    DartEntryImpl copy = new DartEntryImpl();
+    copy.copyFrom(this);
+    return copy;
+  }
+  /**
+   * Invalidate all of the resolution information associated with the compilation unit.
+   */
+  void invalidateAllResolutionInformation() {
+    if (_resolutionMap == null) {
+      _resolutionState.invalidateAllResolutionInformation();
+    } else {
+      for (DartEntryImpl_ResolutionState state in _resolutionMap.values) {
+        state.invalidateAllResolutionInformation();
+      }
+    }
+    _elementState = CacheState.INVALID;
+    _element = null;
+    _publicNamespaceState = CacheState.INVALID;
+    _publicNamespace = null;
+    _launchableState = CacheState.INVALID;
+    _clientServerState = CacheState.INVALID;
+    _bitmask = 0;
+  }
+  /**
+   * Remove any resolution information associated with this compilation unit being part of the given
+   * library, presumably because it is no longer part of the library.
+   * @param librarySource the source of the defining compilation unit of the library that used to
+   * contain this part but no longer does
+   */
+  void removeResolution(Source librarySource2) {
+    if (_resolutionMap == null) {
+      if (librarySource2 == this._librarySource) {
+        _resolutionState.invalidateAllResolutionInformation();
+        this._librarySource = null;
+      }
+    } else {
+      _resolutionMap.remove(librarySource2);
+      if (_resolutionMap.length == 1) {
+        MapEntry<Source, DartEntryImpl_ResolutionState> entry = new JavaIterator(getMapEntrySet(_resolutionMap)).next();
+        this._librarySource = entry.getKey();
+        _resolutionState = entry.getValue();
+        _resolutionMap = null;
+      }
+    }
+  }
+  /**
+   * Set the results of parsing the compilation unit at the given time to the given values.
+   * @param modificationStamp the earliest time at which the source was last modified before the
+   * parsing was started
+   * @param lineInfo the line information resulting from parsing the compilation unit
+   * @param unit the AST structure resulting from parsing the compilation unit
+   * @param errors the parse errors resulting from parsing the compilation unit
+   */
+  void setParseResults(int modificationStamp, LineInfo lineInfo, CompilationUnit unit, List<AnalysisError> errors) {
+    if (getState(SourceEntry.LINE_INFO) != CacheState.VALID) {
+      setValue(SourceEntry.LINE_INFO, lineInfo);
+    }
+    if (_parsedUnitState != CacheState.VALID) {
+      _parsedUnit = unit;
+    }
+    if (_parseErrorsState != CacheState.VALID) {
+      _parseErrors = errors == null ? AnalysisError.NO_ERRORS : errors;
+    }
+  }
+  void setState(DataDescriptor<Object> descriptor, CacheState state) {
+    if (identical(descriptor, DartEntry.ELEMENT)) {
+      _element = updatedValue(state, _element, null);
+      _elementState = state;
+    } else if (identical(descriptor, DartEntry.INCLUDED_PARTS)) {
+      _includedParts = updatedValue(state, _includedParts, Source.EMPTY_ARRAY);
+      _includedPartsState = state;
+    } else if (identical(descriptor, DartEntry.IS_CLIENT)) {
+      _bitmask = updatedValue2(state, _bitmask, _CLIENT_CODE);
+      _clientServerState = state;
+    } else if (identical(descriptor, DartEntry.IS_LAUNCHABLE)) {
+      _bitmask = updatedValue2(state, _bitmask, _LAUNCHABLE);
+      _launchableState = state;
+    } else if (identical(descriptor, DartEntry.PARSE_ERRORS)) {
+      _parseErrors = updatedValue(state, _parseErrors, AnalysisError.NO_ERRORS);
+      _parseErrorsState = state;
+    } else if (identical(descriptor, DartEntry.PARSED_UNIT)) {
+      _parsedUnit = updatedValue(state, _parsedUnit, null);
+      _parsedUnitState = state;
+    } else if (identical(descriptor, DartEntry.PUBLIC_NAMESPACE)) {
+      _publicNamespace = updatedValue(state, _publicNamespace, null);
+      _publicNamespaceState = state;
+    } else if (identical(descriptor, DartEntry.SOURCE_KIND)) {
+      _sourceKind = updatedValue(state, _sourceKind, SourceKind.UNKNOWN);
+      _sourceKindState = state;
+    } else {
+      super.setState(descriptor, state);
+    }
+  }
+  /**
+   * Set the state of the data represented by the given descriptor in the context of the given
+   * library to the given state.
+   * @param descriptor the descriptor representing the data whose state is to be set
+   * @param librarySource the source of the defining compilation unit of the library that is the
+   * context for the data
+   * @param state the new state of the data represented by the given descriptor
+   */
+  void setState2(DataDescriptor<Object> descriptor, Source librarySource2, CacheState state) {
+    if (_resolutionMap == null && this._librarySource != librarySource2) {
+      _resolutionMap = new Map<Source, DartEntryImpl_ResolutionState>();
+      _resolutionMap[this._librarySource] = _resolutionState;
+      this._librarySource = null;
+      _resolutionState = null;
+    }
+    if (identical(descriptor, DartEntry.RESOLUTION_ERRORS)) {
+      if (_resolutionMap == null) {
+        _resolutionState._resolutionErrors = updatedValue(state, _resolutionState._resolutionErrors, AnalysisError.NO_ERRORS);
+        _resolutionState._resolutionErrorsState = state;
+      } else {
+        DartEntryImpl_ResolutionState resolutionState = _resolutionMap[librarySource2];
+        if (resolutionState == null) {
+          resolutionState = new DartEntryImpl_ResolutionState();
+          _resolutionMap[librarySource2] = resolutionState;
+        }
+        resolutionState._resolutionErrors = updatedValue(state, resolutionState._resolutionErrors, AnalysisError.NO_ERRORS);
+        resolutionState._resolutionErrorsState = state;
+      }
+    } else if (identical(descriptor, DartEntry.RESOLVED_UNIT)) {
+      if (_resolutionMap == null) {
+        _resolutionState._resolvedUnit = updatedValue(state, _resolutionState._resolvedUnit, null);
+        _resolutionState._resolvedUnitState = state;
+      } else {
+        DartEntryImpl_ResolutionState resolutionState = _resolutionMap[librarySource2];
+        if (resolutionState == null) {
+          resolutionState = new DartEntryImpl_ResolutionState();
+          _resolutionMap[librarySource2] = resolutionState;
+        }
+        resolutionState._resolvedUnit = updatedValue(state, resolutionState._resolvedUnit, null);
+        resolutionState._resolvedUnitState = state;
+      }
+    } else {
+      throw new IllegalArgumentException("Invalid descriptor: ${descriptor}");
+    }
+  }
+  void setValue(DataDescriptor descriptor, Object value) {
+    if (identical(descriptor, DartEntry.ELEMENT)) {
+      _element = value as LibraryElement;
+      _elementState = CacheState.VALID;
+    } else if (identical(descriptor, DartEntry.INCLUDED_PARTS)) {
+      _includedParts = value == null ? Source.EMPTY_ARRAY : (value as List<Source>);
+      _includedPartsState = CacheState.VALID;
+    } else if (identical(descriptor, DartEntry.IS_CLIENT)) {
+      if (((value as bool))) {
+        _bitmask |= _CLIENT_CODE;
+      } else {
+        _bitmask &= ~_CLIENT_CODE;
+      }
+      _clientServerState = CacheState.VALID;
+    } else if (identical(descriptor, DartEntry.IS_LAUNCHABLE)) {
+      if (((value as bool))) {
+        _bitmask |= _LAUNCHABLE;
+      } else {
+        _bitmask &= ~_LAUNCHABLE;
+      }
+      _launchableState = CacheState.VALID;
+    } else if (identical(descriptor, DartEntry.PARSE_ERRORS)) {
+      _parseErrors = value == null ? AnalysisError.NO_ERRORS : (value as List<AnalysisError>);
+      _parseErrorsState = CacheState.VALID;
+    } else if (identical(descriptor, DartEntry.PARSED_UNIT)) {
+      _parsedUnit = value as CompilationUnit;
+      _parsedUnitState = CacheState.VALID;
+    } else if (identical(descriptor, DartEntry.PUBLIC_NAMESPACE)) {
+      _publicNamespace = value as Namespace;
+      _publicNamespaceState = CacheState.VALID;
+    } else if (identical(descriptor, DartEntry.SOURCE_KIND)) {
+      _sourceKind = value as SourceKind;
+      _sourceKindState = CacheState.VALID;
+    } else {
+      super.setValue(descriptor, value);
+    }
+  }
+  /**
+   * Set the value of the data represented by the given descriptor in the context of the given
+   * library to the given value, and set the state of that data to {@link CacheState#VALID}.
+   * @param descriptor the descriptor representing which data is to have its value set
+   * @param librarySource the source of the defining compilation unit of the library that is the
+   * context for the data
+   * @param value the new value of the data represented by the given descriptor and library
+   */
+  void setValue2(DataDescriptor descriptor, Source librarySource2, Object value) {
+    if (_resolutionMap == null) {
+      if (this._librarySource == null) {
+        this._librarySource = librarySource2;
+      } else if (librarySource2 != this._librarySource) {
+        _resolutionMap = new Map<Source, DartEntryImpl_ResolutionState>();
+        _resolutionMap[this._librarySource] = _resolutionState;
+        this._librarySource = null;
+        _resolutionState = null;
+      }
+    }
+    if (identical(descriptor, DartEntry.RESOLUTION_ERRORS)) {
+      if (_resolutionMap == null) {
+        _resolutionState._resolutionErrors = value == null ? AnalysisError.NO_ERRORS : (value as List<AnalysisError>);
+        _resolutionState._resolutionErrorsState = CacheState.VALID;
+      } else {
+        DartEntryImpl_ResolutionState state = _resolutionMap[librarySource2];
+        if (state != null) {
+          state._resolutionErrors = value == null ? AnalysisError.NO_ERRORS : (value as List<AnalysisError>);
+          state._resolutionErrorsState = CacheState.VALID;
+        }
+      }
+    } else if (identical(descriptor, DartEntry.RESOLVED_UNIT)) {
+      if (_resolutionMap == null) {
+        _resolutionState._resolvedUnit = value as CompilationUnit;
+        _resolutionState._resolvedUnitState = CacheState.VALID;
+      } else {
+        DartEntryImpl_ResolutionState state = _resolutionMap[librarySource2];
+        if (state != null) {
+          state._resolvedUnit = value as CompilationUnit;
+          state._resolvedUnitState = CacheState.VALID;
+        }
+      }
+    }
+  }
+  void copyFrom(SourceEntryImpl entry) {
+    super.copyFrom(entry);
+    DartEntryImpl other = entry as DartEntryImpl;
+    _sourceKindState = other._sourceKindState;
+    _sourceKind = other._sourceKind;
+    _parsedUnitState = other._parsedUnitState;
+    _parsedUnit = other._parsedUnit;
+    _parseErrorsState = other._parseErrorsState;
+    _parseErrors = other._parseErrors;
+    _includedPartsState = other._includedPartsState;
+    _includedParts = other._includedParts;
+    if (other._resolutionMap == null) {
+      _librarySource = other._librarySource;
+      DartEntryImpl_ResolutionState newState = new DartEntryImpl_ResolutionState();
+      newState.copyFrom(_resolutionState);
+      _resolutionState = newState;
+    } else {
+      _resolutionMap = new Map<Source, DartEntryImpl_ResolutionState>();
+      for (MapEntry<Source, DartEntryImpl_ResolutionState> mapEntry in getMapEntrySet(other._resolutionMap)) {
+        DartEntryImpl_ResolutionState newState = new DartEntryImpl_ResolutionState();
+        newState.copyFrom(mapEntry.getValue());
+        _resolutionMap[mapEntry.getKey()] = newState;
+      }
+    }
+    _elementState = other._elementState;
+    _element = other._element;
+    _publicNamespaceState = other._publicNamespaceState;
+    _publicNamespace = other._publicNamespace;
+    _clientServerState = other._clientServerState;
+    _launchableState = other._launchableState;
+    _bitmask = other._bitmask;
+  }
+  /**
+   * Given that one of the flags is being transitioned to the given state, return the value of the
+   * flags that should be kept in the cache.
+   * @param state the state to which the data is being transitioned
+   * @param currentValue the value of the flags before the transition
+   * @param bitMask the mask used to access the bit whose state is being set
+   * @return the value of the data that should be kept in the cache
+   */
+  int updatedValue2(CacheState state, int currentValue, int bitMask) {
+    if (identical(state, CacheState.VALID)) {
+      throw new IllegalArgumentException("Use setValue() to set the state to VALID");
+    } else if (identical(state, CacheState.IN_PROCESS)) {
+      return currentValue;
+    }
+    return currentValue &= ~bitMask;
+  }
+}
+/**
+ * Instances of the class {@code ResolutionState} represent the information produced by resolving
+ * a compilation unit as part of a specific library.
+ */
+class DartEntryImpl_ResolutionState {
+  /**
+   * The state of the cached resolved compilation unit.
+   */
+  CacheState _resolvedUnitState = CacheState.INVALID;
+  /**
+   * The resolved compilation unit, or {@code null} if the resolved compilation unit is not
+   * currently cached.
+   */
+  CompilationUnit _resolvedUnit;
+  /**
+   * The state of the cached resolution errors.
+   */
+  CacheState _resolutionErrorsState = CacheState.INVALID;
+  /**
+   * The errors produced while resolving the compilation unit, or {@code null} if the errors are
+   * not currently cached.
+   */
+  List<AnalysisError> _resolutionErrors = AnalysisError.NO_ERRORS;
+  /**
+   * Initialize a newly created resolution state.
+   */
+  DartEntryImpl_ResolutionState() : super() {
+  }
+  /**
+   * Set this state to be exactly like the given state.
+   * @param other the state to be copied
+   */
+  void copyFrom(DartEntryImpl_ResolutionState other) {
+    _resolvedUnitState = other._resolvedUnitState;
+    _resolvedUnit = other._resolvedUnit;
+    _resolutionErrorsState = other._resolutionErrorsState;
+    _resolutionErrors = other._resolutionErrors;
+  }
+  /**
+   * Invalidate all of the resolution information associated with the compilation unit.
+   */
+  void invalidateAllResolutionInformation() {
+    _resolvedUnitState = CacheState.INVALID;
+    _resolvedUnit = null;
+    _resolutionErrorsState = CacheState.INVALID;
+    _resolutionErrors = AnalysisError.NO_ERRORS;
+  }
+}
+/**
+ * Instances of the class {@code DataDescriptor} are immutable constants representing data that can
+ * be stored in the cache.
+ */
+class DataDescriptor<E> {
+  /**
+   * The name of the descriptor, used for debugging purposes.
+   */
+  String _name;
+  /**
+   * Initialize a newly created descriptor to have the given name.
+   * @param name the name of the descriptor
+   */
+  DataDescriptor(String name) {
+    this._name = name;
+  }
+  String toString() => _name;
+}
+/**
+ * The interface {@code HtmlEntry} defines the behavior of objects that maintain the information
+ * cached by an analysis context about an individual HTML file.
+ * @coverage dart.engine
+ */
+abstract class HtmlEntry implements SourceEntry {
+  /**
+   * The data descriptor representing the HTML element.
+   */
+  static DataDescriptor<HtmlElement> ELEMENT = new DataDescriptor<HtmlElement>("HtmlEntry.ELEMENT");
+  /**
+   * The data descriptor representing the parsed AST structure.
+   */
+  static DataDescriptor<HtmlUnit> PARSED_UNIT = new DataDescriptor<HtmlUnit>("HtmlEntry.PARSED_UNIT");
+  /**
+   * The data descriptor representing the list of referenced libraries.
+   */
+  static DataDescriptor<List<Source>> REFERENCED_LIBRARIES = new DataDescriptor<List<Source>>("HtmlEntry.REFERENCED_LIBRARIES");
+  /**
+   * The data descriptor representing the errors resulting from resolving the source.
+   */
+  static DataDescriptor<List<AnalysisError>> RESOLUTION_ERRORS = new DataDescriptor<List<AnalysisError>>("HtmlEntry.RESOLUTION_ERRORS");
+  /**
+   * The data descriptor representing the resolved AST structure.
+   */
+  static DataDescriptor<HtmlUnit> RESOLVED_UNIT = new DataDescriptor<HtmlUnit>("HtmlEntry.RESOLVED_UNIT");
+  HtmlEntryImpl get writableCopy;
+}
+/**
+ * Instances of the class {@code HtmlEntryImpl} implement an {@link HtmlEntry}.
+ * @coverage dart.engine
+ */
+class HtmlEntryImpl extends SourceEntryImpl implements HtmlEntry {
+  /**
+   * The state of the cached parsed (but not resolved) HTML unit.
+   */
+  CacheState _parsedUnitState = CacheState.INVALID;
+  /**
+   * The parsed HTML unit, or {@code null} if the parsed HTML unit is not currently cached.
+   */
+  HtmlUnit _parsedUnit;
+  /**
+   * The state of the cached resolution errors.
+   */
+  CacheState _resolutionErrorsState = CacheState.INVALID;
+  /**
+   * The errors produced while resolving the compilation unit, or {@code null} if the errors are not
+   * currently cached.
+   */
+  List<AnalysisError> _resolutionErrors = AnalysisError.NO_ERRORS;
+  /**
+   * The state of the cached parsed and resolved HTML unit.
+   */
+  CacheState _resolvedUnitState = CacheState.INVALID;
+  /**
+   * The resolved HTML unit, or {@code null} if the resolved HTML unit is not currently cached.
+   */
+  HtmlUnit _resolvedUnit;
+  /**
+   * The state of the cached list of referenced libraries.
+   */
+  CacheState _referencedLibrariesState = CacheState.INVALID;
+  /**
+   * The list of libraries referenced in the HTML, or {@code null} if the list is not currently
+   * cached. Note that this list does not include libraries defined directly within the HTML file.
+   */
+  List<Source> _referencedLibraries = Source.EMPTY_ARRAY;
+  /**
+   * The state of the cached HTML element.
+   */
+  CacheState _elementState = CacheState.INVALID;
+  /**
+   * The element representing the HTML file, or {@code null} if the element is not currently cached.
+   */
+  HtmlElement _element;
+  /**
+   * Initialize a newly created cache entry to be empty.
+   */
+  HtmlEntryImpl() : super() {
+  }
+  SourceKind get kind => SourceKind.HTML;
+  CacheState getState(DataDescriptor<Object> descriptor) {
+    if (identical(descriptor, HtmlEntry.ELEMENT)) {
+      return _elementState;
+    } else if (identical(descriptor, HtmlEntry.PARSED_UNIT)) {
+      return _parsedUnitState;
+    } else if (identical(descriptor, HtmlEntry.REFERENCED_LIBRARIES)) {
+      return _referencedLibrariesState;
+    } else if (identical(descriptor, HtmlEntry.RESOLUTION_ERRORS)) {
+      return _resolutionErrorsState;
+    } else if (identical(descriptor, HtmlEntry.RESOLVED_UNIT)) {
+      return _resolvedUnitState;
+    }
+    return super.getState(descriptor);
+  }
+  Object getValue(DataDescriptor descriptor) {
+    if (identical(descriptor, HtmlEntry.ELEMENT)) {
+      return _element as Object;
+    } else if (identical(descriptor, HtmlEntry.PARSED_UNIT)) {
+      return _parsedUnit as Object;
+    } else if (identical(descriptor, HtmlEntry.REFERENCED_LIBRARIES)) {
+      return _referencedLibraries as Object;
+    } else if (identical(descriptor, HtmlEntry.RESOLUTION_ERRORS)) {
+      return _resolutionErrors as Object;
+    } else if (identical(descriptor, HtmlEntry.RESOLVED_UNIT)) {
+      return _resolvedUnit as Object;
+    }
+    return super.getValue(descriptor);
+  }
+  HtmlEntryImpl get writableCopy {
+    HtmlEntryImpl copy = new HtmlEntryImpl();
+    copy.copyFrom(this);
+    return copy;
+  }
+  void setState(DataDescriptor<Object> descriptor, CacheState state) {
+    if (identical(descriptor, HtmlEntry.ELEMENT)) {
+      _element = updatedValue(state, _element, null);
+      _elementState = state;
+    } else if (identical(descriptor, HtmlEntry.PARSED_UNIT)) {
+      _parsedUnit = updatedValue(state, _parsedUnit, null);
+      _parsedUnitState = state;
+    } else if (identical(descriptor, HtmlEntry.REFERENCED_LIBRARIES)) {
+      _referencedLibraries = updatedValue(state, _referencedLibraries, Source.EMPTY_ARRAY);
+      _referencedLibrariesState = state;
+    } else if (identical(descriptor, HtmlEntry.RESOLUTION_ERRORS)) {
+      _resolutionErrors = updatedValue(state, _resolutionErrors, AnalysisError.NO_ERRORS);
+      _resolutionErrorsState = state;
+    } else if (identical(descriptor, HtmlEntry.RESOLVED_UNIT)) {
+      _resolvedUnit = updatedValue(state, _resolvedUnit, null);
+      _resolvedUnitState = state;
+    } else {
+      super.setState(descriptor, state);
+    }
+  }
+  void setValue(DataDescriptor descriptor, Object value) {
+    if (identical(descriptor, HtmlEntry.ELEMENT)) {
+      _element = value as HtmlElement;
+      _elementState = CacheState.VALID;
+    } else if (identical(descriptor, HtmlEntry.PARSED_UNIT)) {
+      _parsedUnit = value as HtmlUnit;
+      _parsedUnitState = CacheState.VALID;
+    } else if (identical(descriptor, HtmlEntry.REFERENCED_LIBRARIES)) {
+      _referencedLibraries = value == null ? Source.EMPTY_ARRAY : (value as List<Source>);
+      _referencedLibrariesState = CacheState.VALID;
+    } else if (identical(descriptor, HtmlEntry.RESOLUTION_ERRORS)) {
+      _resolutionErrors = value as List<AnalysisError>;
+      _resolutionErrorsState = CacheState.VALID;
+    } else if (identical(descriptor, HtmlEntry.RESOLVED_UNIT)) {
+      _resolvedUnit = value as HtmlUnit;
+      _resolvedUnitState = CacheState.VALID;
+    } else {
+      super.setValue(descriptor, value);
+    }
+  }
+  void copyFrom(SourceEntryImpl entry) {
+    super.copyFrom(entry);
+    HtmlEntryImpl other = entry as HtmlEntryImpl;
+    _parsedUnitState = other._parsedUnitState;
+    _parsedUnit = other._parsedUnit;
+    _referencedLibrariesState = other._referencedLibrariesState;
+    _referencedLibraries = other._referencedLibraries;
+    _resolutionErrors = other._resolutionErrors;
+    _resolutionErrorsState = other._resolutionErrorsState;
+    _resolvedUnitState = other._resolvedUnitState;
+    _resolvedUnit = other._resolvedUnit;
+    _elementState = other._elementState;
+    _element = other._element;
+  }
+}
+/**
+ * The interface {@code SourceEntry} defines the behavior of objects that maintain the information
+ * cached by an analysis context about an individual source, no matter what kind of source it is.
+ * <p>
+ * Source entries should be treated as if they were immutable unless a writable copy of the entry
+ * has been obtained and has not yet been made visible to other threads.
+ * @coverage dart.engine
+ */
+abstract class SourceEntry {
+  /**
+   * The data descriptor representing the line information.
+   */
+  static DataDescriptor<LineInfo> LINE_INFO = new DataDescriptor<LineInfo>("SourceEntry.LINE_INFO");
+  /**
+   * Return the kind of the source, or {@code null} if the kind is not currently cached.
+   * @return the kind of the source
+   */
+  SourceKind get kind;
+  /**
+   * Return the most recent time at which the state of the source matched the state represented by
+   * this entry.
+   * @return the modification time of this entry
+   */
+  int get modificationTime;
+  /**
+   * Return the state of the data represented by the given descriptor.
+   * @param descriptor the descriptor representing the data whose state is to be returned
+   * @return the state of the data represented by the given descriptor
+   */
+  CacheState getState(DataDescriptor<Object> descriptor);
+  /**
+   * Return the value of the data represented by the given descriptor, or {@code null} if the data
+   * represented by the descriptor is not in the cache.
+   * @param descriptor the descriptor representing which data is to be returned
+   * @return the value of the data represented by the given descriptor
+   */
+  Object getValue(DataDescriptor descriptor);
+  /**
+   * Return a new entry that is initialized to the same state as this entry but that can be
+   * modified.
+   * @return a writable copy of this entry
+   */
+  SourceEntryImpl get writableCopy;
+}
+/**
+ * Instances of the abstract class {@code SourceEntryImpl} implement the behavior common to all{@link SourceEntry source entries}.
+ * @coverage dart.engine
+ */
+abstract class SourceEntryImpl implements SourceEntry {
+  /**
+   * The most recent time at which the state of the source matched the state represented by this
+   * entry.
+   */
+  int _modificationTime = 0;
+  /**
+   * The state of the cached line information.
+   */
+  CacheState _lineInfoState = CacheState.INVALID;
+  /**
+   * The line information computed for the source, or {@code null} if the line information is not
+   * currently cached.
+   */
+  LineInfo _lineInfo;
+  /**
+   * Initialize a newly created cache entry to be empty.
+   */
+  SourceEntryImpl() : super() {
+  }
+  int get modificationTime => _modificationTime;
+  CacheState getState(DataDescriptor<Object> descriptor) {
+    if (identical(descriptor, SourceEntry.LINE_INFO)) {
+      return _lineInfoState;
+    } else {
+      throw new IllegalArgumentException("Invalid descriptor: ${descriptor}");
+    }
+  }
+  Object getValue(DataDescriptor descriptor) {
+    if (identical(descriptor, SourceEntry.LINE_INFO)) {
+      return _lineInfo as Object;
+    } else {
+      throw new IllegalArgumentException("Invalid descriptor: ${descriptor}");
+    }
+  }
+  /**
+   * Set the most recent time at which the state of the source matched the state represented by this
+   * entry to the given time.
+   * @param time the new modification time of this entry
+   */
+  void set modificationTime(int time) {
+    _modificationTime = time;
+  }
+  /**
+   * Set the state of the data represented by the given descriptor to the given state.
+   * @param descriptor the descriptor representing the data whose state is to be set
+   * @param the new state of the data represented by the given descriptor
+   */
+  void setState(DataDescriptor<Object> descriptor, CacheState state) {
+    if (identical(descriptor, SourceEntry.LINE_INFO)) {
+      _lineInfo = updatedValue(state, _lineInfo, null);
+      _lineInfoState = state;
+    } else {
+      throw new IllegalArgumentException("Invalid descriptor: ${descriptor}");
+    }
+  }
+  /**
+   * Set the value of the data represented by the given descriptor to the given value.
+   * @param descriptor the descriptor representing the data whose value is to be set
+   * @param value the new value of the data represented by the given descriptor
+   */
+  void setValue(DataDescriptor descriptor, Object value) {
+    if (identical(descriptor, SourceEntry.LINE_INFO)) {
+      _lineInfo = value as LineInfo;
+      _lineInfoState = CacheState.VALID;
+    } else {
+      throw new IllegalArgumentException("Invalid descriptor: ${descriptor}");
+    }
+  }
+  /**
+   * Copy the information from the given cache entry.
+   * @param entry the cache entry from which information will be copied
+   */
+  void copyFrom(SourceEntryImpl entry) {
+    _modificationTime = entry._modificationTime;
+    _lineInfoState = entry._lineInfoState;
+    _lineInfo = entry._lineInfo;
+  }
+  /**
+   * Given that some data is being transitioned to the given state, return the value that should be
+   * kept in the cache.
+   * @param state the state to which the data is being transitioned
+   * @param currentValue the value of the data before the transition
+   * @param defaultValue the value to be used if the current value is to be removed from the cache
+   * @return the value of the data that should be kept in the cache
+   */
+  Object updatedValue(CacheState state, Object currentValue, Object defaultValue) {
+    if (identical(state, CacheState.VALID)) {
+      throw new IllegalArgumentException("Use setValue() to set the state to VALID");
+    } else if (identical(state, CacheState.IN_PROCESS)) {
+      return currentValue;
+    }
+    return defaultValue;
+  }
+}
+/**
  * Instances of the class {@code AnalysisContextImpl} implement an {@link AnalysisContext analysis
  * context}.
  * @coverage dart.engine
@@ -614,7 +1608,7 @@
   /**
    * A table mapping the sources known to the context to the information known about the source.
    */
-  Map<Source, SourceInfo> _sourceMap = new Map<Source, SourceInfo>();
+  Map<Source, SourceEntry> _sourceMap = new Map<Source, SourceEntry>();
   /**
    * A table mapping sources to the change notices that are waiting to be returned related to that
    * source.
@@ -652,7 +1646,7 @@
    */
   AnalysisContextImpl() : super() {
   }
-  void addSourceInfo(Source source, SourceInfo info) {
+  void addSourceInfo(Source source, SourceEntry info) {
     _sourceMap[source] = info;
   }
   void applyChanges(ChangeSet changeSet) {
@@ -664,8 +1658,11 @@
       for (SourceContainer container in changeSet.removedContainers) {
         addSourcesInContainer(removedSources, container);
       }
+      bool addedDartSource = false;
       for (Source source in changeSet.added3) {
-        sourceAvailable(source);
+        if (sourceAvailable(source)) {
+          addedDartSource = true;
+        }
       }
       for (Source source in changeSet.changed3) {
         sourceChanged(source);
@@ -673,20 +1670,76 @@
       for (Source source in removedSources) {
         sourceRemoved(source);
       }
+      if (addedDartSource) {
+        for (MapEntry<Source, SourceEntry> mapEntry in getMapEntrySet(_sourceMap)) {
+          if (!mapEntry.getKey().isInSystemLibrary() && mapEntry.getValue() is DartEntry) {
+            ((mapEntry.getValue() as DartEntryImpl)).invalidateAllResolutionInformation();
+          }
+        }
+      }
     }
   }
+  String computeDocumentationComment(Element element) {
+    if (element == null) {
+      return null;
+    }
+    Source source2 = element.source;
+    if (source2 == null) {
+      return null;
+    }
+    List<CharSequence> contentHolder = new List<CharSequence>(1);
+    try {
+      source2.getContents(new Source_ContentReceiver_5(contentHolder));
+    } catch (exception) {
+      throw new AnalysisException.con2("Could not get contents of ${source2.fullName}", exception);
+    }
+    if (contentHolder[0] == null) {
+      return null;
+    }
+    CompilationUnit unit = parseCompilationUnit(source2);
+    if (unit == null) {
+      return null;
+    }
+    NodeLocator locator = new NodeLocator.con1(element.nameOffset);
+    ASTNode nameNode = locator.searchWithin(unit);
+    while (nameNode != null) {
+      if (nameNode is AnnotatedNode) {
+        Comment comment = ((nameNode as AnnotatedNode)).documentationComment;
+        if (comment == null) {
+          return null;
+        }
+        int offset2 = comment.offset;
+        return contentHolder[0].subSequence(offset2, offset2 + comment.length).toString();
+      }
+      nameNode = nameNode.parent;
+    }
+    return null;
+  }
   List<AnalysisError> computeErrors(Source source) {
     {
-      CompilationUnitInfo info = getCompilationUnitInfo(source);
-      if (info == null) {
-        return AnalysisError.NO_ERRORS;
+      SourceEntry sourceEntry = getSourceEntry(source);
+      if (sourceEntry is DartEntry) {
+        DartEntry dartEntry = sourceEntry as DartEntry;
+        CacheState parseErrorsState = dartEntry.getState(DartEntry.PARSE_ERRORS);
+        if (parseErrorsState != CacheState.VALID && parseErrorsState != CacheState.ERROR) {
+          parseCompilationUnit(source);
+        }
+        List<Source> libraries = getLibrariesContaining(source);
+        for (Source librarySource in libraries) {
+          CacheState resolutionErrorsState = dartEntry.getState2(DartEntry.RESOLUTION_ERRORS, librarySource);
+          if (resolutionErrorsState != CacheState.VALID && resolutionErrorsState != CacheState.ERROR) {
+          }
+        }
+        return dartEntry.allErrors;
+      } else if (sourceEntry is HtmlEntry) {
+        HtmlEntry htmlEntry = sourceEntry as HtmlEntry;
+        CacheState resolutionErrorsState = htmlEntry.getState(HtmlEntry.RESOLUTION_ERRORS);
+        if (resolutionErrorsState != CacheState.VALID && resolutionErrorsState != CacheState.ERROR) {
+          computeHtmlElement(source);
+        }
+        return htmlEntry.getValue(HtmlEntry.RESOLUTION_ERRORS);
       }
-      if (info.hasInvalidParseErrors()) {
-        parseCompilationUnit(source);
-      }
-      if (info.hasInvalidResolutionErrors()) {
-      }
-      return info.allErrors;
+      return AnalysisError.NO_ERRORS;
     }
   }
   HtmlElement computeHtmlElement(Source source) {
@@ -694,36 +1747,45 @@
       return null;
     }
     {
-      HtmlUnitInfo htmlUnitInfo = getHtmlUnitInfo(source);
-      if (htmlUnitInfo == null) {
+      HtmlEntry htmlEntry = getHtmlEntry(source);
+      if (htmlEntry == null) {
         return null;
       }
-      HtmlElement element2 = htmlUnitInfo.element;
-      if (element2 == null) {
-        HtmlUnit unit = htmlUnitInfo.resolvedUnit;
+      HtmlElement element = htmlEntry.getValue(HtmlEntry.ELEMENT);
+      if (element == null) {
+        HtmlUnit unit = htmlEntry.getValue(HtmlEntry.RESOLVED_UNIT);
         if (unit == null) {
-          unit = htmlUnitInfo.parsedUnit;
+          unit = htmlEntry.getValue(HtmlEntry.PARSED_UNIT);
           if (unit == null) {
             unit = parseHtmlUnit(source);
           }
         }
-        HtmlUnitBuilder builder = new HtmlUnitBuilder(this);
-        element2 = builder.buildHtmlElement2(source, unit);
-        htmlUnitInfo.resolvedUnit = unit;
-        htmlUnitInfo.element = element2;
+        RecordingErrorListener listener = new RecordingErrorListener();
+        HtmlUnitBuilder builder = new HtmlUnitBuilder(this, listener);
+        element = builder.buildHtmlElement2(source, unit);
+        List<AnalysisError> resolutionErrors = listener.getErrors2(source);
+        HtmlEntryImpl htmlCopy = (htmlEntry as HtmlEntryImpl);
+        htmlCopy.setValue(HtmlEntry.RESOLVED_UNIT, unit);
+        htmlCopy.setValue(HtmlEntry.RESOLUTION_ERRORS, resolutionErrors);
+        htmlCopy.setValue(HtmlEntry.ELEMENT, element);
+        getNotice(source).setErrors(resolutionErrors, htmlCopy.getValue(SourceEntry.LINE_INFO));
       }
-      return element2;
+      return element;
     }
   }
   SourceKind computeKindOf(Source source) {
     {
-      SourceInfo sourceInfo = getSourceInfo(source);
-      if (sourceInfo == null) {
+      SourceEntry sourceEntry = getSourceEntry(source);
+      if (sourceEntry == null) {
         return SourceKind.UNKNOWN;
-      } else if (identical(sourceInfo, DartInfo.pendingInstance)) {
-        sourceInfo = internalComputeKindOf(source);
+      } else if (sourceEntry is DartEntry) {
+        DartEntry dartEntry = sourceEntry as DartEntry;
+        CacheState sourceKindState = dartEntry.getState(DartEntry.SOURCE_KIND);
+        if (sourceKindState != CacheState.VALID && sourceKindState != CacheState.ERROR) {
+          internalComputeKindOf(source);
+        }
       }
-      return sourceInfo.kind;
+      return sourceEntry.kind;
     }
   }
   LibraryElement computeLibraryElement(Source source) {
@@ -731,65 +1793,59 @@
       return null;
     }
     {
-      LibraryInfo libraryInfo = getLibraryInfo(source);
-      if (libraryInfo == null) {
+      DartEntry dartEntry = getDartEntry(source);
+      if (dartEntry == null) {
         return null;
       }
-      LibraryElement element2 = libraryInfo.element;
-      if (element2 == null) {
+      LibraryElement element = dartEntry.getValue(DartEntry.ELEMENT);
+      if (element == null) {
         if (computeKindOf(source) != SourceKind.LIBRARY) {
-          return null;
+          throw new AnalysisException.con1("Cannot compute library element for non-library: ${source.fullName}");
         }
         LibraryResolver resolver = new LibraryResolver.con1(this);
         try {
-          element2 = resolver.resolveLibrary(source, true);
-          if (element2 != null) {
-            libraryInfo.element = element2;
+          element = resolver.resolveLibrary(source, true);
+          if (element != null) {
+            ((dartEntry as DartEntryImpl)).setValue(DartEntry.ELEMENT, element);
           }
         } on AnalysisException catch (exception) {
           AnalysisEngine.instance.logger.logError2("Could not resolve the library ${source.fullName}", exception);
         }
       }
-      return element2;
+      return element;
     }
   }
   LineInfo computeLineInfo(Source source) {
     {
-      SourceInfo sourceInfo = getSourceInfo(source);
-      if (sourceInfo == null) {
+      SourceEntry sourceEntry = getSourceEntry(source);
+      if (sourceEntry == null) {
         return null;
       }
-      LineInfo lineInfo2 = sourceInfo.lineInfo;
-      if (lineInfo2 == null) {
-        if (identical(sourceInfo, DartInfo.pendingInstance)) {
-          sourceInfo = internalComputeKindOf(source);
-        }
-        if (sourceInfo is HtmlUnitInfo) {
+      LineInfo lineInfo = sourceEntry.getValue(SourceEntry.LINE_INFO);
+      if (lineInfo == null) {
+        if (sourceEntry is HtmlEntry) {
           parseHtmlUnit(source);
-          lineInfo2 = sourceInfo.lineInfo;
-        } else if (sourceInfo is CompilationUnitInfo) {
+          lineInfo = sourceEntry.getValue(SourceEntry.LINE_INFO);
+        } else if (sourceEntry is DartEntry) {
           parseCompilationUnit(source);
-          lineInfo2 = sourceInfo.lineInfo;
+          lineInfo = sourceEntry.getValue(SourceEntry.LINE_INFO);
         }
       }
-      return lineInfo2;
+      return lineInfo;
     }
   }
   CompilationUnit computeResolvableCompilationUnit(Source source) {
     {
-      CompilationUnitInfo compilationUnitInfo = getCompilationUnitInfo(source);
-      if (compilationUnitInfo == null) {
+      DartEntry dartEntry = getDartEntry(source);
+      if (dartEntry == null) {
         return null;
       }
-      CompilationUnit unit = compilationUnitInfo.parsedCompilationUnit;
-      if (unit == null) {
-        unit = compilationUnitInfo.resolvedCompilationUnit;
-      }
+      CompilationUnit unit = dartEntry.anyParsedCompilationUnit;
       if (unit != null) {
         return unit.accept(new ASTCloner()) as CompilationUnit;
       }
-      unit = internalParseCompilationUnit(compilationUnitInfo, source);
-      compilationUnitInfo.clearParsedUnit();
+      unit = internalParseCompilationUnit(((dartEntry as DartEntryImpl)), source);
+      ((dartEntry as DartEntryImpl)).setState(DartEntry.PARSED_UNIT, CacheState.FLUSHED);
       return unit;
     }
   }
@@ -797,11 +1853,11 @@
   InternalAnalysisContext extractContextInto(SourceContainer container, InternalAnalysisContext newContext) {
     List<Source> sourcesToRemove = new List<Source>();
     {
-      for (MapEntry<Source, SourceInfo> entry in getMapEntrySet(_sourceMap)) {
+      for (MapEntry<Source, SourceEntry> entry in getMapEntrySet(_sourceMap)) {
         Source source = entry.getKey();
         if (container.contains(source)) {
           sourcesToRemove.add(source);
-          newContext.addSourceInfo(source, entry.getValue().copy());
+          newContext.addSourceInfo(source, entry.getValue().writableCopy);
         }
       }
     }
@@ -828,19 +1884,22 @@
   }
   AnalysisErrorInfo getErrors(Source source) {
     {
-      SourceInfo info = getSourceInfo(source);
-      if (info is CompilationUnitInfo) {
-        CompilationUnitInfo compilationUnitInfo = info as CompilationUnitInfo;
-        return new AnalysisErrorInfoImpl(compilationUnitInfo.allErrors, compilationUnitInfo.lineInfo);
+      SourceEntry sourceEntry = getSourceEntry(source);
+      if (sourceEntry is DartEntry) {
+        DartEntry dartEntry = sourceEntry as DartEntry;
+        return new AnalysisErrorInfoImpl(dartEntry.allErrors, dartEntry.getValue(SourceEntry.LINE_INFO));
+      } else if (sourceEntry is HtmlEntry) {
+        HtmlEntry htmlEntry = sourceEntry as HtmlEntry;
+        return new AnalysisErrorInfoImpl(htmlEntry.getValue(HtmlEntry.RESOLUTION_ERRORS), htmlEntry.getValue(SourceEntry.LINE_INFO));
       }
-      return new AnalysisErrorInfoImpl(AnalysisError.NO_ERRORS, info.lineInfo);
+      return new AnalysisErrorInfoImpl(AnalysisError.NO_ERRORS, sourceEntry.getValue(SourceEntry.LINE_INFO));
     }
   }
   HtmlElement getHtmlElement(Source source) {
     {
-      SourceInfo info = getSourceInfo(source);
-      if (info is HtmlUnitInfo) {
-        return ((info as HtmlUnitInfo)).element;
+      SourceEntry sourceEntry = getSourceEntry(source);
+      if (sourceEntry is HtmlEntry) {
+        return ((sourceEntry as HtmlEntry)).getValue(HtmlEntry.ELEMENT);
       }
       return null;
     }
@@ -852,9 +1911,10 @@
         if (getKindOf(source) == SourceKind.LIBRARY) {
         } else if (getKindOf(source) == SourceKind.PART) {
           List<Source> librarySources = getLibrariesContaining(source);
-          for (MapEntry<Source, SourceInfo> entry in getMapEntrySet(_sourceMap)) {
+          for (MapEntry<Source, SourceEntry> entry in getMapEntrySet(_sourceMap)) {
             if (identical(entry.getValue().kind, SourceKind.HTML)) {
-              if (containsAny(((entry.getValue() as HtmlUnitInfo)).librarySources, librarySources)) {
+              List<Source> referencedLibraries = ((entry.getValue() as HtmlEntry)).getValue(HtmlEntry.REFERENCED_LIBRARIES);
+              if (containsAny(referencedLibraries, librarySources)) {
                 htmlSources.add(entry.getKey());
               }
             }
@@ -871,20 +1931,20 @@
   List<Source> get htmlSources => getSources(SourceKind.HTML);
   SourceKind getKindOf(Source source) {
     {
-      SourceInfo sourceInfo = getSourceInfo(source);
-      if (sourceInfo == null) {
+      SourceEntry sourceEntry = getSourceEntry(source);
+      if (sourceEntry == null) {
         return SourceKind.UNKNOWN;
       }
-      return sourceInfo.kind;
+      return sourceEntry.kind;
     }
   }
   List<Source> get launchableClientLibrarySources {
     List<Source> sources = new List<Source>();
     {
-      for (MapEntry<Source, SourceInfo> entry in getMapEntrySet(_sourceMap)) {
+      for (MapEntry<Source, SourceEntry> entry in getMapEntrySet(_sourceMap)) {
         Source source = entry.getKey();
-        SourceInfo info = entry.getValue();
-        if (identical(info.kind, SourceKind.LIBRARY) && !source.isInSystemLibrary()) {
+        SourceEntry sourceEntry = entry.getValue();
+        if (identical(sourceEntry.kind, SourceKind.LIBRARY) && !source.isInSystemLibrary()) {
           sources.add(source);
         }
       }
@@ -894,10 +1954,10 @@
   List<Source> get launchableServerLibrarySources {
     List<Source> sources = new List<Source>();
     {
-      for (MapEntry<Source, SourceInfo> entry in getMapEntrySet(_sourceMap)) {
+      for (MapEntry<Source, SourceEntry> entry in getMapEntrySet(_sourceMap)) {
         Source source = entry.getKey();
-        SourceInfo info = entry.getValue();
-        if (identical(info.kind, SourceKind.LIBRARY) && !source.isInSystemLibrary()) {
+        SourceEntry sourceEntry = entry.getValue();
+        if (identical(sourceEntry.kind, SourceKind.LIBRARY) && !source.isInSystemLibrary()) {
           sources.add(source);
         }
       }
@@ -907,9 +1967,9 @@
   List<Source> getLibrariesContaining(Source source) {
     {
       List<Source> librarySources = new List<Source>();
-      for (MapEntry<Source, SourceInfo> entry in getMapEntrySet(_sourceMap)) {
+      for (MapEntry<Source, SourceEntry> entry in getMapEntrySet(_sourceMap)) {
         if (identical(entry.getValue().kind, SourceKind.LIBRARY)) {
-          if (contains(((entry.getValue() as LibraryInfo)).unitSources, source)) {
+          if (contains(((entry.getValue() as DartEntry)).getValue(DartEntry.INCLUDED_PARTS), source)) {
             librarySources.add(entry.getKey());
           }
         }
@@ -922,9 +1982,9 @@
   }
   LibraryElement getLibraryElement(Source source) {
     {
-      SourceInfo info = getSourceInfo(source);
-      if (info is LibraryInfo) {
-        return ((info as LibraryInfo)).element;
+      SourceEntry sourceEntry = getSourceEntry(source);
+      if (sourceEntry is DartEntry) {
+        return ((sourceEntry as DartEntry)).getValue(DartEntry.ELEMENT);
       }
       return null;
     }
@@ -932,9 +1992,9 @@
   List<Source> get librarySources => getSources(SourceKind.LIBRARY);
   LineInfo getLineInfo(Source source) {
     {
-      SourceInfo info = getSourceInfo(source);
-      if (info != null) {
-        return info.lineInfo;
+      SourceEntry sourceEntry = getSourceEntry(source);
+      if (sourceEntry != null) {
+        return sourceEntry.getValue(SourceEntry.LINE_INFO);
       }
       return null;
     }
@@ -942,26 +2002,26 @@
   Namespace getPublicNamespace(LibraryElement library) {
     Source source2 = library.definingCompilationUnit.source;
     {
-      LibraryInfo libraryInfo = getLibraryInfo(source2);
-      if (libraryInfo == null) {
+      DartEntry dartEntry = getDartEntry(source2);
+      if (dartEntry == null) {
         return null;
       }
-      Namespace namespace = libraryInfo.publicNamespace;
+      Namespace namespace = dartEntry.getValue(DartEntry.PUBLIC_NAMESPACE);
       if (namespace == null) {
         NamespaceBuilder builder = new NamespaceBuilder();
         namespace = builder.createPublicNamespace(library);
-        libraryInfo.publicNamespace = namespace;
+        ((dartEntry as DartEntryImpl)).setValue(DartEntry.PUBLIC_NAMESPACE, namespace);
       }
       return namespace;
     }
   }
   Namespace getPublicNamespace2(Source source) {
     {
-      LibraryInfo libraryInfo = getLibraryInfo(source);
-      if (libraryInfo == null) {
+      DartEntry dartEntry = getDartEntry(source);
+      if (dartEntry == null) {
         return null;
       }
-      Namespace namespace = libraryInfo.publicNamespace;
+      Namespace namespace = dartEntry.getValue(DartEntry.PUBLIC_NAMESPACE);
       if (namespace == null) {
         LibraryElement library = computeLibraryElement(source);
         if (library == null) {
@@ -969,7 +2029,7 @@
         }
         NamespaceBuilder builder = new NamespaceBuilder();
         namespace = builder.createPublicNamespace(library);
-        libraryInfo.publicNamespace = namespace;
+        ((dartEntry as DartEntryImpl)).setValue(DartEntry.PUBLIC_NAMESPACE, namespace);
       }
       return namespace;
     }
@@ -983,43 +2043,47 @@
   CompilationUnit getResolvedCompilationUnit2(Source unitSource, Source librarySource) {
     {
       accessed(unitSource);
-      CompilationUnitInfo compilationUnitInfo = getCompilationUnitInfo(unitSource);
-      if (compilationUnitInfo == null) {
+      DartEntry dartEntry = getDartEntry(unitSource);
+      if (dartEntry == null) {
         return null;
       }
-      return compilationUnitInfo.resolvedCompilationUnit;
+      return dartEntry.getValue2(DartEntry.RESOLVED_UNIT, librarySource);
     }
   }
   SourceFactory get sourceFactory => _sourceFactory;
   bool isClientLibrary(Source librarySource) {
-    SourceInfo sourceInfo = getSourceInfo(librarySource);
-    if (sourceInfo is LibraryInfo) {
-      LibraryInfo libraryInfo = sourceInfo as LibraryInfo;
-      if (libraryInfo.hasInvalidLaunchable() || libraryInfo.hasInvalidClientServer()) {
+    SourceEntry sourceEntry = getSourceEntry(librarySource);
+    if (sourceEntry is DartEntry) {
+      DartEntry dartEntry = sourceEntry as DartEntry;
+      CacheState isClientState = dartEntry.getState(DartEntry.IS_CLIENT);
+      CacheState isLaunchableState = dartEntry.getState(DartEntry.IS_LAUNCHABLE);
+      if (identical(isClientState, CacheState.INVALID) || identical(isClientState, CacheState.ERROR) || identical(isLaunchableState, CacheState.INVALID) || identical(isLaunchableState, CacheState.ERROR)) {
         return false;
       }
-      return libraryInfo.isLaunchable() && libraryInfo.isClient();
+      return dartEntry.getValue(DartEntry.IS_CLIENT) && dartEntry.getValue(DartEntry.IS_LAUNCHABLE);
     }
     return false;
   }
   bool isServerLibrary(Source librarySource) {
-    SourceInfo sourceInfo = getSourceInfo(librarySource);
-    if (sourceInfo is LibraryInfo) {
-      LibraryInfo libraryInfo = sourceInfo as LibraryInfo;
-      if (libraryInfo.hasInvalidLaunchable() || libraryInfo.hasInvalidClientServer()) {
+    SourceEntry sourceEntry = getSourceEntry(librarySource);
+    if (sourceEntry is DartEntry) {
+      DartEntry dartEntry = sourceEntry as DartEntry;
+      CacheState isClientState = dartEntry.getState(DartEntry.IS_CLIENT);
+      CacheState isLaunchableState = dartEntry.getState(DartEntry.IS_LAUNCHABLE);
+      if (identical(isClientState, CacheState.INVALID) || identical(isClientState, CacheState.ERROR) || identical(isLaunchableState, CacheState.INVALID) || identical(isLaunchableState, CacheState.ERROR)) {
         return false;
       }
-      return libraryInfo.isLaunchable() && libraryInfo.isServer();
+      return !dartEntry.getValue(DartEntry.IS_CLIENT) && dartEntry.getValue(DartEntry.IS_LAUNCHABLE);
     }
     return false;
   }
   void mergeContext(AnalysisContext context) {
     {
-      for (MapEntry<Source, SourceInfo> entry in getMapEntrySet(((context as AnalysisContextImpl))._sourceMap)) {
+      for (MapEntry<Source, SourceEntry> entry in getMapEntrySet(((context as AnalysisContextImpl))._sourceMap)) {
         Source newSource = entry.getKey();
-        SourceInfo existingInfo = getSourceInfo(newSource);
-        if (existingInfo == null) {
-          _sourceMap[newSource] = entry.getValue().copy();
+        SourceEntry existingEntry = getSourceEntry(newSource);
+        if (existingEntry == null) {
+          _sourceMap[newSource] = entry.getValue().writableCopy;
         } else {
         }
       }
@@ -1028,16 +2092,13 @@
   CompilationUnit parseCompilationUnit(Source source) {
     {
       accessed(source);
-      CompilationUnitInfo compilationUnitInfo = getCompilationUnitInfo(source);
-      if (compilationUnitInfo == null) {
+      DartEntry dartEntry = getDartEntry(source);
+      if (dartEntry == null) {
         return null;
       }
-      CompilationUnit unit = compilationUnitInfo.resolvedCompilationUnit;
+      CompilationUnit unit = dartEntry.anyParsedCompilationUnit;
       if (unit == null) {
-        unit = compilationUnitInfo.parsedCompilationUnit;
-        if (unit == null) {
-          unit = internalParseCompilationUnit(compilationUnitInfo, source);
-        }
+        unit = internalParseCompilationUnit((dartEntry as DartEntryImpl), source);
       }
       return unit;
     }
@@ -1045,19 +2106,19 @@
   HtmlUnit parseHtmlUnit(Source source) {
     {
       accessed(source);
-      HtmlUnitInfo htmlUnitInfo = getHtmlUnitInfo(source);
-      if (htmlUnitInfo == null) {
+      HtmlEntry htmlEntry = getHtmlEntry(source);
+      if (htmlEntry == null) {
         return null;
       }
-      HtmlUnit unit = htmlUnitInfo.resolvedUnit;
+      HtmlUnit unit = htmlEntry.getValue(HtmlEntry.RESOLVED_UNIT);
       if (unit == null) {
-        unit = htmlUnitInfo.parsedUnit;
+        unit = htmlEntry.getValue(HtmlEntry.PARSED_UNIT);
         if (unit == null) {
           HtmlParseResult result = new HtmlParser(source).parse(scanHtml(source));
           unit = result.htmlUnit;
-          htmlUnitInfo.lineInfo = new LineInfo(result.lineStarts);
-          htmlUnitInfo.parsedUnit = unit;
-          htmlUnitInfo.librarySources = getLibrarySources2(source, unit);
+          ((htmlEntry as HtmlEntryImpl)).setValue(SourceEntry.LINE_INFO, new LineInfo(result.lineStarts));
+          ((htmlEntry as HtmlEntryImpl)).setValue(HtmlEntry.PARSED_UNIT, unit);
+          ((htmlEntry as HtmlEntryImpl)).setValue(HtmlEntry.REFERENCED_LIBRARIES, getLibrarySources2(source, unit));
         }
       }
       return unit;
@@ -1082,38 +2143,38 @@
       for (MapEntry<Source, LibraryElement> entry in getMapEntrySet(elementMap)) {
         Source librarySource = entry.getKey();
         LibraryElement library = entry.getValue();
-        LibraryInfo libraryInfo = getLibraryInfo(librarySource);
-        if (libraryInfo != null) {
-          libraryInfo.element = library;
-          libraryInfo.launchable = library.entryPoint != null;
-          libraryInfo.client = isClient(library, htmlSource, new Set<LibraryElement>());
+        DartEntryImpl dartEntry = getDartEntry(librarySource) as DartEntryImpl;
+        if (dartEntry != null) {
+          dartEntry.setValue(DartEntry.ELEMENT, library);
+          dartEntry.setValue(DartEntry.IS_LAUNCHABLE, library.entryPoint != null);
+          dartEntry.setValue(DartEntry.IS_CLIENT, isClient(library, htmlSource, new Set<LibraryElement>()));
           List<Source> unitSources = new List<Source>();
           unitSources.add(librarySource);
           for (CompilationUnitElement part in library.parts) {
             Source partSource = part.source;
             unitSources.add(partSource);
           }
-          libraryInfo.unitSources = new List.from(unitSources);
+          dartEntry.setValue(DartEntry.INCLUDED_PARTS, new List.from(unitSources));
         }
       }
     }
   }
-  void recordResolutionErrors(Source source, List<AnalysisError> errors, LineInfo lineInfo2) {
+  void recordResolutionErrors(Source source, Source librarySource, List<AnalysisError> errors, LineInfo lineInfo) {
     {
-      CompilationUnitInfo compilationUnitInfo = getCompilationUnitInfo(source);
-      if (compilationUnitInfo != null) {
-        compilationUnitInfo.lineInfo = lineInfo2;
-        compilationUnitInfo.resolutionErrors = errors;
+      DartEntryImpl dartEntry = getDartEntry(source) as DartEntryImpl;
+      if (dartEntry != null) {
+        dartEntry.setValue(SourceEntry.LINE_INFO, lineInfo);
+        dartEntry.setValue2(DartEntry.RESOLUTION_ERRORS, librarySource, errors);
       }
-      getNotice(source).setErrors(compilationUnitInfo.allErrors, lineInfo2);
+      getNotice(source).setErrors(dartEntry.allErrors, lineInfo);
     }
   }
-  void recordResolvedCompilationUnit(Source source, CompilationUnit unit) {
+  void recordResolvedCompilationUnit(Source source, Source librarySource, CompilationUnit unit) {
     {
-      CompilationUnitInfo compilationUnitInfo = getCompilationUnitInfo(source);
-      if (compilationUnitInfo != null) {
-        compilationUnitInfo.resolvedCompilationUnit = unit;
-        compilationUnitInfo.clearParsedUnit();
+      DartEntryImpl dartEntry = getDartEntry(source) as DartEntryImpl;
+      if (dartEntry != null) {
+        dartEntry.setValue2(DartEntry.RESOLVED_UNIT, librarySource, unit);
+        dartEntry.setState(DartEntry.PARSED_UNIT, CacheState.FLUSHED);
         getNotice(source).compilationUnit = unit;
       }
     }
@@ -1127,16 +2188,16 @@
   CompilationUnit resolveCompilationUnit2(Source unitSource, Source librarySource) {
     {
       accessed(unitSource);
-      CompilationUnitInfo compilationUnitInfo = getCompilationUnitInfo(unitSource);
-      if (compilationUnitInfo == null) {
+      DartEntry dartEntry = getDartEntry(unitSource);
+      if (dartEntry == null) {
         return null;
       }
-      CompilationUnit unit = compilationUnitInfo.resolvedCompilationUnit;
+      CompilationUnit unit = dartEntry.getValue2(DartEntry.RESOLVED_UNIT, librarySource);
       if (unit == null) {
         disableCacheRemoval();
         try {
           LibraryElement libraryElement = computeLibraryElement(librarySource);
-          unit = compilationUnitInfo.resolvedCompilationUnit;
+          unit = dartEntry.getValue2(DartEntry.RESOLVED_UNIT, librarySource);
           if (unit == null && libraryElement != null) {
             Source coreLibrarySource = libraryElement.context.sourceFactory.forUri(DartSdk.DART_CORE);
             LibraryElement coreElement = computeLibraryElement(coreLibrarySource);
@@ -1154,7 +2215,7 @@
             ConstantVerifier constantVerifier = new ConstantVerifier(errorReporter);
             unitAST.accept(constantVerifier);
             unitAST.resolutionErrors = errorListener.errors;
-            compilationUnitInfo.resolvedCompilationUnit = unitAST;
+            ((dartEntry as DartEntryImpl)).setValue2(DartEntry.RESOLVED_UNIT, librarySource, unitAST);
             unit = unitAST;
           }
         } finally {
@@ -1167,16 +2228,16 @@
   HtmlUnit resolveHtmlUnit(Source unitSource) {
     {
       accessed(unitSource);
-      HtmlUnitInfo htmlUnitInfo = getHtmlUnitInfo(unitSource);
-      if (htmlUnitInfo == null) {
+      HtmlEntry htmlEntry = getHtmlEntry(unitSource);
+      if (htmlEntry == null) {
         return null;
       }
-      HtmlUnit unit = htmlUnitInfo.resolvedUnit;
+      HtmlUnit unit = htmlEntry.getValue(HtmlEntry.RESOLVED_UNIT);
       if (unit == null) {
         disableCacheRemoval();
         try {
           computeHtmlElement(unitSource);
-          unit = htmlUnitInfo.resolvedUnit;
+          unit = htmlEntry.getValue(HtmlEntry.RESOLVED_UNIT);
           if (unit == null) {
             unit = parseHtmlUnit(unitSource);
           }
@@ -1205,20 +2266,11 @@
       }
       factory.context = this;
       _sourceFactory = factory;
-      for (SourceInfo sourceInfo in _sourceMap.values) {
-        if (sourceInfo is HtmlUnitInfo) {
-          ((sourceInfo as HtmlUnitInfo)).invalidateResolvedUnit();
-        } else if (sourceInfo is CompilationUnitInfo) {
-          CompilationUnitInfo compilationUnitInfo = sourceInfo as CompilationUnitInfo;
-          compilationUnitInfo.invalidateResolvedUnit();
-          compilationUnitInfo.invalidateResolutionErrors();
-          if (sourceInfo is LibraryInfo) {
-            LibraryInfo libraryInfo = sourceInfo as LibraryInfo;
-            libraryInfo.invalidateElement();
-            libraryInfo.invalidatePublicNamespace();
-            libraryInfo.invalidateLaunchable();
-            libraryInfo.invalidateClientServer();
-          }
+      for (SourceEntry sourceEntry in _sourceMap.values) {
+        if (sourceEntry is HtmlEntry) {
+          ((sourceEntry as HtmlEntryImpl)).setState(HtmlEntry.RESOLVED_UNIT, CacheState.INVALID);
+        } else if (sourceEntry is DartEntry) {
+          ((sourceEntry as DartEntryImpl)).invalidateAllResolutionInformation();
         }
       }
     }
@@ -1246,13 +2298,15 @@
     }
     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();
+      SourceEntry sourceEntry = _sourceMap[removedSource];
+      if (sourceEntry is HtmlEntry) {
+        ((sourceEntry as HtmlEntryImpl)).setState(HtmlEntry.PARSED_UNIT, CacheState.FLUSHED);
+        ((sourceEntry as HtmlEntryImpl)).setState(HtmlEntry.RESOLVED_UNIT, CacheState.FLUSHED);
+      } else if (sourceEntry is DartEntry) {
+        ((sourceEntry as DartEntryImpl)).setState(DartEntry.PARSED_UNIT, CacheState.FLUSHED);
+        for (Source librarySource in getLibrariesContaining(source)) {
+          ((sourceEntry as DartEntryImpl)).setState2(DartEntry.RESOLVED_UNIT, librarySource, CacheState.FLUSHED);
+        }
       }
     }
     _recentlyUsed.add(source);
@@ -1305,16 +2359,16 @@
    * @param source the source for which an information object is being created
    * @return the source information object that was created
    */
-  SourceInfo createSourceInfo(Source source) {
+  SourceEntry createSourceEntry(Source source) {
     String name = source.shortName;
     if (AnalysisEngine.isHtmlFileName(name)) {
-      HtmlUnitInfo info = new HtmlUnitInfo();
-      _sourceMap[source] = info;
-      return info;
+      HtmlEntry htmlEntry = new HtmlEntryImpl();
+      _sourceMap[source] = htmlEntry;
+      return htmlEntry;
     } else if (AnalysisEngine.isDartFileName(name)) {
-      DartInfo info = DartInfo.pendingInstance;
-      _sourceMap[source] = info;
-      return info;
+      DartEntry dartEntry = new DartEntryImpl();
+      _sourceMap[source] = dartEntry;
+      return dartEntry;
     }
     return null;
   }
@@ -1335,13 +2389,15 @@
     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();
+        SourceEntry sourceEntry = _sourceMap[removedSource];
+        if (sourceEntry is HtmlEntry) {
+          ((sourceEntry as HtmlEntryImpl)).setState(HtmlEntry.PARSED_UNIT, CacheState.FLUSHED);
+          ((sourceEntry as HtmlEntryImpl)).setState(HtmlEntry.RESOLVED_UNIT, CacheState.FLUSHED);
+        } else if (sourceEntry is DartEntry) {
+          ((sourceEntry as DartEntryImpl)).setState(DartEntry.PARSED_UNIT, CacheState.FLUSHED);
+          for (Source librarySource in getLibrariesContaining(removedSource)) {
+            ((sourceEntry as DartEntryImpl)).setState2(DartEntry.RESOLVED_UNIT, librarySource, CacheState.FLUSHED);
+          }
         }
       }
     }
@@ -1377,19 +2433,14 @@
    * @param source the source for which information is being sought
    * @return the compilation unit information associated with the given source
    */
-  CompilationUnitInfo getCompilationUnitInfo(Source source) {
-    SourceInfo sourceInfo = getSourceInfo(source);
-    if (sourceInfo == null) {
-      sourceInfo = new CompilationUnitInfo();
-      _sourceMap[source] = sourceInfo;
-      return sourceInfo as CompilationUnitInfo;
-    } else if (sourceInfo is CompilationUnitInfo) {
-      return sourceInfo as CompilationUnitInfo;
-    } else if (identical(sourceInfo, DartInfo.pendingInstance)) {
-      sourceInfo = internalComputeKindOf(source);
-      if (sourceInfo is CompilationUnitInfo) {
-        return sourceInfo as CompilationUnitInfo;
-      }
+  DartEntry getDartEntry(Source source) {
+    SourceEntry sourceEntry = getSourceEntry(source);
+    if (sourceEntry == null) {
+      sourceEntry = new DartEntryImpl();
+      _sourceMap[source] = sourceEntry;
+      return sourceEntry as DartEntry;
+    } else if (sourceEntry is DartEntry) {
+      return sourceEntry as DartEntry;
     }
     return null;
   }
@@ -1404,40 +2455,14 @@
    * @param source the source for which information is being sought
    * @return the HTML unit information associated with the given source
    */
-  HtmlUnitInfo getHtmlUnitInfo(Source source) {
-    SourceInfo sourceInfo = getSourceInfo(source);
-    if (sourceInfo == null) {
-      sourceInfo = new HtmlUnitInfo();
-      _sourceMap[source] = sourceInfo;
-      return sourceInfo as HtmlUnitInfo;
-    } else if (sourceInfo is HtmlUnitInfo) {
-      return sourceInfo as HtmlUnitInfo;
-    }
-    return null;
-  }
-  /**
-   * Return the library 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 library information
-   * rather than accessing the library map directly because sources in the SDK are implicitly part
-   * of every analysis context and are therefore only added to the map when first accessed.
-   * <p>
-   * <b>Note:</b> This method must only be invoked while we are synchronized on {@link #cacheLock}.
-   * @param source the source for which information is being sought
-   * @return the library information associated with the given source
-   */
-  LibraryInfo getLibraryInfo(Source source) {
-    SourceInfo sourceInfo = getSourceInfo(source);
-    if (sourceInfo == null) {
-      sourceInfo = new LibraryInfo();
-      _sourceMap[source] = sourceInfo;
-      return sourceInfo as LibraryInfo;
-    } else if (sourceInfo is LibraryInfo) {
-      return sourceInfo as LibraryInfo;
-    } else if (identical(sourceInfo, DartInfo.pendingInstance)) {
-      sourceInfo = internalComputeKindOf(source);
-      if (sourceInfo is LibraryInfo) {
-        return sourceInfo as LibraryInfo;
-      }
+  HtmlEntry getHtmlEntry(Source source) {
+    SourceEntry sourceEntry = getSourceEntry(source);
+    if (sourceEntry == null) {
+      sourceEntry = new HtmlEntryImpl();
+      _sourceMap[source] = sourceEntry;
+      return sourceEntry as HtmlEntry;
+    } else if (sourceEntry is HtmlEntry) {
+      return sourceEntry as HtmlEntry;
     }
     return null;
   }
@@ -1478,12 +2503,12 @@
    * @param source the source for which information is being sought
    * @return the source information associated with the given source
    */
-  SourceInfo getSourceInfo(Source source) {
-    SourceInfo sourceInfo = _sourceMap[source];
-    if (sourceInfo == null) {
-      sourceInfo = createSourceInfo(source);
+  SourceEntry getSourceEntry(Source source) {
+    SourceEntry sourceEntry = _sourceMap[source];
+    if (sourceEntry == null) {
+      sourceEntry = createSourceEntry(source);
     }
-    return sourceInfo;
+    return sourceEntry;
   }
   /**
    * Return an array containing all of the sources known to this context that have the given kind.
@@ -1493,7 +2518,7 @@
   List<Source> getSources(SourceKind kind2) {
     List<Source> sources = new List<Source>();
     {
-      for (MapEntry<Source, SourceInfo> entry in getMapEntrySet(_sourceMap)) {
+      for (MapEntry<Source, SourceEntry> entry in getMapEntrySet(_sourceMap)) {
         if (identical(entry.getValue().kind, kind2)) {
           sources.add(entry.getKey());
         }
@@ -1520,13 +2545,11 @@
   }
   /**
    * 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.
+   * already known.
    * @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) {
+  DartEntry internalComputeKindOf(Source source) {
     try {
       accessed(source);
       RecordingErrorListener errorListener = new RecordingErrorListener();
@@ -1537,24 +2560,26 @@
       List<AnalysisError> errors = errorListener.getErrors2(source);
       unit.parsingErrors = errors;
       unit.lineInfo = lineInfo;
-      CompilationUnitInfo sourceInfo;
+      DartEntryImpl dartEntry = _sourceMap[source] as DartEntryImpl;
       if (hasPartOfDirective(unit)) {
-        sourceInfo = new CompilationUnitInfo();
+        dartEntry.setValue(DartEntry.SOURCE_KIND, SourceKind.PART);
       } else {
-        sourceInfo = new LibraryInfo();
+        dartEntry.setValue(DartEntry.SOURCE_KIND, SourceKind.LIBRARY);
       }
-      sourceInfo.lineInfo = lineInfo;
-      sourceInfo.parsedCompilationUnit = unit;
-      sourceInfo.parseErrors = errors;
-      _sourceMap[source] = sourceInfo;
-      return sourceInfo;
+      dartEntry.setValue(SourceEntry.LINE_INFO, lineInfo);
+      dartEntry.setValue(DartEntry.PARSED_UNIT, unit);
+      dartEntry.setValue(DartEntry.PARSE_ERRORS, errors);
+      return dartEntry;
     } on AnalysisException catch (exception) {
-      DartInfo sourceInfo = DartInfo.errorInstance;
-      _sourceMap[source] = sourceInfo;
-      return sourceInfo;
+      DartEntryImpl dartEntry = _sourceMap[source] as DartEntryImpl;
+      dartEntry.setState(DartEntry.SOURCE_KIND, CacheState.ERROR);
+      dartEntry.setState(SourceEntry.LINE_INFO, CacheState.ERROR);
+      dartEntry.setState(DartEntry.PARSED_UNIT, CacheState.ERROR);
+      dartEntry.setState(DartEntry.PARSE_ERRORS, CacheState.ERROR);
+      return dartEntry;
     }
   }
-  CompilationUnit internalParseCompilationUnit(CompilationUnitInfo compilationUnitInfo, Source source) {
+  CompilationUnit internalParseCompilationUnit(DartEntryImpl dartEntry, Source source) {
     accessed(source);
     RecordingErrorListener errorListener = new RecordingErrorListener();
     AnalysisContextImpl_ScanResult scanResult = internalScan(source, errorListener);
@@ -1564,9 +2589,16 @@
     List<AnalysisError> errors = errorListener.getErrors2(source);
     unit.parsingErrors = errors;
     unit.lineInfo = lineInfo;
-    compilationUnitInfo.lineInfo = lineInfo;
-    compilationUnitInfo.parsedCompilationUnit = unit;
-    compilationUnitInfo.parseErrors = errors;
+    if (identical(dartEntry.getState(DartEntry.SOURCE_KIND), CacheState.INVALID)) {
+      if (hasPartOfDirective(unit)) {
+        dartEntry.setValue(DartEntry.SOURCE_KIND, SourceKind.PART);
+      } else {
+        dartEntry.setValue(DartEntry.SOURCE_KIND, SourceKind.LIBRARY);
+      }
+    }
+    dartEntry.setValue(SourceEntry.LINE_INFO, lineInfo);
+    dartEntry.setValue(DartEntry.PARSED_UNIT, unit);
+    dartEntry.setValue(DartEntry.PARSE_ERRORS, errors);
     return unit;
   }
   AnalysisContextImpl_ScanResult internalScan(Source source, AnalysisErrorListener errorListener) {
@@ -1583,21 +2615,16 @@
    * 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
+   * @param libraryEntry the cache entry 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();
+  void invalidateLibraryResolution(Source librarySource, DartEntryImpl libraryEntry) {
+    if (libraryEntry != null) {
+      for (Source unitSource in libraryEntry.getValue(DartEntry.INCLUDED_PARTS)) {
+        DartEntryImpl partEntry = getDartEntry(unitSource) as DartEntryImpl;
+        partEntry.invalidateAllResolutionInformation();
       }
-      libraryInfo.invalidateUnitSources();
+      libraryEntry.invalidateAllResolutionInformation();
+      libraryEntry.setState(DartEntry.INCLUDED_PARTS, CacheState.INVALID);
     }
   }
   /**
@@ -1634,59 +2661,56 @@
    * @return {@code true} if work was done, implying that there might be more work to be done
    */
   bool performSingleAnalysisTask() {
-    for (MapEntry<Source, SourceInfo> entry in getMapEntrySet(_sourceMap)) {
-      SourceInfo sourceInfo = entry.getValue();
-      if (identical(sourceInfo, DartInfo.pendingInstance)) {
-        internalComputeKindOf(entry.getKey());
-        return true;
-      }
-    }
-    for (MapEntry<Source, SourceInfo> entry in getMapEntrySet(_sourceMap)) {
-      SourceInfo sourceInfo = entry.getValue();
-      if (sourceInfo is CompilationUnitInfo) {
-        CompilationUnitInfo unitInfo = sourceInfo as CompilationUnitInfo;
-        if (unitInfo.hasInvalidParsedUnit()) {
+    for (MapEntry<Source, SourceEntry> entry in getMapEntrySet(_sourceMap)) {
+      SourceEntry sourceEntry = entry.getValue();
+      if (sourceEntry is DartEntry) {
+        DartEntry dartEntry = sourceEntry as DartEntry;
+        CacheState parsedUnitState = dartEntry.getState(DartEntry.PARSED_UNIT);
+        if (identical(parsedUnitState, CacheState.INVALID)) {
           try {
             parseCompilationUnit(entry.getKey());
           } on AnalysisException catch (exception) {
-            unitInfo.parsedCompilationUnit = null;
+            ((dartEntry as DartEntryImpl)).setState(DartEntry.PARSED_UNIT, CacheState.ERROR);
             AnalysisEngine.instance.logger.logError2("Could not parse ${entry.getKey().fullName}", exception);
           }
           return true;
         }
-      } else if (sourceInfo is HtmlUnitInfo) {
-        HtmlUnitInfo unitInfo = sourceInfo as HtmlUnitInfo;
-        if (unitInfo.hasInvalidParsedUnit()) {
+      } else if (sourceEntry is HtmlEntry) {
+        HtmlEntry htmlEntry = sourceEntry as HtmlEntry;
+        CacheState parsedUnitState = htmlEntry.getState(HtmlEntry.PARSED_UNIT);
+        if (identical(parsedUnitState, CacheState.INVALID)) {
           try {
             parseHtmlUnit(entry.getKey());
           } on AnalysisException catch (exception) {
-            unitInfo.parsedUnit = null;
+            ((htmlEntry as HtmlEntryImpl)).setState(HtmlEntry.PARSED_UNIT, CacheState.ERROR);
             AnalysisEngine.instance.logger.logError2("Could not parse ${entry.getKey().fullName}", exception);
           }
           return true;
         }
       }
     }
-    for (MapEntry<Source, SourceInfo> entry in getMapEntrySet(_sourceMap)) {
-      SourceInfo sourceInfo = entry.getValue();
-      if (sourceInfo is LibraryInfo) {
-        LibraryInfo libraryInfo = sourceInfo as LibraryInfo;
-        if (libraryInfo.hasInvalidElement()) {
+    for (MapEntry<Source, SourceEntry> entry in getMapEntrySet(_sourceMap)) {
+      SourceEntry sourceEntry = entry.getValue();
+      if (sourceEntry is DartEntry && identical(sourceEntry.kind, SourceKind.LIBRARY)) {
+        DartEntry dartEntry = sourceEntry as DartEntry;
+        CacheState elementState = dartEntry.getState(DartEntry.ELEMENT);
+        if (identical(elementState, CacheState.INVALID)) {
           try {
             computeLibraryElement(entry.getKey());
           } on AnalysisException catch (exception) {
-            libraryInfo.element = null;
+            ((dartEntry as DartEntryImpl)).setState(DartEntry.ELEMENT, CacheState.ERROR);
             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()) {
+      } else if (sourceEntry is HtmlEntry) {
+        HtmlEntry htmlEntry = sourceEntry as HtmlEntry;
+        CacheState resolvedUnitState = htmlEntry.getState(HtmlEntry.RESOLVED_UNIT);
+        if (identical(resolvedUnitState, CacheState.INVALID)) {
           try {
             resolveHtmlUnit(entry.getKey());
           } on AnalysisException catch (exception) {
-            unitInfo.resolvedUnit = null;
+            ((htmlEntry as HtmlEntryImpl)).setState(HtmlEntry.RESOLVED_UNIT, CacheState.ERROR);
             AnalysisEngine.instance.logger.logError2("Could not resolve ${entry.getKey().fullName}", exception);
           }
           return true;
@@ -1705,37 +2729,46 @@
     return scanner.result;
   }
   /**
+   * Create an entry for the newly added source. Return {@code true} if the new source is a Dart
+   * file.
+   * <p>
    * <b>Note:</b> This method must only be invoked while we are synchronized on {@link #cacheLock}.
    * @param source the source that has been added
+   * @return {@code true} if the new source is a Dart file
    */
-  void sourceAvailable(Source source) {
-    SourceInfo existingInfo = _sourceMap[source];
-    if (existingInfo == null) {
-      createSourceInfo(source);
+  bool sourceAvailable(Source source) {
+    SourceEntry sourceEntry = _sourceMap[source];
+    if (sourceEntry == null) {
+      sourceEntry = createSourceEntry(source);
     }
+    return sourceEntry is DartEntry;
   }
   /**
    * <b>Note:</b> This method must only be invoked while we are synchronized on {@link #cacheLock}.
    * @param source the source that has been changed
    */
   void sourceChanged(Source source) {
-    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) {
-      for (Source librarySource in getLibrariesContaining(source)) {
-        LibraryInfo libraryInfo = getLibraryInfo(librarySource);
-        invalidateLibraryResolution(librarySource, libraryInfo);
+    SourceEntry sourceEntry = _sourceMap[source];
+    if (sourceEntry is HtmlEntry) {
+      HtmlEntryImpl htmlEntry = sourceEntry as HtmlEntryImpl;
+      htmlEntry.setState(HtmlEntry.ELEMENT, CacheState.INVALID);
+      htmlEntry.setState(SourceEntry.LINE_INFO, CacheState.INVALID);
+      htmlEntry.setState(HtmlEntry.PARSED_UNIT, CacheState.INVALID);
+      htmlEntry.setState(HtmlEntry.REFERENCED_LIBRARIES, CacheState.INVALID);
+      htmlEntry.setState(HtmlEntry.RESOLVED_UNIT, CacheState.INVALID);
+    } else if (sourceEntry is DartEntry) {
+      DartEntryImpl dartEntry = sourceEntry as DartEntryImpl;
+      List<Source> containingLibraries = getLibrariesContaining(source);
+      invalidateLibraryResolution(source, dartEntry);
+      dartEntry.setState(DartEntry.INCLUDED_PARTS, CacheState.INVALID);
+      dartEntry.setState(SourceEntry.LINE_INFO, CacheState.INVALID);
+      dartEntry.setState(DartEntry.PARSE_ERRORS, CacheState.INVALID);
+      dartEntry.setState(DartEntry.PARSED_UNIT, CacheState.INVALID);
+      dartEntry.setState(DartEntry.SOURCE_KIND, CacheState.INVALID);
+      for (Source librarySource in containingLibraries) {
+        DartEntryImpl libraryEntry = getDartEntry(librarySource) as DartEntryImpl;
+        invalidateLibraryResolution(librarySource, libraryEntry);
       }
-      _sourceMap[source] = DartInfo.pendingInstance;
     }
   }
   /**
@@ -1743,11 +2776,11 @@
    * @param source the source that has been deleted
    */
   void sourceRemoved(Source source) {
-    CompilationUnitInfo compilationUnitInfo = getCompilationUnitInfo(source);
-    if (compilationUnitInfo != null) {
+    DartEntry dartEntry = getDartEntry(source);
+    if (dartEntry != null) {
       for (Source librarySource in getLibrariesContaining(source)) {
-        LibraryInfo libraryInfo = getLibraryInfo(librarySource);
-        invalidateLibraryResolution(librarySource, libraryInfo);
+        DartEntryImpl libraryEntry = getDartEntry(librarySource) as DartEntryImpl;
+        invalidateLibraryResolution(librarySource, libraryEntry);
       }
     }
     _sourceMap.remove(source);
@@ -1775,6 +2808,16 @@
   AnalysisContextImpl_ScanResult() : super() {
   }
 }
+class Source_ContentReceiver_5 implements Source_ContentReceiver {
+  List<CharSequence> contentHolder;
+  Source_ContentReceiver_5(this.contentHolder);
+  void accept(CharBuffer contents, int modificationTime) {
+    contentHolder[0] = contents;
+  }
+  void accept2(String contents, int modificationTime) {
+    contentHolder[0] = new CharSequence(contents);
+  }
+}
 class RecursiveXmlVisitor_6 extends RecursiveXmlVisitor<Object> {
   final AnalysisContextImpl AnalysisContextImpl_this;
   Source htmlSource;
@@ -1859,20 +2902,56 @@
  */
 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.
+   * The data is not in the cache and the last time an attempt was made to compute the data an
+   * exception occurred, making it pointless to attempt.
+   * <p>
+   * Valid Transitions:
+   * <ul>
+   * <li>{@link #INVALID} if a source was modified that might cause the data to be computable</li>
+   * </ul>
    */
-  static final CacheState FLUSHED = new CacheState('FLUSHED', 0);
+  static final CacheState ERROR = new CacheState('ERROR', 0);
   /**
-   * A state representing the fact that the data was removed from the cache because it was invalid
-   * and needs to be recomputed.
+   * The data is not in the cache because it was flushed from the cache in order to control memory
+   * usage. If the data is recomputed, results do not need to be reported.
+   * <p>
+   * Valid Transitions:
+   * <ul>
+   * <li>{@link #IN_PROCESS} if the data is being recomputed</li>
+   * <li>{@link #INVALID} if a source was modified that causes the data to need to be recomputed</li>
+   * </ul>
    */
-  static final CacheState INVALID = new CacheState('INVALID', 1);
+  static final CacheState FLUSHED = new CacheState('FLUSHED', 1);
   /**
-   * A state representing the fact that the data is in the cache and valid.
+   * The data might or might not be in the cache but is in the process of being recomputed.
+   * <p>
+   * Valid Transitions:
+   * <ul>
+   * <li>{@link #ERROR} if an exception occurred while trying to compute the data</li>
+   * <li>{@link #VALID} if the data was successfully computed and stored in the cache</li>
+   * </ul>
    */
-  static final CacheState VALID = new CacheState('VALID', 2);
-  static final List<CacheState> values = [FLUSHED, INVALID, VALID];
+  static final CacheState IN_PROCESS = new CacheState('IN_PROCESS', 2);
+  /**
+   * The data is not in the cache and needs to be recomputed so that results can be reported.
+   * <p>
+   * Valid Transitions:
+   * <ul>
+   * <li>{@link #IN_PROCESS} if an attempt is being made to recompute the data</li>
+   * </ul>
+   */
+  static final CacheState INVALID = new CacheState('INVALID', 3);
+  /**
+   * The data is in the cache and up-to-date.
+   * <p>
+   * Valid Transitions:
+   * <ul>
+   * <li>{@link #FLUSHED} if the data is removed in order to manage memory usage</li>
+   * <li>{@link #INVALID} if a source was modified in such a way as to invalidate the previous data</li>
+   * </ul>
+   */
+  static final CacheState VALID = new CacheState('VALID', 4);
+  static final List<CacheState> values = [ERROR, FLUSHED, IN_PROCESS, INVALID, VALID];
   final String __name;
   final int __ordinal;
   int get ordinal => __ordinal;
@@ -1958,262 +3037,6 @@
   }
 }
 /**
- * Instances of the class {@code CompilationUnitInfo} maintain the information cached by an analysis
- * context about an individual compilation unit.
- * @coverage dart.engine
- */
-class CompilationUnitInfo extends SourceInfo {
-  /**
-   * The state of the cached parsed compilation unit.
-   */
-  CacheState _parsedUnitState = CacheState.INVALID;
-  /**
-   * The parsed compilation unit, or {@code null} if the parsed compilation unit is not currently
-   * cached.
-   */
-  CompilationUnit _parsedUnit;
-  /**
-   * The state of the cached resolved compilation unit.
-   */
-  CacheState _resolvedUnitState = CacheState.INVALID;
-  /**
-   * The resolved compilation unit, or {@code null} if the resolved compilation unit is not
-   * currently cached.
-   */
-  CompilationUnit _resolvedUnit;
-  /**
-   * The state of the cached parse errors.
-   */
-  CacheState _parseErrorsState = CacheState.INVALID;
-  /**
-   * The errors produced while scanning and parsing the compilation unit, or {@code null} if the
-   * errors are not currently cached.
-   */
-  List<AnalysisError> _parseErrors;
-  /**
-   * The state of the cached resolution errors.
-   */
-  CacheState _resolutionErrorsState = CacheState.INVALID;
-  /**
-   * The errors produced while resolving the compilation unit, or {@code null} if the errors are not
-   * currently cached.
-   */
-  List<AnalysisError> _resolutionErrors;
-  /**
-   * Initialize a newly created information holder to be empty.
-   */
-  CompilationUnitInfo() : super() {
-  }
-  /**
-   * 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();
-    copy.copyFrom(this);
-    return copy;
-  }
-  /**
-   * Return all of the errors associated with the compilation unit.
-   * @return all of the errors associated with the compilation unit
-   */
-  List<AnalysisError> get allErrors {
-    if (_parseErrors == null) {
-      if (_resolutionErrors == null) {
-        return null;
-      }
-      return _resolutionErrors;
-    } else if (_resolutionErrors == null) {
-      return _parseErrors;
-    }
-    int parseCount = _parseErrors.length;
-    int resolutionCount = _resolutionErrors.length;
-    List<AnalysisError> errors = new List<AnalysisError>(parseCount + resolutionCount);
-    JavaSystem.arraycopy(_parseErrors, 0, errors, 0, parseCount);
-    JavaSystem.arraycopy(_resolutionErrors, 0, errors, parseCount, resolutionCount);
-    return errors;
-  }
-  SourceKind get kind => SourceKind.PART;
-  /**
-   * Return the parsed compilation unit, or {@code null} if the parsed compilation unit is not
-   * currently cached.
-   * @return the parsed compilation unit
-   */
-  CompilationUnit get parsedCompilationUnit => _parsedUnit;
-  /**
-   * Return the errors produced while scanning and parsing the compilation unit, or {@code null} if
-   * the errors are not currently cached.
-   * @return the errors produced while scanning and parsing the compilation unit
-   */
-  List<AnalysisError> get parseErrors => _parseErrors;
-  /**
-   * Return the errors produced while resolving the compilation unit, or {@code null} if the errors
-   * are not currently cached.
-   * @return the errors produced while resolving the compilation unit
-   */
-  List<AnalysisError> get resolutionErrors => _resolutionErrors;
-  /**
-   * Return the resolved compilation unit, or {@code null} if the resolved compilation unit is not
-   * currently cached.
-   * @return the resolved compilation unit
-   */
-  CompilationUnit get resolvedCompilationUnit => _resolvedUnit;
-  /**
-   * Return {@code true} if the parsed compilation unit needs to be recomputed.
-   * @return {@code true} if the parsed compilation unit needs to be recomputed
-   */
-  bool hasInvalidParsedUnit() => identical(_parsedUnitState, CacheState.INVALID);
-  /**
-   * Return {@code true} if the parse errors needs to be recomputed.
-   * @return {@code true} if the parse errors needs to be recomputed
-   */
-  bool hasInvalidParseErrors() => identical(_parseErrorsState, CacheState.INVALID);
-  /**
-   * Return {@code true} if the resolution errors needs to be recomputed.
-   * @return {@code true} if the resolution errors needs to be recomputed
-   */
-  bool hasInvalidResolutionErrors() => identical(_resolutionErrorsState, CacheState.INVALID);
-  /**
-   * Return {@code true} if the resolved compilation unit needs to be recomputed.
-   * @return {@code true} if the resolved compilation unit needs to be recomputed
-   */
-  bool hasInvalidResolvedUnit() => identical(_resolvedUnitState, CacheState.INVALID);
-  /**
-   * Mark the parsed compilation unit as needing to be recomputed.
-   */
-  void invalidateParsedUnit() {
-    _parsedUnitState = CacheState.INVALID;
-    _parsedUnit = null;
-  }
-  /**
-   * Mark the parse errors as needing to be recomputed.
-   */
-  void invalidateParseErrors() {
-    _parseErrorsState = CacheState.INVALID;
-    _parseErrors = null;
-  }
-  /**
-   * Mark the resolution errors as needing to be recomputed.
-   */
-  void invalidateResolutionErrors() {
-    _resolutionErrorsState = CacheState.INVALID;
-    _resolutionErrors = null;
-  }
-  /**
-   * Mark the resolved compilation unit as needing to be recomputed.
-   */
-  void invalidateResolvedUnit() {
-    _resolvedUnitState = CacheState.INVALID;
-    _resolvedUnit = 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
-   * either {@link #clear} or {@link #invalidate}.
-   * @param unit the parsed compilation unit
-   */
-  void set parsedCompilationUnit(CompilationUnit unit) {
-    _parsedUnit = unit;
-    _parsedUnitState = CacheState.VALID;
-  }
-  /**
-   * Set the errors produced while scanning and parsing the compilation unit to the given errors.
-   * <p>
-   * <b>Note:</b> Do not use this method to clear or invalidate the parse errors. Use either{@link #clear} or {@link #invalidate}.
-   * @param errors the errors produced while scanning and parsing the compilation unit
-   */
-  void set parseErrors(List<AnalysisError> errors) {
-    _parseErrors = errors;
-    _parseErrorsState = CacheState.VALID;
-  }
-  /**
-   * Set the errors produced while resolving the compilation unit to the given errors.
-   * <p>
-   * <b>Note:</b> Do not use this method to clear or invalidate the resolution errors. Use either{@link #clear} or {@link #invalidate}.
-   * @param errors the errors produced while resolving the compilation unit
-   */
-  void set resolutionErrors(List<AnalysisError> errors) {
-    _resolutionErrors = errors;
-    _resolutionErrorsState = CacheState.VALID;
-  }
-  /**
-   * Set the resolved compilation unit to the given compilation unit.
-   * <p>
-   * <b>Note:</b> Do not use this method to clear or invalidate the resolved compilation unit. Use
-   * either {@link #clear} or {@link #invalidate}.
-   * @param unit the resolved compilation unit
-   */
-  void set resolvedCompilationUnit(CompilationUnit unit) {
-    _resolvedUnit = unit;
-    _resolvedUnitState = CacheState.VALID;
-  }
-  void copyFrom(SourceInfo info) {
-    super.copyFrom(info);
-  }
-}
-/**
- * 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 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 _ErrorInstance = new DartInfo();
-  /**
-   * The instance of this class used to represent a compilation unit for which no attempt has been
-   * made to compute the kind.
-   */
-  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.
-   */
-  DartInfo() : super() {
-  }
-  DartInfo copy() => this;
-  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
@@ -2231,7 +3054,7 @@
    */
   DelegatingAnalysisContextImpl() : super() {
   }
-  void addSourceInfo(Source source, SourceInfo info) {
+  void addSourceInfo(Source source, SourceEntry info) {
     if (source.isInSystemLibrary()) {
       _sdkAnalysisContext.addSourceInfo(source, info);
     } else {
@@ -2398,18 +3221,18 @@
       super.recordLibraryElements(elementMap);
     }
   }
-  void recordResolutionErrors(Source source, List<AnalysisError> errors, LineInfo lineInfo) {
+  void recordResolutionErrors(Source source, Source librarySource, List<AnalysisError> errors, LineInfo lineInfo) {
     if (source.isInSystemLibrary()) {
-      _sdkAnalysisContext.recordResolutionErrors(source, errors, lineInfo);
+      _sdkAnalysisContext.recordResolutionErrors(source, librarySource, errors, lineInfo);
     } else {
-      super.recordResolutionErrors(source, errors, lineInfo);
+      super.recordResolutionErrors(source, librarySource, errors, lineInfo);
     }
   }
-  void recordResolvedCompilationUnit(Source source, CompilationUnit unit) {
+  void recordResolvedCompilationUnit(Source source, Source librarySource, CompilationUnit unit) {
     if (source.isInSystemLibrary()) {
-      _sdkAnalysisContext.recordResolvedCompilationUnit(source, unit);
+      _sdkAnalysisContext.recordResolvedCompilationUnit(source, librarySource, unit);
     } else {
-      super.recordResolvedCompilationUnit(source, unit);
+      super.recordResolvedCompilationUnit(source, librarySource, unit);
     }
   }
   CompilationUnit resolveCompilationUnit(Source source, LibraryElement library) {
@@ -2445,183 +3268,16 @@
     DartSdk sdk = factory.dartSdk;
     if (sdk != null) {
       _sdkAnalysisContext = sdk.context as InternalAnalysisContext;
+      if (_sdkAnalysisContext is DelegatingAnalysisContextImpl) {
+        _sdkAnalysisContext = null;
+        throw new IllegalStateException("The context provided by an SDK cannot itself be a delegating analysis context");
+      }
     } 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
- */
-class HtmlUnitInfo extends SourceInfo {
-  /**
-   * The state of the cached parsed (but not resolved) HTML unit.
-   */
-  CacheState _parsedUnitState = CacheState.INVALID;
-  /**
-   * The parsed HTML unit, or {@code null} if the parsed HTML unit is not currently cached.
-   */
-  HtmlUnit _parsedUnit;
-  /**
-   * The state of the cached parsed and resolved HTML unit.
-   */
-  CacheState _resolvedUnitState = CacheState.INVALID;
-  /**
-   * The resolved HTML unit, or {@code null} if the resolved HTML unit is not currently cached.
-   */
-  HtmlUnit _resolvedUnit;
-  /**
-   * The state of the cached HTML element.
-   */
-  CacheState _elementState = CacheState.INVALID;
-  /**
-   * The element representing the HTML file, or {@code null} if the element is not currently cached.
-   */
-  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() {
-  }
-  /**
-   * Remove the parsed HTML unit from the cache.
-   */
-  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();
-    copy.copyFrom(this);
-    return copy;
-  }
-  /**
-   * Return the element representing the HTML file, or {@code null} if the element is not currently
-   * cached.
-   * @return the element representing the HTML file
-   */
-  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
-   */
-  HtmlUnit get parsedUnit => _parsedUnit;
-  /**
-   * Return the resolved HTML unit, or {@code null} if the resolved HTML unit is not currently
-   * cached.
-   * @return the resolved HTML unit
-   */
-  HtmlUnit get resolvedUnit => _resolvedUnit;
-  /**
-   * Return {@code true} if the HTML element needs to be recomputed.
-   * @return {@code true} if the HTML element needs to be recomputed
-   */
-  bool hasInvalidElement() => identical(_elementState, CacheState.INVALID);
-  /**
-   * Return {@code true} if the parsed HTML unit needs to be recomputed.
-   * @return {@code true} if the parsed HTML unit needs to be recomputed
-   */
-  bool hasInvalidParsedUnit() => identical(_parsedUnitState, CacheState.INVALID);
-  /**
-   * Return {@code true} if the resolved HTML unit needs to be recomputed.
-   * @return {@code true} if the resolved HTML unit needs to be recomputed
-   */
-  bool hasInvalidResolvedUnit() => identical(_resolvedUnitState, CacheState.INVALID);
-  /**
-   * Mark the HTML element as needing to be recomputed.
-   */
-  void invalidateElement() {
-    _elementState = CacheState.INVALID;
-    _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() {
-    _parsedUnitState = CacheState.INVALID;
-    _parsedUnit = null;
-  }
-  /**
-   * Mark the resolved HTML unit as needing to be recomputed.
-   */
-  void invalidateResolvedUnit() {
-    invalidateElement();
-    _resolvedUnitState = CacheState.INVALID;
-    _resolvedUnit = null;
-  }
-  /**
-   * Set the element representing the HTML file to the given element.
-   * <p>
-   * <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 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()}.
-   * @param unit the result of parsing the source as an HTML unit
-   */
-  void set parsedUnit(HtmlUnit unit) {
-    _parsedUnit = unit;
-    _parsedUnitState = CacheState.VALID;
-  }
-  /**
-   * Set the resolved 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 #clearResolvedUnit()} or {@link #invalidateResolvedUnit()}.
-   * @param unit the result of resolving the source as an HTML unit
-   */
-  void set resolvedUnit(HtmlUnit unit) {
-    _resolvedUnit = unit;
-    _resolvedUnitState = CacheState.VALID;
-  }
-  void copyFrom(SourceInfo info) {
-    super.copyFrom(info);
-  }
-}
-/**
  * 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
@@ -2647,10 +3303,10 @@
    * Create a new {@link InstrumentedAnalysisContextImpl} which wraps a new{@link AnalysisContextImpl} as the basis context.
    */
   InstrumentedAnalysisContextImpl() {
-    _jtd_constructor_175_impl();
+    _jtd_constructor_178_impl();
   }
-  _jtd_constructor_175_impl() {
-    _jtd_constructor_176_impl(new AnalysisContextImpl());
+  _jtd_constructor_178_impl() {
+    _jtd_constructor_179_impl(new AnalysisContextImpl());
   }
   /**
    * Create a new {@link InstrumentedAnalysisContextImpl} with a specified basis context, aka the
@@ -2658,12 +3314,12 @@
    * @param context some {@link InstrumentedAnalysisContext} to wrap and instrument
    */
   InstrumentedAnalysisContextImpl.con1(InternalAnalysisContext context) {
-    _jtd_constructor_176_impl(context);
+    _jtd_constructor_179_impl(context);
   }
-  _jtd_constructor_176_impl(InternalAnalysisContext context) {
+  _jtd_constructor_179_impl(InternalAnalysisContext context) {
     _basis = context;
   }
-  void addSourceInfo(Source source, SourceInfo info) {
+  void addSourceInfo(Source source, SourceEntry info) {
     _basis.addSourceInfo(source, info);
   }
   void applyChanges(ChangeSet changeSet) {
@@ -2675,6 +3331,15 @@
       instrumentation.log();
     }
   }
+  String computeDocumentationComment(Element element) {
+    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-computeDocumentationComment");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.computeDocumentationComment(element);
+    } finally {
+      instrumentation.log();
+    }
+  }
   List<AnalysisError> computeErrors(Source source) {
     InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-computeErrors");
     try {
@@ -2983,11 +3648,11 @@
   void recordLibraryElements(Map<Source, LibraryElement> elementMap) {
     _basis.recordLibraryElements(elementMap);
   }
-  void recordResolutionErrors(Source source, List<AnalysisError> errors, LineInfo lineInfo) {
-    _basis.recordResolutionErrors(source, errors, lineInfo);
+  void recordResolutionErrors(Source source, Source librarySource, List<AnalysisError> errors, LineInfo lineInfo) {
+    _basis.recordResolutionErrors(source, librarySource, errors, lineInfo);
   }
-  void recordResolvedCompilationUnit(Source source, CompilationUnit unit) {
-    _basis.recordResolvedCompilationUnit(source, unit);
+  void recordResolvedCompilationUnit(Source source, Source librarySource, CompilationUnit unit) {
+    _basis.recordResolvedCompilationUnit(source, librarySource, unit);
   }
   CompilationUnit resolveCompilationUnit(Source unitSource, LibraryElement library) {
     InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-resolveCompilationUnit");
@@ -3063,7 +3728,7 @@
    * @param source the source to be added
    * @param info the information about the source
    */
-  void addSourceInfo(Source source, SourceInfo info);
+  void addSourceInfo(Source source, SourceEntry 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
@@ -3108,245 +3773,20 @@
    * 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 librarySource the source of the defining compilation unit of the library in which the
+   * source was resolved
    * @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);
+  void recordResolutionErrors(Source source, Source librarySource, 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 librarySource the source of the defining compilation unit of the library in which the
+   * source was resolved
    * @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
- */
-class LibraryInfo extends CompilationUnitInfo {
-  /**
-   * Mask indicating that this library is launchable: that the file has a main method.
-   */
-  static int _LAUNCHABLE = 1 << 1;
-  /**
-   * Mask indicating that the library is client code: that the library depends on the html library.
-   * If the library is not "client code", then it is referenced as "server code".
-   */
-  static int _CLIENT_CODE = 1 << 2;
-  /**
-   * The state of the cached library element.
-   */
-  CacheState _elementState = CacheState.INVALID;
-  /**
-   * The element representing the library, or {@code null} if the element is not currently cached.
-   */
-  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;
-  /**
-   * The public namespace of the library, or {@code null} if the namespace is not currently cached.
-   */
-  Namespace _publicNamespace;
-  /**
-   * The state of the cached client/ server flag.
-   */
-  CacheState _clientServerState = CacheState.INVALID;
-  /**
-   * The state of the cached launchable flag.
-   */
-  CacheState _launchableState = CacheState.INVALID;
-  /**
-   * An integer holding bit masks such as {@link #LAUNCHABLE} and {@link #CLIENT_CODE}.
-   */
-  int _bitmask = 0;
-  /**
-   * Initialize a newly created information holder to be empty.
-   */
-  LibraryInfo() : super() {
-  }
-  /**
-   * 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();
-    copy.copyFrom(this);
-    return copy;
-  }
-  /**
-   * Return the element representing the library, or {@code null} if the element is not currently
-   * cached.
-   * @return the element representing the library
-   */
-  LibraryElement get element => _element;
-  SourceKind get kind => SourceKind.LIBRARY;
-  /**
-   * Return the public namespace of the library, or {@code null} if the namespace is not currently
-   * cached.
-   * @return the public namespace of the library
-   */
-  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
-   */
-  bool hasInvalidClientServer() => identical(_clientServerState, CacheState.INVALID);
-  /**
-   * Return {@code true} if the library element needs to be recomputed.
-   * @return {@code true} if the library element needs to be recomputed
-   */
-  bool hasInvalidElement() => identical(_elementState, CacheState.INVALID);
-  /**
-   * Return {@code true} if the launchable flag needs to be recomputed.
-   * @return {@code true} if the launchable flag needs to be recomputed
-   */
-  bool hasInvalidLaunchable() => identical(_launchableState, CacheState.INVALID);
-  /**
-   * Return {@code true} if the public namespace needs to be recomputed.
-   * @return {@code true} if the public namespace needs to be recomputed
-   */
-  bool hasInvalidPublicNamespace() => identical(_publicNamespaceState, CacheState.INVALID);
-  /**
-   * Mark the client/ server flag as needing to be recomputed.
-   */
-  void invalidateClientServer() {
-    _clientServerState = CacheState.INVALID;
-    _bitmask &= ~_CLIENT_CODE;
-  }
-  /**
-   * Mark the library element as needing to be recomputed.
-   */
-  void invalidateElement() {
-    _elementState = CacheState.INVALID;
-    _element = null;
-  }
-  /**
-   * Mark the launchable flag as needing to be recomputed.
-   */
-  void invalidateLaunchable() {
-    _launchableState = CacheState.INVALID;
-    _bitmask &= ~_LAUNCHABLE;
-  }
-  /**
-   * Mark the public namespace as needing to be recomputed.
-   */
-  void invalidatePublicNamespace() {
-    _publicNamespaceState = CacheState.INVALID;
-    _publicNamespace = null;
-  }
-  /**
-   * 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} if this library is client based code: the library depends on the html
-   * library
-   */
-  bool isClient() => (_bitmask & _CLIENT_CODE) != 0;
-  /**
-   * 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} 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;
-  /**
-   * Sets the value of the client/ server flag.
-   * <p>
-   * <b>Note:</b> Do not use this method to invalidate the flag, use{@link #invalidateClientServer()}.
-   * @param isClient the new value of the client flag
-   */
-  void set client(bool isClient) {
-    if (isClient) {
-      _bitmask |= _CLIENT_CODE;
-    } else {
-      _bitmask &= ~_CLIENT_CODE;
-    }
-    _clientServerState = CacheState.VALID;
-  }
-  /**
-   * Set the element representing the library to the given element.
-   * <p>
-   * <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 element2) {
-    this._element = element2;
-    _elementState = CacheState.VALID;
-  }
-  /**
-   * Sets the value of the launchable flag.
-   * <p>
-   * <b>Note:</b> Do not use this method to invalidate the flag, use {@link #invalidateLaunchable()}.
-   * @param isClient the new value of the client flag
-   */
-  void set launchable(bool launchable2) {
-    if (launchable2) {
-      _bitmask |= _LAUNCHABLE;
-    } else {
-      _bitmask &= ~_LAUNCHABLE;
-    }
-    _launchableState = CacheState.VALID;
-  }
-  /**
-   * Set the public namespace of the library to the given namespace.
-   * <p>
-   * <b>Note:</b> Do not use this method to clear or invalidate the element. Use either{@link #clearPublicNamespace()} or {@link #invalidatePublicNamespace()}.
-   * @param namespace the public namespace of the library
-   */
-  void set publicNamespace(Namespace namespace) {
-    _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);
-  }
+  void recordResolvedCompilationUnit(Source source, Source librarySource, CompilationUnit unit);
 }
 /**
  * Instances of the class {@code RecordingErrorListener} implement an error listener that will
@@ -3470,80 +3910,6 @@
   }
 }
 /**
- * Instances of the class {@code SourceInfo} maintain the information cached by an analysis context
- * about an individual source.
- * @coverage dart.engine
- */
-abstract class SourceInfo {
-  /**
-   * The state of the cached line information.
-   */
-  CacheState _lineInfoState = CacheState.INVALID;
-  /**
-   * The line information computed for the source, or {@code null} if the line information is not
-   * currently cached.
-   */
-  LineInfo _lineInfo;
-  /**
-   * Initialize a newly created information holder to be empty.
-   */
-  SourceInfo() : super() {
-  }
-  /**
-   * Remove the line information from the cache.
-   */
-  void clearLineInfo() {
-    _lineInfo = null;
-    _lineInfoState = CacheState.FLUSHED;
-  }
-  /**
-   * Return a copy of this information holder.
-   * @return a copy of this information holder
-   */
-  SourceInfo copy();
-  /**
-   * Return the kind of the source, or {@code null} if the kind is not currently cached.
-   * @return the kind of the source
-   */
-  SourceKind get kind;
-  /**
-   * Return the line information computed for the source, or {@code null} if the line information is
-   * not currently cached.
-   * @return the line information computed for the source
-   */
-  LineInfo get lineInfo => _lineInfo;
-  /**
-   * Return {@code true} if the line information needs to be recomputed.
-   * @return {@code true} if the line information needs to be recomputed
-   */
-  bool hasInvalidLineInfo() => identical(_lineInfoState, CacheState.INVALID);
-  /**
-   * Mark the line information as needing to be recomputed.
-   */
-  void invalidateLineInfo() {
-    _lineInfoState = CacheState.INVALID;
-    _lineInfo = null;
-  }
-  /**
-   * Set the line information for the source to the given line information.
-   * <p>
-   * <b>Note:</b> Do not use this method to clear or invalidate the element. Use either{@link #clearLineInfo()} or {@link #invalidateLineInfo()}.
-   * @param info the line information for the source
-   */
-  void set lineInfo(LineInfo info) {
-    _lineInfo = info;
-    _lineInfoState = CacheState.VALID;
-  }
-  /**
-   * Copy the information from the given information holder.
-   * @param info the information holder from which information will be copied
-   */
-  void copyFrom(SourceInfo info) {
-    _lineInfoState = info._lineInfoState;
-    _lineInfo = info._lineInfo;
-  }
-}
-/**
  * The interface {@code Logger} defines the behavior of objects that can be used to receive
  * information about errors within the analysis engine. Implementations usually write this
  * information to a file, but can also record the information for later use (such as during testing)
diff --git a/pkg/analyzer_experimental/lib/src/generated/error.dart b/pkg/analyzer_experimental/lib/src/generated/error.dart
index 177546d..1f684c9 100644
--- a/pkg/analyzer_experimental/lib/src/generated/error.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/error.dart
@@ -107,7 +107,7 @@
    * @param arguments the arguments to the error, used to compose the error message
    */
   void reportError(ErrorCode errorCode, ASTNode node, List<Object> arguments) {
-    _errorListener.onError(new AnalysisError.con2(_source, node.offset, node.length, errorCode, [arguments]));
+    _errorListener.onError(new AnalysisError.con2(_source, node.offset, node.length, errorCode, arguments));
   }
   /**
    * Report an error with the given error code and arguments.
@@ -116,7 +116,7 @@
    * @param arguments the arguments to the error, used to compose the error message
    */
   void reportError2(ErrorCode errorCode, Token token, List<Object> arguments) {
-    _errorListener.onError(new AnalysisError.con2(_source, token.offset, token.length, errorCode, [arguments]));
+    _errorListener.onError(new AnalysisError.con2(_source, token.offset, token.length, errorCode, arguments));
   }
   /**
    * Set the source to be used when reporting errors. Setting the source to {@code null} will cause
@@ -499,8 +499,8 @@
   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].
+   * 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', 25, "");
   /**
@@ -552,18 +552,18 @@
   /**
    * 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.
+   * <i>k</i>'s list.
    */
   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>
+   * 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', 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
+   * 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', 32, "Fields cannot be initialized in both the parameter list and the initializers");
@@ -577,7 +577,7 @@
    * 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', 34, "'%s' is final and was given a value when it was declared, so it cannot be set to a new value");
+  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
@@ -702,8 +702,9 @@
    */
   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>.
+   * 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 fewer optional positional parameters than
+   * <i>m2</i>.
    */
   static final CompileTimeErrorCode INVALID_OVERRIDE_POSITIONAL = new CompileTimeErrorCode('INVALID_OVERRIDE_POSITIONAL', 54, "");
   /**
@@ -726,13 +727,15 @@
   /**
    * 12.6 Lists: It is a compile time error if the type argument of a constant list literal includes
    * a type parameter.
+   * @name the name of the type parameter
    */
-  static final CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST = new CompileTimeErrorCode('INVALID_TYPE_ARGUMENT_IN_CONST_LIST', 58, "");
+  static final CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST = new CompileTimeErrorCode('INVALID_TYPE_ARGUMENT_IN_CONST_LIST', 58, "Constant list literals cannot include a type parameter as a type argument, such as '%s'");
   /**
    * 12.7 Maps: It is a compile time error if the type arguments of a constant map literal include a
    * type parameter.
+   * @name the name of the type parameter
    */
-  static final CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP = new CompileTimeErrorCode('INVALID_TYPE_ARGUMENT_IN_CONST_MAP', 59, "");
+  static final CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP = new CompileTimeErrorCode('INVALID_TYPE_ARGUMENT_IN_CONST_MAP', 59, "Constant map literals cannot include a type parameter as a type argument, such as '%s'");
   /**
    * 14.2 Exports: It is a compile-time error if the compilation unit found at the specified URI is
    * not a library declaration.
@@ -858,7 +861,7 @@
   /**
    * 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', 80, "");
+  static final CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR = new CompileTimeErrorCode('OPTIONAL_PARAMETER_IN_OPERATOR', 80, "Optional parameters are not allowed when defining an operator");
   /**
    * 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
@@ -884,9 +887,9 @@
   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.
+   * begins with an '_' character.
    */
-  static final CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER = new CompileTimeErrorCode('PRIVATE_OPTIONAL_PARAMETER', 85, "");
+  static final CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER = new CompileTimeErrorCode('PRIVATE_OPTIONAL_PARAMETER', 85, "Named optional parameters cannot start with an underscore");
   /**
    * 12.1 Constants: It is a compile-time error if the value of a compile-time constant expression
    * depends on itself.
@@ -908,7 +911,7 @@
   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.
+   * <i>k'</i> is not a constant constructor.
    */
   static final CompileTimeErrorCode REDIRECT_TO_NON_CONST_CONSTRUCTOR = new CompileTimeErrorCode('REDIRECT_TO_NON_CONST_CONSTRUCTOR', 90, "");
   /**
@@ -930,7 +933,7 @@
    * 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', 94, "");
+  static final CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR = new CompileTimeErrorCode('RETURN_IN_GENERATIVE_CONSTRUCTOR', 94, "Constructors cannot return a value");
   /**
    * 6.1 Function Declarations: It is a compile-time error to preface a function declaration with
    * the built-in identifier static.
@@ -995,18 +998,19 @@
    */
   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
+   * 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
-   * names: &lt;, &gt;, &lt;=, &gt;=, ==, +, /, ~/, *, %, |, ^, &, &lt;&lt;, &gt;&gt;, [] is not 1.
+   * names: &lt;, &gt;, &lt;=, &gt;=, ==, +, /, ~/, *, %, |, ^, &, &lt;&lt;, &gt;&gt;, \[\] is not 1.
    * 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', 103, "");
   /**
-   * 7.3 Setters: It is a compile-time error if a setter’s formal parameter list does not include
+   * 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>.
+   * @param numberOfParameters the number of parameters found in the setter
    */
-  static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER = new CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER', 104, "");
+  static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER = new CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER', 104, "Setters should declare exactly one parameter, %d found");
   /**
    * 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
@@ -1086,7 +1090,7 @@
    */
   static final StaticWarningCode CAST_TO_NON_TYPE = new StaticWarningCode('CAST_TO_NON_TYPE', 3, "");
   /**
-   * 16.1.2 Comments: A token of the form <i>[new c](uri)</i> will be replaced by a link in the
+   * 16.1.2 Comments: A token of the form <i>\[new c\](uri)</i> will be replaced by a link in the
    * formatted output. The link will point at the constructor named <i>c</i> in <i>L</i>. The title
    * of the link will be <i>c</i>. It is a static warning if uri is not the URI of a dart library
    * <i>L</i>, or if <i>c</i> is not the name of a constructor of a class declared in the exported
@@ -1094,7 +1098,7 @@
    */
   static final StaticWarningCode COMMENT_REFERENCE_CONSTRUCTOR_NOT_VISIBLE = new StaticWarningCode('COMMENT_REFERENCE_CONSTRUCTOR_NOT_VISIBLE', 4, "");
   /**
-   * 16.1.2 Comments: A token of the form <i>[id](uri)</i> will be replaced by a link in the
+   * 16.1.2 Comments: A token of the form <i>\[id\](uri)</i> will be replaced by a link in the
    * formatted output. The link will point at the declaration named <i>id</i> in <i>L</i>. The title
    * of the link will be <i>id</i>. It is a static warning if uri is not the URI of a dart library
    * <i>L</i>, or if <i>id</i> is not a name declared in the exported namespace of <i>L</i>.
@@ -1111,7 +1115,7 @@
    */
   static final StaticWarningCode COMMENT_REFERENCE_UNDECLARED_IDENTIFIER = new StaticWarningCode('COMMENT_REFERENCE_UNDECLARED_IDENTIFIER', 7, "");
   /**
-   * 16.1.2 Comments: A token of the form <i>[id](uri)</i> will be replaced by a link in the
+   * 16.1.2 Comments: A token of the form <i>\[id\](uri)</i> will be replaced by a link in the
    * formatted output. The link will point at the declaration named <i>id</i> in <i>L</i>. The title
    * of the link will be <i>id</i>. It is a static warning if uri is not the URI of a dart library
    * <i>L</i>, or if <i>id</i> is not a name declared in the exported namespace of <i>L</i>.
@@ -1121,7 +1125,7 @@
    * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or
    * inherited in a concrete class.
    */
-  static final StaticWarningCode CONCRETE_CLASS_WITH_ABSTRACT_MEMBER = new StaticWarningCode('CONCRETE_CLASS_WITH_ABSTRACT_MEMBER', 9, "");
+  static final StaticWarningCode CONCRETE_CLASS_WITH_ABSTRACT_MEMBER = new StaticWarningCode('CONCRETE_CLASS_WITH_ABSTRACT_MEMBER', 9, "'%s' must have a method body because '%s' is not abstract");
   /**
    * 7.2 Getters: It is a static warning if a class <i>C</i> declares an instance getter named
    * <i>v</i> and an accessible static member named <i>v</i> or <i>v=</i> is declared in a
@@ -1157,8 +1161,10 @@
   /**
    * 7.6.1 Generative Constructors: An initializing formal has the form <i>this.id</i>. It is a
    * static warning if the static type of <i>id</i> is not assignable to <i>T<sub>id</sub></i>.
+   * @param parameterType the name of the type of the field formal parameter
+   * @param fieldType the name of the type of the field
    */
-  static final StaticWarningCode FIELD_INITIALIZER_WITH_INVALID_TYPE = new StaticWarningCode('FIELD_INITIALIZER_WITH_INVALID_TYPE', 16, "");
+  static final StaticWarningCode FIELD_INITIALIZER_WITH_INVALID_TYPE = new StaticWarningCode('FIELD_INITIALIZER_WITH_INVALID_TYPE', 16, "The parameter type '%s' is incompatable with the field type '%s'");
   /**
    * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt; h</i> or if <i>m &gt;
    * n</i>.
@@ -1246,7 +1252,7 @@
    */
   static final StaticWarningCode NON_TYPE_IN_CATCH_CLAUSE = new StaticWarningCode('NON_TYPE_IN_CATCH_CLAUSE', 31, "");
   /**
-   * 7.1.1 Operators: It is a static warning if the return type of the user-declared operator []= is
+   * 7.1.1 Operators: It is a static warning if the return type of the user-declared operator \[\]= is
    * explicitly declared and not void.
    */
   static final StaticWarningCode NON_VOID_RETURN_FOR_OPERATOR = new StaticWarningCode('NON_VOID_RETURN_FOR_OPERATOR', 32, "");
@@ -1274,7 +1280,7 @@
    */
   static final StaticWarningCode PART_OF_DIFFERENT_LIBRARY = new StaticWarningCode('PART_OF_DIFFERENT_LIBRARY', 36, "Expected this library to be part of '%s', not '%s'");
   /**
-   * 7.6.2 Factories: It is a static warning if the function type of <i>k’</i> is not a subtype of
+   * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> is not a subtype of
    * the type of <i>k</i>.
    */
   static final StaticWarningCode REDIRECT_TO_INVALID_RETURN_TYPE = new StaticWarningCode('REDIRECT_TO_INVALID_RETURN_TYPE', 37, "");
@@ -1298,7 +1304,7 @@
    * <li>The return type of <i>f</i> may not be assigned to void.
    * </ol>
    */
-  static final StaticWarningCode RETURN_WITHOUT_VALUE = new StaticWarningCode('RETURN_WITHOUT_VALUE', 40, "");
+  static final StaticWarningCode RETURN_WITHOUT_VALUE = new StaticWarningCode('RETURN_WITHOUT_VALUE', 40, "Missing return value after 'return'");
   /**
    * 13.9 Switch: It is a static warning if the type of <i>e</i> may not be assigned to the type of
    * <i>e<sub>k</sub></i>.
@@ -1312,20 +1318,24 @@
    */
   static final StaticWarningCode UNDEFINED_CLASS = new StaticWarningCode('UNDEFINED_CLASS', 42, "Undefined class '%s'");
   /**
+   * Same as {@link #UNDEFINED_CLASS}, but to catch using "boolean" instead of "bool".
+   */
+  static final StaticWarningCode UNDEFINED_CLASS_BOOLEAN = new StaticWarningCode('UNDEFINED_CLASS_BOOLEAN', 43, "Undefined class 'boolean'; did you mean 'bool'?");
+  /**
    * 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, "There is no such getter '%s' in '%s'");
+  static final StaticWarningCode UNDEFINED_GETTER = new StaticWarningCode('UNDEFINED_GETTER', 44, "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, "Undefined name '%s'");
+  static final StaticWarningCode UNDEFINED_IDENTIFIER = new StaticWarningCode('UNDEFINED_IDENTIFIER', 45, "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
@@ -1334,7 +1344,7 @@
    * @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'");
+  static final StaticWarningCode UNDEFINED_OPERATOR = new StaticWarningCode('UNDEFINED_OPERATOR', 46, "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
@@ -1347,15 +1357,15 @@
    * @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', 46, "There is no such setter '%s' in '%s'");
+  static final StaticWarningCode UNDEFINED_SETTER = new StaticWarningCode('UNDEFINED_SETTER', 47, "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', 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];
+  static final StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER = new StaticWarningCode('UNDEFINED_STATIC_METHOD_OR_GETTER', 48, "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_CLASS_BOOLEAN, UNDEFINED_GETTER, UNDEFINED_IDENTIFIER, UNDEFINED_OPERATOR, UNDEFINED_SETTER, UNDEFINED_STATIC_METHOD_OR_GETTER];
   final String __name;
   final int __ordinal;
   int get ordinal => __ordinal;
@@ -1397,6 +1407,46 @@
   }
 }
 /**
+ * The enumeration {@code HtmlWarningCode} defines the error codes used for warnings in HTML files.
+ * The convention for this class is for the name of the error code to indicate the problem that
+ * caused the error to be generated and for the error message to explain what is wrong and, when
+ * appropriate, how the problem can be corrected.
+ * @coverage dart.engine.error
+ */
+class HtmlWarningCode implements Comparable<HtmlWarningCode>, ErrorCode {
+  /**
+   * An error code indicating that the value of the 'src' attribute of a Dart script tag is not a
+   * valid URI.
+   */
+  static final HtmlWarningCode INVALID_URI = new HtmlWarningCode('INVALID_URI', 0, "");
+  /**
+   * An error code indicating that the value of the 'src' attribute of a Dart script tag references
+   * a file that does not exist.
+   */
+  static final HtmlWarningCode URI_DOES_NOT_EXIST = new HtmlWarningCode('URI_DOES_NOT_EXIST', 1, "");
+  static final List<HtmlWarningCode> values = [INVALID_URI, URI_DOES_NOT_EXIST];
+  final String __name;
+  final int __ordinal;
+  int get ordinal => __ordinal;
+  /**
+   * The message template used to create the message to be displayed for this error.
+   */
+  String _message;
+  /**
+   * Initialize a newly created error code to have the given type and message.
+   * @param message the message template used to create the message to be displayed for the error
+   */
+  HtmlWarningCode(this.__name, this.__ordinal, String message) {
+    this._message = message;
+  }
+  ErrorSeverity get errorSeverity => ErrorSeverity.WARNING;
+  String get message => _message;
+  ErrorType get type => ErrorType.STATIC_WARNING;
+  bool needsRecompilation() => false;
+  int compareTo(HtmlWarningCode other) => __ordinal - other.__ordinal;
+  String toString() => __name;
+}
+/**
  * 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
  * that caused the error to be generated and for the error message to explain what is wrong and,
@@ -1489,7 +1539,7 @@
    */
   static final StaticTypeWarningCode NON_TYPE_AS_TYPE_ARGUMENT = new StaticTypeWarningCode('NON_TYPE_AS_TYPE_ARGUMENT', 6, "");
   /**
-   * 7.6.2 Factories: It is a static type warning if any of the type arguments to <i>k’</i> are not
+   * 7.6.2 Factories: It is a static type warning if any of the type arguments to <i>k'</i> are not
    * subtypes of the bounds of the corresponding formal type parameters of type.
    */
   static final StaticTypeWarningCode REDIRECT_WITH_INVALID_TYPE_PARAMETERS = new StaticTypeWarningCode('REDIRECT_WITH_INVALID_TYPE_PARAMETERS', 7, "");
@@ -1516,11 +1566,11 @@
    * <p>
    * 15.8 Parameterized Types: If <i>S</i> is the static type of a member <i>m</i> of <i>G</i>, then
    * the static type of the member <i>m</i> of <i>G&lt;A<sub>1</sub>, &hellip; A<sub>n</sub>&gt;</i>
-   * is <i>[A<sub>1</sub>, &hellip;, A<sub>n</sub>/T<sub>1</sub>, &hellip;, T<sub>n</sub>]S</i>
+   * is <i>\[A<sub>1</sub>, &hellip;, A<sub>n</sub>/T<sub>1</sub>, &hellip;, T<sub>n</sub>\]S</i>
    * where <i>T<sub>1</sub>, &hellip; T<sub>n</sub></i> are the formal type parameters of <i>G</i>.
    * Let <i>B<sub>i</sub></i> be the bounds of <i>T<sub>i</sub>, 1 &lt;= i &lt;= n</i>. It is a
-   * static type warning if <i>A<sub>i</sub></i> is not a subtype of <i>[A<sub>1</sub>, &hellip;,
-   * A<sub>n</sub>/T<sub>1</sub>, &hellip;, T<sub>n</sub>]B<sub>i</sub>, 1 &lt;= i &lt;= n</i>.
+   * static type warning if <i>A<sub>i</sub></i> is not a subtype of <i>\[A<sub>1</sub>, &hellip;,
+   * A<sub>n</sub>/T<sub>1</sub>, &hellip;, T<sub>n</sub>\]B<sub>i</sub>, 1 &lt;= i &lt;= n</i>.
    */
   static final StaticTypeWarningCode TYPE_ARGUMENT_VIOLATES_BOUNDS = new StaticTypeWarningCode('TYPE_ARGUMENT_VIOLATES_BOUNDS', 10, "");
   /**
diff --git a/pkg/analyzer_experimental/lib/src/generated/html.dart b/pkg/analyzer_experimental/lib/src/generated/html.dart
index 58f2161..0c0d3cf 100644
--- a/pkg/analyzer_experimental/lib/src/generated/html.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/html.dart
@@ -43,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_150_impl(type, offset);
+    _jtd_constructor_151_impl(type, offset);
   }
-  _jtd_constructor_150_impl(TokenType type, int offset) {
-    _jtd_constructor_151_impl(type, offset, type.lexeme);
+  _jtd_constructor_151_impl(TokenType type, int offset) {
+    _jtd_constructor_152_impl(type, offset, type.lexeme);
   }
   /**
    * Initialize a newly created token.
@@ -55,9 +55,9 @@
    * @param value the lexeme represented by this token (not {@code null})
    */
   Token.con2(TokenType type2, int offset2, String value2) {
-    _jtd_constructor_151_impl(type2, offset2, value2);
+    _jtd_constructor_152_impl(type2, offset2, value2);
   }
-  _jtd_constructor_151_impl(TokenType type2, int offset2, String value2) {
+  _jtd_constructor_152_impl(TokenType type2, int offset2, String value2) {
     this._type = type2;
     this._value = StringUtilities.intern(value2);
     this._offset = offset2;
diff --git a/pkg/analyzer_experimental/lib/src/generated/java_core.dart b/pkg/analyzer_experimental/lib/src/generated/java_core.dart
index 0c40a7e..3bf99ccc 100644
--- a/pkg/analyzer_experimental/lib/src/generated/java_core.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/java_core.dart
@@ -130,7 +130,21 @@
 
 class JavaString {
   static String format(String fmt, List args) {
-    return fmt;
+    var index = 0;
+    return fmt.replaceAllMapped(new RegExp(r'%(.)'), (match) {
+      switch (match.group(1)) {
+        case '%': return '%';
+        case 's':
+          if (index >= args.length) {
+            throw new MissingFormatArgumentException(match.group(0));
+          }
+          return args[index++].toString();
+        default: return match.group(1);
+      }
+    });
+  }
+  static bool startsWithBefore(String s, String other, int start) {
+    return s.indexOf(other, start) != -1;
   }
 }
 
@@ -263,6 +277,14 @@
   String toString() => "IOException";
 }
 
+class MissingFormatArgumentException implements Exception {
+  final String s;
+
+  String toString() => "MissingFormatArgumentException: $s";
+
+  MissingFormatArgumentException(this.s);
+}
+
 class ListWrapper<E> extends ListBase<E> implements List<E> {
   List<E> elements = new List<E>();
 
diff --git a/pkg/analyzer_experimental/lib/src/generated/java_junit.dart b/pkg/analyzer_experimental/lib/src/generated/java_junit.dart
index 2ff97ad..1fa994e 100644
--- a/pkg/analyzer_experimental/lib/src/generated/java_junit.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/java_junit.dart
@@ -52,8 +52,7 @@
 }
 
 /**
- * Returns a matches that matches if the value is not the same instance
- * as [object] (`!==`).
+ * Returns a matches that matches if the value is not the same instance as "object" (`!==`).
  */
 Matcher notSame(expected) => new _IsNotSameAs(expected);
 
diff --git a/pkg/analyzer_experimental/lib/src/generated/parser.dart b/pkg/analyzer_experimental/lib/src/generated/parser.dart
index 2c0da74..42fb425 100644
--- a/pkg/analyzer_experimental/lib/src/generated/parser.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/parser.dart
@@ -431,7 +431,7 @@
    * | 'super' assignableSelector
    * | identifier
    * assignableSelector ::=
-   * '[' expression ']'
+   * '\[' expression '\]'
    * | '.' identifier
    * </pre>
    * @param expression the expression being checked
@@ -472,6 +472,23 @@
     return _currentToken;
   }
   /**
+   * Search the given list of ranges for a range that contains the given index. Return the range
+   * that was found, or {@code null} if none of the ranges contain the index.
+   * @param ranges the ranges to be searched
+   * @param index the index contained in the returned range
+   * @return the range that was found
+   */
+  List<int> findRange(List<List<int>> ranges, int index) {
+    for (List<int> range in ranges) {
+      if (range[0] <= index && index <= range[1]) {
+        return range;
+      } else if (index < range[0]) {
+        return null;
+      }
+    }
+    return null;
+  }
+  /**
    * Advance to the next token in the token stream, making it the new current token.
    * @return the token that was current before this method was invoked
    */
@@ -481,6 +498,47 @@
     return token;
   }
   /**
+   * Return a list of the ranges of characters in the given comment string that should be treated as
+   * code blocks.
+   * @param comment the comment being processed
+   * @return the ranges of characters that should be treated as code blocks
+   */
+  List<List<int>> getCodeBlockRanges(String comment) {
+    List<List<int>> ranges = new List<List<int>>();
+    int length2 = comment.length;
+    int index = 0;
+    if (comment.startsWith("/**") || comment.startsWith("///")) {
+      index = 3;
+    }
+    while (index < length2) {
+      int currentChar = comment.codeUnitAt(index);
+      if (currentChar == 0xD || currentChar == 0xA) {
+        index = index + 1;
+        while (index < length2 && Character.isWhitespace(comment.codeUnitAt(index))) {
+          index = index + 1;
+        }
+        if (JavaString.startsWithBefore(comment, "*     ", index)) {
+          int end = index + 6;
+          while (end < length2 && comment.codeUnitAt(end) != 0xD && comment.codeUnitAt(end) != 0xA) {
+            end = end + 1;
+          }
+          ranges.add(<int> [index, end]);
+          index = end;
+        }
+      } else if (JavaString.startsWithBefore(comment, "[:", index)) {
+        int end = comment.indexOf(":]", index + 2);
+        if (end < 0) {
+          end = length2;
+        }
+        ranges.add(<int> [index, end]);
+        index = end + 1;
+      } else {
+        index = index + 1;
+      }
+    }
+    return ranges;
+  }
+  /**
    * Return {@code true} if the current token is the first token of a return type that is followed
    * by an identifier, possibly followed by a list of type parameters, followed by a
    * left-parenthesis. This is used by parseTypeAlias to determine whether or not to parse a return
@@ -572,6 +630,36 @@
     return identical(type2, TokenType.EQ) || identical(type2, TokenType.COMMA) || identical(type2, TokenType.SEMICOLON) || matches3(token, Keyword.IN);
   }
   /**
+   * Given that we have just found bracketed text within a comment, look to see whether that text is
+   * (a) followed by a parenthesized link address, (b) followed by a colon, or (c) followed by
+   * optional whitespace and another square bracket.
+   * <p>
+   * This method uses the syntax described by the <a
+   * href="http://daringfireball.net/projects/markdown/syntax">markdown</a> project.
+   * @param comment the comment text in which the bracketed text was found
+   * @param rightIndex the index of the right bracket
+   * @return {@code true} if the bracketed text is followed by a link address
+   */
+  bool isLinkText(String comment, int rightIndex) {
+    int length2 = comment.length;
+    int index = rightIndex + 1;
+    if (index >= length2) {
+      return false;
+    }
+    int nextChar = comment.codeUnitAt(index);
+    if (nextChar == 0x28 || nextChar == 0x3A) {
+      return true;
+    }
+    while (Character.isWhitespace(nextChar)) {
+      index = index + 1;
+      if (index >= length2) {
+        return false;
+      }
+      nextChar = comment.codeUnitAt(index);
+    }
+    return nextChar == 0x5B;
+  }
+  /**
    * 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
@@ -916,7 +1004,7 @@
    * Parse an assignable selector.
    * <pre>
    * assignableSelector ::=
-   * '[' expression ']'
+   * '\[' expression '\]'
    * | '.' identifier
    * </pre>
    * @param prefix the expression preceding the selector
@@ -1057,7 +1145,7 @@
    * cascadeSection ::=
    * '..' (cascadeSelector arguments*) (assignableSelector arguments*)* cascadeAssignment?
    * cascadeSelector ::=
-   * '[' expression ']'
+   * '\[' expression '\]'
    * | identifier
    * cascadeAssignment ::=
    * assignmentOperator expressionWithoutCascade
@@ -1175,6 +1263,10 @@
     if (withClause != null && extendsClause == null) {
       reportError5(ParserErrorCode.WITH_WITHOUT_EXTENDS, withClause.withKeyword, []);
     }
+    if (matches2(_NATIVE) && matches4(peek(), TokenType.STRING)) {
+      advance();
+      advance();
+    }
     Token leftBracket = null;
     List<ClassMember> members = null;
     Token rightBracket = null;
@@ -1419,32 +1511,32 @@
       StringScanner scanner = new StringScanner(null, referenceSource, listener);
       scanner.setSourceStart(1, 1, sourceOffset);
       Token firstToken = scanner.tokenize();
-      if (!errorFound[0]) {
-        Token newKeyword = null;
-        if (matches3(firstToken, Keyword.NEW)) {
-          newKeyword = firstToken;
-          firstToken = firstToken.next;
-        }
-        if (matchesIdentifier2(firstToken)) {
-          Token secondToken = firstToken.next;
-          Token thirdToken = secondToken.next;
-          Token nextToken;
-          Identifier identifier;
-          if (matches4(secondToken, TokenType.PERIOD) && matchesIdentifier2(thirdToken)) {
-            identifier = new PrefixedIdentifier.full(new SimpleIdentifier.full(firstToken), secondToken, new SimpleIdentifier.full(thirdToken));
-            nextToken = thirdToken.next;
-          } else {
-            identifier = new SimpleIdentifier.full(firstToken);
-            nextToken = firstToken.next;
-          }
-          if (nextToken.type != TokenType.EOF) {
-          }
-          return new CommentReference.full(newKeyword, identifier);
-        } else if (matches3(firstToken, Keyword.THIS) || matches3(firstToken, Keyword.NULL) || matches3(firstToken, Keyword.TRUE) || matches3(firstToken, Keyword.FALSE)) {
-          return null;
-        } else if (matches4(firstToken, TokenType.STRING)) {
+      if (errorFound[0]) {
+        return null;
+      }
+      Token newKeyword = null;
+      if (matches3(firstToken, Keyword.NEW)) {
+        newKeyword = firstToken;
+        firstToken = firstToken.next;
+      }
+      if (matchesIdentifier2(firstToken)) {
+        Token secondToken = firstToken.next;
+        Token thirdToken = secondToken.next;
+        Token nextToken;
+        Identifier identifier;
+        if (matches4(secondToken, TokenType.PERIOD) && matchesIdentifier2(thirdToken)) {
+          identifier = new PrefixedIdentifier.full(new SimpleIdentifier.full(firstToken), secondToken, new SimpleIdentifier.full(thirdToken));
+          nextToken = thirdToken.next;
         } else {
+          identifier = new SimpleIdentifier.full(firstToken);
+          nextToken = firstToken.next;
         }
+        if (nextToken.type != TokenType.EOF) {
+          return null;
+        }
+        return new CommentReference.full(newKeyword, identifier);
+      } else if (matches3(firstToken, Keyword.THIS) || matches3(firstToken, Keyword.NULL) || matches3(firstToken, Keyword.TRUE) || matches3(firstToken, Keyword.FALSE)) {
+        return null;
       }
     } catch (exception) {
     }
@@ -1454,7 +1546,7 @@
    * Parse all of the comment references occurring in the given array of documentation comments.
    * <pre>
    * commentReference ::=
-   * '[' 'new'? qualified ']' libraryReference?
+   * '\[' 'new'? qualified '\]' libraryReference?
    * libraryReference ::=
    * '(' stringLiteral ')'
    * </pre>
@@ -1465,21 +1557,31 @@
     List<CommentReference> references = new List<CommentReference>();
     for (Token token in tokens) {
       String comment = token.lexeme;
+      int length2 = comment.length;
+      List<List<int>> codeBlockRanges = getCodeBlockRanges(comment);
       int leftIndex = comment.indexOf('[');
-      while (leftIndex >= 0) {
-        int rightIndex = comment.indexOf(']', leftIndex);
-        if (rightIndex >= 0) {
-          int firstChar = comment.codeUnitAt(leftIndex + 1);
-          if (firstChar != 0x27 && firstChar != 0x22 && firstChar != 0x3A) {
-            CommentReference reference = parseCommentReference(comment.substring(leftIndex + 1, rightIndex), token.offset + leftIndex + 1);
-            if (reference != null) {
-              references.add(reference);
+      while (leftIndex >= 0 && leftIndex + 1 < length2) {
+        List<int> range = findRange(codeBlockRanges, leftIndex);
+        if (range == null) {
+          int rightIndex = comment.indexOf(']', leftIndex);
+          if (rightIndex >= 0) {
+            int firstChar = comment.codeUnitAt(leftIndex + 1);
+            if (firstChar != 0x27 && firstChar != 0x22) {
+              if (isLinkText(comment, rightIndex)) {
+              } else {
+                CommentReference reference = parseCommentReference(comment.substring(leftIndex + 1, rightIndex), token.offset + leftIndex + 1);
+                if (reference != null) {
+                  references.add(reference);
+                }
+              }
             }
+          } else {
+            rightIndex = leftIndex + 1;
           }
+          leftIndex = comment.indexOf('[', rightIndex);
         } else {
-          rightIndex = leftIndex + 1;
+          leftIndex = comment.indexOf('[', range[1] + 1);
         }
-        leftIndex = comment.indexOf('[', rightIndex);
       }
     }
     return references;
@@ -2103,7 +2205,7 @@
    * optionalPositionalFormalParameters
    * | namedFormalParameters
    * optionalPositionalFormalParameters ::=
-   * '[' defaultFormalParameter (',' defaultFormalParameter)* ']'
+   * '\[' defaultFormalParameter (',' defaultFormalParameter)* '\]'
    * namedFormalParameters ::=
    * '{' defaultNamedParameter (',' defaultNamedParameter)* '}'
    * </pre>
@@ -2324,7 +2426,10 @@
         return new BlockFunctionBody.full(parseBlock());
       } else if (matches2(_NATIVE)) {
         Token nativeToken = andAdvance;
-        StringLiteral stringLiteral = parseStringLiteral();
+        StringLiteral stringLiteral = null;
+        if (matches5(TokenType.STRING)) {
+          stringLiteral = parseStringLiteral();
+        }
         return new NativeFunctionBody.full(nativeToken, stringLiteral, expect2(TokenType.SEMICOLON));
       } else {
         reportError4(ParserErrorCode.MISSING_FUNCTION_BODY, []);
@@ -2655,7 +2760,7 @@
    * Parse a list literal.
    * <pre>
    * listLiteral ::=
-   * 'const'? typeArguments? '[' (expressionList ','?)? ']'
+   * 'const'? typeArguments? '\[' (expressionList ','?)? '\]'
    * </pre>
    * @param modifier the 'const' modifier appearing before the literal, or {@code null} if there is
    * no modifier
@@ -4044,7 +4149,7 @@
    * @param arguments the arguments to the error, used to compose the error message
    */
   void reportError(ParserErrorCode errorCode, ASTNode node, List<Object> arguments) {
-    _errorListener.onError(new AnalysisError.con2(_source, node.offset, node.length, errorCode, [arguments]));
+    _errorListener.onError(new AnalysisError.con2(_source, node.offset, node.length, errorCode, arguments));
   }
   /**
    * Report an error with the given error code and arguments.
@@ -4061,7 +4166,7 @@
    * @param arguments the arguments to the error, used to compose the error message
    */
   void reportError5(ParserErrorCode errorCode, Token token, List<Object> arguments) {
-    _errorListener.onError(new AnalysisError.con2(_source, token.offset, token.length, errorCode, [arguments]));
+    _errorListener.onError(new AnalysisError.con2(_source, token.offset, token.length, errorCode, arguments));
   }
   /**
    * Parse the 'final', 'const', 'var' or type preceding a variable declaration, starting at the
@@ -4118,7 +4223,7 @@
    * optionalPositionalFormalParameters
    * | namedFormalParameters
    * optionalPositionalFormalParameters ::=
-   * '[' defaultFormalParameter (',' defaultFormalParameter)* ']'
+   * '\[' defaultFormalParameter (',' defaultFormalParameter)* '\]'
    * namedFormalParameters ::=
    * '{' defaultNamedParameter (',' defaultNamedParameter)* '}'
    * </pre>
@@ -4914,9 +5019,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_301_impl(___name, ___ordinal, severity2, message2);
+    _jtd_constructor_302_impl(___name, ___ordinal, severity2, message2);
   }
-  _jtd_constructor_301_impl(String ___name, int ___ordinal, ErrorSeverity severity2, String message2) {
+  _jtd_constructor_302_impl(String ___name, int ___ordinal, ErrorSeverity severity2, String message2) {
     __name = ___name;
     __ordinal = ___ordinal;
     this._severity = severity2;
@@ -4927,10 +5032,10 @@
    * @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_302_impl(___name, ___ordinal, message);
+    _jtd_constructor_303_impl(___name, ___ordinal, message);
   }
-  _jtd_constructor_302_impl(String ___name, int ___ordinal, String message) {
-    _jtd_constructor_301_impl(___name, ___ordinal, ErrorSeverity.ERROR, message);
+  _jtd_constructor_303_impl(String ___name, int ___ordinal, String message) {
+    _jtd_constructor_302_impl(___name, ___ordinal, ErrorSeverity.ERROR, message);
   }
   ErrorSeverity get errorSeverity => _severity;
   String get message => _message;
diff --git a/pkg/analyzer_experimental/lib/src/generated/resolver.dart b/pkg/analyzer_experimental/lib/src/generated/resolver.dart
index ddfe703..fc7b84d 100644
--- a/pkg/analyzer_experimental/lib/src/generated/resolver.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/resolver.dart
@@ -4,6 +4,7 @@
 library engine.resolver;
 
 import 'dart:collection';
+import 'dart:uri' show Uri;
 import 'java_core.dart';
 import 'java_engine.dart';
 import 'instrumentation.dart';
@@ -568,7 +569,7 @@
         ((variable as FieldElementImpl)).static = matches(((node.parent.parent as FieldDeclaration)).keyword, sc.Keyword.STATIC);
       }
     }
-    return super.visitVariableDeclaration(node);
+    return null;
   }
   List<Type2> createTypeVariableTypes(List<TypeVariableElement> typeVariables) {
     int typeVariableCount = typeVariables.length;
@@ -793,6 +794,14 @@
    */
   InternalAnalysisContext _context;
   /**
+   * The error listener to which errors will be reported.
+   */
+  AnalysisErrorListener _errorListener;
+  /**
+   * The line information associated with the source for which an element is being built, or{@code null} if we are not building an element.
+   */
+  LineInfo _lineInfo;
+  /**
    * The HTML element being built.
    */
   HtmlElementImpl _htmlElement;
@@ -803,9 +812,11 @@
   /**
    * Initialize a newly created HTML unit builder.
    * @param context the analysis context in which the element model will be built
+   * @param errorListener the error listener to which errors will be reported
    */
-  HtmlUnitBuilder(InternalAnalysisContext context) {
+  HtmlUnitBuilder(InternalAnalysisContext context, AnalysisErrorListener errorListener) {
     this._context = context;
+    this._errorListener = errorListener;
   }
   /**
    * Build the HTML element for the given source.
@@ -821,6 +832,7 @@
    * @throws AnalysisException if the analysis could not be performed
    */
   HtmlElementImpl buildHtmlElement2(Source source2, ht.HtmlUnit unit) {
+    _lineInfo = _context.computeLineInfo(source2);
     HtmlElementImpl result = new HtmlElementImpl(_context, source2.shortName);
     result.source = source2;
     _htmlElement = result;
@@ -840,30 +852,43 @@
   Object visitXmlTagNode(ht.XmlTagNode node) {
     if (isScriptNode(node)) {
       Source htmlSource = _htmlElement.source;
-      String scriptSourcePath = getScriptSourcePath(node);
+      ht.XmlAttributeNode scriptAttribute = getScriptSourcePath(node);
+      String scriptSourcePath = scriptAttribute == null ? null : scriptAttribute.text;
       if (identical(node.attributeEnd.type, ht.TokenType.GT) && scriptSourcePath == null) {
         EmbeddedHtmlScriptElementImpl script = new EmbeddedHtmlScriptElementImpl(node);
         String contents = node.content;
-        AnalysisErrorListener errorListener = new AnalysisErrorListener_5();
-        sc.StringScanner scanner = new sc.StringScanner(null, contents, errorListener);
+        int attributeEnd2 = node.attributeEnd.end;
+        LineInfo_Location location = _lineInfo.getLocation(attributeEnd2);
+        sc.StringScanner scanner = new sc.StringScanner(htmlSource, contents, _errorListener);
+        scanner.setSourceStart(location.lineNumber, location.columnNumber, attributeEnd2);
         sc.Token firstToken = scanner.tokenize();
         List<int> lineStarts2 = scanner.lineStarts;
-        Parser parser = new Parser(null, errorListener);
+        Parser parser = new Parser(null, _errorListener);
         CompilationUnit unit = parser.parseCompilationUnit(firstToken);
+        unit.lineInfo = new LineInfo(lineStarts2);
         try {
           CompilationUnitBuilder builder = new CompilationUnitBuilder();
           CompilationUnitElementImpl elem = builder.buildCompilationUnit(htmlSource, unit);
           LibraryElementImpl library = new LibraryElementImpl(_context, null);
           library.definingCompilationUnit = elem;
           script.scriptLibrary = library;
-        } on AnalysisException catch (e) {
-          print(e);
+        } on AnalysisException catch (exception) {
+          print(exception);
         }
         _scripts.add(script);
       } else {
         ExternalHtmlScriptElementImpl script = new ExternalHtmlScriptElementImpl(node);
         if (scriptSourcePath != null) {
-          script.scriptSource = _context.sourceFactory.resolveUri(htmlSource, scriptSourcePath);
+          try {
+            new Uri(scriptSourcePath);
+            Source scriptSource = _context.sourceFactory.resolveUri(htmlSource, scriptSourcePath);
+            script.scriptSource = scriptSource;
+            if (!scriptSource.exists()) {
+              reportError(HtmlWarningCode.URI_DOES_NOT_EXIST, scriptAttribute.offset + 1, scriptSourcePath.length, []);
+            }
+          } on URISyntaxException catch (exception) {
+            reportError(HtmlWarningCode.INVALID_URI, scriptAttribute.offset + 1, scriptSourcePath.length, []);
+          }
         }
         _scripts.add(script);
       }
@@ -873,15 +898,14 @@
     return null;
   }
   /**
-   * Return the value of the source attribute if it exists.
+   * Return the first source attribute for the given tag node, or {@code null} if it does not exist.
    * @param node the node containing attributes
-   * @return the source path or {@code null} if not defined
+   * @return the source attribute contained in the given tag
    */
-  String getScriptSourcePath(ht.XmlTagNode node) {
+  ht.XmlAttributeNode getScriptSourcePath(ht.XmlTagNode node) {
     for (ht.XmlAttributeNode attribute in node.attributes) {
       if (attribute.name.lexeme == _SRC) {
-        String text2 = attribute.text;
-        return text2 != null && text2.length > 0 ? text2 : null;
+        return attribute;
       }
     }
     return null;
@@ -908,9 +932,16 @@
     }
     return false;
   }
-}
-class AnalysisErrorListener_5 implements AnalysisErrorListener {
-  void onError(AnalysisError error) {
+  /**
+   * Report an error with the given error code at the given location. Use the given arguments to
+   * compose the error message.
+   * @param errorCode the error code of the error to be reported
+   * @param offset the offset of the first character to be highlighted
+   * @param length the number of characters to be highlighted
+   * @param arguments the arguments used to compose the error message
+   */
+  void reportError(ErrorCode errorCode, int offset, int length, List<Object> arguments) {
+    _errorListener.onError(new AnalysisError.con2(_htmlElement.source, offset, length, errorCode, arguments));
   }
 }
 /**
@@ -1500,6 +1531,63 @@
     }
     return null;
   }
+  Object visitCommentReference(CommentReference node) {
+    Identifier identifier2 = node.identifier;
+    if (identifier2 is SimpleIdentifier) {
+      SimpleIdentifier simpleIdentifier = identifier2 as SimpleIdentifier;
+      visitSimpleIdentifier(simpleIdentifier);
+      Element element2 = simpleIdentifier.element;
+      if (element2 != null) {
+        if (element2.library != _resolver.definingLibrary) {
+        }
+        if (node.newKeyword != null) {
+          if (element2 is ClassElement) {
+            ConstructorElement constructor = ((element2 as ClassElement)).unnamedConstructor;
+            recordResolution(simpleIdentifier, constructor);
+          } else {
+          }
+        }
+      }
+    } else if (identifier2 is PrefixedIdentifier) {
+      PrefixedIdentifier prefixedIdentifier = identifier2 as PrefixedIdentifier;
+      SimpleIdentifier prefix2 = prefixedIdentifier.prefix;
+      SimpleIdentifier name = prefixedIdentifier.identifier;
+      visitSimpleIdentifier(prefix2);
+      Element element3 = prefix2.element;
+      if (element3 != null) {
+        if (element3 is PrefixElement) {
+          element3 = _resolver.nameScope.lookup(identifier2, _resolver.definingLibrary);
+          recordResolution(name, element3);
+          return null;
+        }
+        if (element3.library != _resolver.definingLibrary) {
+        }
+        if (node.newKeyword == null) {
+          if (element3 is ClassElement) {
+            Element memberElement = lookupGetterOrMethod(((element3 as ClassElement)).type, name.name);
+            if (memberElement == null) {
+              memberElement = ((element3 as ClassElement)).getNamedConstructor(name.name);
+            }
+            if (memberElement == null) {
+              reportGetterOrSetterNotFound(prefixedIdentifier, name, element3.name);
+            } else {
+              recordResolution(name, memberElement);
+            }
+          } else {
+          }
+        } else {
+          if (element3 is ClassElement) {
+            ConstructorElement constructor = ((element3 as ClassElement)).getNamedConstructor(name.name);
+            if (constructor != null) {
+              recordResolution(name, constructor);
+            }
+          } else {
+          }
+        }
+      }
+    }
+    return null;
+  }
   Object visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
     FieldElement fieldElement = null;
     SimpleIdentifier fieldName2 = node.fieldName;
@@ -1565,9 +1653,17 @@
         if (!fieldElement.isSynthetic()) {
           ParameterElement parameterElement = node.element;
           if (parameterElement is FieldFormalParameterElementImpl) {
-            ((parameterElement as FieldFormalParameterElementImpl)).field = fieldElement;
+            FieldFormalParameterElementImpl fieldFormal = parameterElement as FieldFormalParameterElementImpl;
+            fieldFormal.field = fieldElement;
+            Type2 declaredType = fieldFormal.type;
+            Type2 fieldType = fieldElement.type;
+            if (node.type == null) {
+              fieldFormal.type = fieldType;
+            }
             if (fieldElement.isStatic()) {
               _resolver.reportError(CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_STATIC_FIELD, node, [fieldName]);
+            } else if (declaredType != null && fieldType != null && !declaredType.isAssignableTo(fieldType)) {
+              _resolver.reportError(StaticWarningCode.FIELD_INITIALIZER_WITH_INVALID_TYPE, node, [declaredType.name, fieldType.name]);
             }
           }
         }
@@ -1732,7 +1828,9 @@
           if (targetTypeName == null) {
             _resolver.reportError(StaticTypeWarningCode.UNDEFINED_FUNCTION, methodName2, [methodName2.name]);
           } else {
-            _resolver.reportError(StaticTypeWarningCode.UNDEFINED_METHOD, methodName2, [methodName2.name, targetTypeName]);
+            if (!doesClassDeclareNoSuchMethod(targetType.element)) {
+              _resolver.reportError(StaticTypeWarningCode.UNDEFINED_METHOD, methodName2, [methodName2.name, targetTypeName]);
+            }
           }
         }
         return null;
@@ -1890,12 +1988,15 @@
       }
     }
     if (memberElement == null) {
-      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]);
+      if (!doesClassDeclareNoSuchMethod(targetType.element)) {
+        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 {
+          System.out.println("two ${identifier.name}");
+          _resolver.reportError(StaticWarningCode.UNDEFINED_IDENTIFIER, identifier, [identifier.name]);
+        }
       }
     } else {
       recordResolution(identifier, memberElement);
@@ -1952,7 +2053,9 @@
       }
     }
     if (element == null) {
-      _resolver.reportError(StaticWarningCode.UNDEFINED_IDENTIFIER, node, [node.name]);
+      if (!doesClassDeclareNoSuchMethod(enclosingClass2)) {
+        _resolver.reportError(StaticWarningCode.UNDEFINED_IDENTIFIER, node, [node.name]);
+      }
     }
     recordResolution(node, element);
     return null;
@@ -1994,6 +2097,27 @@
     return null;
   }
   /**
+   * Return {@code true} if the passed {@link Element} is a {@link ClassElement} that declares a
+   * method "noSuchMethod".
+   * @param element the {@link Element} to evaluate
+   * @return {@code true} if the passed {@link Element} is a {@link ClassElement} that declares a
+   * method "noSuchMethod"
+   */
+  bool doesClassDeclareNoSuchMethod(Element element) {
+    if (element == null) {
+      return false;
+    }
+    if (element is! ClassElementImpl) {
+      return false;
+    }
+    ClassElementImpl classElement = element as ClassElementImpl;
+    MethodElement method = classElement.lookUpMethod("noSuchMethod", _resolver.definingLibrary);
+    if (method == null) {
+      return false;
+    }
+    return true;
+  }
+  /**
    * Search through the array of parameters for a parameter whose name matches the given name.
    * Return the parameter with the given name, or {@code null} if there is no such parameter.
    * @param parameters the parameters being searched
@@ -2101,6 +2225,66 @@
     return lookUpGetterInInterfaces(superclass2, getterName, visitedInterfaces);
   }
   /**
+   * Look up the method or getter with the given name in the given type. Return the element
+   * representing the method or getter that was found, or {@code null} if there is no method or
+   * getter with the given name.
+   * @param type the type in which the method or getter is defined
+   * @param memberName the name of the method or getter being looked up
+   * @return the element representing the method or getter that was found
+   */
+  ExecutableElement lookupGetterOrMethod(Type2 type, String memberName) {
+    type = resolveTypeVariable(type);
+    if (type is InterfaceType) {
+      InterfaceType interfaceType = type as InterfaceType;
+      ExecutableElement member = interfaceType.lookUpMethod(memberName, _resolver.definingLibrary);
+      if (member != null) {
+        return member;
+      }
+      member = interfaceType.lookUpGetter(memberName, _resolver.definingLibrary);
+      if (member != null) {
+        return member;
+      }
+      return lookUpGetterOrMethodInInterfaces(interfaceType, memberName, new Set<ClassElement>());
+    }
+    return null;
+  }
+  /**
+   * Look up the method or getter with the given name in the interfaces implemented by the given
+   * type, either directly or indirectly. Return the element representing the method or getter that
+   * was found, or {@code null} if there is no method or getter with the given name.
+   * @param targetType the type in which the method or getter might be defined
+   * @param memberName the name of the method or 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 method or getter that was found
+   */
+  ExecutableElement lookUpGetterOrMethodInInterfaces(InterfaceType targetType, String memberName, Set<ClassElement> visitedInterfaces) {
+    ClassElement targetClass = targetType.element;
+    if (visitedInterfaces.contains(targetClass)) {
+      return null;
+    }
+    javaSetAdd(visitedInterfaces, targetClass);
+    ExecutableElement member = targetType.getMethod(memberName);
+    if (member != null) {
+      return member;
+    }
+    member = targetType.getGetter(memberName);
+    if (member != null) {
+      return member;
+    }
+    for (InterfaceType interfaceType in targetType.interfaces) {
+      member = lookUpGetterOrMethodInInterfaces(interfaceType, memberName, visitedInterfaces);
+      if (member != null) {
+        return member;
+      }
+    }
+    InterfaceType superclass2 = targetType.superclass;
+    if (superclass2 == null) {
+      return null;
+    }
+    return lookUpGetterInInterfaces(superclass2, memberName, visitedInterfaces);
+  }
+  /**
    * Find the element corresponding to the given label node in the current label scope.
    * @param parentNode the node containing the given label
    * @param labelNode the node representing the label being looked up
@@ -2284,14 +2468,17 @@
     }
   }
   /**
-   * Report the {@link StaticTypeWarningCode}s <code>UNDEFINED_SETTER</code> and
-   * <code>UNDEFINED_GETTER</code>.
+   * Report the {@link StaticTypeWarningCode}s <code>UNDEFINED_SETTER</code> and <code>UNDEFINED_GETTER</code>.
    * @param node the prefixed identifier that gives the context to determine if the error on the
    * undefined identifier is a getter or a setter
    * @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 identifier2, String typeName) {
+    Type2 targetType = getType(node);
+    if (targetType != null && doesClassDeclareNoSuchMethod(targetType.element)) {
+      return;
+    }
     bool isSetterContext = node.identifier.inSetterContext();
     ErrorCode errorCode = isSetterContext ? StaticTypeWarningCode.UNDEFINED_SETTER : StaticTypeWarningCode.UNDEFINED_GETTER;
     _resolver.reportError(errorCode, identifier2, [identifier2.name, typeName]);
@@ -2791,10 +2978,10 @@
    * @param analysisContext the analysis context in which the library is being analyzed
    */
   LibraryResolver.con1(InternalAnalysisContext analysisContext) {
-    _jtd_constructor_263_impl(analysisContext);
+    _jtd_constructor_264_impl(analysisContext);
   }
-  _jtd_constructor_263_impl(InternalAnalysisContext analysisContext) {
-    _jtd_constructor_264_impl(analysisContext, null);
+  _jtd_constructor_264_impl(InternalAnalysisContext analysisContext) {
+    _jtd_constructor_265_impl(analysisContext, null);
   }
   /**
    * Initialize a newly created library resolver to resolve libraries within the given context.
@@ -2802,9 +2989,9 @@
    * @param errorListener the listener to which analysis errors will be reported
    */
   LibraryResolver.con2(InternalAnalysisContext analysisContext2, AnalysisErrorListener additionalAnalysisErrorListener) {
-    _jtd_constructor_264_impl(analysisContext2, additionalAnalysisErrorListener);
+    _jtd_constructor_265_impl(analysisContext2, additionalAnalysisErrorListener);
   }
-  _jtd_constructor_264_impl(InternalAnalysisContext analysisContext2, AnalysisErrorListener additionalAnalysisErrorListener) {
+  _jtd_constructor_265_impl(InternalAnalysisContext analysisContext2, AnalysisErrorListener additionalAnalysisErrorListener) {
     this._analysisContext = analysisContext2;
     this._recordingErrorListener = new RecordingErrorListener();
     if (additionalAnalysisErrorListener == null) {
@@ -3219,19 +3406,20 @@
   void recordResults() {
     Map<Source, LibraryElement> elementMap = new Map<Source, LibraryElement>();
     for (Library library in _librariesInCycles) {
-      recordResults2(library.librarySource, library.definingCompilationUnit);
+      Source librarySource2 = library.librarySource;
+      recordResults2(librarySource2, librarySource2, library.definingCompilationUnit);
       for (Source source in library.compilationUnitSources) {
-        recordResults2(source, library.getAST(source));
+        recordResults2(source, librarySource2, library.getAST(source));
       }
       elementMap[library.librarySource] = library.libraryElement;
     }
     _analysisContext.recordLibraryElements(elementMap);
   }
-  void recordResults2(Source source, CompilationUnit unit) {
+  void recordResults2(Source source, Source librarySource, CompilationUnit unit) {
     List<AnalysisError> errors = _recordingErrorListener.getErrors2(source);
     unit.resolutionErrors = errors;
-    _analysisContext.recordResolvedCompilationUnit(source, unit);
-    _analysisContext.recordResolutionErrors(source, errors, unit.lineInfo);
+    _analysisContext.recordResolvedCompilationUnit(source, librarySource, unit);
+    _analysisContext.recordResolutionErrors(source, librarySource, errors, unit.lineInfo);
   }
   /**
    * Resolve the identifiers and perform type analysis in the libraries in the current cycle.
@@ -3326,9 +3514,9 @@
    * @param typeProvider the object used to access the types from the core library
    */
   ResolverVisitor.con1(Library library, Source source, TypeProvider typeProvider) : super.con1(library, source, typeProvider) {
-    _jtd_constructor_265_impl(library, source, typeProvider);
+    _jtd_constructor_266_impl(library, source, typeProvider);
   }
-  _jtd_constructor_265_impl(Library library, Source source, TypeProvider typeProvider) {
+  _jtd_constructor_266_impl(Library library, Source source, TypeProvider typeProvider) {
     this._elementResolver = new ElementResolver(this);
     this._typeAnalyzer = new StaticTypeAnalyzer(this);
   }
@@ -3342,9 +3530,9 @@
    * 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_267_impl(definingLibrary, source, typeProvider, errorListener);
   }
-  _jtd_constructor_266_impl(LibraryElement definingLibrary, Source source, TypeProvider typeProvider, AnalysisErrorListener errorListener) {
+  _jtd_constructor_267_impl(LibraryElement definingLibrary, Source source, TypeProvider typeProvider, AnalysisErrorListener errorListener) {
     this._elementResolver = new ElementResolver(this);
     this._typeAnalyzer = new StaticTypeAnalyzer(this);
   }
@@ -3360,16 +3548,57 @@
       if (element != null) {
         Type2 type2 = node.type.type;
         if (type2 != null) {
-          _overrideManager.setType(element, type2);
+          override(element, getType(element), type2);
         }
       }
     }
     return null;
   }
   Object visitAssertStatement(AssertStatement node) {
-    Expression condition2 = node.condition;
-    condition2.accept(this);
-    propagateTrueState(condition2);
+    super.visitAssertStatement(node);
+    if (StaticTypeAnalyzer.USE_TYPE_PROPAGATION) {
+      propagateTrueState(node.condition);
+    }
+    return null;
+  }
+  Object visitBinaryExpression(BinaryExpression node) {
+    if (StaticTypeAnalyzer.USE_TYPE_PROPAGATION) {
+      sc.TokenType operatorType = node.operator.type;
+      if (identical(operatorType, sc.TokenType.AMPERSAND_AMPERSAND)) {
+        Expression leftOperand2 = node.leftOperand;
+        leftOperand2.accept(this);
+        Expression rightOperand2 = node.rightOperand;
+        if (rightOperand2 != null) {
+          try {
+            _overrideManager.enterScope();
+            propagateTrueState(leftOperand2);
+            rightOperand2.accept(this);
+          } finally {
+            _overrideManager.exitScope();
+          }
+        }
+      } else if (identical(operatorType, sc.TokenType.BAR_BAR)) {
+        Expression leftOperand3 = node.leftOperand;
+        leftOperand3.accept(this);
+        Expression rightOperand3 = node.rightOperand;
+        if (rightOperand3 != null) {
+          try {
+            _overrideManager.enterScope();
+            propagateFalseState(leftOperand3);
+            rightOperand3.accept(this);
+          } finally {
+            _overrideManager.exitScope();
+          }
+        }
+      } else {
+        node.leftOperand.accept(this);
+        node.rightOperand.accept(this);
+      }
+      node.accept(_elementResolver);
+      node.accept(_typeAnalyzer);
+    } else {
+      super.visitBinaryExpression(node);
+    }
     return null;
   }
   Object visitBreakStatement(BreakStatement node) {
@@ -3389,53 +3618,65 @@
     }
     return null;
   }
-  Object visitComment(Comment node) => null;
+  Object visitCommentReference(CommentReference node) {
+    node.accept(_elementResolver);
+    node.accept(_typeAnalyzer);
+    return 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 {
+    if (StaticTypeAnalyzer.USE_TYPE_PROPAGATION) {
+      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();
       }
-      for (CompilationUnitMember declaration in classes) {
-        declaration.accept(this);
-      }
-    } finally {
-      _overrideManager.exitScope();
+      node.accept(_elementResolver);
+      node.accept(_typeAnalyzer);
+    } else {
+      super.visitCompilationUnit(node);
     }
     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) {
+      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();
+        }
+      }
+      node.accept(_elementResolver);
+      node.accept(_typeAnalyzer);
       bool thenIsAbrupt = thenExpression2 != null && isAbruptTermination(thenExpression2);
       bool elseIsAbrupt = elseExpression2 != null && isAbruptTermination(elseExpression2);
       if (elseIsAbrupt && !thenIsAbrupt) {
@@ -3443,6 +3684,8 @@
       } else if (thenIsAbrupt && !elseIsAbrupt) {
         propagateFalseState(condition2);
       }
+    } else {
+      super.visitConditionalExpression(node);
     }
     return null;
   }
@@ -3473,33 +3716,56 @@
     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());
+    if (StaticTypeAnalyzer.USE_TYPE_PROPAGATION) {
+      try {
+        _overrideManager.enterScope();
+        super.visitFieldDeclaration(node);
+      } finally {
+        Map<Element, Type2> overrides = captureOverrides(node.fields);
+        _overrideManager.exitScope();
+        applyOverrides(overrides);
       }
+    } else {
+      super.visitFieldDeclaration(node);
+    }
+    return null;
+  }
+  Object visitForEachStatement(ForEachStatement node) {
+    if (StaticTypeAnalyzer.USE_TYPE_PROPAGATION) {
+      try {
+        _overrideManager.enterScope();
+        super.visitForEachStatement(node);
+      } finally {
+        _overrideManager.exitScope();
+      }
+    } else {
+      super.visitForEachStatement(node);
     }
     return null;
   }
   Object visitForStatement(ForStatement node) {
-    try {
-      _overrideManager.enterScope();
+    if (StaticTypeAnalyzer.USE_TYPE_PROPAGATION) {
+      try {
+        _overrideManager.enterScope();
+        super.visitForStatement(node);
+      } finally {
+        _overrideManager.exitScope();
+      }
+    } else {
       super.visitForStatement(node);
-    } finally {
-      _overrideManager.exitScope();
     }
     return null;
   }
   Object visitFunctionBody(FunctionBody node) {
-    try {
-      _overrideManager.enterScope();
+    if (StaticTypeAnalyzer.USE_TYPE_PROPAGATION) {
+      try {
+        _overrideManager.enterScope();
+        super.visitFunctionBody(node);
+      } finally {
+        _overrideManager.exitScope();
+      }
+    } else {
       super.visitFunctionBody(node);
-    } finally {
-      _overrideManager.exitScope();
     }
     return null;
   }
@@ -3518,39 +3784,45 @@
     ExecutableElement outerFunction = _enclosingFunction;
     try {
       _enclosingFunction = node.element;
-      _overrideManager.enterScope();
+      if (StaticTypeAnalyzer.USE_TYPE_PROPAGATION) {
+        _overrideManager.enterScope();
+      }
       super.visitFunctionExpression(node);
     } finally {
-      _overrideManager.exitScope();
+      if (StaticTypeAnalyzer.USE_TYPE_PROPAGATION) {
+        _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) {
+      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();
+        }
+      }
+      node.accept(_elementResolver);
+      node.accept(_typeAnalyzer);
       bool thenIsAbrupt = thenStatement2 != null && isAbruptTermination2(thenStatement2);
       bool elseIsAbrupt = elseStatement2 != null && isAbruptTermination2(elseStatement2);
       if (elseIsAbrupt && !thenIsAbrupt) {
@@ -3558,6 +3830,8 @@
       } else if (thenIsAbrupt && !elseIsAbrupt) {
         propagateFalseState(condition2);
       }
+    } else {
+      super.visitIfStatement(node);
     }
     return null;
   }
@@ -3612,37 +3886,68 @@
     return null;
   }
   Object visitSwitchCase(SwitchCase node) {
-    try {
-      _overrideManager.enterScope();
+    if (StaticTypeAnalyzer.USE_TYPE_PROPAGATION) {
+      try {
+        _overrideManager.enterScope();
+        super.visitSwitchCase(node);
+      } finally {
+        _overrideManager.exitScope();
+      }
+    } else {
       super.visitSwitchCase(node);
-    } finally {
-      _overrideManager.exitScope();
     }
     return null;
   }
   Object visitSwitchDefault(SwitchDefault node) {
-    try {
-      _overrideManager.enterScope();
+    if (StaticTypeAnalyzer.USE_TYPE_PROPAGATION) {
+      try {
+        _overrideManager.enterScope();
+        super.visitSwitchDefault(node);
+      } finally {
+        _overrideManager.exitScope();
+      }
+    } else {
       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());
+    if (StaticTypeAnalyzer.USE_TYPE_PROPAGATION) {
+      try {
+        _overrideManager.enterScope();
+        super.visitTopLevelVariableDeclaration(node);
+      } finally {
+        Map<Element, Type2> overrides = captureOverrides(node.variables);
+        _overrideManager.exitScope();
+        applyOverrides(overrides);
       }
+    } else {
+      super.visitTopLevelVariableDeclaration(node);
     }
     return null;
   }
   Object visitTypeName(TypeName node) => null;
+  Object visitWhileStatement(WhileStatement node) {
+    if (StaticTypeAnalyzer.USE_TYPE_PROPAGATION) {
+      Expression condition2 = node.condition;
+      condition2.accept(this);
+      Statement body2 = node.body;
+      if (body2 != null) {
+        try {
+          _overrideManager.enterScope();
+          propagateTrueState(condition2);
+          body2.accept(this);
+        } finally {
+          _overrideManager.exitScope();
+        }
+      }
+      node.accept(_elementResolver);
+      node.accept(_typeAnalyzer);
+    } else {
+      super.visitWhileStatement(node);
+    }
+    return null;
+  }
   /**
    * Return the class element representing the class containing the current node, or {@code null} if
    * the current node is not contained in a class.
@@ -3669,6 +3974,34 @@
     }
     return null;
   }
+  void visitForEachStatementInScope(ForEachStatement node) {
+    if (StaticTypeAnalyzer.USE_TYPE_PROPAGATION) {
+      DeclaredIdentifier loopVariable2 = node.loopVariable;
+      safelyVisit(loopVariable2);
+      Expression iterator2 = node.iterator;
+      if (iterator2 != null) {
+        iterator2.accept(this);
+        if (loopVariable2 != null) {
+          LocalVariableElement loopElement = loopVariable2.element;
+          override(loopElement, loopElement.type, getIteratorElementType(iterator2));
+        }
+      }
+      safelyVisit(node.body);
+      node.accept(_elementResolver);
+      node.accept(_typeAnalyzer);
+    } else {
+      super.visitForEachStatementInScope(node);
+    }
+  }
+  /**
+   * Apply a set of overrides that were previously captured.
+   * @param overrides the overrides to be applied
+   */
+  void applyOverrides(Map<Element, Type2> overrides) {
+    for (MapEntry<Element, Type2> entry in getMapEntrySet(overrides)) {
+      _overrideManager.setType(entry.getKey(), entry.getValue());
+    }
+  }
   /**
    * Return a map from the elements for the variables in the given list that have their types
    * overridden to the overriding type.
@@ -3693,6 +4026,44 @@
     return overrides;
   }
   /**
+   * The given expression is the expression used to compute the iterator for a for-each statement.
+   * Attempt to compute the type of objects that will be assigned to the loop variable and return
+   * that type. Return {@code null} if the type could not be determined.
+   * @param iterator the iterator for a for-each statement
+   * @return the type of objects that will be assigned to the loop variable
+   */
+  Type2 getIteratorElementType(Expression iteratorExpression) {
+    Type2 expressionType = iteratorExpression.staticType;
+    if (expressionType is InterfaceType) {
+      PropertyAccessorElement iterator = ((expressionType as InterfaceType)).lookUpGetter("iterator", definingLibrary);
+      if (iterator == null) {
+        return null;
+      }
+      Type2 iteratorType = iterator.type.returnType;
+      if (iteratorType is InterfaceType) {
+        PropertyAccessorElement current = ((iteratorType as InterfaceType)).lookUpGetter("current", definingLibrary);
+        if (current == null) {
+          return null;
+        }
+        return current.type.returnType;
+      }
+    }
+    return null;
+  }
+  /**
+   * Return the type of the given (overridable) element.
+   * @param element the element whose type is to be returned
+   * @return the type of the given element
+   */
+  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 {@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
@@ -3726,6 +4097,27 @@
     return false;
   }
   /**
+   * 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)) {
+      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);
+    }
+  }
+  /**
    * 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'
@@ -3737,11 +4129,11 @@
     if (condition is IsExpression) {
       IsExpression is2 = condition as IsExpression;
       if (is2.notOperator != null) {
-        Element element = getOverridableElement(is2.expression);
+        VariableElement element = getOverridableElement(is2.expression);
         if (element != null) {
           Type2 type2 = is2.type.type;
           if (type2 != null) {
-            _overrideManager.setType(element, type2);
+            override(element, getType(element), type2);
           }
         }
       }
@@ -3765,11 +4157,11 @@
     if (condition is IsExpression) {
       IsExpression is2 = condition as IsExpression;
       if (is2.notOperator == null) {
-        Element element = getOverridableElement(is2.expression);
+        VariableElement element = getOverridableElement(is2.expression);
         if (element != null) {
           Type2 type2 = is2.type.type;
           if (type2 != null) {
-            _overrideManager.setType(element, type2);
+            override(element, getType(element), type2);
           }
         }
       }
@@ -3838,9 +4230,9 @@
    * @param typeProvider the object used to access the types from the core library
    */
   ScopedVisitor.con1(Library library, Source source2, TypeProvider typeProvider2) {
-    _jtd_constructor_267_impl(library, source2, typeProvider2);
+    _jtd_constructor_268_impl(library, source2, typeProvider2);
   }
-  _jtd_constructor_267_impl(Library library, Source source2, TypeProvider typeProvider2) {
+  _jtd_constructor_268_impl(Library library, Source source2, TypeProvider typeProvider2) {
     this._definingLibrary = library.libraryElement;
     this._source = source2;
     LibraryScope libraryScope2 = library.libraryScope;
@@ -3858,9 +4250,9 @@
    * during resolution
    */
   ScopedVisitor.con2(LibraryElement definingLibrary2, Source source2, TypeProvider typeProvider2, AnalysisErrorListener errorListener2) {
-    _jtd_constructor_268_impl(definingLibrary2, source2, typeProvider2, errorListener2);
+    _jtd_constructor_269_impl(definingLibrary2, source2, typeProvider2, errorListener2);
   }
-  _jtd_constructor_268_impl(LibraryElement definingLibrary2, Source source2, TypeProvider typeProvider2, AnalysisErrorListener errorListener2) {
+  _jtd_constructor_269_impl(LibraryElement definingLibrary2, Source source2, TypeProvider typeProvider2, AnalysisErrorListener errorListener2) {
     this._definingLibrary = definingLibrary2;
     this._source = source2;
     this._errorListener = errorListener2;
@@ -3959,7 +4351,7 @@
     Scope outerNameScope = _nameScope;
     _nameScope = new EnclosedScope(_nameScope);
     try {
-      super.visitForEachStatement(node);
+      visitForEachStatementInScope(node);
     } finally {
       _nameScope = outerNameScope;
       _labelScope = outerLabelScope;
@@ -4115,7 +4507,7 @@
    * @param arguments the arguments to the error, used to compose the error message
    */
   void reportError(ErrorCode errorCode, ASTNode node, List<Object> arguments) {
-    _errorListener.onError(new AnalysisError.con2(_source, node.offset, node.length, errorCode, [arguments]));
+    _errorListener.onError(new AnalysisError.con2(_source, node.offset, node.length, errorCode, arguments));
   }
   /**
    * Report an error with the given error code and arguments.
@@ -4124,7 +4516,16 @@
    * @param arguments the arguments to the error, used to compose the error message
    */
   void reportError3(ErrorCode errorCode, sc.Token token, List<Object> arguments) {
-    _errorListener.onError(new AnalysisError.con2(_source, token.offset, token.length, errorCode, [arguments]));
+    _errorListener.onError(new AnalysisError.con2(_source, token.offset, token.length, errorCode, arguments));
+  }
+  /**
+   * Visit the given statement after it's scope has been created. This replaces the normal call to
+   * the inherited visit method so that ResolverVisitor can intervene when type propagation is
+   * enabled.
+   * @param node the statement to be visited
+   */
+  void visitForEachStatementInScope(ForEachStatement node) {
+    super.visitForEachStatement(node);
   }
   /**
    * Add scopes for each of the given labels.
@@ -4310,17 +4711,17 @@
    * The static type of the expression <i>e<sub>1</sub>.v = e<sub>2</sub></i> is the static type of
    * <i>e<sub>2</sub></i>.
    * <p>
-   * ... an assignment of the form <i>e<sub>1</sub>[e<sub>2</sub>] = e<sub>3</sub></i> ...
+   * ... an assignment of the form <i>e<sub>1</sub>\[e<sub>2</sub>\] = e<sub>3</sub></i> ...
    * <p>
-   * The static type of the expression <i>e<sub>1</sub>[e<sub>2</sub>] = e<sub>3</sub></i> is the
+   * The static type of the expression <i>e<sub>1</sub>\[e<sub>2</sub>\] = e<sub>3</sub></i> is the
    * static type of <i>e<sub>3</sub></i>.
    * <p>
    * A compound assignment of the form <i>v op= e</i> is equivalent to <i>v = v op e</i>. A compound
    * assignment of the form <i>C.v op= e</i> is equivalent to <i>C.v = C.v op e</i>. A compound
    * assignment of the form <i>e<sub>1</sub>.v op= e<sub>2</sub></i> is equivalent to <i>((x) => x.v
    * = x.v op e<sub>2</sub>)(e<sub>1</sub>)</i> where <i>x</i> is a variable that is not used in
-   * <i>e<sub>2</sub></i>. A compound assignment of the form <i>e<sub>1</sub>[e<sub>2</sub>] op=
-   * e<sub>3</sub></i> is equivalent to <i>((a, i) => a[i] = a[i] op e<sub>3</sub>)(e<sub>1</sub>,
+   * <i>e<sub>2</sub></i>. A compound assignment of the form <i>e<sub>1</sub>\[e<sub>2</sub>\] op=
+   * e<sub>3</sub></i> is equivalent to <i>((a, i) => a\[i\] = a\[i\] op e<sub>3</sub>)(e<sub>1</sub>,
    * e<sub>2</sub>)</i> where <i>a</i> and <i>i</i> are a variables that are not used in
    * <i>e<sub>3</sub></i>. </blockquote>
    */
@@ -4435,10 +4836,10 @@
   }
   /**
    * The Dart Language Specification, 12.9: <blockquote>The static type of a function literal of the
-   * form <i>(T<sub>1</sub> a<sub>1</sub>, &hellip;, T<sub>n</sub> a<sub>n</sub>, [T<sub>n+1</sub>
-   * x<sub>n+1</sub> = d1, &hellip;, T<sub>n+k</sub> x<sub>n+k</sub> = dk]) => e</i> is
-   * <i>(T<sub>1</sub>, &hellip;, Tn, [T<sub>n+1</sub> x<sub>n+1</sub>, &hellip;, T<sub>n+k</sub>
-   * x<sub>n+k</sub>]) &rarr; T<sub>0</sub></i>, where <i>T<sub>0</sub></i> is the static type of
+   * form <i>(T<sub>1</sub> a<sub>1</sub>, &hellip;, T<sub>n</sub> a<sub>n</sub>, \[T<sub>n+1</sub>
+   * x<sub>n+1</sub> = d1, &hellip;, T<sub>n+k</sub> x<sub>n+k</sub> = dk\]) => e</i> is
+   * <i>(T<sub>1</sub>, &hellip;, Tn, \[T<sub>n+1</sub> x<sub>n+1</sub>, &hellip;, T<sub>n+k</sub>
+   * x<sub>n+k</sub>\]) &rarr; T<sub>0</sub></i>, where <i>T<sub>0</sub></i> is the static type of
    * <i>e</i>. In any case where <i>T<sub>i</sub>, 1 &lt;= i &lt;= n</i>, is not specified, it is
    * considered to have been specified as dynamic.
    * <p>
@@ -4450,9 +4851,9 @@
    * &lt;= i &lt;= n</i>, is not specified, it is considered to have been specified as dynamic.
    * <p>
    * The static type of a function literal of the form <i>(T<sub>1</sub> a<sub>1</sub>, &hellip;,
-   * T<sub>n</sub> a<sub>n</sub>, [T<sub>n+1</sub> x<sub>n+1</sub> = d1, &hellip;, T<sub>n+k</sub>
-   * x<sub>n+k</sub> = dk]) {s}</i> is <i>(T<sub>1</sub>, &hellip;, T<sub>n</sub>, [T<sub>n+1</sub>
-   * x<sub>n+1</sub>, &hellip;, T<sub>n+k</sub> x<sub>n+k</sub>]) &rarr; dynamic</i>. In any case
+   * T<sub>n</sub> a<sub>n</sub>, \[T<sub>n+1</sub> x<sub>n+1</sub> = d1, &hellip;, T<sub>n+k</sub>
+   * x<sub>n+k</sub> = dk\]) {s}</i> is <i>(T<sub>1</sub>, &hellip;, T<sub>n</sub>, \[T<sub>n+1</sub>
+   * x<sub>n+1</sub>, &hellip;, T<sub>n+k</sub> x<sub>n+k</sub>\]) &rarr; dynamic</i>. In any case
    * where <i>T<sub>i</sub>, 1 &lt;= i &lt;= n</i>, is not specified, it is considered to have been
    * specified as dynamic.
    * <p>
@@ -4486,8 +4887,8 @@
   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>
+   * <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) {
     if (node.inSetterContext()) {
@@ -4532,10 +4933,10 @@
   Object visitIsExpression(IsExpression node) => recordType(node, _typeProvider.boolType);
   /**
    * The Dart Language Specification, 12.6: <blockquote>The static type of a list literal of the
-   * form <i><b>const</b> &lt;E&gt;[e<sub>1</sub>, &hellip;, e<sub>n</sub>]</i> or the form
-   * <i>&lt;E&gt;[e<sub>1</sub>, &hellip;, e<sub>n</sub>]</i> is {@code List&lt;E&gt;}. The static
-   * type a list literal of the form <i><b>const</b> [e<sub>1</sub>, &hellip;, e<sub>n</sub>]</i> or
-   * the form <i>[e<sub>1</sub>, &hellip;, e<sub>n</sub>]</i> is {@code List&lt;dynamic&gt;}.</blockquote>
+   * form <i><b>const</b> &lt;E&gt;\[e<sub>1</sub>, &hellip;, e<sub>n</sub>\]</i> or the form
+   * <i>&lt;E&gt;\[e<sub>1</sub>, &hellip;, e<sub>n</sub>\]</i> is {@code List&lt;E&gt;}. The static
+   * type a list literal of the form <i><b>const</b> \[e<sub>1</sub>, &hellip;, e<sub>n</sub>\]</i> or
+   * 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 typeArguments2 = node.typeArguments;
@@ -4679,7 +5080,7 @@
    * A postfix expression of the form <i>e1.v++</i> is equivalent to <i>(x){var r = x.v; x.v = r +
    * 1; return r}(e1)</i>.
    * <p>
-   * A postfix expression of the form <i>e1[e2]++</i> is equivalent to <i>(a, i){var r = a[i]; a[i]
+   * 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>
    * <p>
    * A postfix expression of the form <i>v--</i>, where <i>v</i> is an identifier, is equivalent to
@@ -4691,7 +5092,7 @@
    * A postfix expression of the form <i>e1.v--</i> is equivalent to <i>(x){var r = x.v; x.v = r -
    * 1; return r}(e1)</i>.
    * <p>
-   * A postfix expression of the form <i>e1[e2]--</i> is equivalent to <i>(a, i){var r = a[i]; a[i]
+   * 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, getType2(node.operand));
@@ -4758,8 +5159,8 @@
    * p<sub>k</sub>: p<sub>k</sub>);}</i> if <i>m</i> has required parameters <i>r<sub>1</sub>,
    * &hellip;, r<sub>n</sub></i>, and named parameters <i>p<sub>1</sub> &hellip; p<sub>k</sub></i>
    * with defaults <i>d<sub>1</sub>, &hellip;, d<sub>k</sub></i>.</li>
-   * <li><i>(r<sub>1</sub>, &hellip;, r<sub>n</sub>, [p<sub>1</sub> = d<sub>1</sub>, &hellip;,
-   * p<sub>k</sub> = d<sub>k</sub>]){return o.m(r<sub>1</sub>, &hellip;, r<sub>n</sub>,
+   * <li><i>(r<sub>1</sub>, &hellip;, r<sub>n</sub>, \[p<sub>1</sub> = d<sub>1</sub>, &hellip;,
+   * p<sub>k</sub> = d<sub>k</sub>\]){return o.m(r<sub>1</sub>, &hellip;, r<sub>n</sub>,
    * p<sub>1</sub>, &hellip;, p<sub>k</sub>);}</i> if <i>m</i> has required parameters
    * <i>r<sub>1</sub>, &hellip;, r<sub>n</sub></i>, and optional positional parameters
    * <i>p<sub>1</sub> &hellip; p<sub>k</sub></i> with defaults <i>d<sub>1</sub>, &hellip;,
@@ -5041,6 +5442,11 @@
     }
     return null;
   }
+  /**
+   * Return the type of the given (overridable) element.
+   * @param element the element whose type is to be returned
+   * @return the type of the given element
+   */
   Type2 getType(Element element) {
     if (element is LocalVariableElement) {
       return ((element as LocalVariableElement)).type;
@@ -5064,7 +5470,7 @@
   /**
    * 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
+   * @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
@@ -5138,7 +5544,7 @@
    * @param inferredType the inferred type of the element
    */
   void override(VariableElement element, Type2 staticType, Type2 inferredType) {
-    if (identical(inferredType, BottomTypeImpl.instance) || element is! VariableElement) {
+    if (identical(inferredType, BottomTypeImpl.instance)) {
       return;
     }
     if (element is PropertyInducingElement) {
@@ -5553,9 +5959,9 @@
    * @param typeProvider the object used to access the types from the core library
    */
   TypeResolverVisitor.con1(Library library, Source source, TypeProvider typeProvider) : super.con1(library, source, typeProvider) {
-    _jtd_constructor_273_impl(library, source, typeProvider);
+    _jtd_constructor_274_impl(library, source, typeProvider);
   }
-  _jtd_constructor_273_impl(Library library, Source source, TypeProvider typeProvider) {
+  _jtd_constructor_274_impl(Library library, Source source, TypeProvider typeProvider) {
     _dynamicType = typeProvider.dynamicType;
   }
   /**
@@ -5568,9 +5974,9 @@
    * 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_275_impl(definingLibrary, source, typeProvider, errorListener);
   }
-  _jtd_constructor_274_impl(LibraryElement definingLibrary, Source source, TypeProvider typeProvider, AnalysisErrorListener errorListener) {
+  _jtd_constructor_275_impl(LibraryElement definingLibrary, Source source, TypeProvider typeProvider, AnalysisErrorListener errorListener) {
     _dynamicType = typeProvider.dynamicType;
   }
   Object visitCatchClause(CatchClause node) {
@@ -5781,7 +6187,11 @@
       } else {
         simpleIdentifier = ((typeName as PrefixedIdentifier)).prefix;
       }
-      reportError(StaticWarningCode.UNDEFINED_CLASS, simpleIdentifier, [simpleIdentifier.name]);
+      if (simpleIdentifier.name == "boolean") {
+        reportError(StaticWarningCode.UNDEFINED_CLASS_BOOLEAN, simpleIdentifier, []);
+      } else {
+        reportError(StaticWarningCode.UNDEFINED_CLASS, simpleIdentifier, [simpleIdentifier.name]);
+      }
       setElement(typeName, _dynamicType.element);
       typeName.staticType = _dynamicType;
       node.type = _dynamicType;
@@ -6252,16 +6662,26 @@
    * @param typeElement the element representing the type alias represented by this scope
    */
   FunctionTypeScope(Scope enclosingScope, FunctionTypeAliasElement typeElement) : super(new EnclosedScope(enclosingScope)) {
-    defineTypeParameters(typeElement);
+    defineTypeVariables(typeElement);
+    defineParameters(typeElement);
   }
   /**
-   * Define the type parameters for the function type alias.
+   * Define the parameters for the function type alias.
    * @param typeElement the element representing the type represented by this scope
    */
-  void defineTypeParameters(FunctionTypeAliasElement typeElement) {
-    Scope parameterScope = enclosingScope;
-    for (TypeVariableElement parameter in typeElement.typeVariables) {
-      parameterScope.define(parameter);
+  void defineParameters(FunctionTypeAliasElement typeElement) {
+    for (ParameterElement parameter in typeElement.parameters) {
+      define(parameter);
+    }
+  }
+  /**
+   * Define the type variables for the function type alias.
+   * @param typeElement the element representing the type represented by this scope
+   */
+  void defineTypeVariables(FunctionTypeAliasElement typeElement) {
+    Scope typeVariableScope = enclosingScope;
+    for (TypeVariableElement typeVariable in typeElement.typeVariables) {
+      typeVariableScope.define(typeVariable);
     }
   }
 }
@@ -6297,10 +6717,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_279_impl(outerScope, onSwitchStatement, onSwitchMember);
+    _jtd_constructor_280_impl(outerScope, 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));
+  _jtd_constructor_280_impl(LabelScope outerScope, bool onSwitchStatement, bool onSwitchMember) {
+    _jtd_constructor_281_impl(outerScope, EMPTY_LABEL, new LabelElementImpl(_EMPTY_LABEL_IDENTIFIER, onSwitchStatement, onSwitchMember));
   }
   /**
    * Initialize a newly created scope to represent the given label.
@@ -6309,9 +6729,9 @@
    * @param element the element to which the label resolves
    */
   LabelScope.con2(LabelScope outerScope2, String label2, LabelElement element2) {
-    _jtd_constructor_280_impl(outerScope2, label2, element2);
+    _jtd_constructor_281_impl(outerScope2, label2, element2);
   }
-  _jtd_constructor_280_impl(LabelScope outerScope2, String label2, LabelElement element2) {
+  _jtd_constructor_281_impl(LabelScope outerScope2, String label2, LabelElement element2) {
     this._outerScope = outerScope2;
     this._label = label2;
     this._element = element2;
@@ -6985,6 +7405,11 @@
    */
   bool _isInSystemLibrary = false;
   /**
+   * 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 that we are currently visiting, or {@code null} if we are not inside a
    * method or function.
    */
@@ -7037,7 +7462,9 @@
     }
   }
   Object visitClassDeclaration(ClassDeclaration node) {
+    ClassElement outerClass = _enclosingClass;
     try {
+      _enclosingClass = node.element;
       checkForBuiltInIdentifierAsName(node.name, CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME);
       ClassElement classElement = node.element;
       if (classElement != null) {
@@ -7053,6 +7480,7 @@
       return super.visitClassDeclaration(node);
     } finally {
       _initialFieldElementsMap = null;
+      _enclosingClass = outerClass;
     }
   }
   Object visitClassTypeAlias(ClassTypeAlias node) {
@@ -7077,6 +7505,10 @@
       _enclosingFunction = outerFunction;
     }
   }
+  Object visitDefaultFormalParameter(DefaultFormalParameter node) {
+    checkForPrivateOptionalParameter(node);
+    return super.visitDefaultFormalParameter(node);
+  }
   Object visitDoStatement(DoStatement node) {
     checkForNonBoolCondition(node.condition);
     return super.visitDoStatement(node);
@@ -7133,14 +7565,41 @@
     }
     return super.visitInstanceCreationExpression(node);
   }
+  Object visitListLiteral(ListLiteral node) {
+    if (node.modifier != null) {
+      TypeArgumentList typeArguments2 = node.typeArguments;
+      if (typeArguments2 != null) {
+        NodeList<TypeName> arguments2 = typeArguments2.arguments;
+        if (arguments2.length != 0) {
+          checkForInvalidTypeArgumentInConstTypedLiteral(arguments2, CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST);
+        }
+      }
+    }
+    return super.visitListLiteral(node);
+  }
   Object visitMapLiteral(MapLiteral node) {
-    checkForInvalidTypeArgumentForKey(node);
+    TypeArgumentList typeArguments2 = node.typeArguments;
+    if (typeArguments2 != null) {
+      NodeList<TypeName> arguments2 = typeArguments2.arguments;
+      if (arguments2.length != 0) {
+        checkForInvalidTypeArgumentForKey(arguments2);
+        if (node.modifier != null) {
+          checkForInvalidTypeArgumentInConstTypedLiteral(arguments2, CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP);
+        }
+      }
+    }
     return super.visitMapLiteral(node);
   }
   Object visitMethodDeclaration(MethodDeclaration node) {
     ExecutableElement previousFunction = _enclosingFunction;
     try {
       _enclosingFunction = node.element;
+      if (node.isSetter()) {
+        checkForWrongNumberOfParametersForSetter(node);
+      } else if (node.isOperator()) {
+        checkForOptionalParameterInOperator(node);
+      }
+      checkForConcreteClassWithAbstractMember(node);
       return super.visitMethodDeclaration(node);
     } finally {
       _enclosingFunction = previousFunction;
@@ -7155,7 +7614,7 @@
     return super.visitRethrowExpression(node);
   }
   Object visitReturnStatement(ReturnStatement node) {
-    checkForReturnOfInvalidType(node);
+    checkForAllReturnStatementErrorCodes(node);
     return super.visitReturnStatement(node);
   }
   Object visitSimpleFormalParameter(SimpleFormalParameter node) {
@@ -7259,6 +7718,46 @@
     return foundError;
   }
   /**
+   * This checks that the return statement of the form <i>return e;</i> is not in a generative
+   * constructor.
+   * <p>
+   * This checks that return statements without expressions are not in a generative constructor and
+   * the return type is not assignable to {@code null}; that is, we don't have {@code return;} if
+   * the enclosing method has a return type.
+   * <p>
+   * 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 {@code true} if and only if an error code is generated on the passed node
+   * @see CompileTimeErrorCode#RETURN_IN_GENERATIVE_CONSTRUCTOR
+   * @see StaticWarningCode#RETURN_WITHOUT_VALUE
+   * @see StaticTypeWarningCode#RETURN_OF_INVALID_TYPE
+   */
+  bool checkForAllReturnStatementErrorCodes(ReturnStatement node) {
+    FunctionType functionType = _enclosingFunction == null ? null : _enclosingFunction.type;
+    Type2 expectedReturnType = functionType == null ? DynamicTypeImpl.instance : functionType.returnType;
+    Expression returnExpression = node.expression;
+    bool isGenerativeConstructor = _enclosingFunction is ConstructorElement && !((_enclosingFunction as ConstructorElement)).isFactory();
+    if (returnExpression != null) {
+      if (isGenerativeConstructor) {
+        _errorReporter.reportError(CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR, returnExpression, []);
+        return true;
+      }
+      if (!expectedReturnType.isVoid()) {
+        Type2 actualReturnType = getType(returnExpression);
+        if (!actualReturnType.isAssignableTo(expectedReturnType)) {
+          _errorReporter.reportError(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE, returnExpression, [actualReturnType.name, expectedReturnType.name, _enclosingFunction.name]);
+          return true;
+        }
+      }
+    } else {
+      if (!isGenerativeConstructor && !VoidTypeImpl.instance.isAssignableTo(expectedReturnType)) {
+        _errorReporter.reportError(StaticWarningCode.RETURN_WITHOUT_VALUE, node, []);
+      }
+    }
+    return false;
+  }
+  /**
    * This verifies that the passed argument definition test identifier is a parameter.
    * @param node the {@link ArgumentDefinitionTest} to evaluate
    * @return return {@code true} if and only if an error code is generated on the passed node
@@ -7338,6 +7837,21 @@
     }
     return false;
   }
+  /**
+   * This verifies that the passed method declaration is abstract only if the enclosing class is
+   * also abstract.
+   * @param node the method declaration to evaluate
+   * @return {@code true} if and only if an error code is generated on the passed node
+   * @see StaticWarningCode#CONCRETE_CLASS_WITH_ABSTRACT_MEMBER
+   */
+  bool checkForConcreteClassWithAbstractMember(MethodDeclaration node) {
+    if (node.isAbstract() && _enclosingClass != null && !_enclosingClass.isAbstract()) {
+      SimpleIdentifier methodName = node.name;
+      _errorReporter.reportError(StaticWarningCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER, methodName, [methodName.name, _enclosingClass.name]);
+      return true;
+    }
+    return false;
+  }
   bool checkForConflictingConstructorNameAndMember(ConstructorDeclaration node) {
     ConstructorElement constructorElement = node.element;
     SimpleIdentifier constructorName = node.name;
@@ -7633,21 +8147,13 @@
     return false;
   }
   /**
-   * Checks to ensure that native function bodies can only in SDK code.
-   * @param node the map literal to test
+   * Checks to ensure that first type argument to a map literal must be the 'String' type.
+   * @param arguments a non-{@code null}, non-empty {@link TypeName} node list from the respective{@link MapLiteral}
    * @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];
+  bool checkForInvalidTypeArgumentForKey(NodeList<TypeName> arguments) {
+    TypeName firstArgument = arguments[0];
     Type2 firstArgumentType = firstArgument.type;
     if (firstArgumentType != null && firstArgumentType != _typeProvider.stringType) {
       _errorReporter.reportError(CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_FOR_KEY, firstArgument, []);
@@ -7656,6 +8162,23 @@
     return false;
   }
   /**
+   * Checks to ensure that the passed {@link ListLiteral} or {@link MapLiteral} does not have a type
+   * parameter as a type argument.
+   * @param arguments a non-{@code null}, non-empty {@link TypeName} node list from the respective{@link ListLiteral} or {@link MapLiteral}
+   * @param errorCode either {@link CompileTimeErrorCode#INVALID_TYPE_ARGUMENT_IN_CONST_LIST} or{@link CompileTimeErrorCode#INVALID_TYPE_ARGUMENT_IN_CONST_MAP}
+   * @return {@code true} if and only if an error code is generated on the passed node
+   */
+  bool checkForInvalidTypeArgumentInConstTypedLiteral(NodeList<TypeName> arguments, ErrorCode errorCode) {
+    bool foundError = false;
+    for (TypeName typeName in arguments) {
+      if (typeName.type is TypeVariableType) {
+        _errorReporter.reportError(errorCode, typeName, [typeName.name]);
+        foundError = true;
+      }
+    }
+    return foundError;
+  }
+  /**
    * 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
@@ -7707,6 +8230,48 @@
     return false;
   }
   /**
+   * This verifies the passed operator-method declaration, does not have an optional parameter.
+   * <p>
+   * This method assumes that the method declaration was tested to be an operator declaration before
+   * being called.
+   * @param node the method declaration to evaluate
+   * @return {@code true} if and only if an error code is generated on the passed node
+   * @see CompileTimeErrorCode#OPTIONAL_PARAMETER_IN_OPERATOR
+   */
+  bool checkForOptionalParameterInOperator(MethodDeclaration node) {
+    FormalParameterList parameterList = node.parameters;
+    if (parameterList == null) {
+      return false;
+    }
+    bool foundError = false;
+    NodeList<FormalParameter> formalParameters = parameterList.parameters;
+    for (FormalParameter formalParameter in formalParameters) {
+      if (formalParameter.kind.isOptional()) {
+        _errorReporter.reportError(CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR, formalParameter, []);
+        foundError = true;
+      }
+    }
+    return foundError;
+  }
+  /**
+   * This checks for named optional parameters that begin with '_'.
+   * @param node the default formal parameter to evaluate
+   * @return {@code true} if and only if an error code is generated on the passed node
+   * @see CompileTimeErrorCode#PRIVATE_OPTIONAL_PARAMETER
+   */
+  bool checkForPrivateOptionalParameter(DefaultFormalParameter node) {
+    sc.Token separator2 = node.separator;
+    if (separator2 != null && separator2.lexeme == ":") {
+      NormalFormalParameter parameter2 = node.parameter;
+      SimpleIdentifier name = parameter2.identifier;
+      if (!name.isSynthetic() && name.name.startsWith("_")) {
+        _errorReporter.reportError(CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER, node, []);
+        return true;
+      }
+    }
+    return false;
+  }
+  /**
    * This checks that the rethrow is inside of a catch clause.
    * @param node the rethrow expression to evaluate
    * @return {@code true} if and only if an error code is generated on the passed node
@@ -7720,28 +8285,8 @@
     return false;
   }
   /**
-   * 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} 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 = _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, _enclosingFunction.name]);
-        return true;
-      }
-    }
-    return false;
-  }
-  /**
    * This verifies that the type arguments in the passed instance creation expression are all within
-   * their bounds as specified by the class element where the constructor [that is being invoked] is
+   * their bounds as specified by the class element where the constructor \[that is being invoked\] is
    * declared.
    * @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
@@ -7769,6 +8314,27 @@
     return false;
   }
   /**
+   * This verifies if the passed setter method declaration, has only one parameter.
+   * <p>
+   * This method assumes that the method declaration was tested to be a setter before being called.
+   * @param node the method declaration to evaluate
+   * @return return {@code true} if and only if an error code is generated on the passed node
+   * @see CompileTimeErrorCode#WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER
+   */
+  bool checkForWrongNumberOfParametersForSetter(MethodDeclaration node) {
+    FormalParameterList parameterList = node.parameters;
+    if (parameterList == null) {
+      return false;
+    }
+    NodeList<FormalParameter> formalParameters = parameterList.parameters;
+    int numberOfParameters = formalParameters.length;
+    if (numberOfParameters != 1) {
+      _errorReporter.reportError(CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER, node.name, [numberOfParameters]);
+      return true;
+    }
+    return false;
+  }
+  /**
    * 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
diff --git a/pkg/analyzer_experimental/lib/src/generated/scanner.dart b/pkg/analyzer_experimental/lib/src/generated/scanner.dart
index d98b898..205e54d 100644
--- a/pkg/analyzer_experimental/lib/src/generated/scanner.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/scanner.dart
@@ -259,10 +259,10 @@
    * @param syntax the lexeme for the keyword
    */
   Keyword.con1(String ___name, int ___ordinal, String syntax) {
-    _jtd_constructor_308_impl(___name, ___ordinal, syntax);
+    _jtd_constructor_309_impl(___name, ___ordinal, syntax);
   }
-  _jtd_constructor_308_impl(String ___name, int ___ordinal, String syntax) {
-    _jtd_constructor_309_impl(___name, ___ordinal, syntax, false);
+  _jtd_constructor_309_impl(String ___name, int ___ordinal, String syntax) {
+    _jtd_constructor_310_impl(___name, ___ordinal, syntax, false);
   }
   /**
    * Initialize a newly created keyword to have the given syntax. The keyword is a pseudo-keyword if
@@ -271,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_309_impl(___name, ___ordinal, syntax2, isPseudoKeyword);
+    _jtd_constructor_310_impl(___name, ___ordinal, syntax2, isPseudoKeyword);
   }
-  _jtd_constructor_309_impl(String ___name, int ___ordinal, String syntax2, bool isPseudoKeyword) {
+  _jtd_constructor_310_impl(String ___name, int ___ordinal, String syntax2, bool isPseudoKeyword) {
     __name = ___name;
     __ordinal = ___ordinal;
     this._syntax = syntax2;
@@ -705,7 +705,7 @@
    * @param arguments any arguments needed to complete the error message
    */
   void reportError(ScannerErrorCode errorCode, List<Object> arguments) {
-    _errorListener.onError(new AnalysisError.con2(source, offset, 1, errorCode, [arguments]));
+    _errorListener.onError(new AnalysisError.con2(source, offset, 1, errorCode, arguments));
   }
   int select(int choice, TokenType yesType, TokenType noType) {
     int next = advance();
@@ -1568,7 +1568,7 @@
 }
 /**
  * Instances of the class {@code BeginToken} represent the opening half of a grouping pair of
- * tokens. This is used for curly brackets ('{'), parentheses ('('), and square brackets ('[').
+ * tokens. This is used for curly brackets ('{'), parentheses ('('), and square brackets ('\[').
  * @coverage dart.engine.parser
  */
 class BeginToken extends Token {
@@ -1676,15 +1676,15 @@
    */
   int _precedence = 0;
   TokenClass.con1(String ___name, int ___ordinal) {
-    _jtd_constructor_318_impl(___name, ___ordinal);
+    _jtd_constructor_319_impl(___name, ___ordinal);
   }
-  _jtd_constructor_318_impl(String ___name, int ___ordinal) {
-    _jtd_constructor_319_impl(___name, ___ordinal, 0);
+  _jtd_constructor_319_impl(String ___name, int ___ordinal) {
+    _jtd_constructor_320_impl(___name, ___ordinal, 0);
   }
   TokenClass.con2(String ___name, int ___ordinal, int precedence2) {
-    _jtd_constructor_319_impl(___name, ___ordinal, precedence2);
+    _jtd_constructor_320_impl(___name, ___ordinal, precedence2);
   }
-  _jtd_constructor_319_impl(String ___name, int ___ordinal, int precedence2) {
+  _jtd_constructor_320_impl(String ___name, int ___ordinal, int precedence2) {
     __name = ___name;
     __ordinal = ___ordinal;
     this._precedence = precedence2;
@@ -1811,15 +1811,15 @@
    */
   String _lexeme;
   TokenType.con1(String ___name, int ___ordinal) {
-    _jtd_constructor_320_impl(___name, ___ordinal);
+    _jtd_constructor_321_impl(___name, ___ordinal);
   }
-  _jtd_constructor_320_impl(String ___name, int ___ordinal) {
-    _jtd_constructor_321_impl(___name, ___ordinal, TokenClass.NO_CLASS, null);
+  _jtd_constructor_321_impl(String ___name, int ___ordinal) {
+    _jtd_constructor_322_impl(___name, ___ordinal, TokenClass.NO_CLASS, null);
   }
   TokenType.con2(String ___name, int ___ordinal, TokenClass tokenClass2, String lexeme2) {
-    _jtd_constructor_321_impl(___name, ___ordinal, tokenClass2, lexeme2);
+    _jtd_constructor_322_impl(___name, ___ordinal, tokenClass2, lexeme2);
   }
-  _jtd_constructor_321_impl(String ___name, int ___ordinal, TokenClass tokenClass2, String lexeme2) {
+  _jtd_constructor_322_impl(String ___name, int ___ordinal, TokenClass tokenClass2, String lexeme2) {
     __name = ___name;
     __ordinal = ___ordinal;
     this._tokenClass = tokenClass2 == null ? TokenClass.NO_CLASS : tokenClass2;
diff --git a/pkg/analyzer_experimental/lib/src/generated/sdk.dart b/pkg/analyzer_experimental/lib/src/generated/sdk.dart
index 9ff8716..64bc958 100644
--- a/pkg/analyzer_experimental/lib/src/generated/sdk.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/sdk.dart
@@ -6,7 +6,7 @@
 import 'dart:uri';
 import 'java_core.dart';
 import 'java_engine.dart';
-import 'source.dart' show Source, ContentCache;
+import 'source.dart' show ContentCache, Source, UriKind;
 import 'engine.dart' show AnalysisContext;
 
 /**
@@ -217,6 +217,15 @@
    */
   static String DART_HTML = "dart:html";
   /**
+   * Return the source representing the file with the given URI.
+   * @param contentCache the content cache used to access the contents of the mapped source
+   * @param kind the kind of URI that was originally resolved in order to produce an encoding with
+   * the given URI
+   * @param uri the URI of the file to be returned
+   * @return the source representing the specified file
+   */
+  Source fromEncoding(ContentCache contentCache, UriKind kind, Uri uri);
+  /**
    * 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}
    */
diff --git a/pkg/analyzer_experimental/lib/src/generated/sdk_io.dart b/pkg/analyzer_experimental/lib/src/generated/sdk_io.dart
index 09ac253..9c40c3b 100644
--- a/pkg/analyzer_experimental/lib/src/generated/sdk_io.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/sdk_io.dart
@@ -164,6 +164,7 @@
     }
     _analysisContext.applyChanges(changeSet);
   }
+  Source fromEncoding(ContentCache contentCache, UriKind kind, Uri uri) => new FileBasedSource.con2(contentCache, new JavaFile.fromUri(uri), kind);
   AnalysisContext get context => _analysisContext;
   /**
    * Return the file containing the Dartium executable, or {@code null} if it does not exist.
@@ -277,7 +278,7 @@
     if (library == null) {
       return null;
     }
-    return new FileBasedSource.con2(contentCache, new JavaFile.relative(libraryDirectory, library.path), true);
+    return new FileBasedSource.con2(contentCache, new JavaFile.relative(libraryDirectory, library.path), UriKind.DART_URI);
   }
   /**
    * Ensure that the dart VM is executable. If it is not, make it executable and log that it was
@@ -361,7 +362,7 @@
   LibraryMap readFrom(JavaFile librariesFile, String libraryFileContents) {
     List<bool> foundError = [false];
     AnalysisErrorListener errorListener = new AnalysisErrorListener_10(foundError);
-    Source source = new FileBasedSource.con2(null, librariesFile, false);
+    Source source = new FileBasedSource.con2(null, librariesFile, UriKind.FILE_URI);
     StringScanner scanner = new StringScanner(source, libraryFileContents, errorListener);
     Parser parser = new Parser(source, errorListener);
     CompilationUnit unit = parser.parseCompilationUnit(scanner.tokenize());
diff --git a/pkg/analyzer_experimental/lib/src/generated/source.dart b/pkg/analyzer_experimental/lib/src/generated/source.dart
index f5f63be..83c24d0 100644
--- a/pkg/analyzer_experimental/lib/src/generated/source.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/source.dart
@@ -31,9 +31,9 @@
    * @param resolvers the resolvers used to resolve absolute URI's
    */
   SourceFactory.con1(ContentCache contentCache2, List<UriResolver> resolvers2) {
-    _jtd_constructor_332_impl(contentCache2, resolvers2);
+    _jtd_constructor_333_impl(contentCache2, resolvers2);
   }
-  _jtd_constructor_332_impl(ContentCache contentCache2, List<UriResolver> resolvers2) {
+  _jtd_constructor_333_impl(ContentCache contentCache2, List<UriResolver> resolvers2) {
     this._contentCache = contentCache2;
     this._resolvers = resolvers2;
   }
@@ -42,10 +42,10 @@
    * @param resolvers the resolvers used to resolve absolute URI's
    */
   SourceFactory.con2(List<UriResolver> resolvers) {
-    _jtd_constructor_333_impl(resolvers);
+    _jtd_constructor_334_impl(resolvers);
   }
-  _jtd_constructor_333_impl(List<UriResolver> resolvers) {
-    _jtd_constructor_332_impl(new ContentCache(), resolvers);
+  _jtd_constructor_334_impl(List<UriResolver> resolvers) {
+    _jtd_constructor_333_impl(new ContentCache(), resolvers);
   }
   /**
    * Return a source object representing the given absolute URI, or {@code null} if the URI is not a
@@ -64,12 +64,33 @@
     return null;
   }
   /**
-   * Return a source object that is equal to the source object used to obtain the given encoding, or{@code null} if the argument is not a valid encoding.
+   * Return a source object that is equal to the source object used to obtain the given encoding.
    * @param encoding the encoding of a source object
    * @return a source object that is described by the given encoding
+   * @throws IllegalArgumentException if the argument is not a valid encoding
    * @see Source#getEncoding()
    */
-  Source fromEncoding(String encoding) => forUri(encoding);
+  Source fromEncoding(String encoding) {
+    if (encoding.length < 2) {
+      throw new IllegalArgumentException("Invalid encoding length");
+    }
+    UriKind kind = UriKind.fromEncoding(encoding.codeUnitAt(0));
+    if (kind == null) {
+      throw new IllegalArgumentException("Invalid source kind in encoding: ${kind}");
+    }
+    try {
+      Uri uri = new Uri(encoding.substring(1));
+      for (UriResolver resolver in _resolvers) {
+        Source result = resolver.fromEncoding(_contentCache, kind, uri);
+        if (result != null) {
+          return result;
+        }
+      }
+      throw new IllegalArgumentException("No resolver for kind: ${kind}");
+    } catch (exception) {
+      throw new IllegalArgumentException("Invalid URI in 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
@@ -183,11 +204,22 @@
   UriResolver() : super() {
   }
   /**
+   * If this resolver should be used for URI's of the given kind, resolve the given absolute URI.
+   * The URI does not need to have the scheme handled by this resolver if the kind matches. 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 kind the kind of URI that was originally resolved in order to produce an encoding with
+   * the given URI
+   * @param uri the URI to be resolved
+   * @return a {@link Source source} representing the file to which given URI was resolved
+   */
+  Source fromEncoding(ContentCache contentCache, UriKind kind, Uri uri);
+  /**
    * 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
+   * @return a {@link Source source} representing the file to which given URI was resolved
    */
   Source resolveAbsolute(ContentCache contentCache, Uri uri);
 }
@@ -254,6 +286,14 @@
    */
   String get shortName;
   /**
+   * Return the kind of URI from which this source was originally derived. If this source was
+   * created from an absolute URI, then the returned kind will reflect the scheme of the absolute
+   * URI. If it was created from a relative URI, then the returned kind will be the same as the kind
+   * of the source against which the relative URI was resolved.
+   * @return the kind of URI from which this source was originally derived
+   */
+  UriKind get uriKind;
+  /**
    * Return a hash code for this source.
    * @return a hash code for this source
    * @see Object#hashCode()
@@ -331,6 +371,66 @@
   String toString() => __name;
 }
 /**
+ * The enumeration {@code UriKind} defines the different kinds of URI's that are known to the
+ * analysis engine. These are used to keep track of the kind of URI associated with a given source.
+ * @coverage dart.engine.source
+ */
+class UriKind implements Comparable<UriKind> {
+  /**
+   * A 'dart:' URI.
+   */
+  static final UriKind DART_URI = new UriKind('DART_URI', 0, 0x64);
+  /**
+   * A 'file:' URI.
+   */
+  static final UriKind FILE_URI = new UriKind('FILE_URI', 1, 0x66);
+  /**
+   * A 'package:' URI.
+   */
+  static final UriKind PACKAGE_URI = new UriKind('PACKAGE_URI', 2, 0x70);
+  static final List<UriKind> values = [DART_URI, FILE_URI, PACKAGE_URI];
+  final String __name;
+  final int __ordinal;
+  int get ordinal => __ordinal;
+  /**
+   * The single character encoding used to identify this kind of URI.
+   */
+  int _encoding = 0;
+  /**
+   * Initialize a newly created URI kind to have the given encoding.
+   * @param encoding the single character encoding used to identify this kind of URI.
+   */
+  UriKind(this.__name, this.__ordinal, int encoding) {
+    this._encoding = encoding;
+  }
+  /**
+   * Return the URI kind represented by the given encoding, or {@code null} if there is no kind with
+   * the given encoding.
+   * @param encoding the single character encoding used to identify the URI kind to be returned
+   * @return the URI kind represented by the given encoding
+   */
+  static UriKind fromEncoding(int encoding) {
+    while (true) {
+      if (encoding == 0x64) {
+        return DART_URI;
+      } else if (encoding == 0x66) {
+        return FILE_URI;
+      } else if (encoding == 0x70) {
+        return PACKAGE_URI;
+      }
+      break;
+    }
+    return null;
+  }
+  /**
+   * Return the single character encoding used to identify this kind of URI.
+   * @return the single character encoding used to identify this kind of URI
+   */
+  int get encoding => _encoding;
+  int compareTo(UriKind other) => __ordinal - other.__ordinal;
+  String toString() => __name;
+}
+/**
  * A source range defines an {@link Element}'s source coordinates relative to its {@link Source}.
  * @coverage dart.engine.utilities
  */
@@ -355,7 +455,7 @@
     this._length = length;
   }
   /**
-   * @return {@code true} 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;
   /**
@@ -485,6 +585,12 @@
   DartUriResolver(DartSdk sdk) {
     this._sdk = sdk;
   }
+  Source fromEncoding(ContentCache contentCache, UriKind kind, Uri uri) {
+    if (identical(kind, UriKind.DART_URI)) {
+      return _sdk.fromEncoding(contentCache, kind, uri);
+    }
+    return null;
+  }
   /**
    * Return the {@link DartSdk} against which URIs are to be resolved.
    * @return the {@link DartSdk} against which URIs are to be resolved.
diff --git a/pkg/analyzer_experimental/lib/src/generated/source_io.dart b/pkg/analyzer_experimental/lib/src/generated/source_io.dart
index 28991a4..f016564 100644
--- a/pkg/analyzer_experimental/lib/src/generated/source_io.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/source_io.dart
@@ -27,13 +27,13 @@
    */
   JavaFile _file;
   /**
-   * The cached URI of the {@link #file}.
+   * The cached encoding for this source.
    */
-  String _fileUriString;
+  String _encoding;
   /**
-   * A flag indicating whether this source is in one of the system libraries.
+   * The kind of URI from which this source was originally derived.
    */
-  bool _inSystemLibrary = false;
+  UriKind _uriKind;
   /**
    * Initialize a newly created source object. The source object is assumed to not be in a system
    * library.
@@ -41,25 +41,25 @@
    * @param file the file represented by this source
    */
   FileBasedSource.con1(ContentCache contentCache, JavaFile file) {
-    _jtd_constructor_328_impl(contentCache, file);
+    _jtd_constructor_329_impl(contentCache, file);
   }
-  _jtd_constructor_328_impl(ContentCache contentCache, JavaFile file) {
-    _jtd_constructor_329_impl(contentCache, file, false);
+  _jtd_constructor_329_impl(ContentCache contentCache, JavaFile file) {
+    _jtd_constructor_330_impl(contentCache, file, UriKind.FILE_URI);
   }
   /**
    * Initialize a newly created source object.
    * @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
+   * @param flags {@code true} if this source is in one of the system libraries
    */
-  FileBasedSource.con2(ContentCache contentCache2, JavaFile file2, bool inSystemLibrary2) {
-    _jtd_constructor_329_impl(contentCache2, file2, inSystemLibrary2);
+  FileBasedSource.con2(ContentCache contentCache2, JavaFile file2, UriKind uriKind2) {
+    _jtd_constructor_330_impl(contentCache2, file2, uriKind2);
   }
-  _jtd_constructor_329_impl(ContentCache contentCache2, JavaFile file2, bool inSystemLibrary2) {
+  _jtd_constructor_330_impl(ContentCache contentCache2, JavaFile file2, UriKind uriKind2) {
     this._contentCache = contentCache2;
     this._file = file2;
-    this._inSystemLibrary = inSystemLibrary2;
-    this._fileUriString = file2.toURI().toString();
+    this._uriKind = uriKind2;
+    this._encoding = "${uriKind2.encoding}${file2.toURI().toString()}";
   }
   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());
@@ -73,7 +73,7 @@
     }
     receiver.accept2(_file.readAsStringSync(), _file.lastModified());
   }
-  String get encoding => _fileUriString;
+  String get encoding => _encoding;
   String get fullName => _file.getAbsolutePath();
   int get modificationStamp {
     int stamp = _contentCache.getModificationStamp(this);
@@ -83,12 +83,13 @@
     return _file.lastModified();
   }
   String get shortName => _file.getName();
+  UriKind get uriKind => _uriKind;
   int get hashCode => _file.hashCode;
-  bool isInSystemLibrary() => _inSystemLibrary;
+  bool isInSystemLibrary() => identical(_uriKind, UriKind.DART_URI);
   Source resolveRelative(Uri containedUri) {
     try {
       Uri resolvedUri = file.toURI().resolveUri(containedUri);
-      return new FileBasedSource.con2(_contentCache, new JavaFile.fromUri(resolvedUri), isInSystemLibrary());
+      return new FileBasedSource.con2(_contentCache, new JavaFile.fromUri(resolvedUri), _uriKind);
     } catch (exception) {
     }
     return null;
@@ -142,6 +143,12 @@
     }
     this._packagesDirectories = packagesDirectories;
   }
+  Source fromEncoding(ContentCache contentCache, UriKind kind, Uri uri) {
+    if (identical(kind, UriKind.PACKAGE_URI)) {
+      return new FileBasedSource.con2(contentCache, new JavaFile.fromUri(uri), kind);
+    }
+    return null;
+  }
   Source resolveAbsolute(ContentCache contentCache, Uri uri) {
     if (!isPackageUri(uri)) {
       return null;
@@ -168,10 +175,10 @@
     for (JavaFile packagesDirectory in _packagesDirectories) {
       JavaFile resolvedFile = new JavaFile.relative(packagesDirectory, path2);
       if (resolvedFile.exists()) {
-        return new FileBasedSource.con1(contentCache, getCanonicalFile(packagesDirectory, pkgName, relPath));
+        return new FileBasedSource.con2(contentCache, getCanonicalFile(packagesDirectory, pkgName, relPath), UriKind.PACKAGE_URI);
       }
     }
-    return new FileBasedSource.con1(contentCache, getCanonicalFile(_packagesDirectories[0], pkgName, relPath));
+    return new FileBasedSource.con2(contentCache, getCanonicalFile(_packagesDirectories[0], pkgName, relPath), UriKind.PACKAGE_URI);
   }
   /**
    * Answer the canonical file for the specified package.
@@ -219,19 +226,19 @@
    * @param directory the directory (not {@code null})
    */
   DirectoryBasedSourceContainer.con1(JavaFile directory) {
-    _jtd_constructor_326_impl(directory);
+    _jtd_constructor_327_impl(directory);
   }
-  _jtd_constructor_326_impl(JavaFile directory) {
-    _jtd_constructor_327_impl(directory.getPath());
+  _jtd_constructor_327_impl(JavaFile directory) {
+    _jtd_constructor_328_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 path2) {
-    _jtd_constructor_327_impl(path2);
+    _jtd_constructor_328_impl(path2);
   }
-  _jtd_constructor_327_impl(String path2) {
+  _jtd_constructor_328_impl(String path2) {
     this._path = appendFileSeparator(path2);
   }
   bool contains(Source source) => source.fullName.startsWith(_path);
@@ -242,6 +249,7 @@
    */
   String get path => _path;
   int get hashCode => _path.hashCode;
+  String toString() => "SourceContainer[${_path}]";
 }
 /**
  * Instances of the class {@code FileUriResolver} resolve {@code file} URI's.
@@ -264,6 +272,12 @@
    */
   FileUriResolver() : super() {
   }
+  Source fromEncoding(ContentCache contentCache, UriKind kind, Uri uri) {
+    if (identical(kind, UriKind.FILE_URI)) {
+      return new FileBasedSource.con2(contentCache, new JavaFile.fromUri(uri), kind);
+    }
+    return null;
+  }
   Source resolveAbsolute(ContentCache contentCache, Uri uri) {
     if (!isFileUri(uri)) {
       return null;
diff --git a/pkg/analyzer_experimental/test/generated/element_test.dart b/pkg/analyzer_experimental/test/generated/element_test.dart
index 834b925..c13d1dc 100644
--- a/pkg/analyzer_experimental/test/generated/element_test.dart
+++ b/pkg/analyzer_experimental/test/generated/element_test.dart
@@ -408,14 +408,6 @@
     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 classA = ElementFactory.classElement2("A", []);
     ClassElement classB = ElementFactory.classElement("B", classA.type, []);
@@ -553,6 +545,20 @@
     JUnitTestCase.assertEquals(typeA, typeB.getLeastUpperBound(typeC));
     JUnitTestCase.assertEquals(typeA, typeC.getLeastUpperBound(typeB));
   }
+  void test_getLeastUpperBound_typeParameters_different() {
+    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.substitute5(<Type2> [_typeProvider.numType]), listOfIntType.getLeastUpperBound(listOfDoubleType));
+  }
+  void test_getLeastUpperBound_typeParameters_same() {
+    InterfaceType listType2 = _typeProvider.listType;
+    InterfaceType intType2 = _typeProvider.intType;
+    InterfaceType listOfIntType = listType2.substitute5(<Type2> [intType2]);
+    JUnitTestCase.assertEquals(listOfIntType, listOfIntType.getLeastUpperBound(listOfIntType));
+  }
   void test_getMethod_implemented() {
     ClassElementImpl classA = ElementFactory.classElement2("A", []);
     String methodName = "m";
@@ -1118,10 +1124,6 @@
         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);
@@ -1170,6 +1172,14 @@
         final __test = new InterfaceTypeImplTest();
         runJUnitTest(__test, __test.test_getLeastUpperBound_sharedSuperinterface4);
       });
+      _ut.test('test_getLeastUpperBound_typeParameters_different', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_getLeastUpperBound_typeParameters_different);
+      });
+      _ut.test('test_getLeastUpperBound_typeParameters_same', () {
+        final __test = new InterfaceTypeImplTest();
+        runJUnitTest(__test, __test.test_getLeastUpperBound_typeParameters_same);
+      });
       _ut.test('test_getMethod_implemented', () {
         final __test = new InterfaceTypeImplTest();
         runJUnitTest(__test, __test.test_getMethod_implemented);
@@ -1475,6 +1485,7 @@
     }
     return field;
   }
+  static FieldFormalParameterElementImpl fieldFormalParameter(Identifier name) => new FieldFormalParameterElementImpl(name);
   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) {
@@ -1630,6 +1641,26 @@
   ElementFactory() {
   }
 }
+class ElementKindTest extends EngineTestCase {
+  void test_of_nonNull() {
+    JUnitTestCase.assertSame(ElementKind.CLASS, ElementKind.of(ElementFactory.classElement2("A", [])));
+  }
+  void test_of_null() {
+    JUnitTestCase.assertSame(ElementKind.ERROR, ElementKind.of(null));
+  }
+  static dartSuite() {
+    _ut.group('ElementKindTest', () {
+      _ut.test('test_of_nonNull', () {
+        final __test = new ElementKindTest();
+        runJUnitTest(__test, __test.test_of_nonNull);
+      });
+      _ut.test('test_of_null', () {
+        final __test = new ElementKindTest();
+        runJUnitTest(__test, __test.test_of_null);
+      });
+    });
+  }
+}
 class ClassElementImplTest extends EngineTestCase {
   void test_getAllSupertypes_interface() {
     ClassElement classA = ElementFactory.classElement2("A", []);
@@ -1671,6 +1702,7 @@
     MethodElement method = ElementFactory.methodElement(methodName, null, []);
     classA.methods = <MethodElement> [method];
     JUnitTestCase.assertSame(method, classA.getMethod(methodName));
+    JUnitTestCase.assertSame(method, classA.getExecutable(methodName));
   }
   void test_getMethod_undeclared() {
     ClassElementImpl classA = ElementFactory.classElement2("A", []);
@@ -1678,6 +1710,7 @@
     MethodElement method = ElementFactory.methodElement(methodName, null, []);
     classA.methods = <MethodElement> [method];
     JUnitTestCase.assertNull(classA.getMethod("${methodName}x"));
+    JUnitTestCase.assertNull(classA.getExecutable("${methodName}x"));
   }
   void test_lookUpGetter_declared() {
     LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
@@ -1687,6 +1720,7 @@
     classA.accessors = <PropertyAccessorElement> [getter];
     ((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
     JUnitTestCase.assertSame(getter, classA.lookUpGetter(getterName, library2));
+    JUnitTestCase.assertSame(getter, classA.lookUpExecutable(getterName, library2));
   }
   void test_lookUpGetter_inherited() {
     LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
@@ -1697,12 +1731,14 @@
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
     ((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA, classB];
     JUnitTestCase.assertSame(getter, classB.lookUpGetter(getterName, library2));
+    JUnitTestCase.assertSame(getter, classB.lookUpExecutable(getterName, library2));
   }
   void test_lookUpGetter_undeclared() {
     LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A", []);
     ((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
     JUnitTestCase.assertNull(classA.lookUpGetter("g", library2));
+    JUnitTestCase.assertNull(classA.lookUpExecutable("g", library2));
   }
   void test_lookUpMethod_declared() {
     LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
@@ -1712,6 +1748,7 @@
     classA.methods = <MethodElement> [method];
     ((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
     JUnitTestCase.assertSame(method, classA.lookUpMethod(methodName, library2));
+    JUnitTestCase.assertSame(method, classA.lookUpExecutable(methodName, library2));
   }
   void test_lookUpMethod_inherited() {
     LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
@@ -1722,12 +1759,14 @@
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
     ((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA, classB];
     JUnitTestCase.assertSame(method, classB.lookUpMethod(methodName, library2));
+    JUnitTestCase.assertSame(method, classB.lookUpExecutable(methodName, library2));
   }
   void test_lookUpMethod_undeclared() {
     LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A", []);
     ((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
     JUnitTestCase.assertNull(classA.lookUpMethod("m", library2));
+    JUnitTestCase.assertNull(classA.lookUpExecutable("m", library2));
   }
   void test_lookUpSetter_declared() {
     LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
@@ -1737,6 +1776,7 @@
     classA.accessors = <PropertyAccessorElement> [setter];
     ((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
     JUnitTestCase.assertSame(setter, classA.lookUpSetter(setterName, library2));
+    JUnitTestCase.assertSame(setter, classA.lookUpExecutable(setterName, library2));
   }
   void test_lookUpSetter_inherited() {
     LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
@@ -1747,12 +1787,14 @@
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
     ((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA, classB];
     JUnitTestCase.assertSame(setter, classB.lookUpSetter(setterName, library2));
+    JUnitTestCase.assertSame(setter, classB.lookUpExecutable(setterName, library2));
   }
   void test_lookUpSetter_undeclared() {
     LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A", []);
     ((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
     JUnitTestCase.assertNull(classA.lookUpSetter("s", library2));
+    JUnitTestCase.assertNull(classA.lookUpExecutable("s", library2));
   }
   static dartSuite() {
     _ut.group('ClassElementImplTest', () {
@@ -2332,6 +2374,7 @@
   bool isDartCoreFunction() => true;
 }
 main() {
+  ElementKindTest.dartSuite();
   FunctionTypeImplTest.dartSuite();
   InterfaceTypeImplTest.dartSuite();
   TypeVariableTypeImplTest.dartSuite();
diff --git a/pkg/analyzer_experimental/test/generated/parser_test.dart b/pkg/analyzer_experimental/test/generated/parser_test.dart
index 0cd547e..31def04 100644
--- a/pkg/analyzer_experimental/test/generated/parser_test.dart
+++ b/pkg/analyzer_experimental/test/generated/parser_test.dart
@@ -1040,6 +1040,11 @@
     JUnitTestCase.assertNull(commentAndMetadata.comment);
     EngineTestCase.assertSize(0, commentAndMetadata.metadata);
   }
+  void test_parseCommentAndMetadata_singleLine() {
+    CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentAndMetadata", EngineTestCase.createSource(["/// 1", "/// 2", "void"]), []);
+    JUnitTestCase.assertNotNull(commentAndMetadata.comment);
+    EngineTestCase.assertSize(0, commentAndMetadata.metadata);
+  }
   void test_parseCommentReference_new_prefixed() {
     CommentReference reference = ParserTestCase.parse("parseCommentReference", <Object> ["new a.b", 7], "");
     PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(PrefixedIdentifier, reference.identifier);
@@ -1110,6 +1115,51 @@
     JUnitTestCase.assertNotNull(reference.identifier);
     JUnitTestCase.assertEquals(35, reference.offset);
   }
+  void test_parseCommentReferences_skipCodeBlock_bracketed() {
+    List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/** [:xxx [a] yyy:] [b] zzz */", 3)];
+    List<CommentReference> references = ParserTestCase.parse("parseCommentReferences", <Object> [tokens], "");
+    EngineTestCase.assertSize(1, references);
+    CommentReference reference = references[0];
+    JUnitTestCase.assertNotNull(reference);
+    JUnitTestCase.assertNotNull(reference.identifier);
+    JUnitTestCase.assertEquals(24, reference.offset);
+  }
+  void test_parseCommentReferences_skipCodeBlock_spaces() {
+    List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/**\n *     a[i]\n * xxx [i] zzz\n */", 3)];
+    List<CommentReference> references = ParserTestCase.parse("parseCommentReferences", <Object> [tokens], "");
+    EngineTestCase.assertSize(1, references);
+    CommentReference reference = references[0];
+    JUnitTestCase.assertNotNull(reference);
+    JUnitTestCase.assertNotNull(reference.identifier);
+    JUnitTestCase.assertEquals(27, reference.offset);
+  }
+  void test_parseCommentReferences_skipLinkDefinition() {
+    List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/** [a]: http://www.google.com (Google) [b] zzz */", 3)];
+    List<CommentReference> references = ParserTestCase.parse("parseCommentReferences", <Object> [tokens], "");
+    EngineTestCase.assertSize(1, references);
+    CommentReference reference = references[0];
+    JUnitTestCase.assertNotNull(reference);
+    JUnitTestCase.assertNotNull(reference.identifier);
+    JUnitTestCase.assertEquals(44, reference.offset);
+  }
+  void test_parseCommentReferences_skipLinked() {
+    List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/** [a](http://www.google.com) [b] zzz */", 3)];
+    List<CommentReference> references = ParserTestCase.parse("parseCommentReferences", <Object> [tokens], "");
+    EngineTestCase.assertSize(1, references);
+    CommentReference reference = references[0];
+    JUnitTestCase.assertNotNull(reference);
+    JUnitTestCase.assertNotNull(reference.identifier);
+    JUnitTestCase.assertEquals(35, reference.offset);
+  }
+  void test_parseCommentReferences_skipReferenceLink() {
+    List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/** [a][c] [b] zzz */", 3)];
+    List<CommentReference> references = ParserTestCase.parse("parseCommentReferences", <Object> [tokens], "");
+    EngineTestCase.assertSize(1, references);
+    CommentReference reference = references[0];
+    JUnitTestCase.assertNotNull(reference);
+    JUnitTestCase.assertNotNull(reference.identifier);
+    JUnitTestCase.assertEquals(15, reference.offset);
+  }
   void test_parseCompilationUnit_abstractAsPrefix_parameterized() {
     CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "abstract<dynamic> _abstract = new abstract.A();", []);
     JUnitTestCase.assertNull(unit.scriptTag);
@@ -4310,6 +4360,10 @@
         final __test = new SimpleParserTest();
         runJUnitTest(__test, __test.test_parseCommentAndMetadata_none);
       });
+      _ut.test('test_parseCommentAndMetadata_singleLine', () {
+        final __test = new SimpleParserTest();
+        runJUnitTest(__test, __test.test_parseCommentAndMetadata_singleLine);
+      });
       _ut.test('test_parseCommentReference_new_prefixed', () {
         final __test = new SimpleParserTest();
         runJUnitTest(__test, __test.test_parseCommentReference_new_prefixed);
@@ -4334,6 +4388,26 @@
         final __test = new SimpleParserTest();
         runJUnitTest(__test, __test.test_parseCommentReferences_singleLine);
       });
+      _ut.test('test_parseCommentReferences_skipCodeBlock_bracketed', () {
+        final __test = new SimpleParserTest();
+        runJUnitTest(__test, __test.test_parseCommentReferences_skipCodeBlock_bracketed);
+      });
+      _ut.test('test_parseCommentReferences_skipCodeBlock_spaces', () {
+        final __test = new SimpleParserTest();
+        runJUnitTest(__test, __test.test_parseCommentReferences_skipCodeBlock_spaces);
+      });
+      _ut.test('test_parseCommentReferences_skipLinkDefinition', () {
+        final __test = new SimpleParserTest();
+        runJUnitTest(__test, __test.test_parseCommentReferences_skipLinkDefinition);
+      });
+      _ut.test('test_parseCommentReferences_skipLinked', () {
+        final __test = new SimpleParserTest();
+        runJUnitTest(__test, __test.test_parseCommentReferences_skipLinked);
+      });
+      _ut.test('test_parseCommentReferences_skipReferenceLink', () {
+        final __test = new SimpleParserTest();
+        runJUnitTest(__test, __test.test_parseCommentReferences_skipReferenceLink);
+      });
       _ut.test('test_parseCompilationUnitMember_abstractAsPrefix', () {
         final __test = new SimpleParserTest();
         runJUnitTest(__test, __test.test_parseCompilationUnitMember_abstractAsPrefix);
@@ -8471,11 +8545,14 @@
   'createSyntheticToken_1': new MethodTrampoline(1, (Parser target, arg0) => target.createSyntheticToken(arg0)),
   'ensureAssignable_1': new MethodTrampoline(1, (Parser target, arg0) => target.ensureAssignable(arg0)),
   'expect_1': new MethodTrampoline(1, (Parser target, arg0) => target.expect(arg0)),
+  'findRange_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.findRange(arg0, arg1)),
+  'getCodeBlockRanges_1': new MethodTrampoline(1, (Parser target, arg0) => target.getCodeBlockRanges(arg0)),
   'hasReturnTypeInTypeAlias_0': new MethodTrampoline(0, (Parser target) => target.hasReturnTypeInTypeAlias()),
   'isFunctionDeclaration_0': new MethodTrampoline(0, (Parser target) => target.isFunctionDeclaration()),
   '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()),
+  'isLinkText_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.isLinkText(arg0, arg1)),
   '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)),
diff --git a/pkg/analyzer_experimental/test/generated/resolver_test.dart b/pkg/analyzer_experimental/test/generated/resolver_test.dart
index 130f6f0..829f7ff 100644
--- a/pkg/analyzer_experimental/test/generated/resolver_test.dart
+++ b/pkg/analyzer_experimental/test/generated/resolver_test.dart
@@ -25,7 +25,7 @@
 
 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;", "  }", "}"]));
+    Source source = addSource(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]);
@@ -40,7 +40,7 @@
     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;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "A f(var p) {", "  assert (p is A);", "  return p;", "}"]));
     LibraryElement library = resolve(source, []);
     assertNoErrors();
     verify([source]);
@@ -54,7 +54,7 @@
     JUnitTestCase.assertSame(typeA, variableName.staticType);
   }
   void test_assignment() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  var v;", "  v = 0;", "  return v;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f() {", "  var v;", "  v = 0;", "  return v;", "}"]));
     LibraryElement library = resolve(source, []);
     assertNoErrors();
     verify([source]);
@@ -66,7 +66,7 @@
     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;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f() {", "  var v = 0;", "  v = 1.0;", "  return v;", "}"]));
     LibraryElement library = resolve(source, []);
     assertNoErrors();
     verify([source]);
@@ -77,8 +77,23 @@
     SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
     JUnitTestCase.assertSame(typeProvider.doubleType, variableName.staticType);
   }
+  void test_forEach() {
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "A f(List<A> p) {", "  for (var e in p) {", "    return e;", "  }", "}"]));
+    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;
+    ForEachStatement forStatement = body2.block.statements[0] as ForEachStatement;
+    ReturnStatement statement = ((forStatement.body as Block)).statements[0] as ReturnStatement;
+    SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
+    JUnitTestCase.assertSame(typeA, variableName.staticType);
+  }
   void test_initializer() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  var v = 0;", "  return v;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f() {", "  var v = 0;", "  return v;", "}"]));
     LibraryElement library = resolve(source, []);
     assertNoErrors();
     verify([source]);
@@ -89,8 +104,19 @@
     SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
     JUnitTestCase.assertSame(typeProvider.intType, variableName.staticType);
   }
+  void test_initializer_dereference() {
+    Source source = addSource(EngineTestCase.createSource(["f() {", "  var v = 'String';", "  v.", "}"]));
+    LibraryElement library = resolve(source, []);
+    CompilationUnit unit = resolveCompilationUnit(source, library);
+    FunctionDeclaration function = unit.declarations[0] as FunctionDeclaration;
+    BlockFunctionBody body2 = function.functionExpression.body as BlockFunctionBody;
+    ExpressionStatement statement = body2.block.statements[1] as ExpressionStatement;
+    PrefixedIdentifier invocation = statement.expression as PrefixedIdentifier;
+    SimpleIdentifier variableName = invocation.prefix;
+    JUnitTestCase.assertSame(typeProvider.stringType, 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;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "A f(var p) {", "  return (p is A) ? p : null;", "}"]));
     LibraryElement library = resolve(source, []);
     assertNoErrors();
     verify([source]);
@@ -105,7 +131,22 @@
     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;", "  }", "}"]));
+    Source source = addSource(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_lessSpecific() {
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "A f(A p) {", "  if (p is Object) {", "    return p;", "  } else {", "    return null;", "  }", "}"]));
     LibraryElement library = resolve(source, []);
     assertNoErrors();
     verify([source]);
@@ -120,7 +161,7 @@
     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;", "  }", "}"]));
+    Source source = addSource(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]);
@@ -135,7 +176,7 @@
     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;", "}"]));
+    Source source = addSource(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]);
@@ -149,7 +190,7 @@
     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;", "}"]));
+    Source source = addSource(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]);
@@ -163,7 +204,7 @@
     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();", "  }", "}"]));
+    Source source = addSource(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]);
@@ -175,8 +216,23 @@
     MethodInvocation invocation = statement.expression as MethodInvocation;
     JUnitTestCase.assertNotNull(invocation.methodName.element);
   }
+  void test_is_while() {
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "A f(var p) {", "  while (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;
+    WhileStatement whileStatement = body2.block.statements[0] as WhileStatement;
+    ReturnStatement statement = ((whileStatement.body as Block)).statements[0] as ReturnStatement;
+    SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
+    JUnitTestCase.assertSame(typeA, variableName.staticType);
+  }
   void test_isNot_conditional() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "A f(var p) {", "  return (p is! A) ? null : p;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "A f(var p) {", "  return (p is! A) ? null : p;", "}"]));
     LibraryElement library = resolve(source, []);
     assertNoErrors();
     verify([source]);
@@ -191,7 +247,7 @@
     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;", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "A f(var p) {", "  if (p is! A) {", "    return null;", "  } else {", "    return p;", "  }", "}"]));
     LibraryElement library = resolve(source, []);
     assertNoErrors();
     verify([source]);
@@ -206,7 +262,7 @@
     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;", "  }", "}"]));
+    Source source = addSource(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]);
@@ -221,7 +277,7 @@
     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;", "}"]));
+    Source source = addSource(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]);
@@ -235,7 +291,7 @@
     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;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "A f(var p) {", "  if (p is! A) {", "    return null;", "  }", "  return p;", "}"]));
     LibraryElement library = resolve(source, []);
     assertNoErrors();
     verify([source]);
@@ -249,7 +305,7 @@
     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];", "}"]));
+    Source source = addSource(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]);
@@ -288,10 +344,18 @@
         final __test = new TypePropagationTest();
         runJUnitTest(__test, __test.test_assignment_afterInitializer);
       });
+      _ut.test('test_forEach', () {
+        final __test = new TypePropagationTest();
+        runJUnitTest(__test, __test.test_forEach);
+      });
       _ut.test('test_initializer', () {
         final __test = new TypePropagationTest();
         runJUnitTest(__test, __test.test_initializer);
       });
+      _ut.test('test_initializer_dereference', () {
+        final __test = new TypePropagationTest();
+        runJUnitTest(__test, __test.test_initializer_dereference);
+      });
       _ut.test('test_isNot_conditional', () {
         final __test = new TypePropagationTest();
         runJUnitTest(__test, __test.test_isNot_conditional);
@@ -320,6 +384,10 @@
         final __test = new TypePropagationTest();
         runJUnitTest(__test, __test.test_is_if);
       });
+      _ut.test('test_is_if_lessSpecific', () {
+        final __test = new TypePropagationTest();
+        runJUnitTest(__test, __test.test_is_if_lessSpecific);
+      });
       _ut.test('test_is_if_logicalAnd', () {
         final __test = new TypePropagationTest();
         runJUnitTest(__test, __test.test_is_if_logicalAnd);
@@ -336,6 +404,10 @@
         final __test = new TypePropagationTest();
         runJUnitTest(__test, __test.test_is_subclass);
       });
+      _ut.test('test_is_while', () {
+        final __test = new TypePropagationTest();
+        runJUnitTest(__test, __test.test_is_while);
+      });
       _ut.test('test_query', () {
         final __test = new TypePropagationTest();
         runJUnitTest(__test, __test.test_query);
@@ -345,301 +417,354 @@
 }
 class NonErrorResolverTest extends ResolverTestCase {
   void test_argumentDefinitionTestNonParameter_formalParameter() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f(var v) {", "  return ?v;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f(var v) {", "  return ?v;", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_argumentDefinitionTestNonParameter_namedParameter() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f({var v : 0}) {", "  return ?v;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f({var v : 0}) {", "  return ?v;", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_argumentDefinitionTestNonParameter_optionalParameter() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f([var v]) {", "  return ?v;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f([var v]) {", "  return ?v;", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_breakWithoutLabelInSwitch() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  void m(int i) {", "    switch (i) {", "      case 0:", "        break;", "    }", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  void m(int i) {", "    switch (i) {", "      case 0:", "        break;", "    }", "  }", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_builtInIdentifierAsType_dynamic() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  dynamic x;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f() {", "  dynamic x;", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_caseExpressionTypeImplementsEquals_int() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f(int i) {", "  switch(i) {", "    case(1) : return 1;", "    default: return 0;", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f(int i) {", "  switch(i) {", "    case(1) : return 1;", "    default: return 0;", "  }", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_caseExpressionTypeImplementsEquals_Object() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class IntWrapper {", "  final int value;", "  const IntWrapper(this.value);", "}", "", "f(IntWrapper intWrapper) {", "  switch(intWrapper) {", "    case(const IntWrapper(1)) : return 1;", "    default: return 0;", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class IntWrapper {", "  final int value;", "  const IntWrapper(this.value);", "}", "", "f(IntWrapper intWrapper) {", "  switch(intWrapper) {", "    case(const IntWrapper(1)) : return 1;", "    default: return 0;", "  }", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_caseExpressionTypeImplementsEquals_String() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f(String s) {", "  switch(s) {", "    case('1') : return 1;", "    default: return 0;", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f(String s) {", "  switch(s) {", "    case('1') : return 1;", "    default: return 0;", "  }", "}"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_concreteClassWithAbstractMember() {
+    Source source = addSource(EngineTestCase.createSource(["abstract class A {", "  m();", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_constConstructorWithNonFinalField_constInstanceVar() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  const int x = 0;", "  const A() {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  const int x = 0;", "  const A() {}", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_constConstructorWithNonFinalField_finalInstanceVar() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  final int x = 0;", "  const A() {}", "}"]));
+    Source source = addSource(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() {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  static int x;", "  const A() {}", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_constConstructorWithNonFinalField_syntheticField() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  const A();", "  set x(value) {}", "  get x {return 0;}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  const A();", "  set x(value) {}", "  get x {return 0;}", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_defaultValueInFunctionTypeAlias() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["typedef F([x]);"]));
+    Source source = addSource(EngineTestCase.createSource(["typedef F([x]);"]));
     resolve(source, []);
     assertErrors([]);
     verify([source]);
   }
   void test_duplicateDefinition_emptyName() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["Map _globalMap = {", "  'a' : () {},", "  'b' : () {}", "}"]));
+    Source source = addSource(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;"]));
+    Source source = addSource(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;"]));
+    Source source = addSource(EngineTestCase.createSource(["library L;", "export 'lib1.dart';"]));
+    addSource2("/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([""]));
+    Source source = addSource(EngineTestCase.createSource(["library L;", "export 'lib1.dart';"]));
+    addSource2("/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 {}", "}"]));
+    Source source = addSource(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 {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  int x = 0;", "  A() : x = 1 {}", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_fieldInitializedInInitializerAndDeclaration_finalFieldNotSet() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  final int x;", "  A() : x = 1 {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  final int x;", "  A() : x = 1 {}", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_fieldInitializerOutsideConstructor() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int x;", "  A(this.x) {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  int x;", "  A(this.x) {}", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_fieldInitializerOutsideConstructor_defaultParameters() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int x;", "  A([this.x]) {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  int x;", "  A([this.x]) {}", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_finalInitializedInDeclarationAndConstructor_initializer() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  final x;", "  A() : x = 1 {}", "}"]));
+    Source source = addSource(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) {}", "}"]));
+    Source source = addSource(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() {}", "}"]));
+    Source source = addSource(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() {}", "}"]));
+    Source source = addSource(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 {}", "}"]));
+    Source source = addSource(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;"]));
+    Source source = addSource(EngineTestCase.createSource(["library lib;", "import 'part.dart';"]));
+    addSource2("/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([""]));
+    Source source = addSource(EngineTestCase.createSource(["library lib;", "import 'part.dart';"]));
+    addSource2("/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;", "  }", "}"]));
+    Source source = addSource(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) {}", "}"]));
+    Source source = addSource(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;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f() {", "  var x;", "  var y;", "  x = y;", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_invalidAssignment_toDynamic() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  var g;", "  g = () => 0;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f() {", "  var g;", "  g = () => 0;", "}"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_invalidTypeArgumentInConstList() {
+    Source source = addSource(EngineTestCase.createSource(["class A<E> {", "  m() {", "    return <E>[]", "  }", "}"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_invalidTypeArgumentInConstMap() {
+    Source source = addSource(EngineTestCase.createSource(["class A<E> {", "  m() {", "    return <String, E>{}", "  }", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_invocationOfNonFunction_dynamic() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  var f;", "}", "class B extends A {", "  g() {", "    f();", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  var f;", "}", "class B extends A {", "  g() {", "    f();", "  }", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_invocationOfNonFunction_getter() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  var g;", "}", "f() {", "  A a;", "  a.g();", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  var g;", "}", "f() {", "  A a;", "  a.g();", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_invocationOfNonFunction_localVariable() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  var g;", "  g();", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f() {", "  var g;", "  g();", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_newWithAbstractClass_factory() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["abstract class A {", "  factory A() { return new B(); }", "}", "class B implements A {", "  B() {}", "}", "A f() {", "  return new A();", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["abstract class A {", "  factory A() { return new B(); }", "}", "class B implements A {", "  B() {}", "}", "A f() {", "  return new A();", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_nonBoolExpression_assert_bool() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  assert(true);", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f() {", "  assert(true);", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_nonBoolExpression_assert_functionType() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["bool makeAssertion() => true;", "f() {", "  assert(makeAssertion);", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["bool makeAssertion() => true;", "f() {", "  assert(makeAssertion);", "}"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_optionalParameterInOperator_required() {
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  operator +(p) {}", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_rethrowOutsideCatch() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  void m() {", "    try {} catch (e) {rethrow;}", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  void m() {", "    try {} catch (e) {rethrow;}", "  }", "}"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_returnInGenerativeConstructor() {
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  A() { return; }", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_returnOfInvalidType_dynamic() {
-    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;", "      }", "    }", "  }", "}"]));
+    Source source = addSource(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]);
   }
   void test_returnOfInvalidType_subtype() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "class B extends A {}", "A f(B b) { return b; }"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "class B extends A {}", "A f(B b) { return b; }"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_returnOfInvalidType_supertype() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "class B extends A {}", "B f(A a) { return a; }"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "class B extends A {}", "B f(A a) { return a; }"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_returnWithoutValue_noReturnType() {
+    Source source = addSource(EngineTestCase.createSource(["f() { return; }"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_returnWithoutValue_void() {
+    Source source = addSource(EngineTestCase.createSource(["void f() { return; }"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_typeArgumentNotMatchingBounds_const() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "class B extends A {}", "class G<E extends A> {", "  const G() {}", "}", "f() { return const G<B>(); }"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "class B extends A {}", "class G<E extends A> {", "  const G() {}", "}", "f() { return const G<B>(); }"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_typeArgumentNotMatchingBounds_new() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "class B extends A {}", "class G<E extends A> {}", "f() { return new G<B>(); }"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "class B extends A {}", "class G<E extends A> {}", "f() { return new G<B>(); }"]));
     resolve(source, []);
     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;", "  }", "}"]));
+    Source source = addSource(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;"]));
+    Source source = addSource(EngineTestCase.createSource(["library L;", "export 'lib1.dart' hide a;"]));
+    addSource2("/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;"]));
+    Source source = addSource(EngineTestCase.createSource(["library L;", "export 'lib1.dart' show a;"]));
+    addSource2("/lib1.dart", EngineTestCase.createSource(["library lib1;"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
+  void test_undefinedMethod_noSuchMethod() {
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  noSuchMethod() {}", "}", "f() {", "  (new A()).someMethod();", "}"]));
+    resolve(source, []);
+    assertNoErrors();
+  }
   void test_undefinedOperator_tilde() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["const A = 3;", "const B = ~((1 << A) - 1);"]));
+    Source source = addSource(EngineTestCase.createSource(["const A = 3;", "const B = ~((1 << A) - 1);"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_wrongNumberOfParametersForSetter() {
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  set x(a) {}", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
@@ -678,6 +803,10 @@
         final __test = new NonErrorResolverTest();
         runJUnitTest(__test, __test.test_caseExpressionTypeImplementsEquals_int);
       });
+      _ut.test('test_concreteClassWithAbstractMember', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_concreteClassWithAbstractMember);
+      });
       _ut.test('test_constConstructorWithNonFinalField_constInstanceVar', () {
         final __test = new NonErrorResolverTest();
         runJUnitTest(__test, __test.test_constConstructorWithNonFinalField_constInstanceVar);
@@ -778,6 +907,14 @@
         final __test = new NonErrorResolverTest();
         runJUnitTest(__test, __test.test_invalidAssignment_toDynamic);
       });
+      _ut.test('test_invalidTypeArgumentInConstList', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_invalidTypeArgumentInConstList);
+      });
+      _ut.test('test_invalidTypeArgumentInConstMap', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_invalidTypeArgumentInConstMap);
+      });
       _ut.test('test_invocationOfNonFunction_dynamic', () {
         final __test = new NonErrorResolverTest();
         runJUnitTest(__test, __test.test_invocationOfNonFunction_dynamic);
@@ -802,10 +939,18 @@
         final __test = new NonErrorResolverTest();
         runJUnitTest(__test, __test.test_nonBoolExpression_assert_functionType);
       });
+      _ut.test('test_optionalParameterInOperator_required', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_optionalParameterInOperator_required);
+      });
       _ut.test('test_rethrowOutsideCatch', () {
         final __test = new NonErrorResolverTest();
         runJUnitTest(__test, __test.test_rethrowOutsideCatch);
       });
+      _ut.test('test_returnInGenerativeConstructor', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_returnInGenerativeConstructor);
+      });
       _ut.test('test_returnOfInvalidType_dynamic', () {
         final __test = new NonErrorResolverTest();
         runJUnitTest(__test, __test.test_returnOfInvalidType_dynamic);
@@ -818,6 +963,14 @@
         final __test = new NonErrorResolverTest();
         runJUnitTest(__test, __test.test_returnOfInvalidType_supertype);
       });
+      _ut.test('test_returnWithoutValue_noReturnType', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_returnWithoutValue_noReturnType);
+      });
+      _ut.test('test_returnWithoutValue_void', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_returnWithoutValue_void);
+      });
       _ut.test('test_typeArgumentNotMatchingBounds_const', () {
         final __test = new NonErrorResolverTest();
         runJUnitTest(__test, __test.test_typeArgumentNotMatchingBounds_const);
@@ -838,10 +991,18 @@
         final __test = new NonErrorResolverTest();
         runJUnitTest(__test, __test.test_undefinedIdentifier_show);
       });
+      _ut.test('test_undefinedMethod_noSuchMethod', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_undefinedMethod_noSuchMethod);
+      });
       _ut.test('test_undefinedOperator_tilde', () {
         final __test = new NonErrorResolverTest();
         runJUnitTest(__test, __test.test_undefinedOperator_tilde);
       });
+      _ut.test('test_wrongNumberOfParametersForSetter', () {
+        final __test = new NonErrorResolverTest();
+        runJUnitTest(__test, __test.test_wrongNumberOfParametersForSetter);
+      });
     });
   }
 }
@@ -993,177 +1154,177 @@
 }
 class StaticTypeWarningCodeTest extends ResolverTestCase {
   void fail_inaccessibleSetter() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.INACCESSIBLE_SETTER]);
     verify([source]);
   }
   void fail_inconsistentMethodInheritance() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.INCONSISTENT_METHOD_INHERITANCE]);
     verify([source]);
   }
   void fail_nonTypeAsTypeArgument() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["int A;", "class B<E> {}", "f(B<A> b) {}"]));
+    Source source = addSource(EngineTestCase.createSource(["int A;", "class B<E> {}", "f(B<A> b) {}"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT]);
     verify([source]);
   }
   void fail_redirectWithInvalidTypeParameters() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.REDIRECT_WITH_INVALID_TYPE_PARAMETERS]);
     verify([source]);
   }
   void fail_typeArgumentViolatesBounds() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.TYPE_ARGUMENT_VIOLATES_BOUNDS]);
     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(EngineTestCase.createSource(["class A {", "  int x;", "}", "f() {", "  A a;", "  a.x = '0';", "}"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.INVALID_ASSIGNMENT]);
     verify([source]);
   }
   void test_invalidAssignment_localVariable() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  int x;", "  x = '0';", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f() {", "  int x;", "  x = '0';", "}"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.INVALID_ASSIGNMENT]);
     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(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(EngineTestCase.createSource(["class A {", "  void m() {", "    A();", "  }", "}"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION]);
   }
   void test_invocationOfNonFunction_localVariable() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  int x;", "  return x();", "}"]));
+    Source source = addSource(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(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(EngineTestCase.createSource(["class A {", "  static int get g => 0;", "  f() {", "    A.g();", "  }", "}"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION]);
   }
   void test_nonBoolCondition_conditional() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() { return 3 ? 2 : 1; }"]));
+    Source source = addSource(EngineTestCase.createSource(["f() { return 3 ? 2 : 1; }"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.NON_BOOL_CONDITION]);
     verify([source]);
   }
   void test_nonBoolCondition_do() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  do {} while (3);", "}"]));
+    Source source = addSource(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(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(EngineTestCase.createSource(["f() {", "  while (3) {}", "}"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.NON_BOOL_CONDITION]);
     verify([source]);
   }
   void test_nonBoolExpression() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  assert(0);", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f() {", "  assert(0);", "}"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.NON_BOOL_EXPRESSION]);
     verify([source]);
   }
   void test_returnOfInvalidType_function() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["int f() { return '0'; }"]));
+    Source source = addSource(EngineTestCase.createSource(["int f() { return '0'; }"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
     verify([source]);
   }
   void test_returnOfInvalidType_localFunction() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  String m() {", "    int f() { return '0'; }", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  String m() {", "    int f() { return '0'; }", "  }", "}"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
     verify([source]);
   }
   void test_returnOfInvalidType_method() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int f() { return '0'; }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  int f() { return '0'; }", "}"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
     verify([source]);
   }
   void test_typeArgumentNotMatchingBounds_const() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "class B {}", "class G<E extends A> {", "  const G() {}", "}", "f() { return const G<B>(); }"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "class B {}", "class G<E extends A> {", "  const G() {}", "}", "f() { return const G<B>(); }"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
     verify([source]);
   }
   void test_typeArgumentNotMatchingBounds_new() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "class B {}", "class G<E extends A> {}", "f() { return new G<B>(); }"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "class B {}", "class G<E extends A> {}", "f() { return new G<B>(); }"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
     verify([source]);
   }
   void test_undefinedFunction() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["void f() {", "  g();", "}"]));
+    Source source = addSource(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; }"]));
+    Source source = addSource(EngineTestCase.createSource(["class T {}", "f(T e) { return e.m; }"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.UNDEFINED_GETTER]);
   }
   void test_undefinedGetter_static() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "var a = A.B;"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "var a = A.B;"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.UNDEFINED_GETTER]);
   }
   void test_undefinedMethod() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  void m() {", "    n();", "  }", "}"]));
+    Source source = addSource(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; }"]));
+    Source source = addSource(EngineTestCase.createSource(["class T {}", "f(T e1) { e1.m = 0; }"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.UNDEFINED_SETTER]);
   }
   void test_undefinedSetter_static() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "f() { A.B = 0;}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "f() { A.B = 0;}"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.UNDEFINED_SETTER]);
   }
   void test_undefinedSuperMethod() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "class B extends A {", "  m() { return super.m(); }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "class B extends A {", "  m() { return super.m(); }", "}"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.UNDEFINED_SUPER_METHOD]);
   }
   void test_wrongNumberOfTypeArguments_tooFew() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A<E, F> {}", "A<A> a = null;"]));
+    Source source = addSource(EngineTestCase.createSource(["class A<E, F> {}", "A<A> a = null;"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
     verify([source]);
   }
   void test_wrongNumberOfTypeArguments_tooMany() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A<E> {}", "A<A, A> a = null;"]));
+    Source source = addSource(EngineTestCase.createSource(["class A<E> {}", "A<A, A> a = null;"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
     verify([source]);
@@ -1301,12 +1462,12 @@
   }
   void fail_visitFieldFormalParameter_noType() {
     FormalParameter node = ASTFactory.fieldFormalParameter(Keyword.VAR, null, "p");
-    JUnitTestCase.assertSame(_typeProvider.dynamicType, resolve5(node, []));
+    JUnitTestCase.assertSame(_typeProvider.dynamicType, resolve6(node, []));
     _listener.assertNoErrors();
   }
   void fail_visitFieldFormalParameter_type() {
     FormalParameter node = ASTFactory.fieldFormalParameter(null, ASTFactory.typeName4("int", []), "p");
-    JUnitTestCase.assertSame(_typeProvider.intType, resolve5(node, []));
+    JUnitTestCase.assertSame(_typeProvider.intType, resolve6(node, []));
     _listener.assertNoErrors();
   }
   void fail_visitFunctionDeclaration() {
@@ -1425,7 +1586,7 @@
   void test_visitSimpleFormalParameter_noType() {
     FormalParameter node = ASTFactory.simpleFormalParameter3("p");
     node.identifier.element = new ParameterElementImpl(ASTFactory.identifier3("p"));
-    JUnitTestCase.assertSame(_typeProvider.dynamicType, resolve5(node, []));
+    JUnitTestCase.assertSame(_typeProvider.dynamicType, resolve6(node, []));
     _listener.assertNoErrors();
   }
   void test_visitSimpleFormalParameter_type() {
@@ -1435,7 +1596,7 @@
     SimpleIdentifier identifier2 = node.identifier;
     ParameterElementImpl element = new ParameterElementImpl(identifier2);
     identifier2.element = element;
-    JUnitTestCase.assertSame(intType2, resolve5(node, [intElement]));
+    JUnitTestCase.assertSame(intType2, resolve6(node, [intElement]));
     _listener.assertNoErrors();
   }
   void test_visitTypeName_noParameters_noArguments() {
@@ -1507,7 +1668,7 @@
    * being resolved
    * @return the type associated with the parameter
    */
-  Type2 resolve5(FormalParameter node, List<Element> definedElements) {
+  Type2 resolve6(FormalParameter node, List<Element> definedElements) {
     resolveNode(node, definedElements);
     return ((node.identifier.element as ParameterElement)).type;
   }
@@ -1608,12 +1769,18 @@
     _sourceFactory = _analysisContext.sourceFactory;
   }
   /**
+   * Add a source file to the content provider.
+   * @param contents the contents to be returned by the content provider for the specified file
+   * @return the source object representing the added file
+   */
+  Source addSource(String contents) => addSource2("/test.dart", contents);
+  /**
    * Add a source file to the content provider. The file path should be absolute.
    * @param filePath the path of the file being added
    * @param contents the contents to be returned by the content provider for the specified file
    * @return the source object representing the added file
    */
-  Source addSource(String filePath, String contents) {
+  Source addSource2(String filePath, String contents) {
     Source source = new FileBasedSource.con1(_sourceFactory.contentCache, FileUtilities2.createFile(filePath));
     _sourceFactory.setContents(source, contents);
     ChangeSet changeSet = new ChangeSet();
@@ -1785,726 +1952,702 @@
 }
 class CompileTimeErrorCodeTest extends ResolverTestCase {
   void fail_ambiguousExport() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["library L;", "export 'lib1.dart';", "export 'lib2.dart';"]));
-    addSource("/lib1.dart", EngineTestCase.createSource(["class N {}"]));
-    addSource("/lib2.dart", EngineTestCase.createSource(["class N {}"]));
+    Source source = addSource(EngineTestCase.createSource(["library L;", "export 'lib1.dart';", "export 'lib2.dart';"]));
+    addSource2("/lib1.dart", EngineTestCase.createSource(["class N {}"]));
+    addSource2("/lib2.dart", EngineTestCase.createSource(["class N {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.AMBIGUOUS_EXPORT]);
     verify([source]);
   }
   void fail_ambiguousImport_function() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["library L;", "import 'lib1.dart';", "import 'lib2.dart';", "g() { return f(); }"]));
-    addSource("/lib1.dart", EngineTestCase.createSource(["f() {}"]));
-    addSource("/lib2.dart", EngineTestCase.createSource(["f() {}"]));
+    Source source = addSource(EngineTestCase.createSource(["library L;", "import 'lib1.dart';", "import 'lib2.dart';", "g() { return f(); }"]));
+    addSource2("/lib1.dart", EngineTestCase.createSource(["f() {}"]));
+    addSource2("/lib2.dart", EngineTestCase.createSource(["f() {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.AMBIGUOUS_IMPORT]);
     verify([source]);
   }
   void fail_ambiguousImport_typeAnnotation() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["library L;", "import 'lib1.dart';", "import 'lib2.dart';", "class A extends N {}"]));
-    addSource("/lib1.dart", EngineTestCase.createSource(["class N {}"]));
-    addSource("/lib2.dart", EngineTestCase.createSource(["class N {}"]));
+    Source source = addSource(EngineTestCase.createSource(["library L;", "import 'lib1.dart';", "import 'lib2.dart';", "class A extends N {}"]));
+    addSource2("/lib1.dart", EngineTestCase.createSource(["class N {}"]));
+    addSource2("/lib2.dart", EngineTestCase.createSource(["class N {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.AMBIGUOUS_IMPORT]);
     verify([source]);
   }
   void fail_compileTimeConstantRaisesException() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.COMPILE_TIME_CONSTANT_RAISES_EXCEPTION]);
     verify([source]);
   }
   void fail_constWithNonConstantArgument() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class T {", "  T(a) {};", "}", "f(p) { return const T(p); }"]));
+    Source source = addSource(EngineTestCase.createSource(["class T {", "  T(a) {};", "}", "f(p) { return const T(p); }"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT]);
     verify([source]);
   }
   void fail_constWithNonType() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["int A;", "f() {", "  return const A();", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["int A;", "f() {", "  return const A();", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.CONST_WITH_NON_TYPE]);
     verify([source]);
   }
   void fail_constWithTypeParameters() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS]);
     verify([source]);
   }
   void fail_constWithUndefinedConstructor() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  A(x) {}", "}", "f() {", "  return const A(0);", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  A(x) {}", "}", "f() {", "  return const A(0);", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR]);
     verify([source]);
   }
   void fail_duplicateDefinition() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  int m = 0;", "  m(a) {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f() {", "  int m = 0;", "  m(a) {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.DUPLICATE_DEFINITION]);
     verify([source]);
   }
+  void fail_duplicateMemberError_classMembers_fields() {
+    Source librarySource = addSource(EngineTestCase.createSource(["class A {", "  int a;", "  int a;", "}"]));
+    resolve(librarySource, []);
+    assertErrors([CompileTimeErrorCode.DUPLICATE_DEFINITION]);
+    verify([librarySource]);
+  }
+  void fail_duplicateMemberError_classMembers_methods() {
+    Source librarySource = addSource(EngineTestCase.createSource(["class A {", "  m() {}", "  m() {}", "}"]));
+    resolve(librarySource, []);
+    assertErrors([CompileTimeErrorCode.DUPLICATE_DEFINITION]);
+    verify([librarySource]);
+  }
+  void fail_duplicateMemberError_localFields() {
+    Source librarySource = addSource(EngineTestCase.createSource(["class A {", "  m() {", "    int a;", "    int a;", "  }", "}"]));
+    resolve(librarySource, []);
+    assertErrors([CompileTimeErrorCode.DUPLICATE_DEFINITION]);
+    verify([librarySource]);
+  }
   void fail_duplicateMemberName() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int x = 0;", "  int x() {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  int x = 0;", "  int x() {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.DUPLICATE_MEMBER_NAME]);
     verify([source]);
   }
   void fail_duplicateMemberNameInstanceStatic() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int x;", "  static int x;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  int x;", "  static int x;", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.DUPLICATE_MEMBER_NAME_INSTANCE_STATIC]);
     verify([source]);
   }
   void fail_duplicateNamedArgument() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f({a, a}) {}"]));
+    Source source = addSource(EngineTestCase.createSource(["f({a, a}) {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.DUPLICATE_NAMED_ARGUMENT]);
     verify([source]);
   }
   void fail_extendsOrImplementsDisallowedClass_extends_null() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A extends Null {}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A extends Null {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
     verify([source]);
   }
   void fail_extendsOrImplementsDisallowedClass_implements_null() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A implements Null {}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A implements Null {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
     verify([source]);
   }
   void fail_finalNotInitialized_inConstructor() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  final int x;", "  A() {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  final int x;", "  A() {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.FINAL_NOT_INITIALIZED]);
     verify([source]);
   }
   void fail_getterAndMethodWithSameName() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  get x -> 0;", "  x(y) {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  get x -> 0;", "  x(y) {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.GETTER_AND_METHOD_WITH_SAME_NAME]);
     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;"]));
-    addSource("/lib2.dart", EngineTestCase.createSource(["library lib;"]));
+    Source source = addSource(EngineTestCase.createSource(["library test;", "import 'lib1.dart';", "import 'lib2.dart';"]));
+    addSource2("/lib1.dart", EngineTestCase.createSource(["library lib;"]));
+    addSource2("/lib2.dart", EngineTestCase.createSource(["library lib;"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.IMPORT_DUPLICATED_LIBRARY_NAME]);
     verify([source]);
   }
   void fail_invalidConstructorName() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.INVALID_CONSTRUCTOR_NAME]);
     verify([source]);
   }
   void fail_invalidFactoryNameNotAClass() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.INVALID_FACTORY_NAME_NOT_A_CLASS]);
     verify([source]);
   }
   void fail_invalidOverrideDefaultValue() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  m([a = 0]) {}", "}", "class B extends A {", "  m([a = 1]) {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  m([a = 0]) {}", "}", "class B extends A {", "  m([a = 1]) {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.INVALID_OVERRIDE_DEFAULT_VALUE]);
     verify([source]);
   }
   void fail_invalidOverrideNamed() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  m({a, b}) {}", "}", "class B extends A {", "  m({a}) {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  m({a, b}) {}", "}", "class B extends A {", "  m({a}) {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.INVALID_OVERRIDE_NAMED]);
     verify([source]);
   }
   void fail_invalidOverridePositional() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  m([a, b]) {}", "}", "class B extends A {", "  m([a]) {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  m([a, b]) {}", "}", "class B extends A {", "  m([a]) {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.INVALID_OVERRIDE_POSITIONAL]);
     verify([source]);
   }
   void fail_invalidOverrideRequired() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  m(a) {}", "}", "class B extends A {", "  m(a, b) {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  m(a) {}", "}", "class B extends A {", "  m(a, b) {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.INVALID_OVERRIDE_REQUIRED]);
     verify([source]);
   }
   void fail_invalidReferenceToThis_staticMethod() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  static m() { return this; }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  static m() { return this; }", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS]);
     verify([source]);
   }
   void fail_invalidReferenceToThis_topLevelFunction() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() { return this; }"]));
+    Source source = addSource(EngineTestCase.createSource(["f() { return this; }"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS]);
     verify([source]);
   }
   void fail_invalidReferenceToThis_variableInitializer() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["int x = this;"]));
+    Source source = addSource(EngineTestCase.createSource(["int x = this;"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS]);
     verify([source]);
   }
-  void fail_invalidTypeArgumentInConstList() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A<E> {", "  m() {", "    return const <E>[]", "  }", "}"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST]);
-    verify([source]);
-  }
-  void fail_invalidTypeArgumentInConstMap() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A<E> {", "  m() {", "    return const <String, E>{}", "  }", "}"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP]);
-    verify([source]);
-  }
   void fail_memberWithClassName() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int A = 0;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  int A = 0;", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.MEMBER_WITH_CLASS_NAME]);
     verify([source]);
   }
   void fail_mixinDeclaresConstructor() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  A() {}", "}", "class B extends Object mixin A {}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  A() {}", "}", "class B extends Object mixin A {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.MIXIN_DECLARES_CONSTRUCTOR]);
     verify([source]);
   }
   void fail_mixinInheritsFromNotObject() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "class B extends A {}", "class C extends Object mixin B {}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "class B extends A {}", "class C extends Object mixin B {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT]);
     verify([source]);
   }
   void fail_mixinOfNonClass() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["var A;", "class B extends Object mixin A {}"]));
+    Source source = addSource(EngineTestCase.createSource(["var A;", "class B extends Object mixin A {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.MIXIN_OF_NON_CLASS]);
     verify([source]);
   }
   void fail_mixinOfNonMixin() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.MIXIN_OF_NON_MIXIN]);
     verify([source]);
   }
   void fail_mixinReferencesSuper() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  toString() -> super.toString();", "}", "class B extends Object mixin A {}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  toString() -> super.toString();", "}", "class B extends Object mixin A {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.MIXIN_REFERENCES_SUPER]);
     verify([source]);
   }
   void fail_mixinWithNonClassSuperclass() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["int A;", "class B extends Object mixin A {}"]));
+    Source source = addSource(EngineTestCase.createSource(["int A;", "class B extends Object mixin A {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS]);
     verify([source]);
   }
   void fail_multipleSuperInitializers() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "class B extends A {", "  B() : super(), super() {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "class B extends A {", "  B() : super(), super() {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.MULTIPLE_SUPER_INITIALIZERS]);
     verify([source]);
   }
   void fail_nonConstantDefaultValue_named() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f({x : 2 + 3}) {}"]));
+    Source source = addSource(EngineTestCase.createSource(["f({x : 2 + 3}) {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE]);
     verify([source]);
   }
   void fail_nonConstantDefaultValue_positional() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f([x = 2 + 3]) {}"]));
+    Source source = addSource(EngineTestCase.createSource(["f([x = 2 + 3]) {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE]);
     verify([source]);
   }
   void fail_nonConstMapAsExpressionStatement() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  {'a' : 0, 'b' : 1};", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f() {", "  {'a' : 0, 'b' : 1};", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT]);
     verify([source]);
   }
   void fail_nonConstMapKey() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f(a) {", "  return const {a : 0};", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f(a) {", "  return const {a : 0};", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.NON_CONSTANT_MAP_KEY]);
     verify([source]);
   }
   void fail_nonConstValueInInitializer() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  static C;", "  int a;", "  A() : a = C {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  static C;", "  int a;", "  A() : a = C {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER]);
     verify([source]);
   }
   void fail_objectCannotExtendAnotherClass() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.OBJECT_CANNOT_EXTEND_ANOTHER_CLASS]);
     verify([source]);
   }
-  void fail_optionalParameterInOperator() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  operator +([p]) {}", "}"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR]);
-    verify([source]);
-  }
   void fail_overrideMissingNamedParameters() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  m(a, {b}) {}", "}", "class B extends A {", "  m(a) {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  m(a, {b}) {}", "}", "class B extends A {", "  m(a) {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.OVERRIDE_MISSING_NAMED_PARAMETERS]);
     verify([source]);
   }
   void fail_overrideMissingRequiredParameters() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  m(a) {}", "}", "class B extends A {", "  m(a, b) {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  m(a) {}", "}", "class B extends A {", "  m(a, b) {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.OVERRIDE_MISSING_REQUIRED_PARAMETERS]);
     verify([source]);
   }
   void fail_prefixCollidesWithTopLevelMembers() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["import 'dart:uri' as uri;", "var uri = null;"]));
+    Source source = addSource(EngineTestCase.createSource(["import 'dart:uri' as uri;", "var uri = null;"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER]);
     verify([source]);
   }
-  void fail_privateOptionalParameter() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f({_p : 0}) {}"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER]);
-    verify([source]);
-  }
   void fail_recursiveCompileTimeConstant() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["const x = y + 1;", "const y = x + 1;"]));
+    Source source = addSource(EngineTestCase.createSource(["const x = y + 1;", "const y = x + 1;"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT]);
     verify([source]);
   }
   void fail_recursiveFactoryRedirect() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT]);
     verify([source]);
   }
   void fail_recursiveFunctionTypeAlias_direct() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["typedef F(F f);"]));
+    Source source = addSource(EngineTestCase.createSource(["typedef F(F f);"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.RECURSIVE_FUNCTION_TYPE_ALIAS]);
     verify([source]);
   }
   void fail_recursiveFunctionTypeAlias_indirect() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["typedef F(G g);", "typedef G(F f);"]));
+    Source source = addSource(EngineTestCase.createSource(["typedef F(G g);", "typedef G(F f);"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.RECURSIVE_FUNCTION_TYPE_ALIAS]);
     verify([source]);
   }
   void fail_recursiveInterfaceInheritance_direct() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A implements A {}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A implements A {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE]);
     verify([source]);
   }
   void fail_recursiveInterfaceInheritance_indirect() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A implements B {}", "class B implements A {}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A implements B {}", "class B implements A {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE]);
     verify([source]);
   }
   void fail_redirectToNonConstConstructor() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.REDIRECT_TO_NON_CONST_CONSTRUCTOR]);
     verify([source]);
   }
   void fail_referenceToDeclaredVariableInInitializer_getter() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  int x = x + 1;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f() {", "  int x = x + 1;", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.REFERENCE_TO_DECLARED_VARIABLE_IN_INITIALIZER]);
     verify([source]);
   }
   void fail_referenceToDeclaredVariableInInitializer_setter() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  int x = x++;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f() {", "  int x = x++;", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.REFERENCE_TO_DECLARED_VARIABLE_IN_INITIALIZER]);
     verify([source]);
   }
   void fail_reservedWordAsIdentifier() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["int class = 2;"]));
+    Source source = addSource(EngineTestCase.createSource(["int class = 2;"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.RESERVED_WORD_AS_IDENTIFIER]);
     verify([source]);
   }
-  void fail_returnInGenerativeConstructor() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  A() { return 0; }", "}"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR]);
-    verify([source]);
-  }
   void fail_staticTopLevelFunction_topLevel() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["static f() {}"]));
+    Source source = addSource(EngineTestCase.createSource(["static f() {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.STATIC_TOP_LEVEL_FUNCTION]);
     verify([source]);
   }
   void fail_staticTopLevelVariable() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["static int x;"]));
+    Source source = addSource(EngineTestCase.createSource(["static int x;"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.STATIC_TOP_LEVEL_VARIABLE]);
     verify([source]);
   }
   void fail_superInInvalidContext_factoryConstructor() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT]);
     verify([source]);
   }
   void fail_superInInvalidContext_instanceVariableInitializer() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  var a;", "}", "class B extends A {", " var b = super.a;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  var a;", "}", "class B extends A {", " var b = super.a;", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT]);
     verify([source]);
   }
   void fail_superInInvalidContext_staticMethod() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  static m() {}", "}", "class B extends A {", "  static n() { return super.m(); }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  static m() {}", "}", "class B extends A {", "  static n() { return super.m(); }", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT]);
     verify([source]);
   }
   void fail_superInInvalidContext_staticVariableInitializer() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  static a = 0;", "}", "class B extends A {", "  static b = super.a;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  static a = 0;", "}", "class B extends A {", "  static b = super.a;", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT]);
     verify([source]);
   }
   void fail_superInInvalidContext_topLevelFunction() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  super.f();", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f() {", "  super.f();", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT]);
     verify([source]);
   }
   void fail_superInInvalidContext_variableInitializer() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["var v = super.v;"]));
+    Source source = addSource(EngineTestCase.createSource(["var v = super.v;"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT]);
     verify([source]);
   }
   void fail_superInitializerInObject() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.SUPER_INITIALIZER_IN_OBJECT]);
     verify([source]);
   }
   void fail_typeArgumentsForNonGenericClass_creation_const() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "f(p) {", "  return const A<int>();", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "f(p) {", "  return const A<int>();", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.TYPE_ARGUMENTS_FOR_NON_GENERIC_CLASS]);
     verify([source]);
   }
   void fail_typeArgumentsForNonGenericClass_creation_new() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "f(p) {", "  return new A<int>();", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "f(p) {", "  return new A<int>();", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.TYPE_ARGUMENTS_FOR_NON_GENERIC_CLASS]);
     verify([source]);
   }
   void fail_typeArgumentsForNonGenericClass_typeCast() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "f(p) {", "  return p as A<int>;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "f(p) {", "  return p as A<int>;", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.TYPE_ARGUMENTS_FOR_NON_GENERIC_CLASS]);
     verify([source]);
   }
   void fail_undefinedConstructorInInitializer() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER]);
     verify([source]);
   }
   void fail_uninitializedFinalField() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  final int i;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  final int i;", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.UNINITIALIZED_FINAL_FIELD]);
     verify([source]);
   }
   void fail_wrongNumberOfParametersForOperator() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  operator []=(i) {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  operator []=(i) {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]);
     verify([source]);
   }
-  void fail_wrongNumberOfParametersForSetter_tooFew() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["set x() {}"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
-    verify([source]);
-  }
-  void fail_wrongNumberOfParametersForSetter_tooMany() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["set x(a, b) {}"]));
-    resolve(source, []);
-    assertErrors([CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
-    verify([source]);
-  }
   void fail_wrongNumberOfTypeArguments_creation_const_tooFew() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "class C<K, V> {}", "f(p) {", "  return const C<A>();", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "class C<K, V> {}", "f(p) {", "  return const C<A>();", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
     verify([source]);
   }
   void fail_wrongNumberOfTypeArguments_creation_const_tooMany() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "class C<E> {}", "f(p) {", "  return const C<A, A>();", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "class C<E> {}", "f(p) {", "  return const C<A, A>();", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
     verify([source]);
   }
   void fail_wrongNumberOfTypeArguments_creation_new_tooFew() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "class C<K, V> {}", "f(p) {", "  return new C<A>();", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "class C<K, V> {}", "f(p) {", "  return new C<A>();", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
     verify([source]);
   }
   void fail_wrongNumberOfTypeArguments_creation_new_tooMany() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "class C<E> {}", "f(p) {", "  return new C<A, A>();", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "class C<E> {}", "f(p) {", "  return new C<A, A>();", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
     verify([source]);
   }
   void fail_wrongNumberOfTypeArguments_typeTest_tooFew() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "class C<K, V> {}", "f(p) {", "  return p is C<A>;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "class C<K, V> {}", "f(p) {", "  return p is C<A>;", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
     verify([source]);
   }
   void fail_wrongNumberOfTypeArguments_typeTest_tooMany() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "class C<E> {}", "f(p) {", "  return p is C<A, A>;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "class C<E> {}", "f(p) {", "  return p is C<A, A>;", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
     verify([source]);
   }
   void test_argumentDefinitionTestNonParameter() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", " var v = 0;", " return ?v;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f() {", " var v = 0;", " return ?v;", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.ARGUMENT_DEFINITION_TEST_NON_PARAMETER]);
     verify([source]);
   }
   void test_builtInIdentifierAsType() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  typedef x;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f() {", "  typedef x;", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE, StaticWarningCode.UNDEFINED_CLASS]);
     verify([source]);
   }
   void test_builtInIdentifierAsTypedefName_classTypeAlias() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}", "class B {}", "typedef as = A with B;"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "class B {}", "typedef as = A with B;"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME]);
     verify([source]);
   }
   void test_builtInIdentifierAsTypedefName_functionTypeAlias() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["typedef bool as();"]));
+    Source source = addSource(EngineTestCase.createSource(["typedef bool as();"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME]);
     verify([source]);
   }
   void test_builtInIdentifierAsTypeName() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class as {}"]));
+    Source source = addSource(EngineTestCase.createSource(["class as {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME]);
     verify([source]);
   }
   void test_builtInIdentifierAsTypeVariableName() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A<as> {}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A<as> {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_VARIABLE_NAME]);
     verify([source]);
   }
   void test_caseExpressionTypeImplementsEquals() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class IntWrapper {", "  final int value;", "  const IntWrapper(this.value);", "  bool operator ==(IntWrapper x) {", "    return value == x.value;", "  }", "}", "", "f(IntWrapper a) {", "  switch(a) {", "    case(const IntWrapper(1)) : return 1;", "    default: return 0;", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class IntWrapper {", "  final int value;", "  const IntWrapper(this.value);", "  bool operator ==(IntWrapper x) {", "    return value == x.value;", "  }", "}", "", "f(IntWrapper a) {", "  switch(a) {", "    case(const IntWrapper(1)) : return 1;", "    default: return 0;", "  }", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
     verify([source]);
   }
   void test_conflictingConstructorNameAndMember_field() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int x;", "  A.x() {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  int x;", "  A.x() {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD]);
     verify([source]);
   }
   void test_conflictingConstructorNameAndMember_method() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  const A.x() {}", "  void x() {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  const A.x() {}", "  void x() {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD]);
     verify([source]);
   }
   void test_constConstructorWithNonFinalField() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int x;", "  const A() {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  int x;", "  const A() {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD]);
     verify([source]);
   }
   void test_constEvalThrowsException() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class C {", "  const C() { throw null; }", "}", "f() { return const C(); }"]));
+    Source source = addSource(EngineTestCase.createSource(["class C {", "  const C() { throw null; }", "}", "f() { return const C(); }"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
     verify([source]);
   }
   void test_constFormalParameter_fieldFormalParameter() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  var x;", "  A(const this.x) {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  var x;", "  A(const this.x) {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.CONST_FORMAL_PARAMETER]);
     verify([source]);
   }
   void test_constFormalParameter_simpleFormalParameter() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f(const x) {}"]));
+    Source source = addSource(EngineTestCase.createSource(["f(const x) {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.CONST_FORMAL_PARAMETER]);
     verify([source]);
   }
   void test_constInitializedWithNonConstValue() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f(p) {", "  const C = p;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f(p) {", "  const C = p;", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE]);
     verify([source]);
   }
   void test_constWithInvalidTypeParameters() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  const A() {}", "}", "f() { return const A<A>(); }"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  const A() {}", "}", "f() { return const A<A>(); }"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS]);
     verify([source]);
   }
   void test_constWithNonConst() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class T {", "  T(a, b, {c, d}) {}", "}", "f() { return const T(0, 1, c: 2, d: 3); }"]));
+    Source source = addSource(EngineTestCase.createSource(["class T {", "  T(a, b, {c, d}) {}", "}", "f() { return const T(0, 1, c: 2, d: 3); }"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.CONST_WITH_NON_CONST]);
     verify([source]);
   }
   void test_defaultValueInFunctionTypeAlias() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["typedef F([x = 0]);"]));
+    Source source = addSource(EngineTestCase.createSource(["typedef F([x = 0]);"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS]);
     verify([source]);
   }
   void test_duplicateMemberError() {
-    Source librarySource = addSource("/lib.dart", EngineTestCase.createSource(["library lib;", "", "part 'a.dart';", "part 'b.dart';"]));
-    Source sourceA = addSource("/a.dart", EngineTestCase.createSource(["part of lib;", "", "class A {}"]));
-    Source sourceB = addSource("/b.dart", EngineTestCase.createSource(["part of lib;", "", "class A {}"]));
+    Source librarySource = addSource2("/lib.dart", EngineTestCase.createSource(["library lib;", "", "part 'a.dart';", "part 'b.dart';"]));
+    Source sourceA = addSource2("/a.dart", EngineTestCase.createSource(["part of lib;", "", "class A {}"]));
+    Source sourceB = addSource2("/b.dart", EngineTestCase.createSource(["part of lib;", "", "class A {}"]));
     resolve(librarySource, [sourceA, sourceB]);
     assertErrors([CompileTimeErrorCode.DUPLICATE_DEFINITION]);
     verify([librarySource, sourceA, sourceB]);
   }
   void test_exportOfNonLibrary() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["library L;", "export 'lib1.dart';"]));
-    addSource("/lib1.dart", EngineTestCase.createSource(["part of lib;"]));
+    Source source = addSource(EngineTestCase.createSource(["library L;", "export 'lib1.dart';"]));
+    addSource2("/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 {}"]));
+    Source source = addSource(EngineTestCase.createSource(["int A;", "class B extends A {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.EXTENDS_NON_CLASS]);
     verify([source]);
   }
   void test_extendsOrImplementsDisallowedClass_extends_bool() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A extends bool {}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A extends bool {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
     verify([source]);
   }
   void test_extendsOrImplementsDisallowedClass_extends_double() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A extends double {}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A extends double {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
     verify([source]);
   }
   void test_extendsOrImplementsDisallowedClass_extends_int() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A extends int {}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A extends int {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
     verify([source]);
   }
   void test_extendsOrImplementsDisallowedClass_extends_num() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A extends num {}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A extends num {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
     verify([source]);
   }
   void test_extendsOrImplementsDisallowedClass_extends_String() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A extends String {}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A extends String {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
     verify([source]);
   }
   void test_extendsOrImplementsDisallowedClass_implements_bool() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A implements bool {}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A implements bool {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
     verify([source]);
   }
   void test_extendsOrImplementsDisallowedClass_implements_double() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A implements double {}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A implements double {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
     verify([source]);
   }
   void test_extendsOrImplementsDisallowedClass_implements_int() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A implements int {}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A implements int {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
     verify([source]);
   }
   void test_extendsOrImplementsDisallowedClass_implements_num() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A implements num {}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A implements num {}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
     verify([source]);
   }
   void test_extendsOrImplementsDisallowedClass_implements_String() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A implements String {}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A implements String {}"]));
     resolve(source, []);
     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 {}", "}"]));
+    Source source = addSource(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 {}", "}"]));
+    Source source = addSource(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 {}", "}"]));
+    Source source = addSource(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 {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  const int x = 0;", "  A() : x = 1 {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION]);
     verify([source]);
   }
   void test_fieldInitializedInInitializerAndDeclaration_final() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  final int x = 0;", "  A() : x = 1 {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  final int x = 0;", "  A() : x = 1 {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION]);
     verify([source]);
   }
   void test_fieldInitializedInParameterAndInitializer() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int x;", "  A(this.x) : x = 1 {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  int x;", "  A(this.x) : x = 1 {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER]);
     verify([source]);
   }
   void test_fieldInitializerOutsideConstructor() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int x;", "  m(this.x) {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  int x;", "  m(this.x) {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]);
     verify([source]);
   }
   void test_fieldInitializerOutsideConstructor_defaultParameter() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int x;", "  m([this.x]) {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  int x;", "  m([this.x]) {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]);
     verify([source]);
@@ -2519,19 +2662,19 @@
    * the broader code
    */
   void test_finalInitializedInDeclarationAndConstructor_initializers() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  final x = 0;", "  A() : x = 0 {}", "}"]));
+    Source source = addSource(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) {}", "}"]));
+    Source source = addSource(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 {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  final x;", "  A() : x = 0, x = 0 {}", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS]);
     verify([source]);
@@ -2545,262 +2688,310 @@
    * 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 {}", "}"]));
+    Source source = addSource(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) {}", "}"]));
+    Source source = addSource(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;", "}"]));
+    Source source = addSource(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;", "}"]));
+    Source source = addSource(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;", "}"]));
+    Source source = addSource(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;", "}"]));
+    Source source = addSource(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;"]));
+    Source source = addSource(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;"]));
+    Source source = addSource(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;", "}"]));
+    Source source = addSource(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;", "}"]));
+    Source source = addSource(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 {}"]));
+    Source source = addSource(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 {}"]));
+    Source source = addSource(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;"]));
+    Source source = addSource(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 {}"]));
+    Source source = addSource(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 {}"]));
+    Source source = addSource(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 {}"]));
+    Source source = addSource(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;"]));
+    Source source = addSource(EngineTestCase.createSource(["library lib;", "import 'part.dart';"]));
+    addSource2("/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;", "  }", "}"]));
+    Source source = addSource(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;", "  }", "}"]));
+    Source source = addSource(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 {}", "}"]));
+    Source source = addSource(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 {}", "}"]));
+    Source source = addSource(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) {}", "}"]));
+    Source source = addSource(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) {}", "}"]));
+    Source source = addSource(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]) {}", "}"]));
+    Source source = addSource(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]) {}", "}"]));
+    Source source = addSource(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>{}", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  m() {", "    return const <int, int>{}", "  }", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_FOR_KEY]);
     verify([source]);
   }
+  void test_invalidTypeArgumentInConstList() {
+    Source source = addSource(EngineTestCase.createSource(["class A<E> {", "  m() {", "    return const <E>[]", "  }", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST]);
+    verify([source]);
+  }
+  void test_invalidTypeArgumentInConstMap() {
+    Source source = addSource(EngineTestCase.createSource(["class A<E> {", "  m() {", "    return const <String, E>{}", "  }", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP]);
+    verify([source]);
+  }
   void test_invalidUri_export() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["library L;", "export 'unknown.dart';"]));
+    Source source = addSource(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';"]));
+    Source source = addSource(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';"]));
+    Source source = addSource(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;", "      };", "    }", "  }", "}"]));
+    Source source = addSource(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, StaticWarningCode.UNDEFINED_OPERATOR]);
   }
   void test_labelUndefined_break() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  x: while (true) {", "    break y;", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f() {", "  x: while (true) {", "    break y;", "  }", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.LABEL_UNDEFINED]);
   }
   void test_labelUndefined_continue() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  x: while (true) {", "    continue y;", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f() {", "  x: while (true) {", "    continue y;", "  }", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.LABEL_UNDEFINED]);
   }
   void test_mixinOfNonClass_class() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["int A;", "class B with A {}"]));
+    Source source = addSource(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;"]));
+    Source source = addSource(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';"]));
+    Source source = addSource(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';", "}"]));
+    Source source = addSource(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>(); }"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}", "f() { return new A<A>(); }"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.NEW_WITH_INVALID_TYPE_PARAMETERS]);
     verify([source]);
   }
   void test_nonConstCaseExpression() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f(int p, int q) {", "  switch (p) {", "    case 3 + q:", "      break;", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f(int p, int q) {", "  switch (p) {", "    case 3 + q:", "      break;", "  }", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION]);
     verify([source]);
   }
   void test_nonConstListElement() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f(a) {", "  return const [a];", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f(a) {", "  return const [a];", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT]);
     verify([source]);
   }
   void test_nonConstMapValue() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f(a) {", "  return const {'a' : a};", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f(a) {", "  return const {'a' : a};", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE]);
     verify([source]);
   }
+  void test_optionalParameterInOperator_named() {
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  operator +({p}) {}", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR]);
+    verify([source]);
+  }
+  void test_optionalParameterInOperator_positional() {
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  operator +([p]) {}", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR]);
+    verify([source]);
+  }
   void test_partOfNonPart() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["library l1;", "part 'l2.dart';"]));
-    addSource("/l2.dart", EngineTestCase.createSource(["library l2;"]));
+    Source source = addSource(EngineTestCase.createSource(["library l1;", "part 'l2.dart';"]));
+    addSource2("/l2.dart", EngineTestCase.createSource(["library l2;"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.PART_OF_NON_PART]);
     verify([source]);
   }
+  void test_privateOptionalParameter() {
+    Source source = addSource(EngineTestCase.createSource(["f({_p : 0}) {}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER]);
+    verify([source]);
+  }
   void test_rethrowOutsideCatch() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  rethrow;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f() {", "  rethrow;", "}"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.RETHROW_OUTSIDE_CATCH]);
     verify([source]);
   }
+  void test_returnInGenerativeConstructor() {
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  A() { return 0; }", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR]);
+    verify([source]);
+  }
   void test_uriWithInterpolation_constant() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["import 'stuff_\$platform.dart';"]));
+    Source source = addSource(EngineTestCase.createSource(["import 'stuff_\$platform.dart';"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.URI_WITH_INTERPOLATION, StaticWarningCode.UNDEFINED_IDENTIFIER]);
   }
   void test_uriWithInterpolation_nonConstant() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["library lib;", "part '\${'a'}.dart';"]));
+    Source source = addSource(EngineTestCase.createSource(["library lib;", "part '\${'a'}.dart';"]));
     resolve(source, []);
     assertErrors([CompileTimeErrorCode.URI_WITH_INTERPOLATION]);
   }
+  void test_wrongNumberOfParametersForSetter_tooFew() {
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  set x() {}", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
+    verify([source]);
+  }
+  void test_wrongNumberOfParametersForSetter_tooMany() {
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  set x(a, b) {}", "}"]));
+    resolve(source, []);
+    assertErrors([CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
+    verify([source]);
+  }
   static dartSuite() {
     _ut.group('CompileTimeErrorCodeTest', () {
       _ut.test('test_argumentDefinitionTestNonParameter', () {
@@ -3071,6 +3262,14 @@
         final __test = new CompileTimeErrorCodeTest();
         runJUnitTest(__test, __test.test_invalidTypeArgumentForKey);
       });
+      _ut.test('test_invalidTypeArgumentInConstList', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_invalidTypeArgumentInConstList);
+      });
+      _ut.test('test_invalidTypeArgumentInConstMap', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_invalidTypeArgumentInConstMap);
+      });
       _ut.test('test_invalidUri_export', () {
         final __test = new CompileTimeErrorCodeTest();
         runJUnitTest(__test, __test.test_invalidUri_export);
@@ -3127,14 +3326,30 @@
         final __test = new CompileTimeErrorCodeTest();
         runJUnitTest(__test, __test.test_nonConstMapValue);
       });
+      _ut.test('test_optionalParameterInOperator_named', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_optionalParameterInOperator_named);
+      });
+      _ut.test('test_optionalParameterInOperator_positional', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_optionalParameterInOperator_positional);
+      });
       _ut.test('test_partOfNonPart', () {
         final __test = new CompileTimeErrorCodeTest();
         runJUnitTest(__test, __test.test_partOfNonPart);
       });
+      _ut.test('test_privateOptionalParameter', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_privateOptionalParameter);
+      });
       _ut.test('test_rethrowOutsideCatch', () {
         final __test = new CompileTimeErrorCodeTest();
         runJUnitTest(__test, __test.test_rethrowOutsideCatch);
       });
+      _ut.test('test_returnInGenerativeConstructor', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_returnInGenerativeConstructor);
+      });
       _ut.test('test_uriWithInterpolation_constant', () {
         final __test = new CompileTimeErrorCodeTest();
         runJUnitTest(__test, __test.test_uriWithInterpolation_constant);
@@ -3143,6 +3358,14 @@
         final __test = new CompileTimeErrorCodeTest();
         runJUnitTest(__test, __test.test_uriWithInterpolation_nonConstant);
       });
+      _ut.test('test_wrongNumberOfParametersForSetter_tooFew', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_wrongNumberOfParametersForSetter_tooFew);
+      });
+      _ut.test('test_wrongNumberOfParametersForSetter_tooMany', () {
+        final __test = new CompileTimeErrorCodeTest();
+        runJUnitTest(__test, __test.test_wrongNumberOfParametersForSetter_tooMany);
+      });
     });
   }
 }
@@ -3392,7 +3615,7 @@
     String label = "loop";
     LabelElementImpl labelElement = new LabelElementImpl(ASTFactory.identifier3(label), false, false);
     ContinueStatement statement = ASTFactory.continueStatement2(label);
-    JUnitTestCase.assertSame(labelElement, resolve2(statement, labelElement));
+    JUnitTestCase.assertSame(labelElement, resolve3(statement, labelElement));
     _listener.assertNoErrors();
   }
   void test_visitContinueStatement_withoutLabel() {
@@ -3406,6 +3629,16 @@
     resolveNode(directive, []);
     _listener.assertNoErrors();
   }
+  void test_visitFieldFormalParameter() {
+    InterfaceType intType2 = _typeProvider.intType;
+    String fieldName = "f";
+    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    classA.fields = <FieldElement> [ElementFactory.fieldElement(fieldName, false, false, false, intType2)];
+    FieldFormalParameter parameter = ASTFactory.fieldFormalParameter2(fieldName);
+    parameter.identifier.element = ElementFactory.fieldFormalParameter(parameter.identifier);
+    resolveInClass(parameter, classA);
+    JUnitTestCase.assertSame(intType2, parameter.element.type);
+  }
   void test_visitImportDirective_noCombinators_noPrefix() {
     ImportDirective directive = ASTFactory.importDirective2(null, null, []);
     directive.element = ElementFactory.importFor(ElementFactory.library(_definingLibrary.context, "lib"), null, []);
@@ -3429,7 +3662,7 @@
     SimpleIdentifier array = ASTFactory.identifier3("a");
     array.staticType = classA.type;
     IndexExpression expression = ASTFactory.indexExpression(array, ASTFactory.identifier3("i"));
-    JUnitTestCase.assertSame(getter, resolve4(expression, []));
+    JUnitTestCase.assertSame(getter, resolve5(expression, []));
     _listener.assertNoErrors();
   }
   void test_visitIndexExpression_set() {
@@ -3441,7 +3674,7 @@
     array.staticType = classA.type;
     IndexExpression expression = ASTFactory.indexExpression(array, ASTFactory.identifier3("i"));
     ASTFactory.assignmentExpression(expression, TokenType.EQ, ASTFactory.integer(0));
-    JUnitTestCase.assertSame(setter, resolve4(expression, []));
+    JUnitTestCase.assertSame(setter, resolve5(expression, []));
     _listener.assertNoErrors();
   }
   void test_visitInstanceCreationExpression_named() {
@@ -3605,7 +3838,7 @@
   void test_visitSimpleIdentifier_lexicalScope() {
     SimpleIdentifier node = ASTFactory.identifier3("i");
     VariableElementImpl element = ElementFactory.localVariableElement(node);
-    JUnitTestCase.assertSame(element, resolve3(node, [element]));
+    JUnitTestCase.assertSame(element, resolve4(node, [element]));
     _listener.assertNoErrors();
   }
   void test_visitSimpleIdentifier_lexicalScope_field_setter() {
@@ -3692,7 +3925,7 @@
    * @param labelElement the label element to be defined in the statement's label scope
    * @return the element to which the statement's label was resolved
    */
-  Element resolve2(ContinueStatement statement, LabelElementImpl labelElement) {
+  Element resolve3(ContinueStatement statement, LabelElementImpl labelElement) {
     resolveStatement(statement, labelElement);
     return statement.label.element;
   }
@@ -3704,7 +3937,7 @@
    * being resolved
    * @return the element to which the expression was resolved
    */
-  Element resolve3(Identifier node, List<Element> definedElements) {
+  Element resolve4(Identifier node, List<Element> definedElements) {
     resolveNode(node, definedElements);
     return node.element;
   }
@@ -3716,7 +3949,7 @@
    * being resolved
    * @return the element to which the expression was resolved
    */
-  Element resolve4(IndexExpression node, List<Element> definedElements) {
+  Element resolve5(IndexExpression node, List<Element> definedElements) {
     resolveNode(node, definedElements);
     return node.element;
   }
@@ -3836,6 +4069,10 @@
         final __test = new ElementResolverTest();
         runJUnitTest(__test, __test.test_visitExportDirective_noCombinators);
       });
+      _ut.test('test_visitFieldFormalParameter', () {
+        final __test = new ElementResolverTest();
+        runJUnitTest(__test, __test.test_visitFieldFormalParameter);
+      });
       _ut.test('test_visitImportDirective_noCombinators_noPrefix', () {
         final __test = new ElementResolverTest();
         runJUnitTest(__test, __test.test_visitImportDirective_noCombinators_noPrefix);
@@ -4015,316 +4252,335 @@
 }
 class StaticWarningCodeTest extends ResolverTestCase {
   void fail_argumentTypeNotAssignable() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]);
     verify([source]);
   }
   void fail_assignmentToFinal() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["final x = 0;", "f() { x = 1; }"]));
+    Source source = addSource(EngineTestCase.createSource(["final x = 0;", "f() { x = 1; }"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.ASSIGNMENT_TO_FINAL]);
     verify([source]);
   }
   void fail_caseBlockNotTerminated() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f(int p) {", "  switch (p) {", "    case 0:", "      f(p);", "    case 1:", "      break;", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f(int p) {", "  switch (p) {", "    case 0:", "      f(p);", "    case 1:", "      break;", "  }", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.CASE_BLOCK_NOT_TERMINATED]);
     verify([source]);
   }
   void fail_castToNonType() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["var A = 0;", "f(String s) { var x = s as A; }"]));
+    Source source = addSource(EngineTestCase.createSource(["var A = 0;", "f(String s) { var x = s as A; }"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.CAST_TO_NON_TYPE]);
     verify([source]);
   }
   void fail_commentReferenceConstructorNotVisible() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([StaticWarningCode.COMMENT_REFERENCE_CONSTRUCTOR_NOT_VISIBLE]);
     verify([source]);
   }
   void fail_commentReferenceIdentifierNotVisible() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([StaticWarningCode.COMMENT_REFERENCE_IDENTIFIER_NOT_VISIBLE]);
     verify([source]);
   }
   void fail_commentReferenceUndeclaredConstructor() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([StaticWarningCode.COMMENT_REFERENCE_UNDECLARED_CONSTRUCTOR]);
     verify([source]);
   }
   void fail_commentReferenceUndeclaredIdentifier() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([StaticWarningCode.COMMENT_REFERENCE_UNDECLARED_IDENTIFIER]);
     verify([source]);
   }
   void fail_commentReferenceUriNotLibrary() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([StaticWarningCode.COMMENT_REFERENCE_URI_NOT_LIBRARY]);
     verify([source]);
   }
-  void fail_concreteClassWithAbstractMember() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  m();", "}"]));
-    resolve(source, []);
-    assertErrors([StaticWarningCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER]);
-    verify([source]);
-  }
   void fail_conflictingInstanceGetterAndSuperclassMember() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER]);
     verify([source]);
   }
   void fail_conflictingInstanceSetterAndSuperclassMember() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([StaticWarningCode.CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER]);
     verify([source]);
   }
   void fail_conflictingStaticGetterAndInstanceSetter() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  static get x -> 0;", "  set x(int p) {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  static get x -> 0;", "  set x(int p) {}", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER]);
     verify([source]);
   }
   void fail_conflictingStaticSetterAndInstanceGetter() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  get x -> 0;", "  static set x(int p) {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  get x -> 0;", "  static set x(int p) {}", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.CONFLICTING_STATIC_SETTER_AND_INSTANCE_GETTER]);
     verify([source]);
   }
-  void fail_fieldInitializerWithInvalidType() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int x;", "  A(String this.x) {}", "}"]));
-    resolve(source, []);
-    assertErrors([StaticWarningCode.FIELD_INITIALIZER_WITH_INVALID_TYPE]);
-    verify([source]);
-  }
   void fail_incorrectNumberOfArguments_tooFew() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f(a, b) -> 0;", "g() {", "  f(2);", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f(a, b) -> 0;", "g() {", "  f(2);", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.INCORRECT_NUMBER_OF_ARGUMENTS]);
     verify([source]);
   }
   void fail_incorrectNumberOfArguments_tooMany() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f(a, b) -> 0;", "g() {", "  f(2, 3, 4);", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f(a, b) -> 0;", "g() {", "  f(2, 3, 4);", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.INCORRECT_NUMBER_OF_ARGUMENTS]);
     verify([source]);
   }
   void fail_instanceMethodNameCollidesWithSuperclassStatic() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  static n", "}", "class C extends A {", "  void n() {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  static n", "}", "class C extends A {", "  void n() {}", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC]);
     verify([source]);
   }
   void fail_invalidFactoryName() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([StaticWarningCode.INVALID_FACTORY_NAME]);
     verify([source]);
   }
   void fail_invalidOverrideGetterType() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int get g -> 0", "}", "class B extends A {", "  String get g { return 'a'; }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  int get g -> 0", "}", "class B extends A {", "  String get g { return 'a'; }", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.INVALID_OVERRIDE_GETTER_TYPE]);
     verify([source]);
   }
   void fail_invalidOverrideReturnType() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int m() { return 0; }", "}", "class B extends A {", "  String m() { return 'a'; }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  int m() { return 0; }", "}", "class B extends A {", "  String m() { return 'a'; }", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.INVALID_OVERRIDE_RETURN_TYPE]);
     verify([source]);
   }
   void fail_invalidOverrideSetterReturnType() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  void set s(int v) {}", "}", "class B extends A {", "  void set s(String v) {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  void set s(int v) {}", "}", "class B extends A {", "  void set s(String v) {}", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.INVALID_OVERRIDE_SETTER_RETURN_TYPE]);
     verify([source]);
   }
   void fail_invocationOfNonFunction() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([StaticWarningCode.INVOCATION_OF_NON_FUNCTION]);
     verify([source]);
   }
   void fail_mismatchedGetterAndSetterTypes() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int get g { return 0; }", "  set g(String v) {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  int get g { return 0; }", "  set g(String v) {}", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES]);
     verify([source]);
   }
   void fail_newWithNonType() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["var A = 0;", "void f() {", "  A a = new A();", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["var A = 0;", "void f() {", "  A a = new A();", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.NEW_WITH_NON_TYPE]);
     verify([source]);
   }
   void fail_newWithUndefinedConstructor() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  A(int p) {}", "}", "A f() {", "  return new A();", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  A(int p) {}", "}", "A f() {", "  return new A();", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR]);
     verify([source]);
   }
   void fail_nonAbstractClassInheritsAbstractMember() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class I {", "  m(p) {}", "}", "class C implements I {", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class I {", "  m(p) {}", "}", "class C implements I {", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER]);
     verify([source]);
   }
   void fail_nonAbstractClassInheritsAbstractMethod() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["abstract class A {", "  m(p);", "}", "class C extends A {", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["abstract class A {", "  m(p);", "}", "class C extends A {", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_METHOD]);
     verify([source]);
   }
   void fail_nonType() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["var A = 0;", "f(var p) {", "  if (p is A) {", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["var A = 0;", "f(var p) {", "  if (p is A) {", "  }", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.NON_TYPE]);
     verify([source]);
   }
   void fail_nonTypeInCatchClause() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["var T = 0;", "f(var p) {", "  try {", "  } on T catch e {", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["var T = 0;", "f(var p) {", "  try {", "  } on T catch e {", "  }", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.NON_TYPE_IN_CATCH_CLAUSE]);
     verify([source]);
   }
   void fail_nonVoidReturnForOperator() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int operator []=() {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  int operator []=() {}", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.NON_VOID_RETURN_FOR_OPERATOR]);
     verify([source]);
   }
   void fail_nonVoidReturnForSetter() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["int set x(int v) {", "  var s = x;", "  x = v;", "  return s;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["int set x(int v) {", "  var s = x;", "  x = v;", "  return s;", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.NON_VOID_RETURN_FOR_SETTER]);
     verify([source]);
   }
   void fail_overrideNotSubtype() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int m() {}", "}", "class B extends A {", "  String m() {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  int m() {}", "}", "class B extends A {", "  String m() {}", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.OVERRIDE_NOT_SUBTYPE]);
     verify([source]);
   }
   void fail_overrideWithDifferentDefault() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  m([int p = 0]) {}", "}", "class B extends A {", "  m([int p = 1]) {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  m([int p = 0]) {}", "}", "class B extends A {", "  m([int p = 1]) {}", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.OVERRIDE_WITH_DIFFERENT_DEFAULT]);
     verify([source]);
   }
   void fail_redirectToInvalidReturnType() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([StaticWarningCode.REDIRECT_TO_INVALID_RETURN_TYPE]);
     verify([source]);
   }
   void fail_redirectToMissingConstructor() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([StaticWarningCode.REDIRECT_TO_MISSING_CONSTRUCTOR]);
     verify([source]);
   }
   void fail_redirectToNonClass() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([StaticWarningCode.REDIRECT_TO_NON_CLASS]);
     verify([source]);
   }
-  void fail_returnWithoutValue() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["int f() { return; }"]));
-    resolve(source, []);
-    assertErrors([StaticWarningCode.RETURN_WITHOUT_VALUE]);
-    verify([source]);
-  }
   void fail_switchExpressionNotAssignable() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f(int p) {", "  switch (p) {", "    case 'a': break;", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f(int p) {", "  switch (p) {", "    case 'a': break;", "  }", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.SWITCH_EXPRESSION_NOT_ASSIGNABLE]);
     verify([source]);
   }
   void fail_undefinedGetter() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource([]));
+    Source source = addSource(EngineTestCase.createSource([]));
     resolve(source, []);
     assertErrors([StaticWarningCode.UNDEFINED_GETTER]);
     verify([source]);
   }
   void fail_undefinedIdentifier_function() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["int a() -> b;"]));
+    Source source = addSource(EngineTestCase.createSource(["int 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;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class C {}", "f(var p) {", "  C.m = 0;", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.UNDEFINED_SETTER]);
     verify([source]);
   }
   void fail_undefinedStaticMethodOrGetter_getter() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class C {}", "f(var p) {", "  f(C.m);", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class C {}", "f(var p) {", "  f(C.m);", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.UNDEFINED_STATIC_METHOD_OR_GETTER]);
     verify([source]);
   }
   void fail_undefinedStaticMethodOrGetter_method() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class C {}", "f(var p) {", "  f(C.m());", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class C {}", "f(var p) {", "  f(C.m());", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.UNDEFINED_STATIC_METHOD_OR_GETTER]);
     verify([source]);
   }
+  void test_concreteClassWithAbstractMember() {
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  m();", "}"]));
+    resolve(source, []);
+    assertErrors([StaticWarningCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER]);
+    verify([source]);
+  }
   void test_constWithAbstractClass() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["abstract class A {", "  const A() {}", "}", "void f() {", "  A a = const A();", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["abstract class A {", "  const A() {}", "}", "void f() {", "  A a = const A();", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.CONST_WITH_ABSTRACT_CLASS]);
     verify([source]);
   }
   void test_equalKeysInMap() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["var m = {'a' : 0, 'b' : 1, 'a' : 2};"]));
+    Source source = addSource(EngineTestCase.createSource(["var m = {'a' : 0, 'b' : 1, 'a' : 2};"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.EQUAL_KEYS_IN_MAP]);
     verify([source]);
   }
+  void test_fieldInitializerWithInvalidType() {
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  int x;", "  A(String this.x) {}", "}"]));
+    resolve(source, []);
+    assertErrors([StaticWarningCode.FIELD_INITIALIZER_WITH_INVALID_TYPE]);
+    verify([source]);
+  }
   void test_newWithAbstractClass() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["abstract class A {}", "void f() {", "  A a = new A();", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["abstract class A {}", "void f() {", "  A a = new A();", "}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.NEW_WITH_ABSTRACT_CLASS]);
     verify([source]);
   }
   void test_partOfDifferentLibrary() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["library lib;", "part 'part.dart';"]));
-    addSource("/part.dart", EngineTestCase.createSource(["part of lub;"]));
+    Source source = addSource(EngineTestCase.createSource(["library lib;", "part 'part.dart';"]));
+    addSource2("/part.dart", EngineTestCase.createSource(["part of lub;"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.PART_OF_DIFFERENT_LIBRARY]);
     verify([source]);
   }
+  void test_returnWithoutValue() {
+    Source source = addSource(EngineTestCase.createSource(["int f() { return; }"]));
+    resolve(source, []);
+    assertErrors([StaticWarningCode.RETURN_WITHOUT_VALUE]);
+    verify([source]);
+  }
   void test_undefinedClass_instanceCreation() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() { new C(); }"]));
+    Source source = addSource(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; }"]));
+    Source source = addSource(EngineTestCase.createSource(["f() { C c; }"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.UNDEFINED_CLASS]);
   }
+  void test_undefinedClassBoolean_variableDeclaration() {
+    Source source = addSource(EngineTestCase.createSource(["f() { boolean v; }"]));
+    resolve(source, []);
+    assertErrors([StaticWarningCode.UNDEFINED_CLASS_BOOLEAN]);
+  }
+  void test_undefinedIdentifier_commentReference() {
+    Source source = addSource(EngineTestCase.createSource(["/** [m] xxx [new B.c] */", "class A {", "}"]));
+    resolve(source, []);
+    assertErrors([StaticWarningCode.UNDEFINED_IDENTIFIER, StaticWarningCode.UNDEFINED_IDENTIFIER]);
+  }
   void test_undefinedIdentifier_initializer() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["var a = b;"]));
+    Source source = addSource(EngineTestCase.createSource(["var a = b;"]));
+    resolve(source, []);
+    assertErrors([StaticWarningCode.UNDEFINED_IDENTIFIER]);
+  }
+  void test_undefinedIdentifier_metadata() {
+    Source source = addSource(EngineTestCase.createSource(["@undefined class A {}"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.UNDEFINED_IDENTIFIER]);
   }
   void test_undefinedIdentifier_methodInvocation() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() { C.m(); }"]));
+    Source source = addSource(EngineTestCase.createSource(["f() { C.m(); }"]));
     resolve(source, []);
     assertErrors([StaticWarningCode.UNDEFINED_IDENTIFIER]);
   }
   static dartSuite() {
     _ut.group('StaticWarningCodeTest', () {
+      _ut.test('test_concreteClassWithAbstractMember', () {
+        final __test = new StaticWarningCodeTest();
+        runJUnitTest(__test, __test.test_concreteClassWithAbstractMember);
+      });
       _ut.test('test_constWithAbstractClass', () {
         final __test = new StaticWarningCodeTest();
         runJUnitTest(__test, __test.test_constWithAbstractClass);
@@ -4333,6 +4589,10 @@
         final __test = new StaticWarningCodeTest();
         runJUnitTest(__test, __test.test_equalKeysInMap);
       });
+      _ut.test('test_fieldInitializerWithInvalidType', () {
+        final __test = new StaticWarningCodeTest();
+        runJUnitTest(__test, __test.test_fieldInitializerWithInvalidType);
+      });
       _ut.test('test_newWithAbstractClass', () {
         final __test = new StaticWarningCodeTest();
         runJUnitTest(__test, __test.test_newWithAbstractClass);
@@ -4341,6 +4601,14 @@
         final __test = new StaticWarningCodeTest();
         runJUnitTest(__test, __test.test_partOfDifferentLibrary);
       });
+      _ut.test('test_returnWithoutValue', () {
+        final __test = new StaticWarningCodeTest();
+        runJUnitTest(__test, __test.test_returnWithoutValue);
+      });
+      _ut.test('test_undefinedClassBoolean_variableDeclaration', () {
+        final __test = new StaticWarningCodeTest();
+        runJUnitTest(__test, __test.test_undefinedClassBoolean_variableDeclaration);
+      });
       _ut.test('test_undefinedClass_instanceCreation', () {
         final __test = new StaticWarningCodeTest();
         runJUnitTest(__test, __test.test_undefinedClass_instanceCreation);
@@ -4349,10 +4617,18 @@
         final __test = new StaticWarningCodeTest();
         runJUnitTest(__test, __test.test_undefinedClass_variableDeclaration);
       });
+      _ut.test('test_undefinedIdentifier_commentReference', () {
+        final __test = new StaticWarningCodeTest();
+        runJUnitTest(__test, __test.test_undefinedIdentifier_commentReference);
+      });
       _ut.test('test_undefinedIdentifier_initializer', () {
         final __test = new StaticWarningCodeTest();
         runJUnitTest(__test, __test.test_undefinedIdentifier_initializer);
       });
+      _ut.test('test_undefinedIdentifier_metadata', () {
+        final __test = new StaticWarningCodeTest();
+        runJUnitTest(__test, __test.test_undefinedIdentifier_metadata);
+      });
       _ut.test('test_undefinedIdentifier_methodInvocation', () {
         final __test = new StaticWarningCodeTest();
         runJUnitTest(__test, __test.test_undefinedIdentifier_methodInvocation);
@@ -4362,13 +4638,13 @@
 }
 class ErrorResolverTest extends ResolverTestCase {
   void test_breakLabelOnSwitchMember() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  void m(int i) {", "    switch (i) {", "      l: case 0:", "        break;", "      case 1:", "        break l;", "    }", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  void m(int i) {", "    switch (i) {", "      l: case 0:", "        break;", "      case 1:", "        break l;", "    }", "  }", "}"]));
     resolve(source, []);
     assertErrors([ResolverErrorCode.BREAK_LABEL_ON_SWITCH_MEMBER]);
     verify([source]);
   }
   void test_continueLabelOnSwitch() {
-    Source source = addSource("/a.dart", EngineTestCase.createSource(["class A {", "  void m(int i) {", "    l: switch (i) {", "      case 0:", "        continue l;", "    }", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  void m(int i) {", "    l: switch (i) {", "      case 0:", "        continue l;", "    }", "  }", "}"]));
     resolve(source, []);
     assertErrors([ResolverErrorCode.CONTINUE_LABEL_ON_SWITCH]);
     verify([source]);
@@ -4416,6 +4692,14 @@
    */
   InterfaceType _intType;
   /**
+   * The type representing the built-in type 'Iterable'.
+   */
+  InterfaceType _iterableType;
+  /**
+   * The type representing the built-in type 'Iterator'.
+   */
+  InterfaceType _iteratorType;
+  /**
    * The type representing the built-in type 'List'.
    */
   InterfaceType _listType;
@@ -4485,12 +4769,31 @@
     }
     return _intType;
   }
+  InterfaceType get iterableType {
+    if (_iterableType == null) {
+      ClassElementImpl iterableElement = ElementFactory.classElement2("Iterable", ["E"]);
+      _iterableType = iterableElement.type;
+      Type2 eType = iterableElement.typeVariables[0].type;
+      iterableElement.accessors = <PropertyAccessorElement> [ElementFactory.getterElement("iterator", false, iteratorType.substitute5(<Type2> [eType])), ElementFactory.getterElement("last", false, eType)];
+    }
+    return _iterableType;
+  }
+  InterfaceType get iteratorType {
+    if (_iteratorType == null) {
+      ClassElementImpl iteratorElement = ElementFactory.classElement2("Iterator", ["E"]);
+      _iteratorType = iteratorElement.type;
+      Type2 eType = iteratorElement.typeVariables[0].type;
+      iteratorElement.accessors = <PropertyAccessorElement> [ElementFactory.getterElement("current", false, eType)];
+    }
+    return _iteratorType;
+  }
   InterfaceType get listType {
     if (_listType == null) {
       ClassElementImpl listElement = ElementFactory.classElement2("List", ["E"]);
       _listType = listElement.type;
       Type2 eType = listElement.typeVariables[0].type;
-      listElement.accessors = <PropertyAccessorElement> [ElementFactory.getterElement("last", false, eType)];
+      InterfaceType supertype = iterableType.substitute5(<Type2> [eType]);
+      listElement.supertype = supertype;
       listElement.methods = <MethodElement> [ElementFactory.methodElement("[]", eType, [_intType]), ElementFactory.methodElement("[]=", VoidTypeImpl.instance, [_intType, eType])];
     }
     return _listType;
@@ -4528,7 +4831,8 @@
     if (_stringType == null) {
       _stringType = ElementFactory.classElement2("String", []).type;
       ClassElementImpl stringElement = _stringType.element as ClassElementImpl;
-      stringElement.accessors = <PropertyAccessorElement> [ElementFactory.getterElement("length", false, intType)];
+      stringElement.accessors = <PropertyAccessorElement> [ElementFactory.getterElement("isEmpty", false, boolType), ElementFactory.getterElement("length", false, intType)];
+      stringElement.methods = <MethodElement> [ElementFactory.methodElement("toLowerCase", _stringType, []), ElementFactory.methodElement("toUpperCase", _stringType, [])];
     }
     return _stringType;
   }
@@ -4574,18 +4878,19 @@
    * @return the analysis context that was created
    */
   static AnalysisContextImpl contextWithCore() {
-    AnalysisContextImpl context = new AnalysisContextImpl();
-    SourceFactory sourceFactory = new SourceFactory.con2([new DartUriResolver(DirectoryBasedDartSdk.defaultSdk), new FileUriResolver()]);
-    context.sourceFactory = sourceFactory;
+    AnalysisContextImpl sdkContext = DirectoryBasedDartSdk.defaultSdk.context as AnalysisContextImpl;
+    SourceFactory sourceFactory2 = sdkContext.sourceFactory;
     TestTypeProvider provider = new TestTypeProvider();
     CompilationUnitElementImpl coreUnit = new CompilationUnitElementImpl("core.dart");
-    Source coreSource = sourceFactory.forUri(DartSdk.DART_CORE);
+    Source coreSource = sourceFactory2.forUri(DartSdk.DART_CORE);
+    sdkContext.setContents(coreSource, "");
     coreUnit.source = coreSource;
     coreUnit.types = <ClassElement> [provider.boolType.element, provider.doubleType.element, provider.functionType.element, provider.intType.element, provider.listType.element, provider.mapType.element, provider.numType.element, provider.objectType.element, provider.stackTraceType.element, provider.stringType.element, provider.typeType.element];
-    LibraryElementImpl coreLibrary = new LibraryElementImpl(context, ASTFactory.libraryIdentifier2(["dart", "core"]));
+    LibraryElementImpl coreLibrary = new LibraryElementImpl(sdkContext, ASTFactory.libraryIdentifier2(["dart", "core"]));
     coreLibrary.definingCompilationUnit = coreUnit;
     CompilationUnitElementImpl htmlUnit = new CompilationUnitElementImpl("html_dartium.dart");
-    Source htmlSource = sourceFactory.forUri(DartSdk.DART_HTML);
+    Source htmlSource = sourceFactory2.forUri(DartSdk.DART_HTML);
+    sdkContext.setContents(htmlSource, "");
     htmlUnit.source = htmlSource;
     ClassElementImpl elementElement = ElementFactory.classElement2("Element", []);
     InterfaceType elementType = elementElement.type;
@@ -4597,14 +4902,15 @@
     TopLevelVariableElementImpl document = ElementFactory.topLevelVariableElement2("document");
     document.type = htmlDocumentElement.type;
     htmlUnit.topLevelVariables = <TopLevelVariableElement> [document];
-    LibraryElementImpl htmlLibrary = new LibraryElementImpl(context, ASTFactory.libraryIdentifier2(["dart", "dom", "html"]));
+    LibraryElementImpl htmlLibrary = new LibraryElementImpl(sdkContext, ASTFactory.libraryIdentifier2(["dart", "dom", "html"]));
     htmlLibrary.definingCompilationUnit = htmlUnit;
     Map<Source, LibraryElement> elementMap = new Map<Source, LibraryElement>();
     elementMap[coreSource] = coreLibrary;
     elementMap[htmlSource] = htmlLibrary;
-    context.setContents(coreSource, "");
-    context.setContents(htmlSource, "");
-    context.recordLibraryElements(elementMap);
+    sdkContext.recordLibraryElements(elementMap);
+    AnalysisContextImpl context = new DelegatingAnalysisContextImpl();
+    sourceFactory2 = new SourceFactory.con2([new DartUriResolver(sdkContext.sourceFactory.dartSdk), new FileUriResolver()]);
+    context.sourceFactory = sourceFactory2;
     return context;
   }
   /**
@@ -4726,10 +5032,10 @@
    * structures that are expected to have been resolved have an element associated with them.
    */
   ResolutionVerifier() {
-    _jtd_constructor_349_impl();
+    _jtd_constructor_351_impl();
   }
-  _jtd_constructor_349_impl() {
-    _jtd_constructor_350_impl(null);
+  _jtd_constructor_351_impl() {
+    _jtd_constructor_352_impl(null);
   }
   /**
    * Initialize a newly created verifier to verify that all of the identifiers in the visited AST
@@ -4740,9 +5046,9 @@
    * therefore not cause the test to fail
    */
   ResolutionVerifier.con1(Set<ASTNode> knownExceptions2) {
-    _jtd_constructor_350_impl(knownExceptions2);
+    _jtd_constructor_352_impl(knownExceptions2);
   }
-  _jtd_constructor_350_impl(Set<ASTNode> knownExceptions2) {
+  _jtd_constructor_352_impl(Set<ASTNode> knownExceptions2) {
     this._knownExceptions = knownExceptions2;
   }
   /**
@@ -6165,86 +6471,110 @@
 }
 class SimpleResolverTest extends ResolverTestCase {
   void fail_staticInvocation() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  static int get g => (a,b) => 0;", "}", "class B {", "  f() {", "    A.g(1,0);", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  static int get g => (a,b) => 0;", "}", "class B {", "  f() {", "    A.g(1,0);", "  }", "}"]));
     resolve(source, []);
     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);", "}"]));
+    Source source = addSource(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 {}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A extends B implements C {}", "class B {}", "class C {}"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_commentReference_class() {
+    Source source = addSource(EngineTestCase.createSource(["f() {}", "/** [A] [new A] [A.n] [new A.n] [m] [f] */", "class A {", "  A() {}", "  A.n() {}", "  m() {}", "}"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_commentReference_parameter() {
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  A() {}", "  A.n() {}", "  /** [e] [f] */", "  m(e, f()) {}", "}"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
+  void test_commentReference_singleLine() {
+    Source source = addSource(EngineTestCase.createSource(["/// [A]", "class A {}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_empty() {
-    Source source = addSource("/test.dart", "");
+    Source source = addSource("");
     resolve(source, []);
     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]) {}", "}"]));
+    Source source = addSource(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_fieldFormalParameter() {
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  int x;", "  A(this.x) {}", "}"]));
     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) {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f() {", "  List list = [1,2,3];", "  for (int x in list) {}", "  for (int x in list) {}", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_forLoops_nonConflicting() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  for (int i = 0; i < 3; i++) {", "  }", "  for (int i = 0; i < 3; i++) {", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f() {", "  for (int i = 0; i < 3; i++) {", "  }", "  for (int i = 0; i < 3; i++) {", "  }", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_functionTypeAlias() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["typedef bool P(e);", "class A {", "  P p;", "  m(e) {", "    if (p(e)) {}", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["typedef bool P(e);", "class A {", "  P p;", "  m(e) {", "    if (p(e)) {}", "  }", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_getterAndSetterWithDifferentTypes() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  int get f => 0;", "  void set f(String s) {}", "}", "g (A a) {", "  a.f = a.f.toString();", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  int get f => 0;", "  void set f(String s) {}", "}", "g (A a) {", "  a.f = a.f.toString();", "}"]));
     resolve(source, []);
     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);", "}"]));
+    addSource2("/two.dart", EngineTestCase.createSource(["library two;", "f(int x) {", "  return x * x;", "}"]));
+    Source source = addSource2("/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];", "}"]));
+    Source source = addSource(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, []);
     assertNoErrors();
     verify([source]);
   }
   void test_indexExpression_typeParameters_invalidAssignmentWarning() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f() {", "  List<List<int>> b;", "  b[0][0] = 'hi';", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f() {", "  List<List<int>> b;", "  b[0][0] = 'hi';", "}"]));
     resolve(source, []);
     assertErrors([StaticTypeWarningCode.INVALID_ASSIGNMENT]);
     verify([source]);
   }
   void test_invoke_dynamicThroughGetter() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  List get X => [() => 0];", "  m(A a) {", "    X.last();", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  List get X => [() => 0];", "  m(A a) {", "    X.last;", "  }", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_isValidMixin_badSuperclass() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A extends B {}", "class B {}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A extends B {}", "class B {}"]));
     LibraryElement library = resolve(source, []);
     JUnitTestCase.assertNotNull(library);
     CompilationUnitElement unit = library.definingCompilationUnit;
@@ -6256,7 +6586,7 @@
     verify([source]);
   }
   void test_isValidMixin_constructor() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  A() {}", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  A() {}", "}"]));
     LibraryElement library = resolve(source, []);
     JUnitTestCase.assertNotNull(library);
     CompilationUnitElement unit = library.definingCompilationUnit;
@@ -6268,7 +6598,7 @@
     verify([source]);
   }
   void test_isValidMixin_super() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  toString() {", "    return super.toString();", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  toString() {", "    return super.toString();", "  }", "}"]));
     LibraryElement library = resolve(source, []);
     JUnitTestCase.assertNotNull(library);
     CompilationUnitElement unit = library.definingCompilationUnit;
@@ -6280,7 +6610,7 @@
     verify([source]);
   }
   void test_isValidMixin_valid() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {}"]));
     LibraryElement library = resolve(source, []);
     JUnitTestCase.assertNotNull(library);
     CompilationUnitElement unit = library.definingCompilationUnit;
@@ -6291,20 +6621,26 @@
     assertNoErrors();
     verify([source]);
   }
+  void test_method_fromSuperclassMixin() {
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  void m1() {}", "}", "class B with A {", "}", "class C extends B {", "}", "f(C c) {", "  c.m1()", "}"]));
+    resolve(source, []);
+    assertNoErrors();
+    verify([source]);
+  }
   void test_methodCascades() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  void m1() {}", "  void m2() {}", "  void m() {", "    A a = new A();", "    a..m1()", "     ..m2();", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  void m1() {}", "  void m2() {}", "  void m() {", "    A a = new A();", "    a..m1()", "     ..m2();", "  }", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_methodCascades_withSetter() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["class A {", "  String name;", "  void m1() {}", "  void m2() {}", "  void m() {", "    A a = new A();", "    a..m1()", "     ..name = 'name'", "     ..m2();", "  }", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["class A {", "  String name;", "  void m1() {}", "  void m2() {}", "  void m() {", "    A a = new A();", "    a..m1()", "     ..name = 'name'", "     ..m2();", "  }", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
   }
   void test_resolveAgainstNull() {
-    Source source = addSource("/test.dart", EngineTestCase.createSource(["f(var p) {", "  return null == p;", "}"]));
+    Source source = addSource(EngineTestCase.createSource(["f(var p) {", "  return null == p;", "}"]));
     resolve(source, []);
     assertNoErrors();
     verify([source]);
@@ -6319,6 +6655,18 @@
         final __test = new SimpleResolverTest();
         runJUnitTest(__test, __test.test_class_extends_implements);
       });
+      _ut.test('test_commentReference_class', () {
+        final __test = new SimpleResolverTest();
+        runJUnitTest(__test, __test.test_commentReference_class);
+      });
+      _ut.test('test_commentReference_parameter', () {
+        final __test = new SimpleResolverTest();
+        runJUnitTest(__test, __test.test_commentReference_parameter);
+      });
+      _ut.test('test_commentReference_singleLine', () {
+        final __test = new SimpleResolverTest();
+        runJUnitTest(__test, __test.test_commentReference_singleLine);
+      });
       _ut.test('test_empty', () {
         final __test = new SimpleResolverTest();
         runJUnitTest(__test, __test.test_empty);
@@ -6327,6 +6675,10 @@
         final __test = new SimpleResolverTest();
         runJUnitTest(__test, __test.test_extractedMethodAsConstant);
       });
+      _ut.test('test_fieldFormalParameter', () {
+        final __test = new SimpleResolverTest();
+        runJUnitTest(__test, __test.test_fieldFormalParameter);
+      });
       _ut.test('test_forEachLoops_nonConflicting', () {
         final __test = new SimpleResolverTest();
         runJUnitTest(__test, __test.test_forEachLoops_nonConflicting);
@@ -6383,6 +6735,10 @@
         final __test = new SimpleResolverTest();
         runJUnitTest(__test, __test.test_methodCascades_withSetter);
       });
+      _ut.test('test_method_fromSuperclassMixin', () {
+        final __test = new SimpleResolverTest();
+        runJUnitTest(__test, __test.test_method_fromSuperclassMixin);
+      });
       _ut.test('test_resolveAgainstNull', () {
         final __test = new SimpleResolverTest();
         runJUnitTest(__test, __test.test_resolveAgainstNull);
diff --git a/pkg/analyzer_experimental/test/generated/test_support.dart b/pkg/analyzer_experimental/test/generated/test_support.dart
index 6e85ac9..c666db1 100644
--- a/pkg/analyzer_experimental/test/generated/test_support.dart
+++ b/pkg/analyzer_experimental/test/generated/test_support.dart
@@ -45,17 +45,17 @@
    * Initialize a newly created error listener to collect errors.
    */
   GatheringErrorListener() : super() {
-    _jtd_constructor_347_impl();
+    _jtd_constructor_349_impl();
   }
-  _jtd_constructor_347_impl() {
+  _jtd_constructor_349_impl() {
   }
   /**
    * Initialize a newly created error listener to collect errors.
    */
   GatheringErrorListener.con1(String rawSource2) {
-    _jtd_constructor_348_impl(rawSource2);
+    _jtd_constructor_350_impl(rawSource2);
   }
-  _jtd_constructor_348_impl(String rawSource2) {
+  _jtd_constructor_350_impl(String rawSource2) {
     this._rawSource = rawSource2;
     this._markedSource = rawSource2;
   }
@@ -259,14 +259,14 @@
    * @param secondError the second error being compared
    * @return {@code true} if the two errors are equivalent
    */
-  bool equals(AnalysisError firstError, AnalysisError secondError) => identical(firstError.errorCode, secondError.errorCode) && firstError.offset == secondError.offset && firstError.length == secondError.length && equals3(firstError.source, secondError.source);
+  bool equals3(AnalysisError firstError, AnalysisError secondError) => identical(firstError.errorCode, secondError.errorCode) && firstError.offset == secondError.offset && firstError.length == secondError.length && equals4(firstError.source, secondError.source);
   /**
    * Return {@code true} if the two sources are equivalent.
    * @param firstSource the first source being compared
    * @param secondSource the second source being compared
    * @return {@code true} if the two sources are equivalent
    */
-  bool equals3(Source firstSource, Source secondSource) {
+  bool equals4(Source firstSource, Source secondSource) {
     if (firstSource == null) {
       return secondSource == null;
     } else if (secondSource == null) {
@@ -325,7 +325,7 @@
    */
   bool foundAndRemoved(List<AnalysisError> errors, AnalysisError targetError) {
     for (AnalysisError error in errors) {
-      if (equals(error, targetError)) {
+      if (equals3(error, targetError)) {
         errors.remove(error);
         return true;
       }
@@ -672,7 +672,7 @@
 }
 
 /**
- * Wrapper around [Function] which should be called with [target] and [arguments].
+ * Wrapper around [Function] which should be called with "target" and "arguments".
  */
 class MethodTrampoline {
   int parameterCount;
diff --git a/pkg/intl/lib/date_format.dart b/pkg/intl/lib/date_format.dart
index bfc9244..d12b6fa 100644
--- a/pkg/intl/lib/date_format.dart
+++ b/pkg/intl/lib/date_format.dart
@@ -105,7 +105,7 @@
  *      new DateFormat("yMd")            -> 07/10/1996
  *      new DateFormat.yMMMMd("en_US")   -> July 10, 1996
  *      new DateFormat("Hm", "en_US")    -> 12:08 PM
- *      new DateFormat.yMd().Hm()        -> 07/10/1996 12:08 PM
+ *      new DateFormat.yMd().add_Hm()        -> 07/10/1996 12:08 PM
  *
  * Explicit Pattern Syntax: Formats can also be specified with a pattern string.
  * The skeleton forms will resolve to explicit patterns of this form, but will
diff --git a/pkg/intl/lib/number_format.dart b/pkg/intl/lib/number_format.dart
index 3f642ca..c8816d8 100644
--- a/pkg/intl/lib/number_format.dart
+++ b/pkg/intl/lib/number_format.dart
@@ -8,18 +8,18 @@
  * format is specified as a pattern using a subset of the ICU formatting
  * patterns.
  *
- * 0 - A single digit
- * # - A single digit, omitted if the value is zero
- * . - Decimal separator
- * - - Minus sign
- * , - Grouping separator
- * E - Separates mantissa and expontent
- * + - Before an exponent, indicates it should be prefixed with a plus sign.
- * % - In prefix or suffix, multiply by 100 and show as percentage
- * \u2030 - In prefix or suffix, multiply by 1000 and show as per mille
- * \u00A4 - Currency sign, replaced by currency name
- * ' - Used to quote special characters
- * ; - Used to separate the positive and negative patterns if both are present
+ * - `0` A single digit
+ * - `#` A single digit, omitted if the value is zero
+ * - `.` Decimal separator
+ * - `-` Minus sign
+ * - `,` Grouping separator
+ * - `E` Separates mantissa and expontent
+ * - `+` - Before an exponent, indicates it should be prefixed with a plus sign.
+ * - `%` - In prefix or suffix, multiply by 100 and show as percentage
+ * - `‰ (\u2030)` In prefix or suffix, multiply by 1000 and show as per mille
+ * - `¤ (\u00A4)` Currency sign, replaced by currency name
+ * - `'` Used to quote special characters
+ * - `;` Used to separate the positive and negative patterns if both are present
  *
  * For example,
  *       var f = new NumberFormat("###.0#", "en_US");
@@ -32,7 +32,7 @@
  * There are also standard patterns available via the special constructors. e.g.
  *       var symbols = new NumberFormat.percentFormat("ar");
  * There are four such constructors: decimalFormat, percentFormat,
- * scientificFormat and currencyForamt. However, at the moment,
+ * scientificFormat and currencyFormat. However, at the moment,
  * scientificFormat prints only as equivalent to "#E0" and does not take
  * into account significant digits. currencyFormat will always use the name
  * of the currency rather than the symbol.
@@ -55,11 +55,11 @@
   bool _useSignForPositiveExponent = false;
   bool _useExponentialNotation = false;
 
-  int _maximumIntegerDigits = 40;
-  int _minimumIntegerDigits = 1;
-  int _maximumFractionDigits = 3;
-  int _minimumFractionDigits = 0;
-  int _minimumExponentDigits = 0;
+  int maximumIntegerDigits = 40;
+  int minimumIntegerDigits = 1;
+  int maximumFractionDigits = 3;
+  int minimumFractionDigits = 0;
+  int minimumExponentDigits = 0;
 
   int _multiplier = 1;
 
@@ -68,41 +68,6 @@
    * is helpful in debugging.
    */
   String _pattern;
-  /**
-   * Set the maximum digits printed to the left of the decimal point.
-   * Normally this is computed from the pattern, but it's exposed here for
-   * testing purposes and for rare cases where you want to force it explicitly.
-   */
-  void setMaximumIntegerDigits(int max) {
-    _maximumIntegerDigits = max;
-  }
-
-  /**
-   * Set the minimum number of digits printed to the left of the decimal point.
-   * Normally this is computed from the pattern, but it's exposed here for
-   * testing purposes and for rare cases where you want to force it explicitly.
-   */
-  void setMinimumIntegerDigits(int min) {
-    _minimumIntegerDigits = min;
-  }
-
-  /**
-   * Set the maximum number of digits printed to the right of the decimal point.
-   * Normally this is computed from the pattern, but it's exposed here for
-   * testing purposes and for rare cases where you want to force it explicitly.
-   */
-  void setMaximumFractionDigits(int max) {
-    _maximumFractionDigits = max;
-  }
-
-  /**
-   * Set the minimum digits printed to the left of the decimal point.
-   * Normally this is computed from the pattern, but it's exposed here for
-   * testing purposes and for rare cases where you want to force it explicitly.
-   */
-  void setMinimumFractionDigits(int max) {
-    _minimumFractionDigits = max;
-  }
 
   /** The locale in which we print numbers. */
   final String _locale;
@@ -216,27 +181,27 @@
     var exponent = (log(number) / log(10)).floor();
     var mantissa = number / pow(10.0, exponent);
 
-    var minIntDigits = _minimumIntegerDigits;
-    if (_maximumIntegerDigits > 1 &&
-        _maximumIntegerDigits > _minimumIntegerDigits) {
+    var minIntDigits = minimumIntegerDigits;
+    if (maximumIntegerDigits > 1 &&
+        maximumIntegerDigits > minimumIntegerDigits) {
       // A repeating range is defined; adjust to it as follows.
       // If repeat == 3, we have 6,5,4=>3; 3,2,1=>0; 0,-1,-2=>-3;
       // -3,-4,-5=>-6, etc. This takes into account that the
       // exponent we have here is off by one from what we expect;
       // it is for the format 0.MMMMMx10^n.
-      while ((exponent % _maximumIntegerDigits) != 0) {
+      while ((exponent % maximumIntegerDigits) != 0) {
         mantissa *= 10;
         exponent--;
       }
       minIntDigits = 1;
     } else {
       // No repeating range is defined, use minimum integer digits.
-      if (_minimumIntegerDigits < 1) {
+      if (minimumIntegerDigits < 1) {
         exponent++;
         mantissa /= 10;
       } else {
-        exponent -= _minimumIntegerDigits - 1;
-        mantissa *= pow(10, _minimumIntegerDigits - 1);
+        exponent -= minimumIntegerDigits - 1;
+        mantissa *= pow(10, minimumIntegerDigits - 1);
       }
     }
     _formatFixed(mantissa);
@@ -254,7 +219,7 @@
     } else if (_useSignForPositiveExponent) {
       _add(symbols.PLUS_SIGN);
     }
-    _pad(_minimumExponentDigits, exponent.toString());
+    _pad(minimumExponentDigits, exponent.toString());
   }
 
   /** Used to test if we have exceeded Javascript integer limits. */
@@ -265,7 +230,7 @@
    */
   void _formatFixed(num number) {
     // Very fussy math to get integer and fractional parts.
-    var power = pow(10, _maximumFractionDigits);
+    var power = pow(10, maximumFractionDigits);
     var shiftedNumber = (number * power);
     // We must not roundToDouble() an int or it will lose precision. We must not
     // round() a large double or it will take its loss of precision and
@@ -283,7 +248,7 @@
       intValue = shiftedNumber.round() ~/ power;
       fracValue = (shiftedNumber - intValue * power).floor();
     }
-    var fractionPresent = _minimumFractionDigits > 0 || fracValue > 0;
+    var fractionPresent = minimumFractionDigits > 0 || fracValue > 0;
 
     // If the int part is larger than 2^52 and we're on Javascript (so it's
     // really a float) it will lose precision, so pad out the rest of it
@@ -301,7 +266,7 @@
     var digitLength = integerDigits.length;
 
     if (_hasPrintableIntegerPart(intValue)) {
-      _pad(_minimumIntegerDigits - digitLength);
+      _pad(minimumIntegerDigits - digitLength);
       for (var i = 0; i < digitLength; i++) {
         _addDigit(integerDigits[i]);
         _group(digitLength, i);
@@ -322,7 +287,7 @@
     var fractionCodes = fractionPart.codeUnits;
     var fractionLength = fractionPart.length;
     while(fractionCodes[fractionLength - 1] == _zero &&
-           fractionLength > _minimumFractionDigits + 1) {
+           fractionLength > minimumFractionDigits + 1) {
       fractionLength--;
     }
     for (var i = 1; i < fractionLength; i++) {
@@ -343,7 +308,7 @@
    * a minimum number of printable digits greater than 1.
    */
   bool _hasPrintableIntegerPart(int intValue) {
-    return intValue > 0 || _minimumIntegerDigits > 0;
+    return intValue > 0 || minimumIntegerDigits > 0;
   }
 
   /**
@@ -607,13 +572,13 @@
     }
     var totalDigits = digitLeftCount + zeroDigitCount + digitRightCount;
 
-    format._maximumFractionDigits =
+    format.maximumFractionDigits =
         decimalPos >= 0 ? totalDigits - decimalPos : 0;
     if (decimalPos >= 0) {
-      format._minimumFractionDigits =
+      format.minimumFractionDigits =
           digitLeftCount + zeroDigitCount - decimalPos;
-      if (format._minimumFractionDigits < 0) {
-        format._minimumFractionDigits = 0;
+      if (format.minimumFractionDigits < 0) {
+        format.minimumFractionDigits = 0;
       }
     }
 
@@ -621,15 +586,15 @@
     // if there is no decimal. Note that if decimalPos<0, then digitTotalCount
     // == digitLeftCount + zeroDigitCount.
     var effectiveDecimalPos = decimalPos >= 0 ? decimalPos : totalDigits;
-    format._minimumIntegerDigits = effectiveDecimalPos - digitLeftCount;
+    format.minimumIntegerDigits = effectiveDecimalPos - digitLeftCount;
     if (format._useExponentialNotation) {
-      format._maximumIntegerDigits =
-          digitLeftCount + format._minimumIntegerDigits;
+      format.maximumIntegerDigits =
+          digitLeftCount + format.minimumIntegerDigits;
 
       // In exponential display, we need to at least show something.
-      if (format._maximumFractionDigits == 0 &&
-          format._minimumIntegerDigits == 0) {
-        format._minimumIntegerDigits = 1;
+      if (format.maximumFractionDigits == 0 &&
+          format.minimumIntegerDigits == 0) {
+        format.minimumIntegerDigits = 1;
       }
     }
 
@@ -685,7 +650,7 @@
               'Multiple exponential symbols in pattern "$pattern"');
         }
         format._useExponentialNotation = true;
-        format._minimumExponentDigits = 0;
+        format.minimumExponentDigits = 0;
 
         // exponent pattern can have a optional '+'.
         pattern.moveNext();
@@ -701,11 +666,11 @@
         while (pattern.current == _PATTERN_ZERO_DIGIT) {
           trunk.write(pattern.current);
           pattern.moveNext();
-          format._minimumExponentDigits++;
+          format.minimumExponentDigits++;
         }
 
         if ((digitLeftCount + zeroDigitCount) < 1 ||
-            format._minimumExponentDigits < 1) {
+            format.minimumExponentDigits < 1) {
           throw new FormatException(
               'Malformed exponential pattern "$pattern"');
         }
diff --git a/pkg/intl/test/number_closure_test.dart b/pkg/intl/test/number_closure_test.dart
index 8574e08..5037b0e 100644
--- a/pkg/intl/test/number_closure_test.dart
+++ b/pkg/intl/test/number_closure_test.dart
@@ -90,20 +90,20 @@
 
 void testCustomPercentage() {
   var fmt = new NumberFormat.percentPattern();
-  fmt.setMaximumFractionDigits(1);
-  fmt.setMinimumFractionDigits(1);
+  fmt.maximumFractionDigits = 1;
+  fmt.minimumFractionDigits = 1;
   var str = fmt.format(0.1291);
   expect('12.9%', str);
-  fmt.setMaximumFractionDigits(2);
-  fmt.setMinimumFractionDigits(1);
+  fmt.maximumFractionDigits = 2;
+  fmt.minimumFractionDigits = 1;
   str = fmt.format(0.129);
   expect('12.9%', str);
-  fmt.setMaximumFractionDigits(2);
-  fmt.setMinimumFractionDigits(1);
+  fmt.maximumFractionDigits = 2;
+  fmt.minimumFractionDigits = 1;
   str = fmt.format(0.12);
   expect('12.0%', str);
-  fmt.setMaximumFractionDigits(2);
-  fmt.setMinimumFractionDigits(1);
+  fmt.maximumFractionDigits = 2;
+  fmt.minimumFractionDigits = 1;
   str = fmt.format(0.12911);
   expect('12.91%', str);
 }
diff --git a/pkg/pathos/lib/path.dart b/pkg/pathos/lib/path.dart
index 8d83077..80ffe72 100644
--- a/pkg/pathos/lib/path.dart
+++ b/pkg/pathos/lib/path.dart
@@ -40,7 +40,7 @@
 }
 
 /// Gets the path to the current working directory.
-String get current => new io.Directory.current().path;
+String get current => io.Directory.current.path;
 
 /// Gets the path separator for the current platform. On Mac and Linux, this
 /// is `/`. On Windows, it's `\`.
diff --git a/pkg/pathos/test/pathos_test.dart b/pkg/pathos/test/pathos_test.dart
index c820a47..2d56ee2 100644
--- a/pkg/pathos/test/pathos_test.dart
+++ b/pkg/pathos/test/pathos_test.dart
@@ -40,7 +40,7 @@
 
     test('uses the current working directory if root is omitted', () {
       var builder = new path.Builder();
-      expect(builder.root, new io.Directory.current().path);
+      expect(builder.root, io.Directory.current.path);
     });
 
     test('uses the host OS if style is omitted', () {
@@ -54,6 +54,6 @@
   });
 
   test('current', () {
-    expect(path.current, new io.Directory.current().path);
+    expect(path.current, io.Directory.current.path);
   });
 }
diff --git a/pkg/pkg.status b/pkg/pkg.status
index af3a270..53e34af 100644
--- a/pkg/pkg.status
+++ b/pkg/pkg.status
@@ -114,10 +114,6 @@
 [ $compiler == dart2js ]
 unittest/test/instance_test: Skip
 
-
-[ $compiler == dart2js && $runtime == drt ]
-intl/test/date_time_format_uninitialized_test: Pass, Fail # http://dartbug.com/9000
-
 [ $compiler == dart2js && $minified ]
 # The unittest package relies on getting the original (non-minified) method
 # names in Invocation.  You can't get that when minifying.
diff --git a/pkg/serialization/lib/src/serialization_rule.dart b/pkg/serialization/lib/src/serialization_rule.dart
index 0fc6f3e..d7560b7 100644
--- a/pkg/serialization/lib/src/serialization_rule.dart
+++ b/pkg/serialization/lib/src/serialization_rule.dart
@@ -567,6 +567,8 @@
   sort([f]) => _throw();
   clear() => _throw();
   insert(x, y) => _throw();
+  insertAll(x, y) => _throw();
+  fillRange(x, y, [z]) => _throw();
   removeAt(x) => _throw();
   remove(x) => _throw();
   removeLast() => _throw();
@@ -574,8 +576,10 @@
   retainAll(x) => _throw();
   removeWhere(x) => _throw();
   retainWhere(x) => _throw();
+  replaceRange(x, y, z) => _throw();
   getRange(x, y) => _throw();
-  setRange(x, y, z, [a]) => _throw();
+  setRange(x, y, z, [a = 0]) => _throw();
+  setAll(x, y) => _throw();
   removeRange(x, y) => _throw();
   get reversed => _throw();
   void set length(x) => _throw();
diff --git a/pkg/unittest/lib/mock.dart b/pkg/unittest/lib/mock.dart
index cacaec7..b6e48a4 100644
--- a/pkg/unittest/lib/mock.dart
+++ b/pkg/unittest/lib/mock.dart
@@ -108,6 +108,7 @@
 library mock;
 
 import 'dart:mirrors' show MirrorSystem;
+import 'dart:collection' show LinkedHashMap;
 
 import 'matcher.dart';
 
@@ -1237,7 +1238,7 @@
   final String name;
 
   /** The set of [Behavior]s supported. */
-  Map<String,Behavior> _behaviors;
+  LinkedHashMap<String,Behavior> _behaviors;
 
   /** The [log] of calls made. Only used if [name] is null. */
   LogEntryList log;
@@ -1262,7 +1263,7 @@
    */
   Mock() : _throwIfNoBehavior = false, log = null, name = null {
     logging = true;
-    _behaviors = new Map<String,Behavior>();
+    _behaviors = new LinkedHashMap<String,Behavior>();
   }
 
   /**
@@ -1281,7 +1282,7 @@
       throw new Exception("Mocks with shared logs must have a name.");
     }
     logging = enableLogging;
-    _behaviors = new Map<String,Behavior>();
+    _behaviors = new LinkedHashMap<String,Behavior>();
   }
 
   /**
diff --git a/pkg/unittest/lib/src/config.dart b/pkg/unittest/lib/src/config.dart
index dc25771..8b5a60c 100644
--- a/pkg/unittest/lib/src/config.dart
+++ b/pkg/unittest/lib/src/config.dart
@@ -4,6 +4,18 @@
 
 part of unittest;
 
+// A custom failure handler for [expect] that routes expect failures
+// to the config.
+class _ExpectFailureHandler extends DefaultFailureHandler {
+  Configuration _config;
+
+  _ExpectFailureHandler(this._config) : super();
+
+  void fail(String reason) {
+    _config.onExpectFailure(reason);
+  }
+}
+
 /**
  * Hooks to configure the unittest library for different platforms. This class
  * implements the API in a platform-independent way. Tests that want to take
@@ -30,6 +42,29 @@
   final bool autoStart = true;
 
   /**
+   * If true (the default), throw an exception at the end if any tests failed.
+   */
+  bool throwOnTestFailures = true;
+
+  /**
+   * If true (the default), then tests will stop after the first failed
+   * [expect]. If false, failed [expect]s will not cause the test
+   * to stop (other exceptions will still terminate the test).
+   */
+  bool stopTestOnExpectFailure = true;
+
+  // If stopTestOnExpectFailure is false, we need to capture failures, which
+  // we do with this List.
+  List _testLogBuffer = new List();
+  
+  /**
+   * The constructor sets up a failure handler for [expect] that redirects
+   * [expect] failures to [onExpectFailure].
+   */
+  Configuration() {
+    configureExpectFailureHandler(new _ExpectFailureHandler(this));
+  }
+  /**
    * Called as soon as the unittest framework becomes initialized. This is done
    * even before tests are added to the test framework. It might be used to
    * determine/debug errors that occur before the test harness starts executing.
@@ -46,18 +81,48 @@
 
   /**
    * Called when each test starts. Useful to show intermediate progress on
-   * a test suite.
+   * a test suite. Derived classes should call this first before their own
+   * override code.
    */
   void onTestStart(TestCase testCase) {
     assert(testCase != null);
+    _testLogBuffer.clear();
   }
 
   /**
    * Called when each test is first completed. Useful to show intermediate
-   * progress on a test suite.
+   * progress on a test suite. Derived classes should call this first 
+   * before their own override code.
    */
   void onTestResult(TestCase testCase) {
     assert(testCase != null);
+    if (!stopTestOnExpectFailure && _testLogBuffer.length > 0) {
+      // Write the message/stack pairs up to the last pairs.
+      var reason = new StringBuffer();
+      for (var i = 0; i < _testLogBuffer.length - 2; i += 2) {
+        reason.write(_testLogBuffer[i]);
+        reason.write('\n');
+        reason.write(_formatStack(_testLogBuffer[i+1]));
+        reason.write('\n');
+      }
+      // Write the last message.
+      reason.write(_testLogBuffer[_testLogBuffer.length - 2]);
+      if (testCase.result == PASS) {
+        testCase._result = FAIL;
+        testCase._message = reason.toString();
+        // Use the last stack as the overall failure stack.    
+        testCase._stackTrace = 
+            _formatStack(_testLogBuffer[_testLogBuffer.length - 1]);
+      } else {
+        // Add the last stack to the message; we have a further stack
+        // caused by some other failure.
+        reason.write(_formatStack(_testLogBuffer[_testLogBuffer.length - 1]));
+        reason.write('\n');
+        // Add the existing reason to the end of the expect log to 
+        // create the final message.
+        testCase._message = '${reason.toString()}\n${testCase._message}';
+      }
+    }
   }
 
   /**
@@ -78,6 +143,23 @@
   }
 
   /**
+   * Handles failures from expect(). The default in
+   * this base configuration is to throw an exception;
+   */
+  void onExpectFailure(String reason) {
+    if (stopTestOnExpectFailure) {
+      throw new TestFailure(reason);
+    } else {
+      _testLogBuffer.add(reason);
+      try {
+        throw '';
+      } catch (_, stack) {
+        _testLogBuffer.add(stack);
+      }
+    }
+  }
+  
+  /**
    * Called with the result of all test cases. The default implementation prints
    * the result summary using the built-in [print] command. Browser tests
    * commonly override this to reformat the output.
@@ -127,7 +209,9 @@
       _receivePort.close();
     } else {
       _receivePort.close();
-      throw new Exception('Some tests failed.');
+      if (throwOnTestFailures) {
+        throw new Exception('Some tests failed.');
+      }
     }
   }
 
diff --git a/pkg/unittest/lib/src/test_case.dart b/pkg/unittest/lib/src/test_case.dart
index 8e761f6..67b791e 100644
--- a/pkg/unittest/lib/src/test_case.dart
+++ b/pkg/unittest/lib/src/test_case.dart
@@ -122,6 +122,7 @@
           // seems to be the more conservative approach, because
           // unittest will not stop at a test failure.
           var stack = getAttachedStackTrace(e);
+          if (stack == null) stack = '';
           error("$description: Test setup failed: $e", "$stack");
         });
     } else {
@@ -148,7 +149,7 @@
   // is the first time the result is being set.
   void _setResult(String testResult, String messageText, String stack) {
     _message = messageText;
-    _stackTrace = stack;
+    _stackTrace = _formatStack(stack);
     if (result == null) {
       _result = testResult;
       _config.onTestResult(this);
@@ -199,6 +200,7 @@
   }
 
   void fail(String messageText, [String stack = '']) {
+    assert(stack != null);
     if (result != null) {
       String newMessage = (result == PASS)
           ? 'Test failed after initially passing: $messageText'
@@ -211,6 +213,7 @@
   }
 
   void error(String messageText, [String stack = '']) {
+    assert(stack != null);
     _complete(ERROR, messageText, stack);
   }
 
diff --git a/pkg/unittest/lib/unittest.dart b/pkg/unittest/lib/unittest.dart
index b2abf069..6562509 100644
--- a/pkg/unittest/lib/unittest.dart
+++ b/pkg/unittest/lib/unittest.dart
@@ -167,8 +167,9 @@
 library unittest;
 
 import 'dart:async';
-import 'dart:isolate';
 import 'dart:collection';
+import 'dart:isolate';
+import 'dart:math' show max;
 import 'matcher.dart';
 export 'matcher.dart';
 
@@ -181,8 +182,17 @@
 
 Configuration _config;
 
-/** [Configuration] used by the unittest library. */
-Configuration get unittestConfiguration => _config;
+/**
+ * [Configuration] used by the unittest library. Note that if a 
+ * configuration has not been set, calling this getter will create
+ * a default configuration.
+ */
+Configuration get unittestConfiguration {
+  if (_config == null) {
+    _config = new Configuration();
+  }
+  return _config;
+}
 
 /**
  * Sets the [Configuration] used by the unittest library.
@@ -214,11 +224,20 @@
 final List<TestCase> testCases = new UnmodifiableListView<TestCase>(_testCases);
 
 /**
+ * The set of tests to run can be restricted by using [solo_test] and
+ * [solo_group].
+ * As groups can be nested we use a counter to keep track of the nest level
+ * of soloing, and a flag to tell if we have seen any solo tests.
+ */
+int _soloNestingLevel = 0;
+bool _soloTestSeen = false;
+
+/**
  * Setup and teardown functions for a group and its parents, the latter
  * for chaining.
  */
-class GroupContext {
-  final GroupContext parent;
+class _GroupContext {
+  final _GroupContext parent;
 
   /** Description text of the current test group. */
   final String _name;
@@ -273,7 +292,7 @@
       ? _name
       : "${parent.fullName}$groupSep$_name";
 
-  GroupContext([this.parent, this._name = '']) {
+  _GroupContext([this.parent, this._name = '']) {
     _testSetup = parentSetup;
     _testTeardown = parentTeardown;
   }
@@ -282,8 +301,8 @@
 // We use a 'dummy' context for the top level to eliminate null
 // checks when querying the context. This allows us to easily
 //  support top-level setUp/tearDown functions as well.
-GroupContext _rootContext = new GroupContext();
-GroupContext _currentContext = _rootContext;
+final _rootContext = new _GroupContext();
+_GroupContext _currentContext = _rootContext;
 
 int _currentTestCaseIndex = 0;
 
@@ -307,9 +326,6 @@
 const FAIL  = 'fail';
 const ERROR = 'error';
 
-/** If set, then all other test cases will be ignored. */
-TestCase _soloTest;
-
 /**
  * A map that can be used to communicate state between a test driver
  * or main() function and the tests, particularly when these two
@@ -326,32 +342,45 @@
  */
 void test(String spec, TestFunction body) {
   ensureInitialized();
-  _testCases.add(new TestCase._internal(testCases.length + 1, _fullSpec(spec),
-                                        body));
+  if (!_soloTestSeen || _soloNestingLevel > 0) {
+    var testcase = new TestCase._internal(testCases.length + 1, _fullSpec(spec),
+                                        body);
+    _testCases.add(testcase);
+  }
 }
 
+/** Convenience function for skipping a test. */
+void skip_test(String spec, TestFunction body){}
+
 /**
  * Creates a new test case with the given description and body. The
  * description will include the descriptions of any surrounding group()
  * calls.
  *
- * "solo_" means that this will be the only test that is run. All other tests
- * will be skipped. This is a convenience function to let you quickly isolate
- * a single test by adding "solo_" before it to temporarily disable all other
- * tests.
+ * If we use [solo_test] (or [solo_group]) instead of test, then all non-solo
+ * tests will be disabled. Note that if we use [solo_group], all tests in
+ * the group will be enabled, regardless of whether they use [test] or
+ * [solo_test], or whether they are in a nested [group] vs [solo_group]. Put
+ * another way, if there are any calls to [solo_test] or [solo_group] in a test
+ * file, all tests that are not inside a [solo_group] will be disabled unless
+ * they are [solo_test]s.
+ *
+ * [skip_test] and [skip_group] take precedence over soloing, by virtue of the
+ * fact that they are effectively no-ops.
  */
 void solo_test(String spec, TestFunction body) {
-  // TODO(rnystrom): Support multiple solos. If more than one test is solo-ed,
-  // all of the solo-ed tests and none of the non-solo-ed ones should run.
-  if (_soloTest != null) {
-    throw new Exception('Only one test can be soloed right now.');
-  }
-
   ensureInitialized();
-
-  _soloTest = new TestCase._internal(testCases.length + 1, _fullSpec(spec),
-                                     body);
-  _testCases.add(_soloTest);
+  if (!_soloTestSeen) {
+    _soloTestSeen = true;
+    // This is the first solo-ed test. Discard all tests up to now.
+    _testCases.clear();
+  }
+  ++_soloNestingLevel;
+  try {
+    test(spec, body);
+  } finally {
+    --_soloNestingLevel;
+  }
 }
 
 /** Sentinel value for [_SpreadArgsHelper]. */
@@ -583,7 +612,7 @@
  */
 void group(String description, void body()) {
   ensureInitialized();
-  _currentContext = new GroupContext(_currentContext, description);
+  _currentContext = new _GroupContext(_currentContext, description);
   try {
     body();
   } catch (e, trace) {
@@ -595,6 +624,25 @@
   }
 }
 
+/** Like [skip_test], but for groups. */
+void skip_group(String description, void body()) {}
+
+/** Like [solo_test], but for groups. */
+void solo_group(String description, void body()) {
+  ensureInitialized();
+  if (!_soloTestSeen) {
+    _soloTestSeen = true;
+    // This is the first solo-ed group. Discard all tests up to now.
+    _testCases.clear();
+  }
+  ++_soloNestingLevel;
+  try {
+    group(description, body);
+  } finally {
+    --_soloNestingLevel;
+  }
+}
+
 /**
  * Register a [setUp] function for a test [group]. This function will
  * be called before each test in the group is run.
@@ -668,11 +716,6 @@
   _ensureInitialized(false);
   _currentTestCaseIndex = 0;
 
-  // If we are soloing a test, remove all the others.
-  if (_soloTest != null) {
-    filterTests((t) => t == _soloTest);
-  }
-
   _config.onStart();
 
   runAsync(() {
@@ -787,10 +830,7 @@
 
   _uncaughtErrorMessage = null;
 
-  if (_config == null) {
-    unittestConfiguration = new Configuration();
-  }
-  _config.onInit();
+  unittestConfiguration.onInit();
 
   if (configAutoStart && _config.autoStart) {
     // Immediately queue the suite up. It will run after a timeout (i.e. after
@@ -800,14 +840,8 @@
 }
 
 /** 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];
-      break;
-    }
-  }
-}
+void setSoloTest(int id) =>
+  _testCases.retainWhere((t) => t.id == id);
 
 /** Enable/disable a test by ID. */
 void _setTestEnabledState(int testId, bool state) {
@@ -832,3 +866,80 @@
 
 /** Signature for a test function. */
 typedef dynamic TestFunction();
+
+// Stack formatting utility. Strips extraneous content from a stack trace.
+// Stack frame lines are parsed with a regexp, which has been tested
+// in Chrome, Firefox and the VM. If a line fails to be parsed it is 
+// included in the output to be conservative.
+//
+// The output stack consists of everything after the call to TestCase._run.
+// If we see an 'expect' in the frame we will prune everything above that
+// as well.
+final _frameRegExp = new RegExp(
+    r'^\s*' // Skip leading spaces.
+    r'(?:'  // Group of choices for the prefix.
+      r'(?:#\d+\s*)|' // Skip VM's #<frameNumber>.
+      r'(?:at )|'     // Skip Firefox's 'at '.
+      r'(?:))'        // Other environments have nothing here.
+    r'(.+)'           // Extract the function/method.
+    r'\s*[@\(]'       // Skip space and @ or (.
+    r'('              // This group of choices is for the source file.
+      r'(?:.+:\/\/.+\/[^:]*)|' // Handle file:// or http:// URLs.
+      r'(?:dart:[^:]*)|'  // Handle dart:<lib>.
+      r'(?:package:[^:]*)' // Handle package:<path>
+    r'):([:\d]+)[\)]?$'); // Get the line number and optional column number.
+
+String _formatStack(stack) {
+  var lines;
+  if (stack is StackTrace) {
+    lines = stack.toString().split('\n');
+  } else if (stack is String) {
+    lines = stack.split('\n');
+  } else {
+    return stack.toString();
+  }
+ 
+  // Calculate the max width of first column so we can 
+  // pad to align the second columns.
+  int padding = lines.fold(0, (n, line) {
+    var match = _frameRegExp.firstMatch(line);
+    if (match == null) return n;
+    return max(n, match[1].length + 1);
+  });
+
+  // We remove all entries that have a location in unittest.
+  // We strip out anything before _nextBatch too.
+  var sb = new StringBuffer();
+  for (var i = 0; i < lines.length; i++) {
+    var line = lines[i];
+    if (line == '') continue;
+    var match = _frameRegExp.firstMatch(line);
+    if (match == null) {
+      sb.write(line);
+      sb.write('\n');
+    } else {
+      var member = match[1];
+      var location = match[2];
+      var position = match[3];
+      if (member.indexOf('TestCase._runTest') >= 0) {
+        // Don't include anything after this.
+        break;
+      } else if (member.indexOf('expect') >= 0) {
+        // It looks like this was an expect() failure;
+        // drop all the frames up to here.
+        sb.clear();
+      } else {
+        sb.write(member);
+        // Pad second column to a fixed position.
+        for (var j = 0; j <= padding - member.length; j++) {
+          sb.write(' ');
+        }
+        sb.write(location);
+        sb.write(' ');
+        sb.write(position);
+        sb.write('\n');
+      }
+    }
+  }
+  return sb.toString();
+}
diff --git a/pkg/unittest/test/mock_test.dart b/pkg/unittest/test/mock_test.dart
index 1788e82..5669f3f 100644
--- a/pkg/unittest/test/mock_test.dart
+++ b/pkg/unittest/test/mock_test.dart
@@ -661,4 +661,62 @@
     expect(m.foo(alice), true);
     expect(m.foo(bob), false);
   });
+
+  test("Behavior ordering", () {
+    // This is distinct from value ordering, i.e.
+    //
+    // m.when(...).thenReturn(1).thenReturn(2)
+    // 
+    // Here we want to test using distinct matchers being
+    // applied in order, so we have a single call that
+    // matches 3 different behaviors, and test that 
+    // the behaviors are applied in the order they are
+    // defined.
+    var m = new Mock();
+    m.when(callsTo("foo")).thenReturn("A");
+    m.when(callsTo("foo", "bar")).thenReturn("B");
+    m.when(callsTo("foo", "bar", "mock")).alwaysReturn("C");
+    expect(m.foo("bar", "mock"), "A");
+    expect(m.foo("bar", "mock"), "B");
+    expect(m.foo("bar", "mock"), "C");
+    expect(m.foo("bar", "mock"), "C");
+    m.resetBehavior();
+
+    m.when(callsTo("foo")).thenReturn("A");
+    m.when(callsTo("foo", "bar", "mock")).alwaysReturn("C");
+    m.when(callsTo("foo", "bar")).thenReturn("B");
+    expect(m.foo("bar", "mock"), "A");
+    expect(m.foo("bar", "mock"), "C");
+    expect(m.foo("bar", "mock"), "C");
+    expect(m.foo("bar", "mock"), "C");
+    m.resetBehavior();
+
+    m.when(callsTo("foo", "bar")).thenReturn("B");
+    m.when(callsTo("foo")).thenReturn("A");
+    m.when(callsTo("foo", "bar", "mock")).alwaysReturn("C");
+    expect(m.foo("bar", "mock"), "B");
+    expect(m.foo("bar", "mock"), "A");
+    expect(m.foo("bar", "mock"), "C");
+    expect(m.foo("bar", "mock"), "C");
+    m.resetBehavior();
+
+    m.when(callsTo("foo", "bar")).thenReturn("B");
+    m.when(callsTo("foo", "bar", "mock")).alwaysReturn("C");
+    m.when(callsTo("foo")).thenReturn("A");
+    expect(m.foo("bar", "mock"), "B");
+    expect(m.foo("bar", "mock"), "C");
+    expect(m.foo("bar", "mock"), "C");
+    expect(m.foo("bar", "mock"), "C");
+    m.resetBehavior();
+
+    m.when(callsTo("foo", "bar", "mock")).alwaysReturn("C");
+    m.when(callsTo("foo")).thenReturn("A");
+    m.when(callsTo("foo", "bar")).thenReturn("B");
+    expect(m.foo("bar", "mock"), "C");
+    expect(m.foo("bar", "mock"), "C");
+    expect(m.foo("bar", "mock"), "C");
+    expect(m.foo("bar", "mock"), "C");
+    m.resetBehavior();
+  });
 }
+
diff --git a/pkg/unittest/test/unittest_test.dart b/pkg/unittest/test/unittest_test.dart
index aa1bd97..f1d1aad 100644
--- a/pkg/unittest/test/unittest_test.dart
+++ b/pkg/unittest/test/unittest_test.dart
@@ -344,6 +344,59 @@
       test('after nest', () {
         expect(s.toString(), "l1 U l2 U l4 U l5 U l6 D l4 D l2 D ");
       });
+    } else if (testName == 'skipped/soloed nested groups with setup/teardown') {
+      StringBuffer s = null;
+      setUp(() {
+        if (s == null) 
+          s = new StringBuffer();
+      });
+      test('top level', () {
+        s.write('A');
+      });
+      skip_test('skipped top level', () {
+        s.write('B');
+      });
+      skip_group('skipped top level group', () {
+        setUp(() {
+          s.write('C');
+        });
+        solo_test('skipped solo nested test', () {
+          s.write('D');
+        });
+      });
+      group('non-solo group', () {
+        setUp(() {
+          s.write('E');
+        });
+        test('in non-solo group', () {
+          s.write('F');
+        });
+        solo_test('solo_test in non-solo group', () {
+          s.write('G');
+        });
+      });
+      solo_group('solo group', () {
+        setUp(() {
+          s.write('H');
+        });
+        test('solo group non-solo test', () {
+          s.write('I');
+        });
+        solo_test('solo group solo test', () {
+          s.write('J');
+        });
+        group('nested non-solo group in solo group', () {
+          test('nested non-solo group non-solo test', () {
+            s.write('K');
+          });
+          solo_test('nested non-solo group solo test', () {
+            s.write('L');
+          });
+        });
+      });
+      solo_test('final', () {
+        expect(s.toString(), "EGHIHJHKHL");
+      });
     }
   });
 }
@@ -403,7 +456,18 @@
     'runTests without tests': buildStatusString(0, 0, 0, null),
     'nested groups setup/teardown':
         buildStatusString(2, 0, 0,
-            'level 1 level 2 level 3 level 4 level 5 level 6 inner::after nest')
+            'level 1 level 2 level 3 level 4 level 5 level 6 inner::'
+            'after nest'),
+    'skipped/soloed nested groups with setup/teardown':
+        buildStatusString(6, 0, 0,
+            'non-solo group solo_test in non-solo group::'
+            'solo group solo group non-solo test::'
+            'solo group solo group solo test::'
+            'solo group nested non-solo group in solo group nested non-'
+            'solo group non-solo test::'
+            'solo group nested non-solo group in solo'
+            ' group nested non-solo group solo test::'
+            'final')
   };
 
   tests.forEach((String name, String expected) {
diff --git a/runtime/bin/builtin_natives.cc b/runtime/bin/builtin_natives.cc
index 86f9aee..a942b6a 100644
--- a/runtime/bin/builtin_natives.cc
+++ b/runtime/bin/builtin_natives.cc
@@ -23,6 +23,7 @@
   V(Directory_Exists, 1)                                                       \
   V(Directory_Create, 1)                                                       \
   V(Directory_Current, 0)                                                      \
+  V(Directory_SetCurrent, 1)                                                   \
   V(Directory_CreateTemp, 1)                                                   \
   V(Directory_Delete, 2)                                                       \
   V(Directory_Rename, 2)                                                       \
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index 3379b16..a803fca 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -566,9 +566,13 @@
                                                    const char* message) {
   // Create a Dart Exception object with a message.
   Dart_Handle clazz = GetDartClass(library_url, exception_name);
-  Dart_Handle args[1];
-  args[0] = NewString(message);
-  return Dart_New(clazz, Dart_Null(), 1, args);
+  if (message != NULL) {
+    Dart_Handle args[1];
+    args[0] = NewString(message);
+    return Dart_New(clazz, Dart_Null(), 1, args);
+  } else {
+    return Dart_New(clazz, Dart_Null(), 0, NULL);
+  }
 }
 
 
diff --git a/runtime/bin/directory.cc b/runtime/bin/directory.cc
index 758df5a..310cf8f 100644
--- a/runtime/bin/directory.cc
+++ b/runtime/bin/directory.cc
@@ -32,6 +32,28 @@
 }
 
 
+void FUNCTION_NAME(Directory_SetCurrent)(Dart_NativeArguments args) {
+  Dart_EnterScope();
+  int argc = Dart_GetNativeArgumentCount(args);
+  Dart_Handle path;
+  if (argc == 1) {
+    path = Dart_GetNativeArgument(args, 0);
+  }
+  if (argc != 1 || !Dart_IsString(path)) {
+    Dart_SetReturnValue(args, DartUtils::NewDartArgumentError(NULL));
+  } else {
+    if (Directory::SetCurrent(DartUtils::GetStringValue(path))) {
+      Dart_SetReturnValue(args, Dart_True());
+    } else {
+      Dart_Handle err = DartUtils::NewDartOSError();
+      if (Dart_IsError(err)) Dart_PropagateError(err);
+      Dart_SetReturnValue(args, err);
+    }
+  }
+  Dart_ExitScope();
+}
+
+
 void FUNCTION_NAME(Directory_Exists)(Dart_NativeArguments args) {
   static const int kExists = 1;
   static const int kDoesNotExist = 0;
diff --git a/runtime/bin/directory.h b/runtime/bin/directory.h
index a8dde3d..a19d274 100644
--- a/runtime/bin/directory.h
+++ b/runtime/bin/directory.h
@@ -105,6 +105,7 @@
                    DirectoryListing* listing);
   static ExistsResult Exists(const char* path);
   static char* Current();
+  static bool SetCurrent(const char* path);
   static bool Create(const char* path);
   static char* CreateTemp(const char* const_template);
   static bool Delete(const char* path, bool recursive);
diff --git a/runtime/bin/directory_android.cc b/runtime/bin/directory_android.cc
index 7c30274..24193f9 100644
--- a/runtime/bin/directory_android.cc
+++ b/runtime/bin/directory_android.cc
@@ -429,6 +429,12 @@
 }
 
 
+bool Directory::SetCurrent(const char* path) {
+  int result = TEMP_FAILURE_RETRY(chdir(path));
+  return result == 0;
+}
+
+
 bool Directory::Create(const char* dir_name) {
   // Create the directory with the permissions specified by the
   // process umask.
diff --git a/runtime/bin/directory_linux.cc b/runtime/bin/directory_linux.cc
index 67ac947..f3c1ec2 100644
--- a/runtime/bin/directory_linux.cc
+++ b/runtime/bin/directory_linux.cc
@@ -420,6 +420,12 @@
 }
 
 
+bool Directory::SetCurrent(const char* path) {
+  int result = TEMP_FAILURE_RETRY(chdir(path));
+  return result == 0;
+}
+
+
 bool Directory::Create(const char* dir_name) {
   // Create the directory with the permissions specified by the
   // process umask.
diff --git a/runtime/bin/directory_macos.cc b/runtime/bin/directory_macos.cc
index 5c7b115..3a9ab04 100644
--- a/runtime/bin/directory_macos.cc
+++ b/runtime/bin/directory_macos.cc
@@ -420,6 +420,12 @@
 }
 
 
+bool Directory::SetCurrent(const char* path) {
+  int result = TEMP_FAILURE_RETRY(chdir(path));
+  return result == 0;
+}
+
+
 bool Directory::Create(const char* dir_name) {
   // Create the directory with the permissions specified by the
   // process umask.
diff --git a/runtime/bin/directory_patch.dart b/runtime/bin/directory_patch.dart
index 4b6ce1f..688686b 100644
--- a/runtime/bin/directory_patch.dart
+++ b/runtime/bin/directory_patch.dart
@@ -4,6 +4,7 @@
 
 patch class _Directory {
   /* patch */ static String _current() native "Directory_Current";
+  /* patch */ static _setCurrent(path) native "Directory_SetCurrent";
   /* patch */ static _createTemp(String template) native "Directory_CreateTemp";
   /* patch */ static int _exists(String path) native "Directory_Exists";
   /* patch */ static _create(String path) native "Directory_Create";
diff --git a/runtime/bin/directory_win.cc b/runtime/bin/directory_win.cc
index dc6cd69..f0f9f935 100644
--- a/runtime/bin/directory_win.cc
+++ b/runtime/bin/directory_win.cc
@@ -425,6 +425,14 @@
 }
 
 
+bool Directory::SetCurrent(const char* path) {
+  const wchar_t* system_path = StringUtils::Utf8ToWide(path);
+  bool result = SetCurrentDirectoryW(system_path) != 0;
+  free(const_cast<wchar_t*>(system_path));
+  return result;
+}
+
+
 bool Directory::Create(const char* dir_name) {
   const wchar_t* system_name = StringUtils::Utf8ToWide(dir_name);
   int create_status = CreateDirectoryW(system_name, NULL);
diff --git a/runtime/bin/hashmap_test.cc b/runtime/bin/hashmap_test.cc
index 23d4ad8..b51d1cf 100644
--- a/runtime/bin/hashmap_test.cc
+++ b/runtime/bin/hashmap_test.cc
@@ -7,6 +7,8 @@
 #include "platform/hashmap.h"
 #include "vm/unit_test.h"
 
+namespace dart {
+
 // Default initial size of hashmaps used in these tests.
 static intptr_t kInitialSize = 8;
 
@@ -167,3 +169,5 @@
   TestSet(CollisionHash3, 50);
   TestSet(CollisionHash4, 50);
 }
+
+}  // namespace dart
diff --git a/runtime/bin/io_natives.cc b/runtime/bin/io_natives.cc
index 0b4cedd..ddaf345 100644
--- a/runtime/bin/io_natives.cc
+++ b/runtime/bin/io_natives.cc
@@ -29,6 +29,7 @@
   V(Filter_End, 1)                                                             \
   V(Filter_Process, 2)                                                         \
   V(Filter_Processed, 2)                                                       \
+  V(InternetAddress_Fixed, 1)                                                  \
   V(Platform_NumberOfProcessors, 0)                                            \
   V(Platform_OperatingSystem, 0)                                               \
   V(Platform_PathSeparator, 0)                                                 \
diff --git a/runtime/bin/net/ssl.gyp b/runtime/bin/net/ssl.gyp
index 3798baa..a86594a 100644
--- a/runtime/bin/net/ssl.gyp
+++ b/runtime/bin/net/ssl.gyp
@@ -8,6 +8,18 @@
 
 # This file is a modified copy of Chromium's src/net/third_party/nss/ssl.gyp.
 # Revision 169195 (this should agree with "nss_rev" in DEPS).
+
+# The following modification was made to make sure we have the same
+# xcode_settings on all configurations (otherwise we can't build with ninja):
+#   'configurations': {
+#     'Debug_Base': {
+# +     'inherit_from': ['Dart_Base'],
+#       'defines': [
+#         'DEBUG',
+#       ],
+#    },
+#  },
+
 {
   # Conditions section for ssl-bodge (Compiling SSL on linux using system
   # NSS and NSPR libraries) removed:
@@ -159,6 +171,7 @@
       ],
       'configurations': {
         'Debug_Base': {
+          'inherit_from': ['Dart_Base'],
           'defines': [
             'DEBUG',
           ],
diff --git a/runtime/bin/socket.cc b/runtime/bin/socket.cc
index 2593238..851104a 100644
--- a/runtime/bin/socket.cc
+++ b/runtime/bin/socket.cc
@@ -38,6 +38,51 @@
 }
 
 
+void FUNCTION_NAME(InternetAddress_Fixed)(Dart_NativeArguments args) {
+  Dart_EnterScope();
+  Dart_Handle id_obj = Dart_GetNativeArgument(args, 0);
+  ASSERT(!Dart_IsError(id_obj));
+  int64_t id = 0;
+  bool ok = DartUtils::GetInt64Value(id_obj, &id);
+  ASSERT(ok);
+  USE(ok);
+  RawAddr raw;
+  memset(&raw, 0, sizeof(raw));
+  switch (id) {
+    case SocketAddress::ADDRESS_LOOPBACK_IP_V4: {
+      raw.in.sin_family = AF_INET;
+      raw.in.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+      break;
+    }
+    case SocketAddress::ADDRESS_LOOPBACK_IP_V6: {
+      raw.in6.sin6_family = AF_INET6;
+      raw.in6.sin6_addr = in6addr_any;
+      break;
+    }
+    case SocketAddress::ADDRESS_ANY_IP_V4: {
+      raw.in.sin_family = AF_INET;
+      raw.in.sin_addr.s_addr = INADDR_ANY;
+      break;
+    }
+    case SocketAddress::ADDRESS_ANY_IP_V6: {
+      raw.in6.sin6_family = AF_INET6;
+      raw.in6.sin6_addr = in6addr_loopback;
+      break;
+    }
+    default:
+      Dart_Handle error = DartUtils::NewDartArgumentError("");
+      if (Dart_IsError(error)) Dart_PropagateError(error);
+      Dart_ThrowException(error);
+  }
+  int len = SocketAddress::GetAddrLength(raw);
+  Dart_Handle result = Dart_NewTypedData(kUint8, len);
+  if (Dart_IsError(result)) Dart_PropagateError(result);
+  Dart_ListSetAsBytes(result, 0, reinterpret_cast<uint8_t *>(&raw), len);
+  Dart_SetReturnValue(args, result);
+  Dart_ExitScope();
+}
+
+
 void FUNCTION_NAME(Socket_CreateConnect)(Dart_NativeArguments args) {
   Dart_EnterScope();
   Dart_Handle socket_obj = Dart_GetNativeArgument(args, 0);
diff --git a/runtime/bin/socket.h b/runtime/bin/socket.h
index aa8d198..99a0078 100644
--- a/runtime/bin/socket.h
+++ b/runtime/bin/socket.h
@@ -42,6 +42,15 @@
     TYPE_IPV6,
   };
 
+  enum {
+    ADDRESS_LOOPBACK_IP_V4,
+    ADDRESS_LOOPBACK_IP_V6,
+    ADDRESS_ANY_IP_V4,
+    ADDRESS_ANY_IP_V6,
+    ADDRESS_FIRST = ADDRESS_LOOPBACK_IP_V4,
+    ADDRESS_LAST = ADDRESS_ANY_IP_V6,
+  };
+
   explicit SocketAddress(struct addrinfo* addrinfo);
 
   int GetType() {
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
index daa59c6..1515403 100644
--- a/runtime/bin/socket_patch.dart
+++ b/runtime/bin/socket_patch.dart
@@ -19,13 +19,43 @@
 
 
 patch class InternetAddress {
+  /* patch */ static InternetAddress get LOOPBACK_IP_V4 {
+    return _InternetAddress.LOOPBACK_IP_V4;
+  }
+
+  /* patch */ static InternetAddress get LOOPBACK_IP_V6 {
+    return _InternetAddress.LOOPBACK_IP_V6;
+  }
+
+  /* patch */ static InternetAddress get ANY_IP_V4 {
+    return _InternetAddress.ANY_IP_V4;
+  }
+
+  /* patch */ static InternetAddress get ANY_IP_V6 {
+    return _InternetAddress.ANY_IP_V6;
+  }
+
   /* patch */ static Future<List<InternetAddress>> lookup(
-      String host, {InternetAddressType type: InternetAddressType.IPv4}) {
+      String host, {InternetAddressType type: InternetAddressType.IP_V4}) {
     return _NativeSocket.lookup(host, type: type);
   }
 }
 
 class _InternetAddress implements InternetAddress {
+  static const int _ADDRESS_LOOPBACK_IP_V4 = 0;
+  static const int _ADDRESS_LOOPBACK_IP_V6 = 1;
+  static const int _ADDRESS_ANY_IP_V4 = 2;
+  static const int _ADDRESS_ANY_IP_V6 = 3;
+
+  static _InternetAddress LOOPBACK_IP_V4 =
+      new _InternetAddress.fixed(_ADDRESS_LOOPBACK_IP_V4);
+  static _InternetAddress LOOPBACK_IP_V6 =
+      new _InternetAddress.fixed(_ADDRESS_LOOPBACK_IP_V6);
+  static _InternetAddress ANY_IP_V4 =
+      new _InternetAddress.fixed(_ADDRESS_ANY_IP_V4);
+  static _InternetAddress ANY_IP_V6 =
+      new _InternetAddress.fixed(_ADDRESS_ANY_IP_V6);
+
   final InternetAddressType type;
   final String address;
   final String host;
@@ -36,9 +66,32 @@
                    String this.host,
                    List<int> this._sockaddr_storage);
 
+  factory _InternetAddress.fixed(int id) {
+    var sockaddr = _fixed(id);
+    switch (id) {
+      case _ADDRESS_LOOPBACK_IP_V4:
+        return new _InternetAddress(
+            InternetAddressType.IP_V4, "127.0.0.1", "localhost", sockaddr);
+      case _ADDRESS_LOOPBACK_IP_V6:
+        return new _InternetAddress(
+            InternetAddressType.IP_V6, "::1", "ip6-localhost", sockaddr);
+      case _ADDRESS_ANY_IP_V4:
+        return new _InternetAddress(
+            InternetAddressType.IP_V4, "0.0.0.0", "0.0.0.0", sockaddr);
+      case _ADDRESS_ANY_IP_V6:
+        return new _InternetAddress(
+            InternetAddressType.IP_V6, "::", "::", sockaddr);
+      default:
+        assert(false);
+        throw new ArgumentError();
+    }
+  }
+
   String toString() {
     return "InternetAddress('$address', ${type.name})";
   }
+
+  static Uint8List _fixed(int id) native "InternetAddress_Fixed";
 }
 
 
@@ -105,7 +158,7 @@
   static SendPort socketService;
 
   static Future<List<InternetAddress>> lookup(
-      String host, {InternetAddressType type: InternetAddressType.IPv4}) {
+      String host, {InternetAddressType type: InternetAddressType.IP_V4}) {
     ensureSocketService();
     return socketService.call([HOST_NAME_LOOKUP, host, type._value])
         .then((response) {
diff --git a/runtime/dart-runtime.gyp b/runtime/dart-runtime.gyp
index 7519576..795e3d4 100644
--- a/runtime/dart-runtime.gyp
+++ b/runtime/dart-runtime.gyp
@@ -11,6 +11,10 @@
     'third_party/jscre/jscre.gypi',
   ],
   'variables': {
+    # TODO(zra): LIB_DIR is not defined by the ninja generator on Windows.
+    # Also, LIB_DIR is not toolset specific on Mac. If we want to do a ninja
+    # build on Windows, or cross-compile on Mac, we'll have to find some other
+    # way of getting generated source files into toolset specific locations.
     'gen_source_dir': '<(LIB_DIR)',
     'version_in_cc_file': 'vm/version_in.cc',
     'version_cc_file': '<(gen_source_dir)/version.cc',
@@ -18,6 +22,8 @@
     # Disable the OpenGLUI embedder by default on desktop OSes.  Note,
     # to build this on the desktop, you need GLUT installed.
     'enable_openglui%': 0,
+    'libdart_deps': ['libdart_lib_withcore', 'libdart_lib', 'libdart_vm',
+                     'libjscre', 'libdouble_conversion',],
   },
   'conditions': [
     ['OS=="android" or enable_openglui==1', {
@@ -64,7 +70,8 @@
       'type': 'none',
       'toolsets':['target','host'],
       'dependencies': [
-        'libdart_dependency_helper',
+        'libdart_dependency_helper.target#target',
+        'libdart_dependency_helper.host#host',
       ],
       'actions': [
         {
@@ -78,7 +85,8 @@
             '<(version_in_cc_file)',
             # Depend on libdart_dependency_helper to track the libraries it
             # depends on.
-            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)libdart_dependency_helper<(EXECUTABLE_SUFFIX)',
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)libdart_dependency_helper.target<(EXECUTABLE_SUFFIX)',
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)libdart_dependency_helper.host<(EXECUTABLE_SUFFIX)',
           ],
           'outputs': [
             '<(version_cc_file)',
@@ -94,18 +102,23 @@
       ],
     },
     {
-      'target_name': 'libdart_dependency_helper',
+      'target_name': 'libdart_dependency_helper.target',
       'type': 'executable',
-      'toolsets':['target','host'],
+      'toolsets':['target'],
       # The dependencies here are the union of the dependencies of libdart and
       # libdart_withcore.
-      'dependencies': [
-        'libdart_lib_withcore',
-        'libdart_lib',
-        'libdart_vm',
-        'libjscre',
-        'libdouble_conversion',
+      'dependencies': ['<@(libdart_deps)'],
+      'sources': [
+        'vm/libdart_dependency_helper.cc',
       ],
+    },
+    {
+      'target_name': 'libdart_dependency_helper.host',
+      'type': 'executable',
+      'toolsets':['host'],
+      # The dependencies here are the union of the dependencies of libdart and
+      # libdart_withcore.
+      'dependencies': ['<@(libdart_deps)'],
       'sources': [
         'vm/libdart_dependency_helper.cc',
       ],
diff --git a/runtime/lib/array.cc b/runtime/lib/array.cc
index ac879d3..da55de9 100644
--- a/runtime/lib/array.cc
+++ b/runtime/lib/array.cc
@@ -15,8 +15,6 @@
 DEFINE_NATIVE_ENTRY(ObjectArray_allocate, 2) {
   const AbstractTypeArguments& type_arguments =
       AbstractTypeArguments::CheckedHandle(isolate, arguments->NativeArgAt(0));
-  ASSERT(type_arguments.IsNull() ||
-         (type_arguments.IsInstantiated() && (type_arguments.Length() == 1)));
   const Instance& length = Instance::CheckedHandle(
       isolate, arguments->NativeArgAt(1));
   if (!length.IsSmi()) {
diff --git a/runtime/lib/core_patch.dart b/runtime/lib/core_patch.dart
index 3f7f5d2..5491698 100644
--- a/runtime/lib/core_patch.dart
+++ b/runtime/lib/core_patch.dart
@@ -4,5 +4,3 @@
 
 import "dart:math";
 import "dart:typed_data";
-
-import "dart:_collection-dev" as _symbol_dev;
diff --git a/runtime/lib/function_patch.dart b/runtime/lib/function_patch.dart
index f0f016c..969836d 100644
--- a/runtime/lib/function_patch.dart
+++ b/runtime/lib/function_patch.dart
@@ -22,7 +22,7 @@
     if (numNamedArguments > 0) {
       namedArguments.forEach((name, value) {
         arguments[argumentIndex++] = value;
-        names[nameIndex++] = _symbol_dev.Symbol.getName(name);
+        names[nameIndex++] = _collection_dev.Symbol.getName(name);
       });
     }
     return _apply(arguments, names);
diff --git a/runtime/lib/growable_array.cc b/runtime/lib/growable_array.cc
index 52278c0..a435975 100644
--- a/runtime/lib/growable_array.cc
+++ b/runtime/lib/growable_array.cc
@@ -15,8 +15,6 @@
 DEFINE_NATIVE_ENTRY(GrowableObjectArray_allocate, 2) {
   const AbstractTypeArguments& type_arguments =
       AbstractTypeArguments::CheckedHandle(arguments->NativeArgAt(0));
-  ASSERT(type_arguments.IsNull() ||
-         (type_arguments.IsInstantiated() && (type_arguments.Length() == 1)));
   GET_NON_NULL_NATIVE_ARGUMENT(Array, data, arguments->NativeArgAt(1));
   if ((data.Length() <= 0)) {
     const Integer& index = Integer::Handle(Integer::New(data.Length()));
diff --git a/runtime/lib/typed_data.cc b/runtime/lib/typed_data.cc
index 4a47d71..cdbaf24 100644
--- a/runtime/lib/typed_data.cc
+++ b/runtime/lib/typed_data.cc
@@ -42,7 +42,6 @@
 
 // Checks to see if a length will not result in an OOM error.
 static void LengthCheck(intptr_t len, intptr_t max) {
-  ASSERT(len >= 0);
   if (len > max) {
     const String& error = String::Handle(String::NewFormatted(
         "insufficient memory to allocate a TypedData object of length (%"Pd")",
@@ -50,6 +49,12 @@
     const Array& args = Array::Handle(Array::New(1));
     args.SetAt(0, error);
     Exceptions::ThrowByType(Exceptions::kOutOfMemory, args);
+  } else if (len < 0) {
+    const String& error = String::Handle(String::NewFormatted(
+        "%"Pd" must be greater than 0", len));
+    const Array& args = Array::Handle(Array::New(1));
+    args.SetAt(0, error);
+    Exceptions::ThrowByType(Exceptions::kArgument, args);
   }
 }
 
diff --git a/runtime/lib/typed_data.dart b/runtime/lib/typed_data.dart
index 9fb8f15..8e5bcaa 100644
--- a/runtime/lib/typed_data.dart
+++ b/runtime/lib/typed_data.dart
@@ -579,10 +579,6 @@
   // Factory constructors.
 
   factory _Int8Array(int length) {
-    if (length < 0) {
-      String message = "$length must be greater than 0";
-      throw new ArgumentError(message);
-    }
     return _new(length);
   }
 
@@ -637,10 +633,6 @@
   // Factory constructors.
 
   factory _Uint8Array(int length) {
-    if (length < 0) {
-      String message = "$length must be greater than 0";
-      throw new ArgumentError(message);
-    }
     return _new(length);
   }
 
@@ -693,10 +685,6 @@
   // Factory constructors.
 
   factory _Uint8ClampedArray(int length) {
-    if (length < 0) {
-      String message = "$length must be greater than 0";
-      throw new ArgumentError(message);
-    }
     return _new(length);
   }
 
@@ -751,10 +739,6 @@
   // Factory constructors.
 
   factory _Int16Array(int length) {
-    if (length < 0) {
-      String message = "$length must be greater than 0";
-      throw new ArgumentError(message);
-    }
     return _new(length);
   }
 
@@ -818,10 +802,6 @@
   // Factory constructors.
 
   factory _Uint16Array(int length) {
-    if (length < 0) {
-      String message = "$length must be greater than 0";
-      throw new ArgumentError(message);
-    }
     return _new(length);
   }
 
@@ -885,10 +865,6 @@
   // Factory constructors.
 
   factory _Int32Array(int length) {
-    if (length < 0) {
-      String message = "$length must be greater than 0";
-      throw new ArgumentError(message);
-    }
     return _new(length);
   }
 
@@ -952,10 +928,6 @@
   // Factory constructors.
 
   factory _Uint32Array(int length) {
-    if (length < 0) {
-      String message = "$length must be greater than 0";
-      throw new ArgumentError(message);
-    }
     return _new(length);
   }
 
@@ -1019,10 +991,6 @@
   // Factory constructors.
 
   factory _Int64Array(int length) {
-    if (length < 0) {
-      String message = "$length must be greater than 0";
-      throw new ArgumentError(message);
-    }
     return _new(length);
   }
 
@@ -1086,10 +1054,6 @@
   // Factory constructors.
 
   factory _Uint64Array(int length) {
-    if (length < 0) {
-      String message = "$length must be greater than 0";
-      throw new ArgumentError(message);
-    }
     return _new(length);
   }
 
@@ -1153,10 +1117,6 @@
   // Factory constructors.
 
   factory _Float32Array(int length) {
-    if (length < 0) {
-      String message = "$length must be greater than 0";
-      throw new ArgumentError(message);
-    }
     return _new(length);
   }
 
@@ -1220,10 +1180,6 @@
   // Factory constructors.
 
   factory _Float64Array(int length) {
-    if (length < 0) {
-      String message = "$length must be greater than 0";
-      throw new ArgumentError(message);
-    }
     return _new(length);
   }
 
@@ -1286,10 +1242,6 @@
   // Factory constructors.
 
   factory _Float32x4Array(int length) {
-    if (length < 0) {
-      String message = "$length must be greater than 0";
-      throw new ArgumentError(message);
-    }
     return _new(length);
   }
 
@@ -1351,10 +1303,6 @@
   // Factory constructors.
 
   factory _ExternalInt8Array(int length) {
-    if (length < 0) {
-      String message = "$length must be greater than 0";
-      throw new ArgumentError(message);
-    }
     return _new(length);
   }
 
@@ -1401,10 +1349,6 @@
   // Factory constructors.
 
   factory _ExternalUint8Array(int length) {
-    if (length < 0) {
-      String message = "$length must be greater than 0";
-      throw new ArgumentError(message);
-    }
     return _new(length);
   }
 
@@ -1452,10 +1396,6 @@
   // Factory constructors.
 
   factory _ExternalUint8ClampedArray(int length) {
-    if (length < 0) {
-      String message = "$length must be greater than 0";
-      throw new ArgumentError(message);
-    }
     return _new(length);
   }
 
@@ -1503,10 +1443,6 @@
   // Factory constructors.
 
   factory _ExternalInt16Array(int length) {
-    if (length < 0) {
-      String message = "$length must be greater than 0";
-      throw new ArgumentError(message);
-    }
     return _new(length);
   }
 
@@ -1562,10 +1498,6 @@
   // Factory constructors.
 
   factory _ExternalUint16Array(int length) {
-    if (length < 0) {
-      String message = "$length must be greater than 0";
-      throw new ArgumentError(message);
-    }
     return _new(length);
   }
 
@@ -1621,10 +1553,6 @@
   // Factory constructors.
 
   factory _ExternalInt32Array(int length) {
-    if (length < 0) {
-      String message = "$length must be greater than 0";
-      throw new ArgumentError(message);
-    }
     return _new(length);
   }
 
@@ -1680,10 +1608,6 @@
   // Factory constructors.
 
   factory _ExternalUint32Array(int length) {
-    if (length < 0) {
-      String message = "$length must be greater than 0";
-      throw new ArgumentError(message);
-    }
     return _new(length);
   }
 
@@ -1739,10 +1663,6 @@
   // Factory constructors.
 
   factory _ExternalInt64Array(int length) {
-    if (length < 0) {
-      String message = "$length must be greater than 0";
-      throw new ArgumentError(message);
-    }
     return _new(length);
   }
 
@@ -1798,10 +1718,6 @@
   // Factory constructors.
 
   factory _ExternalUint64Array(int length) {
-    if (length < 0) {
-      String message = "$length must be greater than 0";
-      throw new ArgumentError(message);
-    }
     return _new(length);
   }
 
@@ -1857,10 +1773,6 @@
   // Factory constructors.
 
   factory _ExternalFloat32Array(int length) {
-    if (length < 0) {
-      String message = "$length must be greater than 0";
-      throw new ArgumentError(message);
-    }
     return _new(length);
   }
 
@@ -1916,10 +1828,6 @@
   // Factory constructors.
 
   factory _ExternalFloat64Array(int length) {
-    if (length < 0) {
-      String message = "$length must be greater than 0";
-      throw new ArgumentError(message);
-    }
     return _new(length);
   }
 
@@ -1975,10 +1883,6 @@
   // Factory constructors.
 
   factory _ExternalFloat32x4Array(int length) {
-    if (length < 0) {
-      String message = "$length must be greater than 0";
-      throw new ArgumentError(message);
-    }
     return _new(length);
   }
 
diff --git a/runtime/platform/hashmap.cc b/runtime/platform/hashmap.cc
index 3bd56f8..693367f 100644
--- a/runtime/platform/hashmap.cc
+++ b/runtime/platform/hashmap.cc
@@ -4,11 +4,11 @@
 
 #include "platform/hashmap.h"
 
-#include "bin/builtin.h"
 #include "platform/utils.h"
 
-HashMap::HashMap(MatchFun match,
-                 uint32_t initial_capacity) {
+namespace dart {
+
+HashMap::HashMap(MatchFun match, uint32_t initial_capacity) {
   match_ = match;
   Initialize(initial_capacity);
 }
@@ -188,3 +188,5 @@
   // Delete old map.
   free(map);
 }
+
+}  // namespace dart
diff --git a/runtime/platform/hashmap.h b/runtime/platform/hashmap.h
index 1b144d4..01fad72 100644
--- a/runtime/platform/hashmap.h
+++ b/runtime/platform/hashmap.h
@@ -7,6 +7,8 @@
 
 #include "platform/globals.h"
 
+namespace dart {
+
 class HashMap {
  public:
   typedef bool (*MatchFun) (void* key1, void* key2);
@@ -73,4 +75,6 @@
   friend class IntSet;  // From hashmap_test.cc
 };
 
+}  // namespace dart
+
 #endif  // PLATFORM_HASHMAP_H_
diff --git a/runtime/tests/vm/vm.status b/runtime/tests/vm/vm.status
index 6e71bf0..26005da 100644
--- a/runtime/tests/vm/vm.status
+++ b/runtime/tests/vm/vm.status
@@ -20,7 +20,6 @@
 
 # The following section refers to the dart vm tests which live under
 # runtime/tests/vm/dart.
-
 [ $system == windows ]
 cc/Dart2JSCompileAll: Skip
 cc/ExternalizeConstantStrings: Skip
@@ -72,7 +71,6 @@
 # Tests missing code generation support.
 cc/CorelibCompileAll: Skip
 cc/Dart2JSCompileAll: Skip
-cc/Debug_InterruptIsolate: Skip
 # Tests needing Dart execution.
 dart/*: Skip
 
diff --git a/runtime/vm/assembler_mips.cc b/runtime/vm/assembler_mips.cc
index bda9cd0..d4029ce 100644
--- a/runtime/vm/assembler_mips.cc
+++ b/runtime/vm/assembler_mips.cc
@@ -387,7 +387,6 @@
   Label next;
   // Branch and link to the instruction after the delay slot to get the PC.
   bal(&next);
-
   // RA is the address of the sw instruction below. Save it in T0.
   delay_slot()->mov(T0, RA);
 
diff --git a/runtime/vm/assembler_mips.h b/runtime/vm/assembler_mips.h
index 6402b6e..8269737 100644
--- a/runtime/vm/assembler_mips.h
+++ b/runtime/vm/assembler_mips.h
@@ -709,68 +709,80 @@
     bne(rd, CMPRES, l);
   }
 
-  void BranchGreater(Register rd, int32_t value, Label* l) {
-    if (Utils::IsInt(kImmBits, -value)) {
-      addiu(CMPRES, rd, Immediate(-value));
-      bgtz(CMPRES, l);
-    } else {
-      LoadImmediate(CMPRES, value);
-      subu(CMPRES, rd, CMPRES);
-      bgtz(CMPRES, l);
-    }
+  void BranchSignedGreater(Register rd, Register rs, Label* l) {
+    slt(CMPRES, rs, rd);  // CMPRES = rd > rs ? 1 : 0.
+    bne(CMPRES, ZR, l);
   }
 
-  void BranchGreater(Register rd, Register rs, Label* l) {
-    subu(CMPRES, rd, rs);
-    bgtz(CMPRES, l);
+  void BranchSignedGreater(Register rd, int32_t value, Label* l) {
+    LoadImmediate(CMPRES, value);
+    BranchSignedGreater(rd, CMPRES, l);
   }
 
-  void BranchGreaterEqual(Register rd, int32_t value, Label* l) {
-    if (Utils::IsInt(kImmBits, -value)) {
-      addiu(CMPRES, rd, Immediate(-value));
-      bgez(CMPRES, l);
-    } else {
-      LoadImmediate(CMPRES, value);
-      subu(CMPRES, rd, CMPRES);
-      bgez(CMPRES, l);
-    }
+  void BranchUnsignedGreater(Register rd, Register rs, Label* l) {
+    sltu(CMPRES, rs, rd);
+    bne(CMPRES, ZR, l);
   }
 
-  void BranchGreaterEqual(Register rd, Register rs, Label* l) {
-    subu(CMPRES, rd, rs);
-    bgez(CMPRES, l);
+  void BranchUnsignedGreater(Register rd, int32_t value, Label* l) {
+    LoadImmediate(CMPRES, value);
+    BranchUnsignedGreater(rd, CMPRES, l);
   }
 
-  void BranchLess(Register rd, int32_t value, Label* l) {
-    if (Utils::IsInt(kImmBits, -value)) {
-      addiu(CMPRES, rd, Immediate(-value));
-      bltz(CMPRES, l);
-    } else {
-      LoadImmediate(CMPRES, value);
-      subu(CMPRES, rd, CMPRES);
-      bltz(CMPRES, l);
-    }
+  void BranchSignedGreaterEqual(Register rd, Register rs, Label* l) {
+    slt(CMPRES, rd, rs);  // CMPRES = rd < rs ? 1 : 0.
+    beq(CMPRES, ZR, l);  // If CMPRES = 0, then rd >= rs.
   }
 
-  void BranchLess(Register rd, Register rs, Label* l) {
-    subu(CMPRES, rd, rs);
-    bltz(CMPRES, l);
+  void BranchSignedGreaterEqual(Register rd, int32_t value, Label* l) {
+    LoadImmediate(CMPRES, value);
+    BranchSignedGreaterEqual(rd, CMPRES, l);
   }
 
-  void BranchLessEqual(Register rd, int32_t value, Label* l) {
-    if (Utils::IsInt(kImmBits, -value)) {
-      addiu(CMPRES, rd, Immediate(-value));
-      blez(CMPRES, l);
-    } else {
-      LoadImmediate(CMPRES, value);
-      subu(CMPRES, rd, CMPRES);
-      blez(CMPRES, l);
-    }
+  void BranchUnsignedGreaterEqual(Register rd, Register rs, Label* l) {
+    sltu(CMPRES, rd, rs);  // CMPRES = rd < rs ? 1 : 0.
+    beq(CMPRES, ZR, l);
   }
 
-  void BranchLessEqual(Register rd, Register rs, Label* l) {
-    subu(CMPRES, rd, rs);
-    blez(CMPRES, l);
+  void BranchUnsignedGreaterEqual(Register rd, int32_t value, Label* l) {
+    LoadImmediate(CMPRES, value);
+    BranchUnsignedGreaterEqual(rd, CMPRES, l);
+  }
+
+  void BranchSignedLess(Register rd, Register rs, Label* l) {
+    BranchSignedGreater(rs, rd, l);
+  }
+
+  void BranchSignedLess(Register rd, int32_t value, Label* l) {
+    LoadImmediate(CMPRES, value);
+    BranchSignedGreater(CMPRES, rd, l);
+  }
+
+  void BranchUnsignedLess(Register rd, Register rs, Label* l) {
+    BranchUnsignedGreater(rs, rd, l);
+  }
+
+  void BranchUnsignedLess(Register rd, int32_t value, Label* l) {
+    LoadImmediate(CMPRES, value);
+    BranchUnsignedGreater(CMPRES, rd, l);
+  }
+
+  void BranchSignedLessEqual(Register rd, Register rs, Label* l) {
+    BranchSignedGreaterEqual(rs, rd, l);
+  }
+
+  void BranchSignedLessEqual(Register rd, int32_t value, Label* l) {
+    LoadImmediate(CMPRES, value);
+    BranchSignedGreaterEqual(CMPRES, rd, l);
+  }
+
+  void BranchUnsignedLessEqual(Register rd, Register rs, Label* l) {
+    BranchUnsignedGreaterEqual(rs, rd, l);
+  }
+
+  void BranchUnsignedLessEqual(Register rd, int32_t value, Label* l) {
+    LoadImmediate(CMPRES, value);
+    BranchUnsignedGreaterEqual(CMPRES, rd, l);
   }
 
   void Push(Register rt) {
diff --git a/runtime/vm/bootstrap.cc b/runtime/vm/bootstrap.cc
index 132478c..03e69dc 100644
--- a/runtime/vm/bootstrap.cc
+++ b/runtime/vm/bootstrap.cc
@@ -11,112 +11,142 @@
 #include "vm/dart_api_impl.h"
 #include "vm/object.h"
 #include "vm/object_store.h"
+#include "vm/symbols.h"
 
 namespace dart {
 
 DEFINE_FLAG(bool, print_bootstrap, false, "Print the bootstrap source.");
 
+#define INIT_LIBRARY(index, name, source, patch)                               \
+  { index,                                                                     \
+    "dart:"#name, source,                                                      \
+    "dart:"#name"-patch", patch }                                              \
 
-RawScript* Bootstrap::LoadScript(const char* url,
-                                 const char* source,
-                                 bool patch) {
-  return Script::New(String::Handle(String::New(url, Heap::kOld)),
-                     String::Handle(String::New(source, Heap::kOld)),
-                     patch ? RawScript::kPatchTag : RawScript::kLibraryTag);
+typedef struct {
+  intptr_t index_;
+  const char* uri_;
+  const char* source_;
+  const char* patch_uri_;
+  const char* patch_source_;
+} bootstrap_lib_props;
+
+
+static bootstrap_lib_props bootstrap_libraries[] = {
+  INIT_LIBRARY(ObjectStore::kCore,
+               core,
+               Bootstrap::corelib_source_,
+               Bootstrap::corelib_patch_),
+  INIT_LIBRARY(ObjectStore::kAsync,
+               async,
+               Bootstrap::async_source_,
+               Bootstrap::async_patch_),
+  INIT_LIBRARY(ObjectStore::kCollection,
+               collection,
+               Bootstrap::collection_source_,
+               Bootstrap::collection_patch_),
+  INIT_LIBRARY(ObjectStore::kCollectionDev,
+               _collection-dev,
+               Bootstrap::collection_dev_source_,
+               Bootstrap::collection_dev_patch_),
+  INIT_LIBRARY(ObjectStore::kCrypto,
+               crypto,
+               Bootstrap::crypto_source_,
+               NULL),
+  INIT_LIBRARY(ObjectStore::kIsolate,
+               isolate,
+               Bootstrap::isolate_source_,
+               Bootstrap::isolate_patch_),
+  INIT_LIBRARY(ObjectStore::kJson,
+               json,
+               Bootstrap::json_source_,
+               Bootstrap::json_patch_),
+  INIT_LIBRARY(ObjectStore::kMath,
+               math,
+               Bootstrap::math_source_,
+               Bootstrap::math_patch_),
+  INIT_LIBRARY(ObjectStore::kMirrors,
+               mirrors,
+               Bootstrap::mirrors_source_,
+               Bootstrap::mirrors_patch_),
+  INIT_LIBRARY(ObjectStore::kTypedData,
+               typed_data,
+               Bootstrap::typed_data_source_,
+               Bootstrap::typed_data_patch_),
+  INIT_LIBRARY(ObjectStore::kUtf,
+               utf,
+               Bootstrap::utf_source_,
+               NULL),
+  INIT_LIBRARY(ObjectStore::kUri,
+               uri,
+               Bootstrap::uri_source_,
+               NULL),
+
+  { ObjectStore::kNone, NULL, NULL, NULL, NULL }
+};
+
+
+static RawString* GetLibrarySource(intptr_t index, bool patch) {
+  // TODO(asiva): Replace with actual read of the source file.
+  const char* source = patch ? bootstrap_libraries[index].patch_source_ :
+                               bootstrap_libraries[index].source_;
+  ASSERT(source != NULL);
+  return String::New(source, Heap::kOld);
 }
 
 
-RawScript* Bootstrap::LoadAsyncScript(bool patch) {
-  const char* url = patch ? "dart:async-patch" : "dart:async";
-  const char* source = patch ? async_patch_ : async_source_;
-  return LoadScript(url, source, patch);
+static Dart_Handle LoadPartSource(Isolate* isolate,
+                                  const Library& lib,
+                                  const String& uri) {
+  // TODO(asiva): For now we return an error here, once we start
+  // loading libraries from the real source this would have to call the
+  // file read callback here and invoke Compiler::Compile on it.
+  return Dart_NewApiError("Unable to load source '%s' ", uri.ToCString());
 }
 
 
-RawScript* Bootstrap::LoadCoreScript(bool patch) {
-  // TODO(iposva): Use proper library name.
-  const char* url = patch ? "dart:core-patch" : "bootstrap";
-  const char* source = patch ? corelib_patch_ : corelib_source_;
-  return LoadScript(url, source, patch);
+static Dart_Handle BootstrapLibraryTagHandler(Dart_LibraryTag tag,
+                                              Dart_Handle library,
+                                              Dart_Handle uri) {
+  Isolate* isolate = Isolate::Current();
+  if (!Dart_IsLibrary(library)) {
+    return Dart_NewApiError("not a library");
+  }
+  if (!Dart_IsString(uri)) {
+    return Dart_NewApiError("uri is not a string");
+  }
+  const String& uri_str = Api::UnwrapStringHandle(isolate, uri);
+  ASSERT(!uri_str.IsNull());
+  bool is_dart_scheme_uri = uri_str.StartsWith(Symbols::DartScheme());
+  if (!is_dart_scheme_uri) {
+    // The bootstrap tag handler can only handle dart scheme uris.
+    return Dart_NewApiError("Do not know how to load '%s' ",
+                            uri_str.ToCString());
+  }
+  if (tag == kCanonicalizeUrl) {
+    // Dart Scheme URIs do not need any canonicalization.
+    return uri;
+  }
+  if (tag == kImportTag) {
+    // We expect the core bootstrap libraries to only import other
+    // core bootstrap libraries.
+    // We have precreated all the bootstrap library objects hence
+    // we do not expect to be called back with the tag set to kImportTag.
+    // The bootstrap process explicitly loads all the libraries one by one.
+    return Dart_NewApiError("Invalid import of '%s' in a bootstrap library",
+                            uri_str.ToCString());
+  }
+  ASSERT(tag == kSourceTag);
+  const Library& lib = Api::UnwrapLibraryHandle(isolate, library);
+  ASSERT(!lib.IsNull());
+  return LoadPartSource(isolate, lib, uri_str);
 }
 
 
-RawScript* Bootstrap::LoadCollectionScript(bool patch) {
-  const char* url = patch ? "dart:collection-patch" : "dart:collection";
-  const char* source = patch ? collection_patch_ : collection_source_;
-  return LoadScript(url, source, patch);
-}
-
-
-RawScript* Bootstrap::LoadCollectionDevScript(bool patch) {
-  const char* url =
-      patch ? "dart:_collection-dev-patch" : "dart:_collection-dev";
-  const char* source = patch ? collection_dev_patch_ : collection_dev_source_;
-  return LoadScript(url, source, patch);
-}
-
-
-RawScript* Bootstrap::LoadCryptoScript(bool patch) {
-  const char* url = patch ? "dart:crypto-patch" : "dart:crypto";
-  const char* source = patch ? crypto_source_ : crypto_source_;
-  return LoadScript(url, source, patch);
-}
-
-
-RawScript* Bootstrap::LoadIsolateScript(bool patch)  {
-  const char* url = patch ? "dart:isolate-patch" : "dart:isolate";
-  const char* source = patch ? isolate_patch_ : isolate_source_;
-  return LoadScript(url, source, patch);
-}
-
-
-RawScript* Bootstrap::LoadJsonScript(bool patch) {
-  const char* url = patch ? "dart:json-patch" : "dart:json";
-  const char* source = patch ? json_patch_ : json_source_;
-  return LoadScript(url, source, patch);
-}
-
-
-RawScript* Bootstrap::LoadMathScript(bool patch) {
-  const char* url = patch ? "dart:math-patch" : "dart:math";
-  const char* source = patch ? math_patch_ : math_source_;
-  return LoadScript(url, source, patch);
-}
-
-
-RawScript* Bootstrap::LoadMirrorsScript(bool patch)  {
-  const char* url = patch ? "dart:mirrors-patch" : "dart:mirrors";
-  const char* source = patch ? mirrors_patch_ : mirrors_source_;
-  return LoadScript(url, source, patch);
-}
-
-
-RawScript* Bootstrap::LoadTypedDataScript(bool patch) {
-  const char* url = patch ? "dart:typed_data_patch" : "dart:typed_data";
-  const char* source = patch ? typed_data_patch_ : typed_data_source_;
-  return LoadScript(url, source, patch);
-}
-
-
-RawScript* Bootstrap::LoadUriScript(bool patch) {
-  const char* url = patch ? "dart:uri-patch" : "dart:uri";
-  const char* source = patch ? uri_source_ : uri_source_;
-  return LoadScript(url, source, patch);
-}
-
-
-RawScript* Bootstrap::LoadUtfScript(bool patch) {
-  const char* url = patch ? "dart:utf-patch" : "dart:utf";
-  const char* source = patch ? utf_source_ : utf_source_;
-  return LoadScript(url, source, patch);
-}
-
-
-RawError* Bootstrap::Compile(const Library& library, const Script& script) {
+static RawError* Compile(const Library& library, const Script& script) {
   if (FLAG_print_bootstrap) {
     OS::Print("Bootstrap source '%s':\n%s\n",
-        String::Handle(script.url()).ToCString(),
-        String::Handle(script.Source()).ToCString());
+              String::Handle(script.url()).ToCString(),
+              String::Handle(script.Source()).ToCString());
   }
   library.SetLoadInProgress();
   const Error& error = Error::Handle(Compiler::Compile(library, script));
@@ -128,4 +158,75 @@
   return error.raw();
 }
 
+
+RawError* Bootstrap::LoadandCompileScripts() {
+  Isolate* isolate = Isolate::Current();
+  String& uri = String::Handle();
+  String& patch_uri = String::Handle();
+  String& source = String::Handle();
+  Script& script = Script::Handle();
+  Library& lib = Library::Handle();
+  Error& error = Error::Handle();
+  Dart_LibraryTagHandler saved_tag_handler = isolate->library_tag_handler();
+
+  // Set the library tag handler for the isolate to the bootstrap
+  // library tag handler so that we can load all the bootstrap libraries.
+  isolate->set_library_tag_handler(BootstrapLibraryTagHandler);
+
+  // Enter the Dart Scope as we will be calling back into the library
+  // tag handler when compiling the bootstrap libraries.
+  Dart_EnterScope();
+
+  // Create library objects for all the bootstrap libraries.
+  intptr_t i = 0;
+  while (bootstrap_libraries[i].index_ != ObjectStore::kNone) {
+    uri = Symbols::New(bootstrap_libraries[i].uri_);
+    lib = Library::LookupLibrary(uri);
+    if (lib.IsNull()) {
+      lib = Library::NewLibraryHelper(uri, false);
+      lib.Register();
+    }
+    isolate->object_store()->set_bootstrap_library(
+        bootstrap_libraries[i].index_, lib);
+    i = i + 1;
+  }
+
+  // Load and compile bootstrap libraries.
+  i = 0;
+  while (bootstrap_libraries[i].index_ != ObjectStore::kNone) {
+    uri = Symbols::New(bootstrap_libraries[i].uri_);
+    lib = Library::LookupLibrary(uri);
+    ASSERT(!lib.IsNull());
+    source = GetLibrarySource(i, false);
+    script = Script::New(uri, source, RawScript::kLibraryTag);
+    error = Compile(lib, script);
+    if (!error.IsNull()) {
+      break;
+    }
+    // If a patch exists, load and patch the script.
+    if (bootstrap_libraries[i].patch_source_ != NULL) {
+      patch_uri = String::New(bootstrap_libraries[i].patch_uri_,
+                              Heap::kOld);
+      source = GetLibrarySource(i, true);
+      script = Script::New(patch_uri, source, RawScript::kPatchTag);
+      error = lib.Patch(script);
+      if (!error.IsNull()) {
+        break;
+      }
+    }
+    i = i + 1;
+  }
+  if (error.IsNull()) {
+    SetupNativeResolver();
+  }
+
+  // Exit the Dart scope.
+  Dart_ExitScope();
+
+  // Restore the library tag handler for the isolate.
+  isolate->set_library_tag_handler(saved_tag_handler);
+
+  return error.raw();
+}
+
 }  // namespace dart
diff --git a/runtime/vm/bootstrap.h b/runtime/vm/bootstrap.h
index 93619a4..025b90b 100644
--- a/runtime/vm/bootstrap.h
+++ b/runtime/vm/bootstrap.h
@@ -10,31 +10,13 @@
 namespace dart {
 
 // Forward declarations.
-class Library;
 class RawError;
-class RawScript;
-class Script;
 
 class Bootstrap : public AllStatic {
  public:
-  static RawScript* LoadAsyncScript(bool patch);
-  static RawScript* LoadCoreScript(bool patch);
-  static RawScript* LoadCollectionScript(bool patch);
-  static RawScript* LoadCollectionDevScript(bool patch);
-  static RawScript* LoadCryptoScript(bool patch);
-  static RawScript* LoadIsolateScript(bool patch);
-  static RawScript* LoadJsonScript(bool patch);
-  static RawScript* LoadMathScript(bool patch);
-  static RawScript* LoadMirrorsScript(bool patch);
-  static RawScript* LoadTypedDataScript(bool patch);
-  static RawScript* LoadUriScript(bool patch);
-  static RawScript* LoadUtfScript(bool patch);
-  static RawError* Compile(const Library& library, const Script& script);
+  static RawError* LoadandCompileScripts();
   static void SetupNativeResolver();
 
- private:
-  static RawScript* LoadScript(const char* url, const char* source, bool patch);
-
   static const char async_source_[];
   static const char async_patch_[];
   static const char corelib_source_[];
diff --git a/runtime/vm/bootstrap_nocorelib.cc b/runtime/vm/bootstrap_nocorelib.cc
index 7655b1e..99b2780 100644
--- a/runtime/vm/bootstrap_nocorelib.cc
+++ b/runtime/vm/bootstrap_nocorelib.cc
@@ -15,79 +15,7 @@
 DEFINE_FLAG(bool, print_bootstrap, false, "Print the bootstrap source.");
 
 
-RawScript* Bootstrap::LoadAsyncScript(bool is_patch) {
-  UNREACHABLE();
-  return Script::null();
-}
-
-
-RawScript* Bootstrap::LoadCoreScript(bool is_patch) {
-  UNREACHABLE();
-  return Script::null();
-}
-
-
-RawScript* Bootstrap::LoadCollectionScript(bool is_patch) {
-  UNREACHABLE();
-  return Script::null();
-}
-
-
-RawScript* Bootstrap::LoadCollectionDevScript(bool is_patch) {
-  UNREACHABLE();
-  return Script::null();
-}
-
-
-RawScript* Bootstrap::LoadCryptoScript(bool is_patch) {
-  UNREACHABLE();
-  return Script::null();
-}
-
-
-RawScript* Bootstrap::LoadIsolateScript(bool is_patch) {
-  UNREACHABLE();
-  return Script::null();
-}
-
-
-RawScript* Bootstrap::LoadJsonScript(bool is_patch) {
-  UNREACHABLE();
-  return Script::null();
-}
-
-
-RawScript* Bootstrap::LoadMathScript(bool is_patch) {
-  UNREACHABLE();
-  return Script::null();
-}
-
-
-RawScript* Bootstrap::LoadMirrorsScript(bool is_patch) {
-  UNREACHABLE();
-  return Script::null();
-}
-
-
-RawScript* Bootstrap::LoadTypedDataScript(bool is_patch) {
-  UNREACHABLE();
-  return Script::null();
-}
-
-
-RawScript* Bootstrap::LoadUriScript(bool is_patch) {
-  UNREACHABLE();
-  return Script::null();
-}
-
-
-RawScript* Bootstrap::LoadUtfScript(bool is_patch) {
-  UNREACHABLE();
-  return Script::null();
-}
-
-
-RawError* Bootstrap::Compile(const Library& library, const Script& script) {
+RawError* Bootstrap::LoadandCompileScripts() {
   UNREACHABLE();
   return Error::null();
 }
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index 6d0b880..63f4ca4 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -245,6 +245,11 @@
       optimizer.SelectRepresentations();
       DEBUG_ASSERT(flow_graph->VerifyUseLists());
 
+      if (FLAG_common_subexpression_elimination ||
+          FLAG_loop_invariant_code_motion) {
+        flow_graph->ComputeBlockEffects();
+      }
+
       if (FLAG_common_subexpression_elimination) {
         if (DominatorBasedCSE::Optimize(flow_graph)) {
           DEBUG_ASSERT(flow_graph->VerifyUseLists());
diff --git a/runtime/vm/dart_api_impl_test.cc b/runtime/vm/dart_api_impl_test.cc
index 1f939b5..ae47a18 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -17,10 +17,6 @@
 
 DECLARE_FLAG(bool, enable_type_checks);
 
-#if defined(TARGET_ARCH_IA32) ||                                               \
-    defined(TARGET_ARCH_X64) ||                                                \
-    defined(TARGET_ARCH_ARM)
-
 TEST_CASE(ErrorHandleBasics) {
   const char* kScriptChars =
       "void testMain() {\n"
@@ -167,8 +163,6 @@
   EXPECT_SUBSTRING("myException", Dart_GetError(result));
 }
 
-#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM
-
 
 TEST_CASE(Dart_Error) {
   Dart_Handle error = Dart_Error("An %s", "error");
@@ -216,10 +210,6 @@
 }
 
 
-#if defined(TARGET_ARCH_IA32) ||                                               \
-    defined(TARGET_ARCH_X64) ||                                                \
-    defined(TARGET_ARCH_ARM)
-
 TEST_CASE(ObjectEquals) {
   bool equal = false;
   Dart_Handle five = NewString("5");
@@ -239,8 +229,6 @@
   EXPECT(!equal);
 }
 
-#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM
-
 
 TEST_CASE(InstanceValues) {
   EXPECT(Dart_IsInstance(NewString("test")));
@@ -338,10 +326,6 @@
 }
 
 
-#if defined(TARGET_ARCH_IA32) ||                                               \
-    defined(TARGET_ARCH_X64) ||                                                \
-    defined(TARGET_ARCH_ARM)
-
 TEST_CASE(NumberValues) {
   // TODO(antonm): add various kinds of ints (smi, mint, bigint).
   const char* kScriptChars =
@@ -374,8 +358,6 @@
   EXPECT(!Dart_IsNumber(result));
 }
 
-#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM
-
 
 TEST_CASE(IntegerValues) {
   const int64_t kIntegerVal1 = 100;
@@ -639,10 +621,6 @@
 }
 
 
-#if defined(TARGET_ARCH_IA32) ||                                               \
-    defined(TARGET_ARCH_X64) ||                                                \
-    defined(TARGET_ARCH_ARM)
-
 static void ExternalStringCallbackFinalizer(void* peer) {
   *static_cast<int*>(peer) *= 2;
 }
@@ -1412,9 +1390,6 @@
 }
 
 
-#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM
-
-
 // Unit test for entering a scope, creating a local handle and exiting
 // the scope.
 UNIT_TEST_CASE(EnterExitScope) {
@@ -1547,10 +1522,6 @@
 };
 
 
-#if defined(TARGET_ARCH_IA32) ||                                               \
-    defined(TARGET_ARCH_X64) ||                                                \
-    defined(TARGET_ARCH_ARM)
-
 TEST_CASE(WeakPersistentHandle) {
   Dart_Handle weak_new_ref = Dart_Null();
   EXPECT(Dart_IsNull(weak_new_ref));
@@ -2414,8 +2385,6 @@
   EXPECT_EQ(7, global_epilogue_callback_status);
 }
 
-#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM
-
 
 // Unit test for creating multiple scopes and local handles within them.
 // Ensure that the local handles get all cleaned out when exiting the
@@ -2586,10 +2555,6 @@
 }
 
 
-#if defined(TARGET_ARCH_IA32) ||                                               \
-    defined(TARGET_ARCH_X64) ||                                                \
-    defined(TARGET_ARCH_ARM)
-
 TEST_CASE(ClassTypedefsEtc) {
   const char* kScriptChars =
       "class SomeClass {\n"
@@ -7651,6 +7616,4 @@
   EXPECT_EQ(260, value);
 }
 
-#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 0290e50..0023217 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -339,7 +339,7 @@
 }
 
 
-RawContext* ActivationFrame::GetSavedContext() {
+RawContext* ActivationFrame::GetSavedContext(const Context& ctx) {
   GetVarDescriptors();
   intptr_t var_desc_len = var_descriptors_.Length();
   for (int i = 0; i < var_desc_len; i++) {
@@ -349,8 +349,7 @@
       return reinterpret_cast<RawContext*>(GetLocalVarValue(var_info.index));
     }
   }
-  UNREACHABLE();
-  return Context::null();
+  return ctx.raw();
 }
 
 
@@ -883,7 +882,6 @@
   Code& code = Code::Handle(isolate);
   StackFrameIterator iterator(false);
   StackFrame* frame = iterator.NextFrame();
-  bool get_saved_context = false;
   bool optimized_frame_found = false;
   while (frame != NULL) {
     ASSERT(frame->IsValid());
@@ -898,16 +896,12 @@
         activation->SetContext(Context::Handle());
         optimized_frame_found = true;
       } else {
-        if (get_saved_context) {
-          ctx = activation->GetSavedContext();
-        }
         activation->SetContext(ctx);
+        ctx = activation->GetSavedContext(ctx);
       }
       stack_trace->AddActivation(activation);
-      get_saved_context = activation->function().IsClosureFunction();
     } else if (frame->IsEntryFrame()) {
       ctx = reinterpret_cast<EntryFrame*>(frame)->SavedContext();
-      get_saved_context = false;
     }
     frame = iterator.NextFrame();
   }
diff --git a/runtime/vm/debugger.h b/runtime/vm/debugger.h
index 0aa2a9c..94863b4 100644
--- a/runtime/vm/debugger.h
+++ b/runtime/vm/debugger.h
@@ -159,7 +159,7 @@
                   Instance* value);
 
   RawArray* GetLocalVariables();
-  RawContext* GetSavedContext();
+  RawContext* GetSavedContext(const Context& ctx);
 
  private:
   intptr_t PcDescIndex();
diff --git a/runtime/vm/flow_graph.cc b/runtime/vm/flow_graph.cc
index 167e443..34ca693 100644
--- a/runtime/vm/flow_graph.cc
+++ b/runtime/vm/flow_graph.cc
@@ -28,7 +28,8 @@
     graph_entry_(graph_entry),
     preorder_(),
     postorder_(),
-    reverse_postorder_() {
+    reverse_postorder_(),
+    block_effects_(NULL) {
   DiscoverBlocks();
 }
 
@@ -99,6 +100,9 @@
   for (intptr_t i = 0; i < block_count; ++i) {
     reverse_postorder_.Add(postorder_[block_count - i - 1]);
   }
+
+  // Block effects are using postorder numbering. Discard computed information.
+  block_effects_ = NULL;
 }
 
 
@@ -923,4 +927,114 @@
   return size;
 }
 
+
+void FlowGraph::ComputeBlockEffects() {
+  block_effects_ = new BlockEffects(this);
+}
+
+
+BlockEffects::BlockEffects(FlowGraph* flow_graph)
+    : available_at_(flow_graph->postorder().length()) {
+  // We are tracking a single effect.
+  ASSERT(EffectSet::kLastEffect == 1);
+
+  const intptr_t block_count = flow_graph->postorder().length();
+
+  // Set of blocks that contain side-effects.
+  BitVector* kill = new BitVector(block_count);
+
+  // Per block available-after sets. Block A is available after the block B if
+  // and only if A is either equal to B or A is available at B and B contains no
+  // side-effects. Initially we consider all blocks available after all other
+  // blocks.
+  GrowableArray<BitVector*> available_after(block_count);
+
+  // Discover all blocks with side-effects.
+  for (BlockIterator it = flow_graph->postorder_iterator();
+       !it.Done();
+       it.Advance()) {
+    available_at_.Add(NULL);
+    available_after.Add(NULL);
+
+    BlockEntryInstr* block = it.Current();
+    for (ForwardInstructionIterator it(block);
+         !it.Done();
+         it.Advance()) {
+      if (!it.Current()->Effects().IsNone()) {
+        kill->Add(block->postorder_number());
+        break;
+      }
+    }
+  }
+
+  BitVector* temp = new BitVector(block_count);
+
+  // Recompute available-at based on predecessors' available-after until the fix
+  // point is reached.
+  bool changed;
+  do {
+    changed = false;
+
+    for (BlockIterator it = flow_graph->reverse_postorder_iterator();
+         !it.Done();
+         it.Advance()) {
+      BlockEntryInstr* block = it.Current();
+      const intptr_t block_num = block->postorder_number();
+
+      if (block->IsGraphEntry()) {
+        temp->Clear();  // Nothing is live-in into graph entry.
+      } else {
+        // Available-at is an intersection of all predecessors' available-after
+        // sets.
+        temp->SetAll();
+        for (intptr_t i = 0; i < block->PredecessorCount(); i++) {
+          const intptr_t pred = block->PredecessorAt(i)->postorder_number();
+          if (available_after[pred] != NULL) {
+            temp->Intersect(available_after[pred]);
+          }
+        }
+      }
+
+      BitVector* current = available_at_[block_num];
+      if ((current == NULL) || !current->Equals(*temp)) {
+        // Available-at changed: update it and recompute available-after.
+        if (available_at_[block_num] == NULL) {
+          current = available_at_[block_num] = new BitVector(block_count);
+          available_after[block_num] = new BitVector(block_count);
+          // Block is always available after itself.
+          available_after[block_num]->Add(block_num);
+        }
+        current->CopyFrom(temp);
+        if (!kill->Contains(block_num)) {
+          available_after[block_num]->CopyFrom(temp);
+          // Block is always available after itself.
+          available_after[block_num]->Add(block_num);
+        }
+        changed = true;
+      }
+    }
+  } while (changed);
+}
+
+
+bool BlockEffects::IsAvailableAt(Instruction* instr,
+                                 BlockEntryInstr* block) const {
+  return (instr->Dependencies().IsNone()) ||
+      IsSideEffectFreePath(instr->GetBlock(), block);
+}
+
+
+bool BlockEffects::CanBeMovedTo(Instruction* instr,
+                                BlockEntryInstr* block) const {
+  return (instr->Dependencies().IsNone()) ||
+      IsSideEffectFreePath(block, instr->GetBlock());
+}
+
+
+bool BlockEffects::IsSideEffectFreePath(BlockEntryInstr* from,
+                                        BlockEntryInstr* to) const {
+  return available_at_[to->postorder_number()]->Contains(
+      from->postorder_number());
+}
+
 }  // namespace dart
diff --git a/runtime/vm/flow_graph.h b/runtime/vm/flow_graph.h
index 4d384f3..7016767 100644
--- a/runtime/vm/flow_graph.h
+++ b/runtime/vm/flow_graph.h
@@ -11,6 +11,7 @@
 
 namespace dart {
 
+class BlockEffects;
 class FlowGraphBuilder;
 class ValueInliningContext;
 class VariableLivenessAnalysis;
@@ -140,6 +141,11 @@
 
   void DiscoverBlocks();
 
+  // Compute information about effects occuring in different blocks and
+  // discover side-effect free paths.
+  void ComputeBlockEffects();
+  BlockEffects* block_effects() const { return block_effects_; }
+
  private:
   friend class IfConverter;
   friend class BranchSimplifier;
@@ -193,6 +199,8 @@
   GrowableArray<BlockEntryInstr*> postorder_;
   GrowableArray<BlockEntryInstr*> reverse_postorder_;
   ConstantInstr* constant_null_;
+
+  BlockEffects* block_effects_;
 };
 
 
@@ -266,6 +274,35 @@
   GrowableArray<BitVector*> live_in_;
 };
 
+
+// Information about side effect free paths between blocks.
+class BlockEffects : public ZoneAllocated {
+ public:
+  explicit BlockEffects(FlowGraph* flow_graph);
+
+  // Return true if the given instruction is not affected by anything between
+  // its current block and target block. Used by CSE to determine if
+  // a computation is available in the given block.
+  bool IsAvailableAt(Instruction* instr, BlockEntryInstr* block) const;
+
+  // Return true if the given instruction is not affected by anything between
+  // the given block and its current block. Used by LICM to determine if
+  // a computation can be moved to loop's preheader and remain available at
+  // its current location.
+  bool CanBeMovedTo(Instruction* instr, BlockEntryInstr* block) const;
+
+ private:
+  // Returns true if from dominates to and all paths between from and to are
+  // free of side effects.
+  bool IsSideEffectFreePath(BlockEntryInstr* from, BlockEntryInstr* to) const;
+
+  // Per block sets of available blocks. Block A is available at the block B if
+  // and only if A dominates B and all paths from A to B are free of side
+  // effects.
+  GrowableArray<BitVector*> available_at_;
+};
+
+
 }  // namespace dart
 
 #endif  // VM_FLOW_GRAPH_H_
diff --git a/runtime/vm/flow_graph_allocator.cc b/runtime/vm/flow_graph_allocator.cc
index a347c8f..5125f97 100644
--- a/runtime/vm/flow_graph_allocator.cc
+++ b/runtime/vm/flow_graph_allocator.cc
@@ -522,13 +522,13 @@
         spill_slots_.Add(range->End());
         quad_spill_slots_.Add(false);
       }
-      AssignSafepoints(range);
     } else {
       ConstantInstr* constant = defn->AsConstant();
       ASSERT(constant != NULL);
       range->set_assigned_location(Location::Constant(constant->value()));
       range->set_spill_slot(Location::Constant(constant->value()));
     }
+    AssignSafepoints(range);
     range->finger()->Initialize(range);
     UsePosition* use =
         range->finger()->FirstRegisterBeneficialUse(graph_entry->start_pos());
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index 76f6469..9a7cf79 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -978,13 +978,13 @@
     // No instantiator when inside factory.
     *push_instantiator_result = PushArgument(BuildNullValue());
     instantiator_type_arguments =
-        BuildInstantiatorTypeArguments(token_pos, NULL);
+        BuildInstantiatorTypeArguments(token_pos, instantiator_class, NULL);
   } else {
     instantiator = Bind(BuildStoreExprTemp(instantiator));
     *push_instantiator_result = PushArgument(instantiator);
     Value* loaded = Bind(BuildLoadExprTemp());
     instantiator_type_arguments =
-        BuildInstantiatorTypeArguments(token_pos, loaded);
+        BuildInstantiatorTypeArguments(token_pos, instantiator_class, loaded);
   }
   *push_instantiator_type_arguments_result =
       PushArgument(instantiator_type_arguments);
@@ -1007,13 +1007,13 @@
     // No instantiator when inside factory.
     instantiator = BuildNullValue();
     instantiator_type_arguments =
-        BuildInstantiatorTypeArguments(token_pos, NULL);
+        BuildInstantiatorTypeArguments(token_pos, instantiator_class, NULL);
   } else {
     // Preserve instantiator.
     instantiator = Bind(BuildStoreExprTemp(instantiator));
     Value* loaded = Bind(BuildLoadExprTemp());
     instantiator_type_arguments =
-        BuildInstantiatorTypeArguments(token_pos, loaded);
+        BuildInstantiatorTypeArguments(token_pos, instantiator_class, loaded);
   }
   *instantiator_result = instantiator;
   *instantiator_type_arguments_result = instantiator_type_arguments;
@@ -1843,7 +1843,11 @@
   Value* type_arguments = NULL;
   if (requires_type_arguments) {
     ASSERT(!function.IsImplicitStaticClosureFunction());
-    type_arguments = BuildInstantiatorTypeArguments(node->token_pos(), NULL);
+    const Class& instantiator_class = Class::Handle(
+        owner()->parsed_function().function().Owner());
+    type_arguments = BuildInstantiatorTypeArguments(node->token_pos(),
+                                                    instantiator_class,
+                                                    NULL);
   } else {
     type_arguments = BuildNullValue();
   }
@@ -2046,27 +2050,6 @@
 }
 
 
-// List of recognized list factories in core lib:
-// (factory-name-symbol, result-cid, fingerprint).
-// TODO(srdjan): Store the values in the snapshot instead.
-#define RECOGNIZED_LIST_FACTORY_LIST(V)                                        \
-  V(ObjectArrayFactory, kArrayCid, 97987288)                                   \
-  V(GrowableObjectArrayWithData, kGrowableObjectArrayCid, 816132033)           \
-  V(GrowableObjectArrayFactory, kGrowableObjectArrayCid, 552407276)            \
-  V(Int8ListFactory, kTypedDataInt8ArrayCid, 1299195009)                       \
-  V(Uint8ListFactory, kTypedDataUint8ArrayCid, 1493118613)                     \
-  V(Uint8ClampedListFactory, kTypedDataUint8ClampedArrayCid, 642014193)        \
-  V(Int16ListFactory, kTypedDataInt16ArrayCid, 1346619471)                     \
-  V(Uint16ListFactory, kTypedDataUint16ArrayCid, 1374024153)                   \
-  V(Int32ListFactory, kTypedDataInt32ArrayCid, 1583592980)                     \
-  V(Uint32ListFactory, kTypedDataUint32ArrayCid, 1940214615)                   \
-  V(Int64ListFactory, kTypedDataInt64ArrayCid, 108181413)                      \
-  V(Uint64ListFactory, kTypedDataUint64ArrayCid, 375587484)                    \
-  V(Float64ListFactory, kTypedDataFloat64ArrayCid, 919047725)                  \
-  V(Float32ListFactory, kTypedDataFloat32ArrayCid, 1038684997)                 \
-  V(Float32x4ListFactory, kTypedDataFloat32x4ArrayCid, 801641591)              \
-
-
 // Class that recognizes factories and returns corresponding result cid.
 class FactoryRecognizer : public AllStatic {
  public:
@@ -2182,9 +2165,9 @@
 // 'expression_temp_var' may not be used inside this method if 'instantiator'
 // is not NULL.
 Value* EffectGraphVisitor::BuildInstantiatorTypeArguments(
-    intptr_t token_pos, Value* instantiator) {
-  const Class& instantiator_class = Class::Handle(
-      owner()->parsed_function().function().Owner());
+    intptr_t token_pos,
+    const Class& instantiator_class,
+    Value* instantiator) {
   if (instantiator_class.NumTypeParameters() == 0) {
     // The type arguments are compile time constants.
     AbstractTypeArguments& type_arguments = AbstractTypeArguments::ZoneHandle();
@@ -2237,10 +2220,13 @@
     return Bind(new ConstantInstr(type_arguments));
   }
   // The type arguments are uninstantiated.
+  const Class& instantiator_class = Class::ZoneHandle(
+      owner()->parsed_function().function().Owner());
   Value* instantiator_value =
-      BuildInstantiatorTypeArguments(token_pos, NULL);
+      BuildInstantiatorTypeArguments(token_pos, instantiator_class, NULL);
   return Bind(new InstantiateTypeArgumentsInstr(token_pos,
                                                 type_arguments,
+                                                instantiator_class,
                                                 instantiator_value));
 }
 
@@ -2286,8 +2272,10 @@
   ASSERT(owner()->parsed_function().expression_temp_var() != NULL);
   const LocalVariable& t1 = *owner()->parsed_function().expression_temp_var();
   const LocalVariable& t2 = node->allocated_object_var();
+  const Class& instantiator_class = Class::Handle(
+      owner()->parsed_function().function().Owner());
   Value* instantiator_type_arguments = BuildInstantiatorTypeArguments(
-      node->token_pos(), NULL);
+      node->token_pos(), instantiator_class, NULL);
   Value* stored_instantiator =
       Bind(BuildStoreTemp(t1, instantiator_type_arguments));
   // t1: instantiator type arguments.
@@ -2296,6 +2284,7 @@
       new ExtractConstructorTypeArgumentsInstr(
           node->token_pos(),
           node->type_arguments(),
+          instantiator_class,
           stored_instantiator));
 
   Do(BuildStoreTemp(t2, extract_type_arguments));
@@ -2303,7 +2292,9 @@
   Value* load_instantiator = Bind(BuildLoadLocal(t1));
 
   Value* extract_instantiator =
-      Bind(new ExtractConstructorInstantiatorInstr(node, load_instantiator));
+      Bind(new ExtractConstructorInstantiatorInstr(node,
+                                                   instantiator_class,
+                                                   load_instantiator));
   Do(BuildStoreTemp(t1, extract_instantiator));
   // t2: extracted constructor type arguments.
   // t1: extracted constructor instantiator.
diff --git a/runtime/vm/flow_graph_builder.h b/runtime/vm/flow_graph_builder.h
index 3350151..ec525ec 100644
--- a/runtime/vm/flow_graph_builder.h
+++ b/runtime/vm/flow_graph_builder.h
@@ -16,6 +16,27 @@
 class Instruction;
 class ParsedFunction;
 
+// List of recognized list factories:
+// (factory-name-symbol, result-cid, fingerprint).
+// TODO(srdjan): Store the values in the snapshot instead.
+#define RECOGNIZED_LIST_FACTORY_LIST(V)                                        \
+  V(ObjectArrayFactory, kArrayCid, 97987288)                                   \
+  V(GrowableObjectArrayWithData, kGrowableObjectArrayCid, 816132033)           \
+  V(GrowableObjectArrayFactory, kGrowableObjectArrayCid, 552407276)            \
+  V(_Int8ArrayFactory, kTypedDataInt8ArrayCid, 1168404493)                     \
+  V(_Uint8ArrayFactory, kTypedDataUint8ArrayCid, 2094565809)                   \
+  V(_Uint8ClampedArrayFactory, kTypedDataUint8ClampedArrayCid, 1449285088)     \
+  V(_Int16ArrayFactory, kTypedDataInt16ArrayCid, 1430476167)                   \
+  V(_Uint16ArrayFactory, kTypedDataUint16ArrayCid, 996241892)                  \
+  V(_Int32ArrayFactory, kTypedDataInt32ArrayCid, 360797715)                    \
+  V(_Uint32ArrayFactory, kTypedDataUint32ArrayCid, 995053409)                  \
+  V(_Int64ArrayFactory, kTypedDataInt64ArrayCid, 570248142)                    \
+  V(_Uint64ArrayFactory, kTypedDataUint64ArrayCid, 1114332856)                 \
+  V(_Float64ArrayFactory, kTypedDataFloat64ArrayCid, 1896334311)               \
+  V(_Float32ArrayFactory, kTypedDataFloat32ArrayCid, 1719636031)               \
+  V(_Float32x4ArrayFactory, kTypedDataFloat32x4ArrayCid, 1768466392)           \
+
+
 // 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 {
@@ -253,6 +274,7 @@
                                Value** instantiator_type_arguments);
   Value* BuildInstantiator();
   Value* BuildInstantiatorTypeArguments(intptr_t token_pos,
+                                        const Class& instantiator_class,
                                         Value* instantiator);
 
   // Perform a type check on the given value.
diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc
index 4a363ce5..2ec6ebc 100644
--- a/runtime/vm/flow_graph_compiler.cc
+++ b/runtime/vm/flow_graph_compiler.cc
@@ -146,6 +146,8 @@
           Isolate::Current()->object_store()->double_class())),
       float32x4_class_(Class::ZoneHandle(
           Isolate::Current()->object_store()->float32x4_class())),
+      uint32x4_class_(Class::ZoneHandle(
+          Isolate::Current()->object_store()->uint32x4_class())),
       parallel_move_resolver_(this),
       pending_deoptimization_env_(NULL) {
   ASSERT(assembler != NULL);
diff --git a/runtime/vm/flow_graph_compiler.h b/runtime/vm/flow_graph_compiler.h
index 26c0d80..4c7204a 100644
--- a/runtime/vm/flow_graph_compiler.h
+++ b/runtime/vm/flow_graph_compiler.h
@@ -413,6 +413,7 @@
 
   const Class& double_class() const { return double_class_; }
   const Class& float32x4_class() const { return float32x4_class_; }
+  const Class& uint32x4_class() const { return uint32x4_class_; }
 
   void SaveLiveRegisters(LocationSummary* locs);
   void RestoreLiveRegisters(LocationSummary* locs);
@@ -571,6 +572,7 @@
 
   const Class& double_class_;
   const Class& float32x4_class_;
+  const Class& uint32x4_class_;
 
   ParallelMoveResolver parallel_move_resolver_;
 
diff --git a/runtime/vm/flow_graph_compiler_mips.cc b/runtime/vm/flow_graph_compiler_mips.cc
index 110bc96..4308491 100644
--- a/runtime/vm/flow_graph_compiler_mips.cc
+++ b/runtime/vm/flow_graph_compiler_mips.cc
@@ -601,10 +601,12 @@
   __ lw(T2, FieldAddress(S4, ArgumentsDescriptor::positional_count_offset()));
   // Check that min_num_pos_args <= num_pos_args.
   Label wrong_num_arguments;
-  __ BranchLess(T2, Smi::RawValue(min_num_pos_args), &wrong_num_arguments);
+  __ BranchSignedLess(T2, Smi::RawValue(min_num_pos_args),
+                      &wrong_num_arguments);
 
   // Check that num_pos_args <= max_num_pos_args.
-  __ BranchGreater(T2, Smi::RawValue(max_num_pos_args), &wrong_num_arguments);
+  __ BranchSignedGreater(T2, Smi::RawValue(max_num_pos_args),
+                         &wrong_num_arguments);
 
   // Copy positional arguments.
   // Argument i passed at fp[kLastParamSlotIndex + num_args - 1 - i] is copied
@@ -724,7 +726,7 @@
       // arguments have been passed, where k is param_pos, the position of this
       // optional parameter in the formal parameter list.
       const int param_pos = num_fixed_params + i;
-      __ BranchGreater(T2, param_pos, &next_parameter);
+      __ BranchSignedGreater(T2, param_pos, &next_parameter);
       // Load T3 with default argument.
       const Object& value = Object::ZoneHandle(
           parsed_function().default_parameter_values().At(i));
@@ -885,7 +887,8 @@
 
       // Skip Branch if T1 is less than the threshold.
       Label dont_branch;
-      __ BranchLess(T1, FLAG_optimization_counter_threshold, &dont_branch);
+      __ BranchSignedLess(T1, FLAG_optimization_counter_threshold,
+                          &dont_branch);
 
       ASSERT(function_reg == T0);
       __ Branch(&StubCode::OptimizeFunctionLabel());
@@ -1121,7 +1124,21 @@
     intptr_t deopt_id,
     intptr_t token_pos,
     LocationSummary* locs) {
-  UNIMPLEMENTED();
+  // Each ICData propagated from unoptimized to optimized code contains the
+  // function that corresponds to the Dart function of that IC call. Due
+  // to inlining in optimized code, that function may not correspond to the
+  // top-level function (parsed_function().function()) which could be
+  // reoptimized and which counter needs to be incremented.
+  // Pass the function explicitly, it is used in IC stub.
+  __ LoadObject(T0, parsed_function().function());
+  __ LoadObject(S4, arguments_descriptor);
+  __ LoadObject(S5, ic_data);
+  GenerateDartCall(deopt_id,
+                   token_pos,
+                   target_label,
+                   PcDescriptors::kIcCall,
+                   locs);
+  __ Drop(argument_count);
 }
 
 
@@ -1179,7 +1196,18 @@
 void FlowGraphCompiler::EmitEqualityRegConstCompare(Register reg,
                                                     const Object& obj,
                                                     bool needs_number_check) {
-  UNIMPLEMENTED();
+  if (needs_number_check &&
+      (obj.IsMint() || obj.IsDouble() || obj.IsBigint())) {
+    __ addiu(SP, SP, Immediate(-2 * kWordSize));
+    __ sw(reg, Address(SP, 1 * kWordSize));
+    __ LoadObject(TMP1, obj);
+    __ sw(TMP1, Address(SP, 0 * kWordSize));
+    __ BranchLink(&StubCode::IdenticalWithNumberCheckLabel());
+    __ lw(reg, Address(SP, 1 * kWordSize));  // Restore 'reg'.
+    __ addiu(SP, SP, Immediate(2 * kWordSize));  // Discard constant.
+    return;
+  }
+  __ CompareObject(CMPRES, reg, obj);
 }
 
 
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index 3170079..555b859 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -374,6 +374,13 @@
     converted = new UnboxFloat32x4Instr(use->CopyWithType(), deopt_id);
   } else if ((from == kUnboxedFloat32x4) && (to == kTagged)) {
     converted = new BoxFloat32x4Instr(use->CopyWithType());
+  } else if ((from == kTagged) && (to == kUnboxedUint32x4)) {
+    ASSERT((deopt_target != NULL) || (use->Type()->ToCid() == kUint32x4Cid));
+    const intptr_t deopt_id = (deopt_target != NULL) ?
+        deopt_target->DeoptimizationTarget() : Isolate::kNoDeoptId;
+    converted = new UnboxUint32x4Instr(use->CopyWithType(), deopt_id);
+  } else if ((from == kUnboxedUint32x4) && (to == kTagged)) {
+    converted = new BoxUint32x4Instr(use->CopyWithType());
   }
   ASSERT(converted != NULL);
   use->BindTo(converted);
@@ -1605,11 +1612,10 @@
   }
 
   if ((recognized_kind == MethodRecognizer::kIntegerToDouble) &&
+      (ic_data.NumberOfChecks() == 1) &&
       (class_ids[0] == kSmiCid)) {
-    SmiToDoubleInstr* s2d_instr = new SmiToDoubleInstr(call);
-    call->ReplaceWith(s2d_instr, current_iterator());
-    // Pushed arguments are not removed because SmiToDouble is implemented
-    // as a call.
+    AddReceiverCheck(call);
+    ReplaceCall(call, new SmiToDoubleInstr(new Value(call->ArgumentAt(0))));
     return true;
   }
 
@@ -1730,6 +1736,86 @@
         return false;
     }
   }
+
+  if ((class_ids[0] == kFloat32x4Cid) && (ic_data.NumberOfChecks() == 1)) {
+    switch (recognized_kind) {
+      case MethodRecognizer::kFloat32x4Equal:
+      case MethodRecognizer::kFloat32x4GreaterThan:
+      case MethodRecognizer::kFloat32x4GreaterThanOrEqual:
+      case MethodRecognizer::kFloat32x4LessThan:
+      case MethodRecognizer::kFloat32x4LessThanOrEqual:
+      case MethodRecognizer::kFloat32x4NotEqual: {
+        Definition* left = call->ArgumentAt(0);
+        Definition* right = call->ArgumentAt(1);
+        // Type check left.
+        AddCheckClass(left,
+                      ICData::ZoneHandle(
+                          call->ic_data()->AsUnaryClassChecksForArgNr(0)),
+                      call->deopt_id(),
+                      call->env(),
+                      call);
+        // Replace call.
+        Float32x4ComparisonInstr* cmp =
+            new Float32x4ComparisonInstr(recognized_kind, new Value(left),
+                                         new Value(right), call);
+        ReplaceCall(call, cmp);
+        return true;
+      }
+      case MethodRecognizer::kFloat32x4Min:
+      case MethodRecognizer::kFloat32x4Max: {
+        Definition* left = call->ArgumentAt(0);
+        Definition* right = call->ArgumentAt(1);
+        // Type check left.
+        AddCheckClass(left,
+                      ICData::ZoneHandle(
+                          call->ic_data()->AsUnaryClassChecksForArgNr(0)),
+                      call->deopt_id(),
+                      call->env(),
+                      call);
+        Float32x4MinMaxInstr* minmax =
+            new Float32x4MinMaxInstr(recognized_kind, new Value(left),
+                                     new Value(right), call);
+        ReplaceCall(call, minmax);
+        return true;
+      }
+      case MethodRecognizer::kFloat32x4Scale: {
+        Definition* left = call->ArgumentAt(0);
+        Definition* right = call->ArgumentAt(1);
+        // Type check left.
+        AddCheckClass(left,
+                      ICData::ZoneHandle(
+                          call->ic_data()->AsUnaryClassChecksForArgNr(0)),
+                      call->deopt_id(),
+                      call->env(),
+                      call);
+        // Left and right values are swapped when handed to the instruction,
+        // this is done so that the double value is loaded into the output
+        // register and can be destroyed.
+        Float32x4ScaleInstr* scale =
+            new Float32x4ScaleInstr(recognized_kind, new Value(right),
+                                    new Value(left), call);
+        ReplaceCall(call, scale);
+        return true;
+      }
+      case MethodRecognizer::kFloat32x4Sqrt:
+      case MethodRecognizer::kFloat32x4ReciprocalSqrt:
+      case MethodRecognizer::kFloat32x4Reciprocal: {
+        Definition* left = call->ArgumentAt(0);
+        AddCheckClass(left,
+              ICData::ZoneHandle(
+                  call->ic_data()->AsUnaryClassChecksForArgNr(0)),
+              call->deopt_id(),
+              call->env(),
+              call);
+        Float32x4SqrtInstr* sqrt =
+            new Float32x4SqrtInstr(recognized_kind, new Value(left), call);
+        ReplaceCall(call, sqrt);
+        return true;
+      }
+      default:
+        return false;
+    }
+  }
   return false;
 }
 
@@ -1819,7 +1905,6 @@
     default:
       // Array cids are already checked in the caller.
       UNREACHABLE();
-      return NULL;
   }
 
   Definition* index = call->ArgumentAt(1);
@@ -3076,7 +3161,9 @@
            !it.Done();
            it.Advance()) {
         Instruction* current = it.Current();
-        if (!current->IsPushArgument() && !current->AffectedBySideEffect()) {
+        if (!current->IsPushArgument() &&
+            current->AllowsCSE() &&
+            flow_graph()->block_effects()->CanBeMovedTo(current, pre_header)) {
           bool inputs_loop_invariant = true;
           for (int i = 0; i < current->InputCount(); ++i) {
             Definition* input_def = current->InputAt(i)->definition();
@@ -3107,7 +3194,7 @@
   // Immutable loads (not affected by side effects) are handled
   // in the DominatorBasedCSE pass.
   // TODO(fschneider): Extend to other load instructions.
-  return (def->IsLoadField() && def->AffectedBySideEffect())
+  return (def->IsLoadField() && !def->Dependencies().IsNone())
       || def->IsLoadIndexed()
       || def->IsLoadStaticField()
       || def->IsCurrentContext();
@@ -3586,7 +3673,7 @@
         }
 
         // Other instructions with side effects kill all loads.
-        if (instr->HasSideEffect()) {
+        if (!instr->Effects().IsNone()) {
           kill->SetAll();
           // There is no need to clear out_values when clearing GEN set
           // because only those values that are in the GEN set
@@ -3947,6 +4034,56 @@
 };
 
 
+class CSEInstructionMap : public ValueObject {
+ public:
+  // Right now CSE and LICM track a single effect: possible externalization of
+  // strings.
+  // Other effects like modifications of fields are tracked in a separate load
+  // forwarding pass via Alias structure.
+  COMPILE_ASSERT(EffectSet::kLastEffect == 1, single_effect_is_tracked);
+
+  CSEInstructionMap() : independent_(), dependent_() { }
+  explicit CSEInstructionMap(const CSEInstructionMap& other)
+      : ValueObject(),
+        independent_(other.independent_),
+        dependent_(other.dependent_) {
+  }
+
+  void RemoveAffected(EffectSet effects) {
+    if (!effects.IsNone()) {
+      dependent_.Clear();
+    }
+  }
+
+  Instruction* Lookup(Instruction* other) const {
+    return GetMapFor(other)->Lookup(other);
+  }
+
+  void Insert(Instruction* instr) {
+    return GetMapFor(instr)->Insert(instr);
+  }
+
+ private:
+  typedef DirectChainedHashMap<PointerKeyValueTrait<Instruction> >  Map;
+
+  Map* GetMapFor(Instruction* instr) {
+    return instr->Dependencies().IsNone() ? &independent_ : &dependent_;
+  }
+
+  const Map* GetMapFor(Instruction* instr) const {
+    return instr->Dependencies().IsNone() ? &independent_ : &dependent_;
+  }
+
+  // All computations that are not affected by any side-effect.
+  // Majority of computations are not affected by anything and will be in
+  // this map.
+  Map independent_;
+
+  // All computations that are affected by side effect.
+  Map dependent_;
+};
+
+
 bool DominatorBasedCSE::Optimize(FlowGraph* graph) {
   bool changed = false;
   if (FLAG_load_cse) {
@@ -3965,7 +4102,7 @@
     }
   }
 
-  DirectChainedHashMap<PointerKeyValueTrait<Instruction> > map;
+  CSEInstructionMap map;
   changed = OptimizeRecursive(graph, graph->graph_entry(), &map) || changed;
 
   return changed;
@@ -3975,19 +4112,29 @@
 bool DominatorBasedCSE::OptimizeRecursive(
     FlowGraph* graph,
     BlockEntryInstr* block,
-    DirectChainedHashMap<PointerKeyValueTrait<Instruction> >* map) {
+    CSEInstructionMap* map) {
   bool changed = false;
   for (ForwardInstructionIterator it(block); !it.Done(); it.Advance()) {
     Instruction* current = it.Current();
-    if (current->AffectedBySideEffect()) continue;
-    Instruction* replacement = map->Lookup(current);
-    if (replacement == NULL) {
+    if (current->AllowsCSE()) {
+      Instruction* replacement = map->Lookup(current);
+      if ((replacement != NULL) &&
+          graph->block_effects()->IsAvailableAt(replacement, block)) {
+        // Replace current with lookup result.
+        ReplaceCurrentInstruction(&it, current, replacement, graph);
+        changed = true;
+        continue;
+      }
+
+      // For simplicity we assume that instruction either does not depend on
+      // anything or does not affect anything. If this is not the case then
+      // we should first remove affected instructions from the map and
+      // then add instruction to the map so that it does not kill itself.
+      ASSERT(current->Effects().IsNone() || current->Dependencies().IsNone());
       map->Insert(current);
-      continue;
     }
-    // Replace current with lookup result.
-    ReplaceCurrentInstruction(&it, current, replacement, graph);
-    changed = true;
+
+    map->RemoveAffected(current->Effects());
   }
 
   // Process children in the dominator tree recursively.
@@ -3996,7 +4143,7 @@
     BlockEntryInstr* child = block->dominated_blocks()[i];
     if (i  < num_children - 1) {
       // Copy map.
-      DirectChainedHashMap<PointerKeyValueTrait<Instruction> > child_map(*map);
+      CSEInstructionMap child_map(*map);
       changed = OptimizeRecursive(graph, child, &child_map) || changed;
     } else {
       // Reuse map for the last child.
@@ -4552,7 +4699,9 @@
       SetValue(instr, object);
       return;
     }
-    if (instr->type_arguments().IsUninstantiatedIdentity()) {
+    if (instr->type_arguments().IsUninstantiatedIdentity() ||
+        instr->type_arguments().CanShareInstantiatorTypeArguments(
+            instr->instantiator_class())) {
       SetValue(instr, object);
       return;
     }
@@ -4675,8 +4824,13 @@
 
 
 void ConstantPropagator::VisitSmiToDouble(SmiToDoubleInstr* instr) {
-  // TODO(kmillikin): Handle conversion.
-  SetValue(instr, non_constant_);
+  const Object& value = instr->value()->definition()->constant_value();
+  if (IsConstant(value) && value.IsInteger()) {
+    SetValue(instr, Double::Handle(
+        Double::New(Integer::Cast(value).AsDoubleValue(), Heap::kOld)));
+  } else if (IsNonConstant(value)) {
+    SetValue(instr, non_constant_);
+  }
 }
 
 
@@ -4762,6 +4916,27 @@
 }
 
 
+void ConstantPropagator::VisitFloat32x4Comparison(
+    Float32x4ComparisonInstr* instr) {
+  SetValue(instr, non_constant_);
+}
+
+
+void ConstantPropagator::VisitFloat32x4MinMax(Float32x4MinMaxInstr* instr) {
+  SetValue(instr, non_constant_);
+}
+
+
+void ConstantPropagator::VisitFloat32x4Scale(Float32x4ScaleInstr* instr) {
+  SetValue(instr, non_constant_);
+}
+
+
+void ConstantPropagator::VisitFloat32x4Sqrt(Float32x4SqrtInstr* instr) {
+  SetValue(instr, non_constant_);
+}
+
+
 void ConstantPropagator::VisitMathSqrt(MathSqrtInstr* instr) {
   const Object& value = instr->value()->definition()->constant_value();
   if (IsNonConstant(value)) {
@@ -4817,6 +4992,28 @@
 }
 
 
+void ConstantPropagator::VisitUnboxUint32x4(UnboxUint32x4Instr* instr) {
+  const Object& value = instr->value()->definition()->constant_value();
+  if (IsNonConstant(value)) {
+    SetValue(instr, non_constant_);
+  } else if (IsConstant(value)) {
+    // TODO(kmillikin): Handle conversion.
+    SetValue(instr, non_constant_);
+  }
+}
+
+
+void ConstantPropagator::VisitBoxUint32x4(BoxUint32x4Instr* instr) {
+  const Object& value = instr->value()->definition()->constant_value();
+  if (IsNonConstant(value)) {
+    SetValue(instr, non_constant_);
+  } else if (IsConstant(value)) {
+    // TODO(kmillikin): Handle conversion.
+    SetValue(instr, non_constant_);
+  }
+}
+
+
 void ConstantPropagator::Analyze() {
   GraphEntryInstr* entry = graph_->graph_entry();
   reachable_->Add(entry->preorder_number());
diff --git a/runtime/vm/flow_graph_optimizer.h b/runtime/vm/flow_graph_optimizer.h
index 4bc64c3..980890b 100644
--- a/runtime/vm/flow_graph_optimizer.h
+++ b/runtime/vm/flow_graph_optimizer.h
@@ -10,9 +10,9 @@
 
 namespace dart {
 
+class CSEInstructionMap;
 template <typename T> class GrowableArray;
-template <typename T> class DirectChainedHashMap;
-template <typename T> class PointerKeyValueTrait;
+class ParsedFunction;
 
 class FlowGraphOptimizer : public FlowGraphVisitor {
  public:
@@ -177,9 +177,6 @@
 };
 
 
-class ParsedFunction;
-
-
 // Loop invariant code motion.
 class LICM : public ValueObject {
  public:
@@ -215,7 +212,7 @@
   static bool OptimizeRecursive(
       FlowGraph* graph,
       BlockEntryInstr* entry,
-      DirectChainedHashMap<PointerKeyValueTrait<Instruction> >* map);
+      CSEInstructionMap* map);
 };
 
 
diff --git a/runtime/vm/flow_graph_type_propagator.cc b/runtime/vm/flow_graph_type_propagator.cc
index f3f77f8..253697a 100644
--- a/runtime/vm/flow_graph_type_propagator.cc
+++ b/runtime/vm/flow_graph_type_propagator.cc
@@ -256,7 +256,7 @@
 
 void FlowGraphTypePropagator::VisitCheckClass(CheckClassInstr* check) {
   if ((check->unary_checks().NumberOfChecks() != 1) ||
-      check->AffectedBySideEffect()) {
+      !check->Dependencies().IsNone()) {
     // TODO(vegorov): If check is affected by side-effect we can still propagate
     // the type further but not the cid.
     return;
@@ -991,6 +991,26 @@
 }
 
 
+CompileType Float32x4ComparisonInstr::ComputeType() const {
+  return CompileType::FromCid(kUint32x4Cid);
+}
+
+
+CompileType Float32x4MinMaxInstr::ComputeType() const {
+  return CompileType::FromCid(kFloat32x4Cid);
+}
+
+
+CompileType Float32x4ScaleInstr::ComputeType() const {
+  return CompileType::FromCid(kFloat32x4Cid);
+}
+
+
+CompileType Float32x4SqrtInstr::ComputeType() const {
+  return CompileType::FromCid(kFloat32x4Cid);
+}
+
+
 CompileType MathSqrtInstr::ComputeType() const {
   return CompileType::FromCid(kDoubleCid);
 }
@@ -1016,6 +1036,16 @@
 }
 
 
+CompileType UnboxUint32x4Instr::ComputeType() const {
+  return CompileType::FromCid(kUint32x4Cid);
+}
+
+
+CompileType BoxUint32x4Instr::ComputeType() const {
+  return CompileType::FromCid(kUint32x4Cid);
+}
+
+
 CompileType SmiToDoubleInstr::ComputeType() const {
   return CompileType::FromCid(kDoubleCid);
 }
diff --git a/runtime/vm/freelist.cc b/runtime/vm/freelist.cc
index ee3d9f9..bbd1bea 100644
--- a/runtime/vm/freelist.cc
+++ b/runtime/vm/freelist.cc
@@ -21,7 +21,6 @@
   FreeListElement* result = reinterpret_cast<FreeListElement*>(addr);
 
   uword tags = 0;
-  tags = RawObject::FreeBit::update(true, tags);
   tags = RawObject::SizeTag::update(size, tags);
   tags = RawObject::ClassIdTag::update(kFreeListElement, tags);
 
diff --git a/runtime/vm/hash_map.h b/runtime/vm/hash_map.h
index fefd788..babaeca 100644
--- a/runtime/vm/hash_map.h
+++ b/runtime/vm/hash_map.h
@@ -28,7 +28,20 @@
 
   bool IsEmpty() const { return count_ == 0; }
 
- private:
+  void Clear() {
+    if (!IsEmpty()) {
+      count_ = 0;
+      memset(array_, 0, sizeof(HashMapListElement) * array_size_);
+      memset(lists_, 0, sizeof(HashMapListElement) * lists_size_);
+      lists_[0].next = kNil;
+      for (intptr_t i = 1; i < lists_size_; ++i) {
+        lists_[i].next = i - 1;
+      }
+      free_list_head_ = lists_size_ - 1;
+    }
+  }
+
+ protected:
   // A linked list of T values.  Stored in arrays.
   struct HashMapListElement {
     typename KeyValueTrait::Pair kv;
diff --git a/runtime/vm/il_printer.cc b/runtime/vm/il_printer.cc
index c0dffcc..bf50596 100644
--- a/runtime/vm/il_printer.cc
+++ b/runtime/vm/il_printer.cc
@@ -634,6 +634,36 @@
 }
 
 
+void Float32x4ComparisonInstr::PrintOperandsTo(BufferFormatter* f) const {
+  f->Print("Float32x4 Comparison %d", op_kind());
+  left()->PrintTo(f);
+  f->Print(", ");
+  right()->PrintTo(f);
+}
+
+
+void Float32x4MinMaxInstr::PrintOperandsTo(BufferFormatter* f) const {
+  f->Print("%s, ", MethodRecognizer::KindToCString(op_kind()));
+  left()->PrintTo(f);
+  f->Print(", ");
+  right()->PrintTo(f);
+}
+
+
+void Float32x4SqrtInstr::PrintOperandsTo(BufferFormatter* f) const {
+  f->Print("%s, ", MethodRecognizer::KindToCString(op_kind()));
+  left()->PrintTo(f);
+}
+
+
+void Float32x4ScaleInstr::PrintOperandsTo(BufferFormatter* f) const {
+  f->Print("%s, ", MethodRecognizer::KindToCString(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 ea389c7..db49612 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -103,11 +103,12 @@
 }
 
 
-bool CheckClassInstr::AffectedBySideEffect() const {
-  // The class-id of string objects is not invariant: Externalization of strings
-  // via the API can change the class-id.
-  return unary_checks().HasReceiverClassId(kOneByteStringCid)
-      || unary_checks().HasReceiverClassId(kTwoByteStringCid);
+EffectSet CheckClassInstr::Dependencies() const {
+  // Externalization of strings via the API can change the class-id.
+  const bool externalizable =
+      unary_checks().HasReceiverClassId(kOneByteStringCid) ||
+      unary_checks().HasReceiverClassId(kTwoByteStringCid);
+  return externalizable ? EffectSet::Externalization() : EffectSet::None();
 }
 
 
@@ -116,11 +117,6 @@
 }
 
 
-bool GuardFieldInstr::AffectedBySideEffect() const {
-  return false;
-}
-
-
 bool CheckArrayBoundInstr::AttributesEqual(Instruction* other) const {
   CheckArrayBoundInstr* other_check = other->AsCheckArrayBound();
   ASSERT(other_check != NULL);
@@ -153,6 +149,11 @@
 }
 
 
+EffectSet LoadFieldInstr::Dependencies() const {
+  return immutable_ ? EffectSet::None() : EffectSet::All();
+}
+
+
 bool LoadFieldInstr::AttributesEqual(Instruction* other) const {
   LoadFieldInstr* other_load = other->AsLoadField();
   ASSERT(other_load != NULL);
@@ -162,6 +163,11 @@
 }
 
 
+EffectSet LoadStaticFieldInstr::Dependencies() const {
+  return field().is_final() ? EffectSet::None() : EffectSet::All();
+}
+
+
 bool LoadStaticFieldInstr::AttributesEqual(Instruction* other) const {
   LoadStaticFieldInstr* other_load = other->AsLoadStaticField();
   ASSERT(other_load != NULL);
@@ -172,6 +178,11 @@
 }
 
 
+EffectSet LoadIndexedInstr::Dependencies() const {
+  return EffectSet::All();
+}
+
+
 bool LoadIndexedInstr::AttributesEqual(Instruction* other) const {
   LoadIndexedInstr* other_load = other->AsLoadIndexed();
   ASSERT(other_load != NULL);
@@ -1710,8 +1721,10 @@
   a = UnwrapConstraint(a);
   b = UnwrapConstraint(b);
   return (a == b) ||
-      (!a->AffectedBySideEffect() &&
-       !b->AffectedBySideEffect() &&
+      (a->AllowsCSE() &&
+       a->Dependencies().IsNone() &&
+       b->AllowsCSE() &&
+       b->Dependencies().IsNone() &&
        a->Equals(b));
 }
 
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index c8110bb..6b560f6 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -82,6 +82,18 @@
   V(_Float32x4, get:y, Float32x4ShuffleY, 211144022)                           \
   V(_Float32x4, get:z, Float32x4ShuffleZ, 211144022)                           \
   V(_Float32x4, get:w, Float32x4ShuffleW, 211144022)                           \
+  V(_Float32x4, _cmpequal, Float32x4Equal, 548944488)                          \
+  V(_Float32x4, _cmpgt, Float32x4GreaterThan, 548944488)                       \
+  V(_Float32x4, _cmpgte, Float32x4GreaterThanOrEqual, 548944488)               \
+  V(_Float32x4, _cmplt, Float32x4LessThan, 548944488)                          \
+  V(_Float32x4, _cmplte, Float32x4LessThanOrEqual, 548944488)                  \
+  V(_Float32x4, _cmpnequal, Float32x4NotEqual, 548944488)                      \
+  V(_Float32x4, _min, Float32x4Min, 342800599)                                 \
+  V(_Float32x4, _max, Float32x4Max, 342800599)                                 \
+  V(_Float32x4, _scale, Float32x4Scale, 219466242)                             \
+  V(_Float32x4, _sqrt, Float32x4Sqrt, 42621627)                                \
+  V(_Float32x4, _reciprocalSqrt, Float32x4ReciprocalSqrt, 42621627)            \
+  V(_Float32x4, _reciprocal, Float32x4Reciprocal, 42621627)                    \
 
 // Class that recognizes the name and owner of a function and returns the
 // corresponding enum. See RECOGNIZED_LIST above for list of recognizable
@@ -281,6 +293,39 @@
 };
 
 
+class EffectSet : public ValueObject {
+ public:
+  enum Effects {
+    kNoEffects = 0,
+    kExternalization = 1,
+    kLastEffect = kExternalization
+  };
+
+  EffectSet(const EffectSet& other)
+      : ValueObject(), effects_(other.effects_) {
+  }
+
+  bool IsNone() const { return effects_ == kNoEffects; }
+
+  static EffectSet None() { return EffectSet(kNoEffects); }
+  static EffectSet All() {
+    ASSERT(EffectSet::kLastEffect == 1);
+    return EffectSet(kExternalization);
+  }
+
+  static EffectSet Externalization() {
+    return EffectSet(kExternalization);
+  }
+
+  bool ToInt() { return effects_; }
+
+ private:
+  explicit EffectSet(intptr_t effects) : effects_(effects) { }
+
+  intptr_t effects_;
+};
+
+
 class Value : public ZoneAllocated {
  public:
   // A forward iterator that allows removing the current value from the
@@ -504,6 +549,8 @@
   M(BoxDouble)                                                                 \
   M(BoxFloat32x4)                                                              \
   M(UnboxFloat32x4)                                                            \
+  M(BoxUint32x4)                                                               \
+  M(UnboxUint32x4)                                                             \
   M(UnboxInteger)                                                              \
   M(BoxInteger)                                                                \
   M(BinaryMintOp)                                                              \
@@ -520,6 +567,10 @@
   M(Float32x4Constructor)                                                      \
   M(Float32x4Zero)                                                             \
   M(Float32x4Splat)                                                            \
+  M(Float32x4Comparison)                                                       \
+  M(Float32x4MinMax)                                                           \
+  M(Float32x4Scale)                                                            \
+  M(Float32x4Sqrt)                                                             \
 
 
 #define FORWARD_DECLARATION(type) class type##Instr;
@@ -594,9 +645,6 @@
   // Returns true, if this instruction can deoptimize.
   virtual bool CanDeoptimize() const = 0;
 
-  // Returns true if the instruction may have side effects.
-  virtual bool HasSideEffect() const  = 0;
-
   // Visiting support.
   virtual void Accept(FlowGraphVisitor* visitor) = 0;
 
@@ -713,12 +761,19 @@
   // Insert this instruction after 'prev' after use lists are computed.
   void InsertAfter(Instruction* prev);
 
-  // Returns true if the instruction is affected by side effects.
-  // Only instructions that are not affected by side effects can participate
-  // in redundancy elimination or loop invariant code motion.
-  // TODO(fschneider): Make this abstract and implement for all instructions
-  // instead of returning the safe default (true).
-  virtual bool AffectedBySideEffect() const { return true; }
+  // Returns true if CSE and LICM are allowed for this instruction.
+  virtual bool AllowsCSE() const {
+    return false;
+  }
+
+  // Returns set of effects created by this instruction.
+  virtual EffectSet Effects() const = 0;
+
+  // Returns set of effects that affect this instruction.
+  virtual EffectSet Dependencies() const {
+    UNREACHABLE();
+    return EffectSet::All();
+  }
 
   // Get the block entry for this instruction.
   virtual BlockEntryInstr* GetBlock() const;
@@ -769,12 +824,17 @@
   friend class UnboxIntegerInstr;
   friend class UnboxDoubleInstr;
   friend class UnboxFloat32x4Instr;
+  friend class UnboxUint32x4Instr;
   friend class BinaryDoubleOpInstr;
   friend class BinaryFloat32x4OpInstr;
   friend class Float32x4ZeroInstr;
   friend class Float32x4SplatInstr;
   friend class Float32x4ShuffleInstr;
   friend class Float32x4ConstructorInstr;
+  friend class Float32x4ComparisonInstr;
+  friend class Float32x4MinMaxInstr;
+  friend class Float32x4ScaleInstr;
+  friend class Float32x4SqrtInstr;
   friend class BinaryMintOpInstr;
   friend class BinarySmiOpInstr;
   friend class UnarySmiOpInstr;
@@ -908,7 +968,15 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return false; }
+  virtual EffectSet Effects() const {
+    UNREACHABLE();  // This instruction never visited by optimization passes.
+    return EffectSet::None();
+  }
+
+  virtual EffectSet Dependencies() const {
+    UNREACHABLE();  // This instruction never visited by optimization passes.
+    return EffectSet::None();
+  }
 
   MoveOperands* AddMove(Location dest, Location src) {
     MoveOperands* move = new MoveOperands(dest, src);
@@ -1027,7 +1095,8 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return false; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
 
   intptr_t try_index() const { return try_index_; }
 
@@ -1216,6 +1285,9 @@
 
   virtual void PrintTo(BufferFormatter* f) const;
 
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+
  private:
   // Classes that have access to predecessors_ when inlining.
   friend class BlockEntryInstr;
@@ -1526,7 +1598,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return false; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
   // Phi is alive if it reaches a non-environment use.
   bool is_alive() const { return is_alive_; }
@@ -1603,7 +1675,8 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return false; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
 
   virtual intptr_t Hashcode() const {
     UNREACHABLE();
@@ -1659,7 +1732,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return false; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
   virtual void PrintOperandsTo(BufferFormatter* f) const;
 
@@ -1703,7 +1776,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return false; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
  private:
   const intptr_t token_pos_;
@@ -1724,7 +1797,7 @@
 
   virtual bool CanDeoptimize() const { return true; }
 
-  virtual bool HasSideEffect() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
  private:
   const intptr_t token_pos_;
@@ -1745,7 +1818,7 @@
 
   virtual bool CanDeoptimize() const { return true; }
 
-  virtual bool HasSideEffect() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
  private:
   const intptr_t token_pos_;
@@ -1777,7 +1850,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return false; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
   ParallelMoveInstr* parallel_move() const {
     return parallel_move_;
@@ -1845,7 +1918,7 @@
   virtual bool CanDeoptimize() const;
   virtual bool CanBeDeoptimizationTarget() const;
 
-  virtual bool HasSideEffect() const;
+  virtual EffectSet Effects() const;
 
   ComparisonInstr* comparison() const { return comparison_; }
   void SetComparison(ComparisonInstr* comp);
@@ -1918,7 +1991,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return false; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
  private:
   DISALLOW_COPY_AND_ASSIGN(StoreContextInstr);
@@ -2135,7 +2208,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return false; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
   virtual bool AttributesEqual(Instruction* other) const {
     UNREACHABLE();
@@ -2193,13 +2266,13 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return false; }
-
-  virtual bool AttributesEqual(Instruction* other) const;
-  virtual bool AffectedBySideEffect() const { return false; }
-
   virtual void InferRange();
 
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const;
+
  private:
   const Object& value_;
 
@@ -2244,13 +2317,13 @@
 
   virtual bool CanDeoptimize() const { return true; }
 
-  virtual bool HasSideEffect() const { return false; }
-
-  virtual bool AffectedBySideEffect() const { return false; }
-  virtual bool AttributesEqual(Instruction* other) const;
-
   virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer);
 
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const;
+
  private:
   const intptr_t token_pos_;
   AbstractType& dst_type_;
@@ -2277,13 +2350,13 @@
 
   virtual bool CanDeoptimize() const { return true; }
 
-  virtual bool HasSideEffect() const { return false; }
-
-  virtual bool AffectedBySideEffect() const { return false; }
-  virtual bool AttributesEqual(Instruction* other) const { return true; }
-
   virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer);
 
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const { return true; }
+
  private:
   const intptr_t token_pos_;
 
@@ -2316,7 +2389,7 @@
 
   virtual bool CanDeoptimize() const { return true; }
 
-  virtual bool HasSideEffect() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
  private:
   const ArgumentDefinitionTestNode& ast_node_;
@@ -2336,8 +2409,8 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return false; }
-
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
   virtual bool AttributesEqual(Instruction* other) const { return true; }
 
  private:
@@ -2366,7 +2439,7 @@
 
   virtual bool CanDeoptimize() const { return true; }
 
-  virtual bool HasSideEffect() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::All(); }
 
  private:
   const ClosureCallNode& ast_node_;
@@ -2428,7 +2501,7 @@
 
   virtual bool CanDeoptimize() const { return true; }
 
-  virtual bool HasSideEffect() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::All(); }
 
  protected:
   friend class FlowGraphOptimizer;
@@ -2474,7 +2547,7 @@
 
   virtual bool CanDeoptimize() const { return true; }
 
-  virtual bool HasSideEffect() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::All(); }
 
   virtual void PrintOperandsTo(BufferFormatter* f) const;
 
@@ -2542,8 +2615,8 @@
 }
 
 
-inline bool BranchInstr::HasSideEffect() const {
-  return comparison()->HasSideEffect();
+inline EffectSet BranchInstr::Effects() const {
+  return comparison()->Effects();
 }
 
 
@@ -2585,11 +2658,6 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return false; }
-
-  virtual bool AttributesEqual(Instruction* other) const;
-  virtual bool AffectedBySideEffect() const { return false; }
-
   virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer);
 
   virtual void EmitBranchCode(FlowGraphCompiler* compiler,
@@ -2599,6 +2667,11 @@
   void set_needs_number_check(bool value) { needs_number_check_ = value; }
   void set_kind(Token::Kind value) { kind_ = value; }
 
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const;
+
  private:
   // True if the comparison must check for double, Mint or Bigint and
   // use value comparison instead.
@@ -2650,10 +2723,6 @@
     return !IsInlinedNumericComparison();
   }
 
-  virtual bool HasSideEffect() const {
-    return !IsInlinedNumericComparison();
-  }
-
   virtual void EmitBranchCode(FlowGraphCompiler* compiler,
                               BranchInstr* branch);
 
@@ -2670,6 +2739,10 @@
 
   bool IsPolymorphic() const;
 
+  virtual EffectSet Effects() const {
+    return IsInlinedNumericComparison() ? EffectSet::None() : EffectSet::All();
+  }
+
  private:
   const ICData* ic_data_;
   const intptr_t token_pos_;
@@ -2724,9 +2797,6 @@
   virtual bool CanDeoptimize() const {
     return !IsInlinedNumericComparison();
   }
-  virtual bool HasSideEffect() const {
-    return !IsInlinedNumericComparison();
-  }
 
   virtual void EmitBranchCode(FlowGraphCompiler* compiler,
                               BranchInstr* branch);
@@ -2743,6 +2813,10 @@
     return kTagged;
   }
 
+  virtual EffectSet Effects() const {
+    return IsInlinedNumericComparison() ? EffectSet::None() : EffectSet::All();
+  }
+
  private:
   const ICData* ic_data_;
   const intptr_t token_pos_;
@@ -2785,18 +2859,6 @@
   virtual void InferRange();
 
   virtual bool CanDeoptimize() const { return false; }
-  virtual bool HasSideEffect() const { return false; }
-
-  virtual bool AttributesEqual(Instruction* other) const {
-    IfThenElseInstr* other_if_then_else = other->AsIfThenElse();
-    return (kind_ == other_if_then_else->kind_) &&
-           (if_true_ == other_if_then_else->if_true_) &&
-           (if_false_ == other_if_then_else->if_false_);
-  }
-
-  virtual bool AffectedBySideEffect() const {
-    return false;
-  }
 
   Value* left() const { return inputs_[0]; }
   Value* right() const { return inputs_[1]; }
@@ -2805,6 +2867,16 @@
 
   Token::Kind kind() const { return kind_; }
 
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const {
+    IfThenElseInstr* other_if_then_else = other->AsIfThenElse();
+    return (kind_ == other_if_then_else->kind_) &&
+           (if_true_ == other_if_then_else->if_true_) &&
+           (if_false_ == other_if_then_else->if_false_);
+  }
+
  private:
   const Token::Kind kind_;
   const intptr_t if_true_;
@@ -2847,7 +2919,7 @@
 
   virtual bool CanDeoptimize() const { return true; }
 
-  virtual bool HasSideEffect() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::All(); }
 
   void set_result_cid(intptr_t value) { result_cid_ = value; }
 
@@ -2884,9 +2956,9 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const {
-    UNREACHABLE();
-    return false;
+  virtual EffectSet Effects() const {
+    UNREACHABLE();  // Eliminated by SSA construction.
+    return EffectSet::None();
   }
 
   void mark_last() { is_last_ = true; }
@@ -2917,17 +2989,17 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const {
-    UNREACHABLE();
-    return false;
-  }
-
   void mark_dead() { is_dead_ = true; }
   bool is_dead() const { return is_dead_; }
 
   void mark_last() { is_last_ = true; }
   bool is_last() const { return is_last_; }
 
+  virtual EffectSet Effects() const {
+    UNREACHABLE();  // Eliminated by SSA construction.
+    return EffectSet::None();
+  }
+
  private:
   const LocalVariable& local_;
   bool is_dead_;
@@ -2960,7 +3032,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::All(); }
 
  private:
   const NativeBodyNode& ast_node_;
@@ -3003,7 +3075,10 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return true; }
+  // Currently CSE/LICM don't operate on any instructions that can be affected
+  // by stores/loads. LoadOptimizer handles loads separately. Hence stores
+  // are marked as having no side-effects.
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
  private:
   bool CanValueBeSmi() const {
@@ -3030,25 +3105,24 @@
     SetInputAt(0, value);
   }
 
+  Value* value() const { return inputs_[0]; }
+
+  const Field& field() const { return field_; }
+
   DECLARE_INSTRUCTION(GuardField)
 
   virtual intptr_t ArgumentCount() const { return 0; }
 
   virtual bool CanDeoptimize() const { return true; }
 
-  virtual bool HasSideEffect() const { return false; }
-
-  virtual bool AttributesEqual(Instruction* other) const;
-
-  virtual bool AffectedBySideEffect() const;
-
-  Value* value() const { return inputs_[0]; }
-
   virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer);
 
   virtual void PrintOperandsTo(BufferFormatter* f) const;
 
-  const Field& field() const { return field_; }
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const;
 
  private:
   const Field& field_;
@@ -3070,9 +3144,9 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return false; }
-
-  virtual bool AffectedBySideEffect() const { return !field().is_final(); }
+  virtual bool AllowsCSE() const { return field_.is_final(); }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const;
   virtual bool AttributesEqual(Instruction* other) const;
 
  private:
@@ -3100,7 +3174,10 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return true; }
+  // Currently CSE/LICM don't operate on any instructions that can be affected
+  // by stores/loads. LoadOptimizer handles loads separately. Hence stores
+  // are marked as having no side-effects.
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
  private:
   bool CanValueBeSmi() const {
@@ -3152,16 +3229,15 @@
     return deopt_id_ != Isolate::kNoDeoptId;
   }
 
-  virtual bool HasSideEffect() const { return false; }
 
   virtual Representation representation() const;
-
-  virtual bool AttributesEqual(Instruction* other) const;
-
-  virtual bool AffectedBySideEffect() const { return true; }
-
   virtual void InferRange();
 
+  virtual bool AllowsCSE() const { return false; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const;
+  virtual bool AttributesEqual(Instruction* other) const;
+
  private:
   const intptr_t index_scale_;
   const intptr_t class_id_;
@@ -3187,11 +3263,12 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return false; }
-
-  virtual bool AttributesEqual(Instruction* other) const { return true; }
-
-  virtual bool AffectedBySideEffect() const { return false; }
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const {
+    return other->AsStringFromCharCode()->cid_ == cid_;
+  }
 
  private:
   const intptr_t cid_;
@@ -3233,8 +3310,6 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return true; }
-
   virtual Representation RequiredInputRepresentation(intptr_t idx) const;
 
   bool IsExternal() const {
@@ -3247,6 +3322,8 @@
     return deopt_id_;
   }
 
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+
  private:
   const StoreBarrierType emit_store_barrier_;
   const intptr_t index_scale_;
@@ -3270,7 +3347,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return false; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
  private:
   DISALLOW_COPY_AND_ASSIGN(BooleanNegateInstr);
@@ -3311,7 +3388,7 @@
 
   virtual bool CanDeoptimize() const { return true; }
 
-  virtual bool HasSideEffect() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
  private:
   const intptr_t token_pos_;
@@ -3351,7 +3428,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
  private:
   const ConstructorCallNode& ast_node_;
@@ -3381,7 +3458,7 @@
 
   virtual bool CanDeoptimize() const { return true; }
 
-  virtual bool HasSideEffect() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
  private:
   const ConstructorCallNode& ast_node_;
@@ -3418,7 +3495,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
  private:
   const intptr_t token_pos_;
@@ -3453,7 +3530,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
  private:
   const Function& function_;
@@ -3481,14 +3558,13 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return false; }
-
-  virtual bool AttributesEqual(Instruction* other) const { return true; }
-
   // This instruction must not be moved without the indexed access that
   // depends on it (e.g. out of loops). GC may cause collect
   // the array while the external data-array is still accessed.
-  virtual bool AffectedBySideEffect() const { return true; }
+  virtual bool AllowsCSE() const { return false; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const { return true; }
 
  private:
   intptr_t offset_;
@@ -3514,26 +3590,17 @@
     SetInputAt(0, value);
   }
 
-  DECLARE_INSTRUCTION(LoadField)
-  virtual CompileType ComputeType() const;
-
   Value* value() const { return inputs_[0]; }
   intptr_t offset_in_bytes() const { return offset_in_bytes_; }
   const AbstractType& type() const { return type_; }
   void set_result_cid(intptr_t value) { result_cid_ = value; }
   intptr_t result_cid() const { return result_cid_; }
 
-  virtual void PrintOperandsTo(BufferFormatter* f) const;
+  void set_field_name(const char* name) { field_name_ = name; }
+  const char* field_name() const { return field_name_; }
 
-  virtual bool CanDeoptimize() const { return false; }
-
-  virtual bool HasSideEffect() const { return false; }
-
-  virtual bool AttributesEqual(Instruction* other) const;
-
-  virtual bool AffectedBySideEffect() const { return !immutable_; }
-
-  virtual void InferRange();
+  Field* field() const { return field_; }
+  void set_field(Field* field) { field_ = field; }
 
   void set_recognized_kind(MethodRecognizer::Kind kind) {
     recognized_kind_ = kind;
@@ -3543,6 +3610,15 @@
     return recognized_kind_;
   }
 
+  DECLARE_INSTRUCTION(LoadField)
+  virtual CompileType ComputeType() const;
+
+  virtual void PrintOperandsTo(BufferFormatter* f) const;
+
+  virtual bool CanDeoptimize() const { return false; }
+
+  virtual void InferRange();
+
   bool IsImmutableLengthLoad() const;
 
   virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer);
@@ -3551,11 +3627,10 @@
 
   static bool IsFixedLengthArrayCid(intptr_t cid);
 
-  void set_field_name(const char* name) { field_name_ = name; }
-  const char* field_name() const { return field_name_; }
-
-  Field* field() const { return field_; }
-  void set_field(Field* field) { field_ = field; }
+  virtual bool AllowsCSE() const { return immutable_; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const;
+  virtual bool AttributesEqual(Instruction* other) const;
 
  private:
   const intptr_t offset_in_bytes_;
@@ -3596,7 +3671,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
  private:
   const intptr_t offset_in_bytes_;
@@ -3610,9 +3685,11 @@
  public:
   InstantiateTypeArgumentsInstr(intptr_t token_pos,
                                 const AbstractTypeArguments& type_arguments,
+                                const Class& instantiator_class,
                                 Value* instantiator)
       : token_pos_(token_pos),
-        type_arguments_(type_arguments) {
+        type_arguments_(type_arguments),
+        instantiator_class_(instantiator_class) {
     ASSERT(type_arguments.IsZoneHandle());
     SetInputAt(0, instantiator);
   }
@@ -3623,17 +3700,19 @@
   const AbstractTypeArguments& type_arguments() const {
     return type_arguments_;
   }
+  const Class& instantiator_class() const { return instantiator_class_; }
   intptr_t token_pos() const { return token_pos_; }
 
   virtual void PrintOperandsTo(BufferFormatter* f) const;
 
   virtual bool CanDeoptimize() const { return true; }
 
-  virtual bool HasSideEffect() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
  private:
   const intptr_t token_pos_;
   const AbstractTypeArguments& type_arguments_;
+  const Class& instantiator_class_;
 
   DISALLOW_COPY_AND_ASSIGN(InstantiateTypeArgumentsInstr);
 };
@@ -3644,9 +3723,11 @@
   ExtractConstructorTypeArgumentsInstr(
       intptr_t token_pos,
       const AbstractTypeArguments& type_arguments,
+      const Class& instantiator_class,
       Value* instantiator)
       : token_pos_(token_pos),
-        type_arguments_(type_arguments) {
+        type_arguments_(type_arguments),
+        instantiator_class_(instantiator_class) {
     SetInputAt(0, instantiator);
   }
 
@@ -3656,17 +3737,19 @@
   const AbstractTypeArguments& type_arguments() const {
     return type_arguments_;
   }
+  const Class& instantiator_class() const { return instantiator_class_; }
   intptr_t token_pos() const { return token_pos_; }
 
   virtual void PrintOperandsTo(BufferFormatter* f) const;
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return false; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
  private:
   const intptr_t token_pos_;
   const AbstractTypeArguments& type_arguments_;
+  const Class& instantiator_class_;
 
   DISALLOW_COPY_AND_ASSIGN(ExtractConstructorTypeArgumentsInstr);
 };
@@ -3675,8 +3758,9 @@
 class ExtractConstructorInstantiatorInstr : public TemplateDefinition<1> {
  public:
   ExtractConstructorInstantiatorInstr(ConstructorCallNode* ast_node,
+                                      const Class& instantiator_class,
                                       Value* instantiator)
-      : ast_node_(*ast_node) {
+      : ast_node_(*ast_node), instantiator_class_(instantiator_class) {
     SetInputAt(0, instantiator);
   }
 
@@ -3687,14 +3771,16 @@
     return ast_node_.type_arguments();
   }
   const Function& constructor() const { return ast_node_.constructor(); }
+  const Class& instantiator_class() const { return instantiator_class_; }
   intptr_t token_pos() const { return ast_node_.token_pos(); }
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return false; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
  private:
   const ConstructorCallNode& ast_node_;
+  const Class& instantiator_class_;
 
   DISALLOW_COPY_AND_ASSIGN(ExtractConstructorInstantiatorInstr);
 };
@@ -3717,7 +3803,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return false; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
  private:
   const intptr_t token_pos_;
@@ -3741,7 +3827,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
  private:
   DISALLOW_COPY_AND_ASSIGN(ChainContextInstr);
@@ -3763,7 +3849,7 @@
 
   virtual bool CanDeoptimize() const { return true; }
 
-  virtual bool HasSideEffect() const { return false; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
  private:
   const intptr_t token_pos_;
@@ -3789,7 +3875,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::All(); }
 
  private:
   const LocalVariable& exception_var_;
@@ -3809,24 +3895,22 @@
     deopt_id_ = instance_call->deopt_id();
   }
 
+  Value* left() const { return inputs_[0]; }
+  Value* right() const { return inputs_[1]; }
+
   DECLARE_INSTRUCTION(CheckEitherNonSmi)
 
   virtual intptr_t ArgumentCount() const { return 0; }
 
   virtual bool CanDeoptimize() const { return true; }
 
-  virtual bool HasSideEffect() const { return false; }
-
-  virtual bool AttributesEqual(Instruction* other) const { return true; }
-
-  virtual bool AffectedBySideEffect() const { return false; }
-
-  Value* left() const { return inputs_[0]; }
-
-  Value* right() const { return inputs_[1]; }
-
   virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer);
 
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const { return true; }
+
  private:
   DISALLOW_COPY_AND_ASSIGN(CheckEitherNonSmiInstr);
 };
@@ -3840,20 +3924,20 @@
 
   Value* value() const { return inputs_[0]; }
 
+  DECLARE_INSTRUCTION(BoxDouble)
+  virtual CompileType ComputeType() 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 true; }
-
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx == 0);
     return kUnboxedDouble;
   }
 
-  DECLARE_INSTRUCTION(BoxDouble)
-  virtual CompileType ComputeType() const;
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const { return true; }
 
  private:
   DISALLOW_COPY_AND_ASSIGN(BoxDoubleInstr);
@@ -3870,11 +3954,6 @@
 
   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 true; }
-
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx == 0);
     return kUnboxedFloat32x4;
@@ -3883,11 +3962,44 @@
   DECLARE_INSTRUCTION(BoxFloat32x4)
   virtual CompileType ComputeType() const;
 
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const { return true; }
+
  private:
   DISALLOW_COPY_AND_ASSIGN(BoxFloat32x4Instr);
 };
 
 
+class BoxUint32x4Instr : public TemplateDefinition<1> {
+ public:
+  explicit BoxUint32x4Instr(Value* value) {
+    SetInputAt(0, value);
+  }
+
+  Value* value() const { return inputs_[0]; }
+
+  virtual bool CanDeoptimize() const { return false; }
+
+  virtual Representation RequiredInputRepresentation(intptr_t idx) const {
+    ASSERT(idx == 0);
+    return kUnboxedUint32x4;
+  }
+
+  DECLARE_INSTRUCTION(BoxUint32x4)
+  virtual CompileType ComputeType() const;
+
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const { return true; }
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(BoxUint32x4Instr);
+};
+
+
 class BoxIntegerInstr : public TemplateDefinition<1> {
  public:
   explicit BoxIntegerInstr(Value* value) {
@@ -3898,11 +4010,6 @@
 
   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 true; }
-
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx == 0);
     return kUnboxedMint;
@@ -3911,6 +4018,11 @@
   DECLARE_INSTRUCTION(BoxInteger)
   virtual CompileType ComputeType() const;
 
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const { return true; }
+
  private:
   DISALLOW_COPY_AND_ASSIGN(BoxIntegerInstr);
 };
@@ -3930,18 +4042,18 @@
         && (value()->Type()->ToCid() != kSmiCid);
   }
 
-  virtual bool HasSideEffect() const { return false; }
-
   virtual Representation representation() const {
     return kUnboxedDouble;
   }
 
-  virtual bool AffectedBySideEffect() const { return false; }
-  virtual bool AttributesEqual(Instruction* other) const { return true; }
-
   DECLARE_INSTRUCTION(UnboxDouble)
   virtual CompileType ComputeType() const;
 
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const { return true; }
+
  private:
   DISALLOW_COPY_AND_ASSIGN(UnboxDoubleInstr);
 };
@@ -3960,23 +4072,55 @@
     return (value()->Type()->ToCid() != kFloat32x4Cid);
   }
 
-  virtual bool HasSideEffect() const { return false; }
-
   virtual Representation representation() const {
     return kUnboxedFloat32x4;
   }
 
-  virtual bool AffectedBySideEffect() const { return false; }
-  virtual bool AttributesEqual(Instruction* other) const { return true; }
-
   DECLARE_INSTRUCTION(UnboxFloat32x4)
   virtual CompileType ComputeType() const;
 
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const { return true; }
+
  private:
   DISALLOW_COPY_AND_ASSIGN(UnboxFloat32x4Instr);
 };
 
 
+class UnboxUint32x4Instr : public TemplateDefinition<1> {
+ public:
+  UnboxUint32x4Instr(Value* value, intptr_t deopt_id) {
+    SetInputAt(0, value);
+    deopt_id_ = deopt_id;
+  }
+
+  Value* value() const { return inputs_[0]; }
+
+  virtual bool CanDeoptimize() const {
+    return (value()->Type()->ToCid() != kUint32x4Cid);
+  }
+
+  virtual bool HasSideEffect() const { return false; }
+
+  virtual Representation representation() const {
+    return kUnboxedUint32x4;
+  }
+
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const { return true; }
+
+  DECLARE_INSTRUCTION(UnboxUint32x4)
+  virtual CompileType ComputeType() const;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(UnboxUint32x4Instr);
+};
+
+
 class UnboxIntegerInstr : public TemplateDefinition<1> {
  public:
   UnboxIntegerInstr(Value* value, intptr_t deopt_id) {
@@ -3991,19 +4135,18 @@
         && (value()->Type()->ToCid() != kMintCid);
   }
 
-  virtual bool HasSideEffect() const { return false; }
-
-  virtual CompileType ComputeType() const;
-
   virtual Representation representation() const {
     return kUnboxedMint;
   }
 
 
-  virtual bool AffectedBySideEffect() const { return false; }
-  virtual bool AttributesEqual(Instruction* other) const { return true; }
-
   DECLARE_INSTRUCTION(UnboxInteger)
+  virtual CompileType ComputeType() const;
+
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const { return true; }
 
  private:
   DISALLOW_COPY_AND_ASSIGN(UnboxIntegerInstr);
@@ -4021,12 +4164,6 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return false; }
-
-  virtual bool AttributesEqual(Instruction* other) const {
-    return true;
-  }
-
   virtual Representation representation() const {
     return kUnboxedDouble;
   }
@@ -4045,6 +4182,11 @@
   DECLARE_INSTRUCTION(MathSqrt)
   virtual CompileType ComputeType() const;
 
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const { return true; }
+
  private:
   DISALLOW_COPY_AND_ASSIGN(MathSqrtInstr);
 };
@@ -4071,14 +4213,6 @@
 
   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->AsBinaryDoubleOp()->op_kind();
-  }
-
   virtual Representation representation() const {
     return kUnboxedDouble;
   }
@@ -4099,6 +4233,13 @@
 
   virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer);
 
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const {
+    return op_kind() == other->AsBinaryDoubleOp()->op_kind();
+  }
+
  private:
   const Token::Kind op_kind_;
 
@@ -4127,14 +4268,6 @@
 
   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;
   }
@@ -4153,6 +4286,13 @@
   DECLARE_INSTRUCTION(BinaryFloat32x4Op)
   virtual CompileType ComputeType() const;
 
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const {
+    return op_kind() == other->AsBinaryFloat32x4Op()->op_kind();
+  }
+
  private:
   const Token::Kind op_kind_;
 
@@ -4177,14 +4317,6 @@
 
   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->AsFloat32x4Shuffle()->op_kind();
-  }
-
   virtual Representation representation() const {
     if ((op_kind_ == MethodRecognizer::kFloat32x4ShuffleX) ||
         (op_kind_ == MethodRecognizer::kFloat32x4ShuffleY) ||
@@ -4209,6 +4341,13 @@
   DECLARE_INSTRUCTION(Float32x4Shuffle)
   virtual CompileType ComputeType() const;
 
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const {
+    return op_kind() == other->AsFloat32x4Shuffle()->op_kind();
+  }
+
  private:
   const MethodRecognizer::Kind op_kind_;
 
@@ -4236,12 +4375,6 @@
 
   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 true; }
-
   virtual Representation representation() const {
     return kUnboxedFloat32x4;
   }
@@ -4260,6 +4393,11 @@
   DECLARE_INSTRUCTION(Float32x4Constructor)
   virtual CompileType ComputeType() const;
 
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const { return true; }
+
  private:
   DISALLOW_COPY_AND_ASSIGN(Float32x4ConstructorInstr);
 };
@@ -4278,12 +4416,6 @@
 
   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 true; }
-
   virtual Representation representation() const {
     return kUnboxedFloat32x4;
   }
@@ -4302,6 +4434,11 @@
   DECLARE_INSTRUCTION(Float32x4Splat)
   virtual CompileType ComputeType() const;
 
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const { return true; }
+
  private:
   DISALLOW_COPY_AND_ASSIGN(Float32x4SplatInstr);
 };
@@ -4319,12 +4456,6 @@
 
   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 true; }
-
   virtual Representation representation() const {
     return kUnboxedFloat32x4;
   }
@@ -4343,11 +4474,220 @@
   DECLARE_INSTRUCTION(Float32x4Zero)
   virtual CompileType ComputeType() const;
 
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const { return true; }
+
  private:
   DISALLOW_COPY_AND_ASSIGN(Float32x4ZeroInstr);
 };
 
 
+class Float32x4ComparisonInstr : public TemplateDefinition<2> {
+ public:
+  Float32x4ComparisonInstr(MethodRecognizer::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]; }
+
+  MethodRecognizer::Kind op_kind() const { return op_kind_; }
+
+  virtual void PrintOperandsTo(BufferFormatter* f) const;
+
+  virtual bool CanDeoptimize() const { return false; }
+
+  virtual Representation representation() const {
+    return kUnboxedUint32x4;
+  }
+
+  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(Float32x4Comparison)
+  virtual CompileType ComputeType() const;
+
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const {
+    return op_kind() == other->AsFloat32x4Comparison()->op_kind();
+  }
+
+ private:
+  const MethodRecognizer::Kind op_kind_;
+
+  DISALLOW_COPY_AND_ASSIGN(Float32x4ComparisonInstr);
+};
+
+
+class Float32x4MinMaxInstr : public TemplateDefinition<2> {
+ public:
+  Float32x4MinMaxInstr(MethodRecognizer::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]; }
+
+  MethodRecognizer::Kind op_kind() const { return op_kind_; }
+
+  virtual void PrintOperandsTo(BufferFormatter* f) const;
+
+  virtual bool CanDeoptimize() const { return false; }
+
+  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(Float32x4MinMax)
+  virtual CompileType ComputeType() const;
+
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const {
+    return op_kind() == other->AsFloat32x4MinMax()->op_kind();
+  }
+
+ private:
+  const MethodRecognizer::Kind op_kind_;
+
+  DISALLOW_COPY_AND_ASSIGN(Float32x4MinMaxInstr);
+};
+
+
+class Float32x4ScaleInstr : public TemplateDefinition<2> {
+ public:
+  Float32x4ScaleInstr(MethodRecognizer::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]; }
+
+  MethodRecognizer::Kind op_kind() const { return op_kind_; }
+
+  virtual void PrintOperandsTo(BufferFormatter* f) const;
+
+  virtual bool CanDeoptimize() const { return false; }
+
+  virtual Representation representation() const {
+    return kUnboxedFloat32x4;
+  }
+
+  virtual Representation RequiredInputRepresentation(intptr_t idx) const {
+    ASSERT((idx == 0) || (idx == 1));
+    if (idx == 0) {
+      return kUnboxedDouble;
+    }
+    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(Float32x4Scale)
+  virtual CompileType ComputeType() const;
+
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const {
+    return op_kind() == other->AsFloat32x4Scale()->op_kind();
+  }
+
+ private:
+  const MethodRecognizer::Kind op_kind_;
+
+  DISALLOW_COPY_AND_ASSIGN(Float32x4ScaleInstr);
+};
+
+
+class Float32x4SqrtInstr : public TemplateDefinition<1> {
+ public:
+  Float32x4SqrtInstr(MethodRecognizer::Kind op_kind, Value* left,
+                     InstanceCallInstr* instance_call) : op_kind_(op_kind) {
+    SetInputAt(0, left);
+    deopt_id_ = instance_call->deopt_id();
+  }
+
+  Value* left() const { return inputs_[0]; }
+
+  MethodRecognizer::Kind op_kind() const { return op_kind_; }
+
+  virtual void PrintOperandsTo(BufferFormatter* f) const;
+
+  virtual bool CanDeoptimize() const { return false; }
+
+  virtual Representation representation() const {
+    return kUnboxedFloat32x4;
+  }
+
+  virtual Representation RequiredInputRepresentation(intptr_t idx) const {
+    ASSERT(idx == 0);
+    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(Float32x4Sqrt)
+  virtual CompileType ComputeType() const;
+
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const {
+    return op_kind() == other->AsFloat32x4Sqrt()->op_kind();
+  }
+
+ private:
+  const MethodRecognizer::Kind op_kind_;
+
+  DISALLOW_COPY_AND_ASSIGN(Float32x4SqrtInstr);
+};
+
+
 class BinaryMintOpInstr : public TemplateDefinition<2> {
  public:
   BinaryMintOpInstr(Token::Kind op_kind,
@@ -4374,17 +4714,6 @@
     return (op_kind() == Token::kADD) || (op_kind() == Token::kSUB);
   }
 
-  virtual bool HasSideEffect() const { return false; }
-
-  virtual bool AffectedBySideEffect() const { return false; }
-
-  virtual bool AttributesEqual(Instruction* other) const {
-    ASSERT(other->IsBinaryMintOp());
-    return op_kind() == other->AsBinaryMintOp()->op_kind();
-  }
-
-  virtual CompileType ComputeType() const;
-
   virtual Representation representation() const {
     return kUnboxedMint;
   }
@@ -4403,6 +4732,15 @@
   virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer);
 
   DECLARE_INSTRUCTION(BinaryMintOp)
+  virtual CompileType ComputeType() const;
+
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const {
+    ASSERT(other->IsBinaryMintOp());
+    return op_kind() == other->AsBinaryMintOp()->op_kind();
+  }
 
  private:
   const Token::Kind op_kind_;
@@ -4434,14 +4772,6 @@
 
   virtual bool CanDeoptimize() const { return true; }
 
-  virtual bool HasSideEffect() const { return false; }
-
-  virtual bool AffectedBySideEffect() const { return false; }
-
-  virtual bool AttributesEqual(Instruction* other) const {
-    return op_kind() == other->AsShiftMintOp()->op_kind();
-  }
-
   virtual CompileType ComputeType() const;
 
   virtual Representation representation() const {
@@ -4461,6 +4791,13 @@
 
   DECLARE_INSTRUCTION(ShiftMintOp)
 
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const {
+    return op_kind() == other->AsShiftMintOp()->op_kind();
+  }
+
  private:
   const Token::Kind op_kind_;
 
@@ -4487,16 +4824,6 @@
 
   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->AsUnaryMintOp()->op_kind();
-  }
-
-  virtual CompileType ComputeType() const;
-
   virtual Representation representation() const {
     return kUnboxedMint;
   }
@@ -4513,6 +4840,14 @@
   }
 
   DECLARE_INSTRUCTION(UnaryMintOp)
+  virtual CompileType ComputeType() const;
+
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const {
+    return op_kind() == other->AsUnaryMintOp()->op_kind();
+  }
 
  private:
   const Token::Kind op_kind_;
@@ -4545,28 +4880,23 @@
 
   const ICData* ic_data() const { return instance_call()->ic_data(); }
 
+  void set_overflow(bool overflow) { overflow_ = overflow; }
+
+  void set_is_truncating(bool value) { is_truncating_ = value; }
+  bool is_truncating() const { return is_truncating_; }
+
   virtual void PrintOperandsTo(BufferFormatter* f) const;
 
   DECLARE_INSTRUCTION(BinarySmiOp)
-
   virtual CompileType ComputeType() const;
 
   virtual bool CanDeoptimize() const;
 
-  virtual bool HasSideEffect() const { return false; }
-
-  virtual bool AffectedBySideEffect() const { return false; }
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
   virtual bool AttributesEqual(Instruction* other) const;
 
-  void set_overflow(bool overflow) {
-    overflow_ = overflow;
-  }
-
-  void set_is_truncating(bool value) {
-    is_truncating_ = value;
-  }
-  bool is_truncating() const { return is_truncating_; }
-
   void PrintTo(BufferFormatter* f) const;
 
   virtual void InferRange();
@@ -4609,7 +4939,12 @@
 
   virtual bool CanDeoptimize() const { return op_kind() == Token::kNEGATE; }
 
-  virtual bool HasSideEffect() const { return false; }
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const {
+    return other->AsUnarySmiOp()->op_kind() == op_kind();
+  }
 
  private:
   const Token::Kind op_kind_;
@@ -4631,7 +4966,7 @@
 
   virtual bool CanDeoptimize() const { return true; }
 
-  virtual bool HasSideEffect() const { return false; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
  private:
   const intptr_t token_pos_;
@@ -4640,25 +4975,31 @@
 };
 
 
-class SmiToDoubleInstr : public TemplateDefinition<0> {
+class SmiToDoubleInstr : public TemplateDefinition<1> {
  public:
-  explicit SmiToDoubleInstr(InstanceCallInstr* instance_call)
-      : instance_call_(instance_call) { }
+  explicit SmiToDoubleInstr(Value* value) {
+    SetInputAt(0, value);
+  }
 
-  InstanceCallInstr* instance_call() const { return instance_call_; }
+  Value* value() const { return inputs_[0]; }
 
   DECLARE_INSTRUCTION(SmiToDouble)
   virtual CompileType ComputeType() const;
 
+  virtual Representation representation() const {
+    return kUnboxedDouble;
+  }
+
   virtual intptr_t ArgumentCount() const { return 1; }
 
-  virtual bool CanDeoptimize() const { return true; }
+  virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return false; }
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const { return true; }
 
  private:
-  InstanceCallInstr* instance_call_;
-
   DISALLOW_COPY_AND_ASSIGN(SmiToDoubleInstr);
 };
 
@@ -4680,7 +5021,7 @@
 
   virtual bool CanDeoptimize() const { return true; }
 
-  virtual bool HasSideEffect() const { return false; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
 
  private:
   InstanceCallInstr* instance_call_;
@@ -4705,8 +5046,6 @@
 
   virtual bool CanDeoptimize() const { return true; }
 
-  virtual bool HasSideEffect() const { return false; }
-
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     ASSERT(idx == 0);
     return kUnboxedDouble;
@@ -4714,6 +5053,8 @@
 
   virtual intptr_t DeoptimizationTarget() const { return deopt_id_; }
 
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+
  private:
   DISALLOW_COPY_AND_ASSIGN(DoubleToSmiInstr);
 };
@@ -4738,8 +5079,6 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return false; }
-
   virtual Representation representation() const {
     return kUnboxedDouble;
   }
@@ -4751,6 +5090,13 @@
 
   virtual intptr_t DeoptimizationTarget() const { return deopt_id_; }
 
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const {
+    return other->AsDoubleToDouble()->recognized_kind() == recognized_kind();
+  }
+
  private:
   const MethodRecognizer::Kind recognized_kind_;
 
@@ -4776,8 +5122,6 @@
 
   virtual bool CanDeoptimize() const { return false; }
 
-  virtual bool HasSideEffect() const { return false; }
-
   virtual Representation representation() const {
     return kUnboxedDouble;
   }
@@ -4806,6 +5150,14 @@
     return locs_;
   }
 
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const {
+    InvokeMathCFunctionInstr* other_invoke = other->AsInvokeMathCFunction();
+    return other_invoke->recognized_kind() == recognized_kind();
+  }
+
  private:
   virtual void RawSetInputAt(intptr_t i, Value* value) {
     (*inputs_)[i] = value;
@@ -4833,12 +5185,6 @@
 
   virtual bool CanDeoptimize() const { return true; }
 
-  virtual bool HasSideEffect() const { return false; }
-
-  virtual bool AttributesEqual(Instruction* other) const;
-
-  virtual bool AffectedBySideEffect() const;
-
   Value* value() const { return inputs_[0]; }
 
   const ICData& unary_checks() const { return unary_checks_; }
@@ -4851,6 +5197,11 @@
 
   bool null_check() const { return null_check_; }
 
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const;
+  virtual bool AttributesEqual(Instruction* other) const;
+
  private:
   const ICData& unary_checks_;
 
@@ -4868,21 +5219,20 @@
     deopt_id_ = original_deopt_id;
   }
 
+  Value* value() const { return inputs_[0]; }
+
   DECLARE_INSTRUCTION(CheckSmi)
 
   virtual intptr_t ArgumentCount() const { return 0; }
 
   virtual bool CanDeoptimize() const { return true; }
 
-  virtual bool HasSideEffect() const { return false; }
-
-  virtual bool AttributesEqual(Instruction* other) const { return true; }
-
-  virtual bool AffectedBySideEffect() const { return false; }
-
   virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer);
 
-  Value* value() const { return inputs_[0]; }
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const { return true; }
 
  private:
   DISALLOW_COPY_AND_ASSIGN(CheckSmiInstr);
@@ -4901,23 +5251,17 @@
     deopt_id_ = instance_call->deopt_id();
   }
 
+  Value* length() const { return inputs_[0]; }
+  Value* index() const { return inputs_[1]; }
+
+  intptr_t array_type() const { return array_type_; }
+
   DECLARE_INSTRUCTION(CheckArrayBound)
 
   virtual intptr_t ArgumentCount() const { return 0; }
 
   virtual bool CanDeoptimize() const { return true; }
 
-  virtual bool HasSideEffect() const { return false; }
-
-  virtual bool AttributesEqual(Instruction* other) const;
-
-  virtual bool AffectedBySideEffect() const { return false; }
-
-  Value* length() const { return inputs_[0]; }
-  Value* index() const { return inputs_[1]; }
-
-  intptr_t array_type() const { return array_type_; }
-
   bool IsRedundant(RangeBoundary length);
 
   // Returns the length offset for array and string types.
@@ -4925,6 +5269,11 @@
 
   static bool IsFixedLengthArrayType(intptr_t class_id);
 
+  virtual bool AllowsCSE() const { return true; }
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+  virtual EffectSet Dependencies() const { return EffectSet::None(); }
+  virtual bool AttributesEqual(Instruction* other) const;
+
  private:
   intptr_t array_type_;
 
diff --git a/runtime/vm/intermediate_language_arm.cc b/runtime/vm/intermediate_language_arm.cc
index 43043a5..60f959f 100644
--- a/runtime/vm/intermediate_language_arm.cc
+++ b/runtime/vm/intermediate_language_arm.cc
@@ -1458,7 +1458,9 @@
 
   // 'instantiator_reg' is the instantiator AbstractTypeArguments object
   // (or null).
-  if (!type_arguments().IsUninstantiatedIdentity()) {
+  if (!type_arguments().IsUninstantiatedIdentity() &&
+      !type_arguments().CanShareInstantiatorTypeArguments(
+          instantiator_class())) {
     // 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.
@@ -1507,7 +1509,9 @@
 
   // instantiator_reg is the instantiator type argument vector, i.e. an
   // AbstractTypeArguments object (or null).
-  if (!type_arguments().IsUninstantiatedIdentity()) {
+  if (!type_arguments().IsUninstantiatedIdentity() &&
+      !type_arguments().CanShareInstantiatorTypeArguments(
+          instantiator_class())) {
     // 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.
@@ -1549,7 +1553,9 @@
 
   // instantiator_reg is the instantiator AbstractTypeArguments object
   // (or null).
-  if (type_arguments().IsUninstantiatedIdentity()) {
+  if (type_arguments().IsUninstantiatedIdentity() ||
+      type_arguments().CanShareInstantiatorTypeArguments(
+          instantiator_class())) {
     // The instantiator was used in VisitExtractConstructorTypeArguments as the
     // instantiated type arguments, no proper instantiator needed.
     __ LoadImmediate(instantiator_reg,
@@ -1947,6 +1953,28 @@
 }
 
 
+LocationSummary* BoxUint32x4Instr::MakeLocationSummary() const {
+  UNIMPLEMENTED();
+  return NULL;
+}
+
+
+void BoxUint32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  UNIMPLEMENTED();
+}
+
+
+LocationSummary* UnboxUint32x4Instr::MakeLocationSummary() const {
+  UNIMPLEMENTED();
+  return NULL;
+}
+
+
+void UnboxUint32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  UNIMPLEMENTED();
+}
+
+
 LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary() const {
   UNIMPLEMENTED();
   return NULL;
@@ -2013,6 +2041,50 @@
 }
 
 
+LocationSummary* Float32x4ComparisonInstr::MakeLocationSummary() const {
+  UNIMPLEMENTED();
+  return NULL;
+}
+
+
+void Float32x4ComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  UNIMPLEMENTED();
+}
+
+
+LocationSummary* Float32x4MinMaxInstr::MakeLocationSummary() const {
+  UNIMPLEMENTED();
+  return NULL;
+}
+
+
+void Float32x4MinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  UNIMPLEMENTED();
+}
+
+
+LocationSummary* Float32x4SqrtInstr::MakeLocationSummary() const {
+  UNIMPLEMENTED();
+  return NULL;
+}
+
+
+void Float32x4SqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  UNIMPLEMENTED();
+}
+
+
+LocationSummary* Float32x4ScaleInstr::MakeLocationSummary() const {
+  UNIMPLEMENTED();
+  return NULL;
+}
+
+
+void Float32x4ScaleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  UNIMPLEMENTED();
+}
+
+
 LocationSummary* MathSqrtInstr::MakeLocationSummary() const {
   UNIMPLEMENTED();
   return NULL;
diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc
index 00cd501..b085eed 100644
--- a/runtime/vm/intermediate_language_ia32.cc
+++ b/runtime/vm/intermediate_language_ia32.cc
@@ -1875,7 +1875,9 @@
 
   // 'instantiator_reg' is the instantiator AbstractTypeArguments object
   // (or null).
-  if (!type_arguments().IsUninstantiatedIdentity()) {
+  if (!type_arguments().IsUninstantiatedIdentity() &&
+      !type_arguments().CanShareInstantiatorTypeArguments(
+          instantiator_class())) {
     // 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.
@@ -1925,7 +1927,9 @@
 
   // instantiator_reg is the instantiator type argument vector, i.e. an
   // AbstractTypeArguments object (or null).
-  if (!type_arguments().IsUninstantiatedIdentity()) {
+  if (!type_arguments().IsUninstantiatedIdentity() &&
+      !type_arguments().CanShareInstantiatorTypeArguments(
+          instantiator_class())) {
     // 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.
@@ -1968,7 +1972,9 @@
 
   // instantiator_reg is the instantiator AbstractTypeArguments object
   // (or null).
-  if (type_arguments().IsUninstantiatedIdentity()) {
+  if (type_arguments().IsUninstantiatedIdentity() ||
+      type_arguments().CanShareInstantiatorTypeArguments(
+          instantiator_class())) {
     // The instantiator was used in VisitExtractConstructorTypeArguments as the
     // instantiated type arguments, no proper instantiator needed.
     __ movl(instantiator_reg,
@@ -2719,11 +2725,16 @@
 
 
 LocationSummary* UnboxFloat32x4Instr::MakeLocationSummary() const {
+  const intptr_t value_cid = value()->Type()->ToCid();
   const intptr_t kNumInputs = 1;
-  const intptr_t kNumTemps = 0;
+  const intptr_t kNumTemps = value_cid == kFloat32x4Cid ? 0 : 1;
   LocationSummary* summary =
       new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
   summary->set_in(0, Location::RequiresRegister());
+  if (kNumTemps > 0) {
+    ASSERT(kNumTemps == 1);
+    summary->set_temp(0, Location::RequiresRegister());
+  }
   summary->set_out(Location::RequiresFpuRegister());
   return summary;
 }
@@ -2734,11 +2745,113 @@
   const Register value = locs()->in(0).reg();
   const XmmRegister result = locs()->out().fpu_reg();
 
-  ASSERT(value_cid == kFloat32x4Cid);
+  if (value_cid != kFloat32x4Cid) {
+    const Register temp = locs()->temp(0).reg();
+    Label* deopt = compiler->AddDeoptStub(deopt_id_, kDeoptCheckClass);
+    __ testl(value, Immediate(kSmiTagMask));
+    __ j(ZERO, deopt);
+    __ CompareClassId(value, kFloat32x4Cid, temp);
+    __ j(NOT_EQUAL, deopt);
+  }
   __ movups(result, FieldAddress(value, Float32x4::value_offset()));
 }
 
 
+LocationSummary* BoxUint32x4Instr::MakeLocationSummary() const {
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary =
+      new LocationSummary(kNumInputs,
+                          kNumTemps,
+                          LocationSummary::kCallOnSlowPath);
+  summary->set_in(0, Location::RequiresFpuRegister());
+  summary->set_out(Location::RequiresRegister());
+  return summary;
+}
+
+
+class BoxUint32x4SlowPath : public SlowPathCode {
+ public:
+  explicit BoxUint32x4SlowPath(BoxUint32x4Instr* instruction)
+      : instruction_(instruction) { }
+
+  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
+    __ Comment("BoxUint32x4SlowPath");
+    __ Bind(entry_label());
+    const Class& uint32x4_class = compiler->uint32x4_class();
+    const Code& stub =
+        Code::Handle(StubCode::GetAllocationStubForClass(uint32x4_class));
+    const ExternalLabel label(uint32x4_class.ToCString(), stub.EntryPoint());
+
+    LocationSummary* locs = instruction_->locs();
+    locs->live_registers()->Remove(locs->out());
+
+    compiler->SaveLiveRegisters(locs);
+    compiler->GenerateCall(Scanner::kDummyTokenIndex,  // No token position.
+                           &label,
+                           PcDescriptors::kOther,
+                           locs);
+    __ MoveRegister(locs->out().reg(), EAX);
+    compiler->RestoreLiveRegisters(locs);
+
+    __ jmp(exit_label());
+  }
+
+ private:
+  BoxUint32x4Instr* instruction_;
+};
+
+
+void BoxUint32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  BoxUint32x4SlowPath* slow_path = new BoxUint32x4SlowPath(this);
+  compiler->AddSlowPathCode(slow_path);
+
+  Register out_reg = locs()->out().reg();
+  XmmRegister value = locs()->in(0).fpu_reg();
+
+  __ TryAllocate(compiler->uint32x4_class(),
+                 slow_path->entry_label(),
+                 Assembler::kFarJump,
+                 out_reg);
+  __ Bind(slow_path->exit_label());
+  __ movups(FieldAddress(out_reg, Uint32x4::value_offset()), value);
+}
+
+
+LocationSummary* UnboxUint32x4Instr::MakeLocationSummary() const {
+  const intptr_t value_cid = value()->Type()->ToCid();
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = value_cid == kUint32x4Cid ? 0 : 1;
+  LocationSummary* summary =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresRegister());
+  if (kNumTemps > 0) {
+    ASSERT(kNumTemps == 1);
+    summary->set_temp(0, Location::RequiresRegister());
+  }
+  summary->set_out(Location::RequiresFpuRegister());
+  return summary;
+}
+
+
+void UnboxUint32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  const intptr_t value_cid = value()->Type()->ToCid();
+  const Register value = locs()->in(0).reg();
+  const XmmRegister result = locs()->out().fpu_reg();
+
+  if (value_cid != kUint32x4Cid) {
+    const Register temp = locs()->temp(0).reg();
+    Label* deopt = compiler->AddDeoptStub(deopt_id_, kDeoptCheckClass);
+    __ testl(value, Immediate(kSmiTagMask));
+    __ j(ZERO, deopt);
+    __ CompareClassId(value, kUint32x4Cid, temp);
+    __ j(NOT_EQUAL, deopt);
+  }
+  __ movups(result, FieldAddress(value, Uint32x4::value_offset()));
+}
+
+
+
 LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary() const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
@@ -2920,6 +3033,139 @@
 }
 
 
+LocationSummary* Float32x4ComparisonInstr::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 Float32x4ComparisonInstr::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 MethodRecognizer::kFloat32x4Equal:
+      __ cmppseq(left, right);
+      break;
+    case MethodRecognizer::kFloat32x4NotEqual:
+      __ cmppsneq(left, right);
+      break;
+    case MethodRecognizer::kFloat32x4GreaterThan:
+      __ cmppsnle(left, right);
+      break;
+    case MethodRecognizer::kFloat32x4GreaterThanOrEqual:
+      __ cmppsnlt(left, right);
+      break;
+    case MethodRecognizer::kFloat32x4LessThan:
+      __ cmppslt(left, right);
+      break;
+    case MethodRecognizer::kFloat32x4LessThanOrEqual:
+      __ cmppsle(left, right);
+      break;
+
+    default: UNREACHABLE();
+  }
+}
+
+
+LocationSummary* Float32x4MinMaxInstr::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 Float32x4MinMaxInstr::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 MethodRecognizer::kFloat32x4Min:
+      __ minps(left, right);
+      break;
+    case MethodRecognizer::kFloat32x4Max:
+      __ maxps(left, right);
+      break;
+    default: UNREACHABLE();
+  }
+}
+
+
+LocationSummary* Float32x4ScaleInstr::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 Float32x4ScaleInstr::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 MethodRecognizer::kFloat32x4Scale:
+      __ cvtsd2ss(left, left);
+      __ shufps(left, left, Immediate(0x00));
+      __ mulps(left, right);
+      break;
+    default: UNREACHABLE();
+  }
+}
+
+
+LocationSummary* Float32x4SqrtInstr::MakeLocationSummary() const {
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresFpuRegister());
+  summary->set_out(Location::SameAsFirstInput());
+  return summary;
+}
+
+
+void Float32x4SqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  XmmRegister left = locs()->in(0).fpu_reg();
+
+  ASSERT(locs()->out().fpu_reg() == left);
+
+  switch (op_kind()) {
+    case MethodRecognizer::kFloat32x4Sqrt:
+      __ sqrtps(left);
+      break;
+    case MethodRecognizer::kFloat32x4Reciprocal:
+      __ reciprocalps(left);
+      break;
+    case MethodRecognizer::kFloat32x4ReciprocalSqrt:
+      __ rsqrtps(left);
+      break;
+    default: UNREACHABLE();
+  }
+}
+
+
 LocationSummary* MathSqrtInstr::MakeLocationSummary() const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
@@ -2969,37 +3215,21 @@
 
 
 LocationSummary* SmiToDoubleInstr::MakeLocationSummary() const {
-  return MakeCallSummary();  // Calls a stub to allocate result.
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* result =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  result->set_in(0, Location::WritableRegister());
+  result->set_out(Location::RequiresFpuRegister());
+  return result;
 }
 
 
 void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  Register result = locs()->out().reg();
-
-  Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(),
-                                        kDeoptIntegerToDouble);
-
-  const Class& double_class = compiler->double_class();
-  const Code& stub =
-      Code::Handle(StubCode::GetAllocationStubForClass(double_class));
-  const ExternalLabel label(double_class.ToCString(), stub.EntryPoint());
-
-  // TODO(vegorov): allocate box in the driver loop to avoid spilling.
-  compiler->GenerateCall(instance_call()->token_pos(),
-                         &label,
-                         PcDescriptors::kOther,
-                         locs());
-  ASSERT(result == EAX);
-  Register value = EBX;
-  // Preserve argument on the stack until after the deoptimization point.
-  __ movl(value, Address(ESP, 0));
-
-  __ testl(value, Immediate(kSmiTagMask));
-  __ j(NOT_ZERO, deopt);  // Deoptimize if not Smi.
+  Register value = locs()->in(0).reg();
+  FpuRegister result = locs()->out().fpu_reg();
   __ SmiUntag(value);
-  __ cvtsi2sd(XMM0, value);
-  __ movsd(FieldAddress(result, Double::value_offset()), XMM0);
-  __ Drop(1);
+  __ cvtsi2sd(result, value);
 }
 
 
@@ -3063,8 +3293,6 @@
   Register result = locs()->out().reg();
   XmmRegister value = locs()->in(0).fpu_reg();
   __ cvttsd2si(result, value);
-  // Overflow is signalled with minint.
-  Label do_call, done;
   // Check for overflow and that it fits into Smi.
   __ cmpl(result, Immediate(0xC0000000));
   __ j(NEGATIVE, deopt);
diff --git a/runtime/vm/intermediate_language_mips.cc b/runtime/vm/intermediate_language_mips.cc
index fa66db3..21ba210 100644
--- a/runtime/vm/intermediate_language_mips.cc
+++ b/runtime/vm/intermediate_language_mips.cc
@@ -859,25 +859,192 @@
 
 
 CompileType LoadIndexedInstr::ComputeType() const {
-  UNIMPLEMENTED();
-  return CompileType::Dynamic();
+  switch (class_id_) {
+    case kArrayCid:
+    case kImmutableArrayCid:
+      return CompileType::Dynamic();
+
+    case kTypedDataFloat32ArrayCid:
+    case kTypedDataFloat64ArrayCid:
+      return CompileType::FromCid(kDoubleCid);
+    case kTypedDataFloat32x4ArrayCid:
+      return CompileType::FromCid(kFloat32x4Cid);
+
+    case kTypedDataInt8ArrayCid:
+    case kTypedDataUint8ArrayCid:
+    case kTypedDataUint8ClampedArrayCid:
+    case kExternalTypedDataUint8ArrayCid:
+    case kExternalTypedDataUint8ClampedArrayCid:
+    case kTypedDataInt16ArrayCid:
+    case kTypedDataUint16ArrayCid:
+    case kOneByteStringCid:
+    case kTwoByteStringCid:
+      return CompileType::FromCid(kSmiCid);
+
+    case kTypedDataInt32ArrayCid:
+    case kTypedDataUint32ArrayCid:
+      // Result can be Smi or Mint when boxed.
+      // Instruction can deoptimize if we optimistically assumed that the result
+      // fits into Smi.
+      return CanDeoptimize() ? CompileType::FromCid(kSmiCid)
+                             : CompileType::Int();
+
+    default:
+      UNIMPLEMENTED();
+      return CompileType::Dynamic();
+  }
 }
 
 
 Representation LoadIndexedInstr::representation() const {
-  UNIMPLEMENTED();
-  return kTagged;
+  switch (class_id_) {
+    case kArrayCid:
+    case kImmutableArrayCid:
+    case kTypedDataInt8ArrayCid:
+    case kTypedDataUint8ArrayCid:
+    case kTypedDataUint8ClampedArrayCid:
+    case kExternalTypedDataUint8ArrayCid:
+    case kExternalTypedDataUint8ClampedArrayCid:
+    case kTypedDataInt16ArrayCid:
+    case kTypedDataUint16ArrayCid:
+    case kOneByteStringCid:
+    case kTwoByteStringCid:
+      return kTagged;
+    case kTypedDataInt32ArrayCid:
+    case kTypedDataUint32ArrayCid:
+      // Instruction can deoptimize if we optimistically assumed that the result
+      // fits into Smi.
+      return CanDeoptimize() ? kTagged : kUnboxedMint;
+    case kTypedDataFloat32ArrayCid:
+    case kTypedDataFloat64ArrayCid:
+      return kUnboxedDouble;
+    case kTypedDataFloat32x4ArrayCid:
+      return kUnboxedFloat32x4;
+    default:
+      UNIMPLEMENTED();
+      return kTagged;
+  }
 }
 
 
 LocationSummary* LoadIndexedInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 2;
+  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());
+  if (representation() == kUnboxedDouble) {
+    locs->set_out(Location::RequiresFpuRegister());
+  } else {
+    locs->set_out(Location::RequiresRegister());
+  }
+  return locs;
 }
 
 
 void LoadIndexedInstr::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: {
+        __ sll(index.reg(), index.reg(), 1);
+        break;
+      }
+      case 8: {
+        __ sll(index.reg(), index.reg(), 2);
+        break;
+      }
+      case 16: {
+        __ sll(index.reg(), index.reg(), 3);
+        break;
+      }
+      default:
+        UNREACHABLE();
+    }
+    __ AddImmediate(index.reg(),
+        FlowGraphCompiler::DataOffsetFor(class_id()) - kHeapObjectTag);
+    element_address = Address(array, index.reg());
+  }
+
+  if ((representation() == kUnboxedDouble) ||
+      (representation() == kUnboxedMint) ||
+      (representation() == kUnboxedFloat32x4)) {
+    UNIMPLEMENTED();
+  }
+
+  Register result = locs()->out().reg();
+  if ((index_scale() == 1) && index.IsRegister()) {
+    __ SmiUntag(index.reg());
+  }
+  switch (class_id()) {
+    case kTypedDataInt8ArrayCid:
+      ASSERT(index_scale() == 1);
+      __ lb(result, element_address);
+      __ SmiTag(result);
+      break;
+    case kTypedDataUint8ArrayCid:
+    case kTypedDataUint8ClampedArrayCid:
+    case kExternalTypedDataUint8ArrayCid:
+    case kExternalTypedDataUint8ClampedArrayCid:
+    case kOneByteStringCid:
+      ASSERT(index_scale() == 1);
+      __ lbu(result, element_address);
+      __ SmiTag(result);
+      break;
+    case kTypedDataInt16ArrayCid:
+      __ lh(result, element_address);
+      __ SmiTag(result);
+      break;
+    case kTypedDataUint16ArrayCid:
+    case kTwoByteStringCid:
+      __ lhu(result, element_address);
+      __ SmiTag(result);
+      break;
+    case kTypedDataInt32ArrayCid: {
+        Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptInt32Load);
+        __ lw(result, element_address);
+        // Verify that the signed value in 'result' can fit inside a Smi.
+        __ BranchSignedLess(result, 0xC0000000, deopt);
+        __ SmiTag(result);
+      }
+      break;
+    case kTypedDataUint32ArrayCid: {
+        Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptUint32Load);
+        __ lw(result, element_address);
+        // Verify that the unsigned value in 'result' can fit inside a Smi.
+        __ LoadImmediate(TMP1, 0xC0000000);
+        __ and_(CMPRES, result, TMP1);
+        __ bne(CMPRES, ZR, deopt);
+        __ SmiTag(result);
+      }
+      break;
+    default:
+      ASSERT((class_id() == kArrayCid) || (class_id() == kImmutableArrayCid));
+      __ lw(result, element_address);
+      break;
+  }
 }
 
 
@@ -1318,7 +1485,9 @@
 
   // 'instantiator_reg' is the instantiator AbstractTypeArguments object
   // (or null).
-  if (!type_arguments().IsUninstantiatedIdentity()) {
+  if (!type_arguments().IsUninstantiatedIdentity() &&
+      !type_arguments().CanShareInstantiatorTypeArguments(
+          instantiator_class())) {
     // 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.
@@ -1374,7 +1543,9 @@
 
   // instantiator_reg is the instantiator type argument vector, i.e. an
   // AbstractTypeArguments object (or null).
-  if (!type_arguments().IsUninstantiatedIdentity()) {
+  if (!type_arguments().IsUninstantiatedIdentity() &&
+      !type_arguments().CanShareInstantiatorTypeArguments(
+          instantiator_class())) {
     // 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.
@@ -1416,7 +1587,9 @@
 
   // instantiator_reg is the instantiator AbstractTypeArguments object
   // (or null).
-  if (type_arguments().IsUninstantiatedIdentity()) {
+  if (type_arguments().IsUninstantiatedIdentity() ||
+      type_arguments().CanShareInstantiatorTypeArguments(
+          instantiator_class())) {
     // The instantiator was used in VisitExtractConstructorTypeArguments as the
     // instantiated type arguments, no proper instantiator needed.
     __ LoadImmediate(instantiator_reg,
@@ -1568,7 +1741,7 @@
   __ LoadImmediate(TMP1, Isolate::Current()->stack_limit_address());
 
   __ lw(TMP1, Address(TMP1));
-  __ BranchLessEqual(SP, TMP1, slow_path->entry_label());
+  __ BranchUnsignedLessEqual(SP, TMP1, slow_path->entry_label());
 
   __ Bind(slow_path->exit_label());
 }
@@ -1835,6 +2008,28 @@
 }
 
 
+LocationSummary* BoxUint32x4Instr::MakeLocationSummary() const {
+  UNIMPLEMENTED();
+  return NULL;
+}
+
+
+void BoxUint32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  UNIMPLEMENTED();
+}
+
+
+LocationSummary* UnboxUint32x4Instr::MakeLocationSummary() const {
+  UNIMPLEMENTED();
+  return NULL;
+}
+
+
+void UnboxUint32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  UNIMPLEMENTED();
+}
+
+
 LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary() const {
   UNIMPLEMENTED();
   return NULL;
@@ -1901,6 +2096,50 @@
 }
 
 
+LocationSummary* Float32x4ComparisonInstr::MakeLocationSummary() const {
+  UNIMPLEMENTED();
+  return NULL;
+}
+
+
+void Float32x4ComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  UNIMPLEMENTED();
+}
+
+
+LocationSummary* Float32x4MinMaxInstr::MakeLocationSummary() const {
+  UNIMPLEMENTED();
+  return NULL;
+}
+
+
+void Float32x4MinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  UNIMPLEMENTED();
+}
+
+
+LocationSummary* Float32x4SqrtInstr::MakeLocationSummary() const {
+  UNIMPLEMENTED();
+  return NULL;
+}
+
+
+void Float32x4SqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  UNIMPLEMENTED();
+}
+
+
+LocationSummary* Float32x4ScaleInstr::MakeLocationSummary() const {
+  UNIMPLEMENTED();
+  return NULL;
+}
+
+
+void Float32x4ScaleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  UNIMPLEMENTED();
+}
+
+
 LocationSummary* MathSqrtInstr::MakeLocationSummary() const {
   UNIMPLEMENTED();
   return NULL;
@@ -2034,13 +2273,56 @@
 
 
 LocationSummary* CheckClassInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresRegister());
+  if (!null_check()) {
+    summary->AddTemp(Location::RequiresRegister());
+  }
+  return summary;
 }
 
 
 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  if (null_check()) {
+    Label* deopt = compiler->AddDeoptStub(deopt_id(),
+                                          kDeoptCheckClass);
+    __ BranchEqual(locs()->in(0).reg(),
+                  reinterpret_cast<intptr_t>(Object::null()), deopt);
+    return;
+  }
+
+  ASSERT((unary_checks().GetReceiverClassIdAt(0) != kSmiCid) ||
+         (unary_checks().NumberOfChecks() > 1));
+  Register value = locs()->in(0).reg();
+  Register temp = locs()->temp(0).reg();
+  Label* deopt = compiler->AddDeoptStub(deopt_id(),
+                                        kDeoptCheckClass);
+  Label is_ok;
+  intptr_t cix = 0;
+  if (unary_checks().GetReceiverClassIdAt(cix) == kSmiCid) {
+    __ andi(CMPRES, value, Immediate(kSmiTagMask));
+    __ beq(CMPRES, ZR, &is_ok);
+    cix++;  // Skip first check.
+  } else {
+    __ andi(CMPRES, value, Immediate(kSmiTagMask));
+    __ beq(CMPRES, ZR, deopt);
+  }
+  __ LoadClassId(temp, value);
+  const intptr_t num_checks = unary_checks().NumberOfChecks();
+  for (intptr_t i = cix; i < num_checks; i++) {
+    ASSERT(unary_checks().GetReceiverClassIdAt(i) != kSmiCid);
+    __ LoadImmediate(TMP1, unary_checks().GetReceiverClassIdAt(i));
+    __ subu(CMPRES, temp, TMP1);
+    if (i == (num_checks - 1)) {
+      __ bne(CMPRES, ZR, deopt);
+    } else {
+      __ beq(CMPRES, ZR, &is_ok);
+    }
+  }
+  __ Bind(&is_ok);
 }
 
 
@@ -2065,13 +2347,43 @@
 
 
 LocationSummary* CheckArrayBoundInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 2;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* locs =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  locs->set_in(0, Location::RegisterOrSmiConstant(length()));
+  locs->set_in(1, Location::RegisterOrSmiConstant(index()));
+  return locs;
 }
 
 
 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Label* deopt = compiler->AddDeoptStub(deopt_id(),
+                                        kDeoptCheckArrayBound);
+  if (locs()->in(0).IsConstant() && locs()->in(1).IsConstant()) {
+    // Unconditionally deoptimize for constant bounds checks because they
+    // only occur only when index is out-of-bounds.
+    __ b(deopt);
+    return;
+  }
+
+  if (locs()->in(1).IsConstant()) {
+    Register length = locs()->in(0).reg();
+    const Object& constant = locs()->in(1).constant();
+    ASSERT(constant.IsSmi());
+    __ BranchUnsignedLessEqual(
+        length, reinterpret_cast<int32_t>(constant.raw()), deopt);
+  } else if (locs()->in(0).IsConstant()) {
+    ASSERT(locs()->in(0).constant().IsSmi());
+    const Smi& smi_const = Smi::Cast(locs()->in(0).constant());
+    Register index = locs()->in(1).reg();
+    __ BranchUnsignedGreaterEqual(
+        index, reinterpret_cast<int32_t>(smi_const.raw()), deopt);
+  } else {
+    Register length = locs()->in(0).reg();
+    Register index = locs()->in(1).reg();
+    __ BranchUnsignedGreaterEqual(index, length, deopt);
+  }
 }
 
 
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index f859440..ac9d6f8 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -1845,7 +1845,9 @@
 
   // 'instantiator_reg' is the instantiator AbstractTypeArguments object
   // (or null).
-  if (!type_arguments().IsUninstantiatedIdentity()) {
+  if (!type_arguments().IsUninstantiatedIdentity() &&
+      !type_arguments().CanShareInstantiatorTypeArguments(
+          instantiator_class())) {
     // 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.
@@ -1895,7 +1897,9 @@
 
   // instantiator_reg is the instantiator type argument vector, i.e. an
   // AbstractTypeArguments object (or null).
-  if (!type_arguments().IsUninstantiatedIdentity()) {
+  if (!type_arguments().IsUninstantiatedIdentity() &&
+      !type_arguments().CanShareInstantiatorTypeArguments(
+          instantiator_class())) {
     // 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.
@@ -1938,7 +1942,9 @@
 
   // instantiator_reg is the instantiator AbstractTypeArguments object
   // (or null).
-  if (type_arguments().IsUninstantiatedIdentity()) {
+  if (type_arguments().IsUninstantiatedIdentity() ||
+      type_arguments().CanShareInstantiatorTypeArguments(
+          instantiator_class())) {
     // The instantiator was used in VisitExtractConstructorTypeArguments as the
     // instantiated type arguments, no proper instantiator needed.
     __ movq(instantiator_reg,
@@ -2755,11 +2761,105 @@
   const Register value = locs()->in(0).reg();
   const XmmRegister result = locs()->out().fpu_reg();
 
-  ASSERT(value_cid == kFloat32x4Cid);
+  if (value_cid != kFloat32x4Cid) {
+    Label* deopt = compiler->AddDeoptStub(deopt_id_, kDeoptCheckClass);
+    __ testq(value, Immediate(kSmiTagMask));
+    __ j(ZERO, deopt);
+    __ CompareClassId(value, kFloat32x4Cid);
+    __ j(NOT_EQUAL, deopt);
+  }
   __ movups(result, FieldAddress(value, Float32x4::value_offset()));
 }
 
 
+LocationSummary* BoxUint32x4Instr::MakeLocationSummary() const {
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary =
+      new LocationSummary(kNumInputs,
+                          kNumTemps,
+                          LocationSummary::kCallOnSlowPath);
+  summary->set_in(0, Location::RequiresFpuRegister());
+  summary->set_out(Location::RequiresRegister());
+  return summary;
+}
+
+
+class BoxUint32x4SlowPath : public SlowPathCode {
+ public:
+  explicit BoxUint32x4SlowPath(BoxUint32x4Instr* instruction)
+      : instruction_(instruction) { }
+
+  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
+    __ Comment("BoxUint32x4SlowPath");
+    __ Bind(entry_label());
+    const Class& uint32x4_class = compiler->uint32x4_class();
+    const Code& stub =
+        Code::Handle(StubCode::GetAllocationStubForClass(uint32x4_class));
+    const ExternalLabel label(uint32x4_class.ToCString(), stub.EntryPoint());
+
+    LocationSummary* locs = instruction_->locs();
+    locs->live_registers()->Remove(locs->out());
+
+    compiler->SaveLiveRegisters(locs);
+    compiler->GenerateCall(Scanner::kDummyTokenIndex,  // No token position.
+                           &label,
+                           PcDescriptors::kOther,
+                           locs);
+    __ MoveRegister(locs->out().reg(), RAX);
+    compiler->RestoreLiveRegisters(locs);
+
+    __ jmp(exit_label());
+  }
+
+ private:
+  BoxUint32x4Instr* instruction_;
+};
+
+
+void BoxUint32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  BoxUint32x4SlowPath* slow_path = new BoxUint32x4SlowPath(this);
+  compiler->AddSlowPathCode(slow_path);
+
+  Register out_reg = locs()->out().reg();
+  XmmRegister value = locs()->in(0).fpu_reg();
+
+  __ TryAllocate(compiler->uint32x4_class(),
+                 slow_path->entry_label(),
+                 Assembler::kFarJump,
+                 out_reg);
+  __ Bind(slow_path->exit_label());
+  __ movups(FieldAddress(out_reg, Uint32x4::value_offset()), value);
+}
+
+
+LocationSummary* UnboxUint32x4Instr::MakeLocationSummary() const {
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresRegister());
+  summary->set_out(Location::RequiresFpuRegister());
+  return summary;
+}
+
+
+void UnboxUint32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  const intptr_t value_cid = value()->Type()->ToCid();
+  const Register value = locs()->in(0).reg();
+  const XmmRegister result = locs()->out().fpu_reg();
+
+  if (value_cid != kUint32x4Cid) {
+    Label* deopt = compiler->AddDeoptStub(deopt_id_, kDeoptCheckClass);
+    __ testq(value, Immediate(kSmiTagMask));
+    __ j(ZERO, deopt);
+    __ CompareClassId(value, kUint32x4Cid);
+    __ j(NOT_EQUAL, deopt);
+  }
+  __ movups(result, FieldAddress(value, Uint32x4::value_offset()));
+}
+
+
 LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary() const {
   const intptr_t kNumInputs = 2;
   const intptr_t kNumTemps = 0;
@@ -2940,6 +3040,139 @@
 }
 
 
+LocationSummary* Float32x4ComparisonInstr::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 Float32x4ComparisonInstr::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 MethodRecognizer::kFloat32x4Equal:
+      __ cmppseq(left, right);
+      break;
+    case MethodRecognizer::kFloat32x4NotEqual:
+      __ cmppsneq(left, right);
+      break;
+    case MethodRecognizer::kFloat32x4GreaterThan:
+      __ cmppsnle(left, right);
+      break;
+    case MethodRecognizer::kFloat32x4GreaterThanOrEqual:
+      __ cmppsnlt(left, right);
+      break;
+    case MethodRecognizer::kFloat32x4LessThan:
+      __ cmppslt(left, right);
+      break;
+    case MethodRecognizer::kFloat32x4LessThanOrEqual:
+      __ cmppsle(left, right);
+      break;
+
+    default: UNREACHABLE();
+  }
+}
+
+
+LocationSummary* Float32x4MinMaxInstr::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 Float32x4MinMaxInstr::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 MethodRecognizer::kFloat32x4Min:
+      __ minps(left, right);
+      break;
+    case MethodRecognizer::kFloat32x4Max:
+      __ maxps(left, right);
+      break;
+    default: UNREACHABLE();
+  }
+}
+
+
+LocationSummary* Float32x4ScaleInstr::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 Float32x4ScaleInstr::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 MethodRecognizer::kFloat32x4Scale:
+      __ cvtsd2ss(left, left);
+      __ shufps(left, left, Immediate(0x00));
+      __ mulps(left, right);
+      break;
+    default: UNREACHABLE();
+  }
+}
+
+
+LocationSummary* Float32x4SqrtInstr::MakeLocationSummary() const {
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresFpuRegister());
+  summary->set_out(Location::SameAsFirstInput());
+  return summary;
+}
+
+
+void Float32x4SqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  XmmRegister left = locs()->in(0).fpu_reg();
+
+  ASSERT(locs()->out().fpu_reg() == left);
+
+  switch (op_kind()) {
+    case MethodRecognizer::kFloat32x4Sqrt:
+      __ sqrtps(left);
+      break;
+    case MethodRecognizer::kFloat32x4Reciprocal:
+      __ reciprocalps(left);
+      break;
+    case MethodRecognizer::kFloat32x4ReciprocalSqrt:
+      __ rsqrtps(left);
+      break;
+    default: UNREACHABLE();
+  }
+}
+
+
 LocationSummary* MathSqrtInstr::MakeLocationSummary() const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
@@ -2989,38 +3222,21 @@
 
 
 LocationSummary* SmiToDoubleInstr::MakeLocationSummary() const {
-  return MakeCallSummary();  // Calls a stub to allocate result.
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* result =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  result->set_in(0, Location::WritableRegister());
+  result->set_out(Location::RequiresFpuRegister());
+  return result;
 }
 
 
 void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  Register result = locs()->out().reg();
-
-  Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(),
-                                        kDeoptIntegerToDouble);
-
-  const Class& double_class = compiler->double_class();
-  const Code& stub =
-    Code::Handle(StubCode::GetAllocationStubForClass(double_class));
-  const ExternalLabel label(double_class.ToCString(), stub.EntryPoint());
-
-  // TODO(fschneider): Inline new-space allocation and move the call into
-  // deferred code.
-  compiler->GenerateCall(instance_call()->token_pos(),
-                         &label,
-                         PcDescriptors::kOther,
-                         locs());
-  ASSERT(result == RAX);
-  Register value = RBX;
-  // Preserve argument on the stack until after the deoptimization point.
-  __ movq(value, Address(RSP, 0));
-
-  __ testq(value, Immediate(kSmiTagMask));
-  __ j(NOT_ZERO, deopt);  // Deoptimize if not Smi.
+  Register value = locs()->in(0).reg();
+  FpuRegister result = locs()->out().fpu_reg();
   __ SmiUntag(value);
-  __ cvtsi2sd(XMM0, value);
-  __ movsd(FieldAddress(result, Double::value_offset()), XMM0);
-  __ Drop(1);
+  __ cvtsi2sd(result, value);
 }
 
 
diff --git a/runtime/vm/intrinsifier.h b/runtime/vm/intrinsifier.h
index b60dd83..04b60f4 100644
--- a/runtime/vm/intrinsifier.h
+++ b/runtime/vm/intrinsifier.h
@@ -105,18 +105,18 @@
   V(_Float32Array, _new, TypedData_Float32Array_new, 723829075)                \
   V(_Float64Array, _new, TypedData_Float64Array_new, 111654177)                \
   V(_Float32x4Array, _new, TypedData_Float32x4Array_new, 984763738)            \
-  V(_Int8Array, ., TypedData_Int8Array_factory, 974805301)                     \
-  V(_Uint8Array, ., TypedData_Uint8Array_factory, 839639001)                   \
-  V(_Uint8ClampedArray, ., TypedData_Uint8ClampedArray_factory, 1947193032)    \
-  V(_Int16Array, ., TypedData_Int16Array_factory, 1492289327)                  \
-  V(_Uint16Array, ., TypedData_Uint16Array_factory, 358109132)                 \
-  V(_Int32Array, ., TypedData_Int32Array_factory, 1238390459)                  \
-  V(_Uint32Array, ., TypedData_Uint32Array_factory, 1091191177)                \
-  V(_Int64Array, ., TypedData_Int64Array_factory, 569474614)                   \
-  V(_Uint64Array, ., TypedData_Uint64Array_factory, 1778132384)                \
-  V(_Float32Array, ., TypedData_Float32Array_factory, 630024167)               \
-  V(_Float64Array, ., TypedData_Float64Array_factory, 740945295)               \
-  V(_Float32x4Array, ., TypedData_Float32x4Array_factory, 1881134784)          \
+  V(_Int8Array, ., TypedData_Int8Array_factory, 1168404493)                    \
+  V(_Uint8Array, ., TypedData_Uint8Array_factory, 2094565809)                  \
+  V(_Uint8ClampedArray, ., TypedData_Uint8ClampedArray_factory, 1449285088)    \
+  V(_Int16Array, ., TypedData_Int16Array_factory, 1430476167)                  \
+  V(_Uint16Array, ., TypedData_Uint16Array_factory, 996241892)                 \
+  V(_Int32Array, ., TypedData_Int32Array_factory, 360797715)                   \
+  V(_Uint32Array, ., TypedData_Uint32Array_factory, 995053409)                 \
+  V(_Int64Array, ., TypedData_Int64Array_factory, 570248142)                   \
+  V(_Uint64Array, ., TypedData_Uint64Array_factory, 1114332856)                \
+  V(_Float32Array, ., TypedData_Float32Array_factory, 1719636031)              \
+  V(_Float64Array, ., TypedData_Float64Array_factory, 1896334311)              \
+  V(_Float32x4Array, ., TypedData_Float32x4Array_factory, 1768466392)          \
 
 // TODO(srdjan): Implement _FixedSizeArrayIterator, get:current and
 //   _FixedSizeArrayIterator, moveNext.
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index b43547d..30a8cd0 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -24,6 +24,7 @@
 #include "vm/deopt_instructions.h"
 #include "vm/double_conversion.h"
 #include "vm/exceptions.h"
+#include "vm/flow_graph_builder.h"
 #include "vm/growable_array.h"
 #include "vm/heap.h"
 #include "vm/intermediate_language.h"
@@ -676,31 +677,6 @@
 }
 
 
-#define LOAD_LIBRARY(name, raw_name)                                           \
-  url = Symbols::Dart##name().raw();                                           \
-  lib = Library::LookupLibrary(url);                                           \
-  if (lib.IsNull()) {                                                          \
-    lib = Library::NewLibraryHelper(url, true);                                \
-    lib.Register();                                                            \
-  }                                                                            \
-  isolate->object_store()->set_##raw_name##_library(lib);                      \
-
-#define INIT_LIBRARY(name, raw_name, has_patch)                                \
-  LOAD_LIBRARY(name, raw_name)                                                 \
-  script = Bootstrap::Load##name##Script(false);                               \
-  error = Bootstrap::Compile(lib, script);                                     \
-  if (!error.IsNull()) {                                                       \
-    return error.raw();                                                        \
-  }                                                                            \
-  if (has_patch) {                                                             \
-    script = Bootstrap::Load##name##Script(true);                              \
-    error = lib.Patch(script);                                                 \
-    if (!error.IsNull()) {                                                     \
-      return error.raw();                                                      \
-    }                                                                          \
-  }                                                                            \
-
-
 RawError* Object::Init(Isolate* isolate) {
   TIMERSCOPE(time_bootstrap);
   ObjectStore* object_store = isolate->object_store();
@@ -708,10 +684,7 @@
   Class& cls = Class::Handle();
   Type& type = Type::Handle();
   Array& array = Array::Handle();
-  String& url = String::Handle();
   Library& lib = Library::Handle();
-  Script& script = Script::Handle();
-  Error& error = Error::Handle();
 
   // All RawArray fields will be initialized to an empty array, therefore
   // initialize array class first.
@@ -842,13 +815,14 @@
   pending_classes.Add(cls, Heap::kOld);
 
   // Initialize the base interfaces used by the core VM classes.
-  script = Bootstrap::LoadCoreScript(false);
 
   // Allocate and initialize the pre-allocated classes in the core library.
+  // The script and token index of these pre-allocated classes is set up in
+  // the parser when the corelib script is compiled (see
+  // Parser::ParseClassDefinition).
   cls = Class::New<Instance>(kInstanceCid);
   object_store->set_object_class(cls);
   cls.set_name(Symbols::Object());
-  cls.set_script(script);
   cls.set_is_prefinalized();
   core_lib.AddClass(cls);
   pending_classes.Add(cls, Heap::kOld);
@@ -899,7 +873,13 @@
 
   // Pre-register the typed_data library so the native class implementations
   // can be hooked up before compiling it.
-  LOAD_LIBRARY(TypedData, typed_data);
+  lib = Library::LookupLibrary(Symbols::DartTypedData());
+  if (lib.IsNull()) {
+    lib = Library::NewLibraryHelper(Symbols::DartTypedData(), true);
+    lib.Register();
+    isolate->object_store()->set_bootstrap_library(ObjectStore::kTypedData,
+                                                   lib);
+  }
   ASSERT(!lib.IsNull());
   ASSERT(lib.raw() == Library::TypedDataLibrary());
   const intptr_t typed_data_class_array_length =
@@ -945,15 +925,14 @@
   object_store->set_uint32x4_class(cls);
   RegisterPrivateClass(cls, Symbols::_Uint32x4(), lib);
 
-  cls = Class::New<Instance>(Symbols::Float32x4(), script,
-                             Scanner::kDummyTokenIndex);
+  cls = Class::New<Instance>(kIllegalCid);
   RegisterClass(cls, Symbols::Float32x4(), lib);
   pending_classes.Add(cls, Heap::kOld);
   type = Type::NewNonParameterizedType(cls);
   object_store->set_float32x4_type(type);
 
-  cls = Class::New<Instance>(Symbols::Uint32x4(), script,
-                             Scanner::kDummyTokenIndex);
+  cls = Class::New<Instance>(kIllegalCid);
+  RegisterClass(cls, Symbols::Uint32x4(), lib);
   pending_classes.Add(cls, Heap::kOld);
   type = Type::NewNonParameterizedType(cls);
   object_store->set_uint32x4_type(type);
@@ -979,30 +958,26 @@
   type = Type::NewNonParameterizedType(cls);
   object_store->set_number_type(type);
 
-  cls = Class::New<Instance>(Symbols::Int(), script, Scanner::kDummyTokenIndex);
+  cls = Class::New<Instance>(kIllegalCid);
   RegisterClass(cls, Symbols::Int(), core_lib);
   pending_classes.Add(cls, Heap::kOld);
   type = Type::NewNonParameterizedType(cls);
   object_store->set_int_type(type);
 
-  cls = Class::New<Instance>(Symbols::Double(),
-                             script,
-                             Scanner::kDummyTokenIndex);
+  cls = Class::New<Instance>(kIllegalCid);
   RegisterClass(cls, Symbols::Double(), core_lib);
   pending_classes.Add(cls, Heap::kOld);
   type = Type::NewNonParameterizedType(cls);
   object_store->set_double_type(type);
 
   name = Symbols::New("String");
-  cls = Class::New<Instance>(name, script, Scanner::kDummyTokenIndex);
+  cls = Class::New<Instance>(kIllegalCid);
   RegisterClass(cls, name, core_lib);
   pending_classes.Add(cls, Heap::kOld);
   type = Type::NewNonParameterizedType(cls);
   object_store->set_string_type(type);
 
-  cls = Class::New<Instance>(Symbols::List(),
-                             script,
-                             Scanner::kDummyTokenIndex);
+  cls = Class::New<Instance>(kIllegalCid);
   RegisterClass(cls, Symbols::List(), core_lib);
   pending_classes.Add(cls, Heap::kOld);
   object_store->set_list_class(cls);
@@ -1041,21 +1016,10 @@
 
   // Finish the initialization by compiling the bootstrap scripts containing the
   // base interfaces and the implementation of the internal classes.
-  INIT_LIBRARY(Core, core, true);
-
-  INIT_LIBRARY(Async, async, true);
-  INIT_LIBRARY(Collection, collection, true);
-  INIT_LIBRARY(CollectionDev, collection_dev, true);
-  INIT_LIBRARY(Crypto, crypto, false);
-  INIT_LIBRARY(Isolate, isolate, true);
-  INIT_LIBRARY(Json, json, true);
-  INIT_LIBRARY(Math, math, true);
-  INIT_LIBRARY(Mirrors, mirrors, true);
-  INIT_LIBRARY(TypedData, typed_data, true);
-  INIT_LIBRARY(Utf, utf, false);
-  INIT_LIBRARY(Uri, uri, false);
-
-  Bootstrap::SetupNativeResolver();
+  const Error& error = Error::Handle(Bootstrap::LoadandCompileScripts());
+  if (!error.IsNull()) {
+    return error.raw();
+  }
 
   // Remove the Object superclass cycle by setting the super type to null (not
   // to the type of null).
@@ -1840,11 +1804,10 @@
 }
 
 
-template <class FakeInstance>
 RawClass* Class::New(const String& name,
                      const Script& script,
                      intptr_t token_pos) {
-  Class& result = Class::Handle(New<FakeInstance>(kIllegalCid));
+  Class& result = Class::Handle(New<Instance>(kIllegalCid));
   result.set_name(name);
   result.set_script(script);
   result.set_token_pos(token_pos);
@@ -1852,19 +1815,11 @@
 }
 
 
-RawClass* Class::New(const String& name,
-                     const Script& script,
-                     intptr_t token_pos) {
-  Class& result = Class::Handle(New<Instance>(name, script, token_pos));
-  return result.raw();
-}
-
-
 RawClass* Class::NewSignatureClass(const String& name,
                                    const Function& signature_function,
                                    const Script& script,
                                    intptr_t token_pos) {
-  const Class& result = Class::Handle(New<Instance>(name, script, token_pos));
+  const Class& result = Class::Handle(New(name, script, token_pos));
   const Type& super_type = Type::Handle(Type::ObjectType());
   ASSERT(!super_type.IsNull());
   // Instances of a signature class can only be closures.
@@ -1919,7 +1874,7 @@
                                   int field_count) {
   Class& cls = Class::Handle(library.LookupClass(name));
   if (cls.IsNull()) {
-    cls = New<Instance>(name, Script::Handle(), Scanner::kDummyTokenIndex);
+    cls = New(name, Script::Handle(), Scanner::kDummyTokenIndex);
     cls.SetFields(Object::empty_array());
     cls.SetFunctions(Object::empty_array());
     // Set super class to Object.
@@ -2664,6 +2619,14 @@
 }
 
 
+bool AbstractTypeArguments::CanShareInstantiatorTypeArguments(
+      const Class& instantiator_class) const {
+  // AbstractTypeArguments is an abstract class.
+  UNREACHABLE();
+  return false;
+}
+
+
 bool AbstractTypeArguments::IsBounded() const {
   // AbstractTypeArguments is an abstract class.
   UNREACHABLE();
@@ -2893,7 +2856,7 @@
 bool TypeArguments::IsUninstantiatedIdentity() const {
   ASSERT(!IsInstantiated());
   AbstractType& type = AbstractType::Handle();
-  intptr_t num_types = Length();
+  const intptr_t num_types = Length();
   for (intptr_t i = 0; i < num_types; i++) {
     type = TypeAt(i);
     if (!type.IsTypeParameter()) {
@@ -2915,6 +2878,62 @@
     }
   }
   return true;
+  // Note that it is not necessary to verify at runtime that the instantiator
+  // type vector is long enough, since this uninstantiated vector contains as
+  // many different type parameters as it is long.
+}
+
+
+bool TypeArguments::CanShareInstantiatorTypeArguments(
+      const Class& instantiator_class) const {
+  ASSERT(!IsInstantiated());
+  const intptr_t num_instantiator_type_args =
+      instantiator_class.NumTypeArguments();
+  const intptr_t num_instantiator_type_params =
+      instantiator_class.NumTypeParameters();
+  const intptr_t num_super_instantiator_type_args =
+      num_instantiator_type_args - num_instantiator_type_params;
+  const intptr_t num_type_args = Length();
+  // As a first requirement in order to share the instantiator type argument
+  // vector, this type argument vector must refer to the type parameters of the
+  // instantiator class in declaration order. It does not need to contain all
+  // type parameters.
+  if (num_type_args < num_super_instantiator_type_args) {
+    return false;
+  }
+  AbstractType& type_arg = AbstractType::Handle();
+  for (intptr_t i = num_super_instantiator_type_args; i < num_type_args; i++) {
+    type_arg = TypeAt(i);
+    if (!type_arg.IsTypeParameter()) {
+      return false;
+    }
+    const TypeParameter& type_param = TypeParameter::Cast(type_arg);
+    ASSERT(type_param.IsFinalized());
+    if ((type_param.index() != i)) {
+      return false;
+    }
+  }
+  // As a second requirement, the type arguments corresponding to the super type
+  // must be identical.
+  if (num_super_instantiator_type_args == 0) {
+    return true;
+  }
+  AbstractType& super_type = AbstractType::Handle(
+      instantiator_class.super_type());
+  const AbstractTypeArguments& super_type_args = AbstractTypeArguments::Handle(
+      super_type.arguments());
+  if (super_type_args.IsNull()) {
+    return false;
+  }
+  AbstractType& super_type_arg = AbstractType::Handle();
+  for (intptr_t i = 0; i < num_super_instantiator_type_args; i++) {
+    type_arg = TypeAt(i);
+    super_type_arg = super_type_args.TypeAt(i);
+    if (!type_arg.Equals(super_type_arg)) {
+      return false;
+    }
+  }
+  return true;
 }
 
 
@@ -6445,7 +6464,7 @@
   const Library& core_lib =
       Library::Handle(Library::NewLibraryHelper(core_lib_url, false));
   core_lib.Register();
-  isolate->object_store()->set_core_library(core_lib);
+  isolate->object_store()->set_bootstrap_library(ObjectStore::kCore, core_lib);
   isolate->object_store()->set_root_library(Library::Handle());
 
   // Hook up predefined classes without setting their library pointers. These
@@ -6868,12 +6887,14 @@
   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();
@@ -6918,6 +6939,21 @@
   TYPED_DATA_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS);
 
 #undef CHECK_FINGERPRINTS
+
+#define CHECK_FACTORY_FINGERPRINTS(factory_symbol, cid, fp)                    \
+  cls = Isolate::Current()->class_table()->At(cid);                            \
+  func = cls.LookupFunctionAllowPrivate(Symbols::factory_symbol());            \
+  ASSERT(!func.IsNull());                                                      \
+  if (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()));              \
+  }                                                                            \
+
+  RECOGNIZED_LIST_FACTORY_LIST(CHECK_FACTORY_FINGERPRINTS);
+
+#undef CHECK_FACTORY_FINGERPRINTS
   if (has_errors) {
     for (intptr_t i = 0; i < collected_fp_diffs.length(); i++) {
       OS::Print("s/%d/%d/\n",
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 222b358..fb7f5d1 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -907,9 +907,6 @@
 
   // Allocate an instance class which has a VM implementation.
   template <class FakeInstance> static RawClass* New(intptr_t id);
-  template <class FakeInstance> static RawClass* New(const String& name,
-                                                     const Script& script,
-                                                     intptr_t token_pos);
 
   // Check the subtype or 'more specific' relationship.
   bool TypeTest(TypeTestKind test_kind,
@@ -1027,6 +1024,8 @@
   virtual bool IsResolved() const;
   virtual bool IsInstantiated() const;
   virtual bool IsUninstantiatedIdentity() const;
+  virtual bool CanShareInstantiatorTypeArguments(
+      const Class& instantiator_class) const;
   virtual bool IsBounded() const;
 
   virtual intptr_t Hash() const;
@@ -1070,6 +1069,8 @@
   virtual bool IsResolved() const;
   virtual bool IsInstantiated() const;
   virtual bool IsUninstantiatedIdentity() const;
+  virtual bool CanShareInstantiatorTypeArguments(
+      const Class& instantiator_class) const;
   virtual bool IsBounded() const;
   // Canonicalize only if instantiated, otherwise returns 'this'.
   virtual RawAbstractTypeArguments* Canonicalize() const;
@@ -1126,7 +1127,15 @@
   virtual void SetTypeAt(intptr_t index, const AbstractType& value) const;
   virtual bool IsResolved() const { return true; }
   virtual bool IsInstantiated() const { return true; }
-  virtual bool IsUninstantiatedIdentity() const  { return false; }
+  virtual bool IsUninstantiatedIdentity() const {
+    UNREACHABLE();
+    return false;
+  }
+  virtual bool CanShareInstantiatorTypeArguments(
+      const Class& instantiator_class) const {
+    UNREACHABLE();
+    return false;
+  }
   virtual bool IsBounded() const { return false; }  // Bounds were checked.
 
   RawAbstractTypeArguments* uninstantiated_type_arguments() const {
@@ -2223,12 +2232,13 @@
 
   FINAL_HEAP_OBJECT_IMPLEMENTATION(Library, Object);
 
-  friend class Object;
+  friend class Bootstrap;
   friend class Class;
   friend class Debugger;
   friend class DictionaryIterator;
   friend class Isolate;
   friend class Namespace;
+  friend class Object;
 };
 
 
diff --git a/runtime/vm/object_store.cc b/runtime/vm/object_store.cc
index 5c3aebf..1f8a131 100644
--- a/runtime/vm/object_store.cc
+++ b/runtime/vm/object_store.cc
@@ -50,7 +50,6 @@
     async_library_(Library::null()),
     builtin_library_(Library::null()),
     core_library_(Library::null()),
-    core_impl_library_(Library::null()),
     crypto_library_(Library::null()),
     isolate_library_(Library::null()),
     json_library_(Library::null()),
diff --git a/runtime/vm/object_store.h b/runtime/vm/object_store.h
index 8eb1d16..f7fce5d 100644
--- a/runtime/vm/object_store.h
+++ b/runtime/vm/object_store.h
@@ -19,6 +19,22 @@
 // by snapshots eventually.
 class ObjectStore {
  public:
+  enum {
+    kNone = 0,
+    kAsync,
+    kCore,
+    kCollection,
+    kCollectionDev,
+    kCrypto,
+    kIsolate,
+    kJson,
+    kMath,
+    kMirrors,
+    kTypedData,
+    kUtf,
+    kUri,
+  };
+
   ~ObjectStore();
 
   RawClass* object_class() const {
@@ -239,72 +255,65 @@
   }
 
   RawLibrary* async_library() const { return async_library_; }
-  void set_async_library(const Library& value) {
-    async_library_ = value.raw();
-  }
-
-  RawLibrary* builtin_library() const {
-    return builtin_library_;
-  }
-  void set_builtin_library(const Library& value) {
-    builtin_library_ = value.raw();
-  }
-
+  RawLibrary* builtin_library() const { return builtin_library_; }
   RawLibrary* core_library() const { return core_library_; }
-  void set_core_library(const Library& value) {
-    core_library_ = value.raw();
-  }
-
-  RawLibrary* core_impl_library() const { return core_impl_library_; }
-  void set_core_impl_library(const Library& value) {
-    core_impl_library_ = value.raw();
-  }
-
-  RawLibrary* collection_library() const {
-    return collection_library_;
-  }
-  void set_collection_library(const Library& value) {
-    collection_library_ = value.raw();
-  }
-
+  RawLibrary* collection_library() const { return collection_library_; }
   RawLibrary* collection_dev_library() const {
     return collection_dev_library_;
   }
-  void set_collection_dev_library(const Library& value) {
-    collection_dev_library_ = value.raw();
-  }
-
-  RawLibrary* crypto_library() const {
-    return crypto_library_;
-  }
-  void set_crypto_library(const Library& value) {
-    crypto_library_ = value.raw();
-  }
-
-  RawLibrary* isolate_library() const {
-    return isolate_library_;
-  }
-  void set_isolate_library(const Library& value) {
-    isolate_library_ = value.raw();
-  }
-
-  RawLibrary* json_library() const {
-    return json_library_;
-  }
-  void set_json_library(const Library& value) {
-    json_library_ = value.raw();
-  }
-
-  RawLibrary* math_library() const {
-    return math_library_;
-  }
-  void set_math_library(const Library& value) {
-    math_library_ = value.raw();
-  }
-
+  RawLibrary* crypto_library() const { return crypto_library_; }
+  RawLibrary* isolate_library() const { return isolate_library_; }
+  RawLibrary* json_library() const { return json_library_; }
+  RawLibrary* math_library() const { return math_library_; }
   RawLibrary* mirrors_library() const { return mirrors_library_; }
-  void set_mirrors_library(const Library& value) {
-    mirrors_library_ = value.raw();
+  RawLibrary* typed_data_library() const { return typed_data_library_; }
+  RawLibrary* uri_library() const { return uri_library_; }
+  RawLibrary* utf_library() const { return utf_library_; }
+  void set_bootstrap_library(intptr_t index, const Library& value) {
+    switch (index) {
+      case kAsync:
+        async_library_ = value.raw();
+        break;
+      case kCore:
+        core_library_ = value.raw();
+        break;
+      case kCollection:
+        collection_library_ = value.raw();
+        break;
+      case kCollectionDev:
+        collection_dev_library_ = value.raw();
+        break;
+      case kCrypto:
+        crypto_library_ = value.raw();
+        break;
+      case kIsolate:
+        isolate_library_ = value.raw();
+        break;
+      case kJson:
+        json_library_ = value.raw();
+        break;
+      case kMath:
+        math_library_ = value.raw();
+        break;
+      case kMirrors:
+        mirrors_library_ = value.raw();
+        break;
+      case kTypedData:
+        typed_data_library_ = value.raw();
+        break;
+      case kUtf:
+        utf_library_ = value.raw();
+        break;
+      case kUri:
+        uri_library_ = value.raw();
+        break;
+      default:
+        UNREACHABLE();
+    }
+  }
+
+  void set_builtin_library(const Library& value) {
+    builtin_library_ = value.raw();
   }
 
   RawLibrary* native_wrappers_library() const {
@@ -319,27 +328,6 @@
     root_library_ = value.raw();
   }
 
-  RawLibrary* typed_data_library() const {
-    return typed_data_library_;
-  }
-  void set_typed_data_library(const Library& value) {
-    typed_data_library_ = value.raw();
-  }
-
-  RawLibrary* uri_library() const {
-    return uri_library_;
-  }
-  void set_uri_library(const Library& value) {
-    uri_library_ = value.raw();
-  }
-
-  RawLibrary* utf_library() const {
-    return utf_library_;
-  }
-  void set_utf_library(const Library& value) {
-    utf_library_ = value.raw();
-  }
-
   RawGrowableObjectArray* libraries() const { return libraries_; }
   void set_libraries(const GrowableObjectArray& value) {
     libraries_ = value.raw();
@@ -473,7 +461,6 @@
   RawLibrary* async_library_;
   RawLibrary* builtin_library_;
   RawLibrary* core_library_;
-  RawLibrary* core_impl_library_;
   RawLibrary* collection_library_;
   RawLibrary* collection_dev_library_;
   RawLibrary* crypto_library_;
diff --git a/runtime/vm/os_linux.cc b/runtime/vm/os_linux.cc
index 9d8a8f7..5e7356f 100644
--- a/runtime/vm/os_linux.cc
+++ b/runtime/vm/os_linux.cc
@@ -358,7 +358,7 @@
 
 word OS::PreferredCodeAlignment() {
 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
-  const int kMinimumAlignment = 16;
+  const int kMinimumAlignment = 32;
 #elif defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS)
   // TODO(regis): Verify alignment constraints on MIPS.
   const int kMinimumAlignment = 16;
diff --git a/runtime/vm/os_win.cc b/runtime/vm/os_win.cc
index 1c81e16..bdd6cec 100644
--- a/runtime/vm/os_win.cc
+++ b/runtime/vm/os_win.cc
@@ -137,8 +137,8 @@
 
 
 word OS::PreferredCodeAlignment() {
-  ASSERT(16 <= OS::kMaxPreferredCodeAlignment);
-  return 16;
+  ASSERT(32 <= OS::kMaxPreferredCodeAlignment);
+  return 32;
 }
 
 
diff --git a/runtime/vm/raw_object.cc b/runtime/vm/raw_object.cc
index e82b98e..0d57f54 100644
--- a/runtime/vm/raw_object.cc
+++ b/runtime/vm/raw_object.cc
@@ -180,7 +180,6 @@
         break;
       }
       case kFreeListElement: {
-        ASSERT(FreeBit::decode(ptr()->tags_));
         uword addr = RawObject::ToAddr(const_cast<RawObject*>(this));
         FreeListElement* element = reinterpret_cast<FreeListElement*>(addr);
         instance_size = element->Size();
@@ -247,7 +246,6 @@
       }
 #undef RAW_VISITPOINTERS
       case kFreeListElement: {
-        ASSERT(FreeBit::decode(ptr()->tags_));
         uword addr = RawObject::ToAddr(const_cast<RawObject*>(this));
         FreeListElement* element = reinterpret_cast<FreeListElement*>(addr);
         size = element->Size();
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index cfb81b0..d7ed903 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -219,13 +219,12 @@
   // The tags field which is a part of the object header uses the following
   // bit fields for storing tags.
   enum TagBits {
-    kFreeBit = 0,
+    kWatchedBit = 0,
     kMarkBit = 1,
     kCanonicalBit = 2,
     kFromSnapshotBit = 3,
-    kWatchedBit = 4,
-    kReservedTagBit = 5,  // kReservedBit{10K,100K,1M,10M}
-    kReservedTagSize = 3,
+    kReservedTagBit = 4,  // kReservedBit{1K, 10K,100K,1M,10M}
+    kReservedTagSize = 4,
     kSizeTagBit = 8,
     kSizeTagSize = 8,
     kClassIdTagBit = kSizeTagBit + kSizeTagSize,
@@ -386,12 +385,10 @@
  private:
   uword tags_;  // Various object tags (bits).
 
-  class FreeBit : public BitField<bool, kFreeBit, 1> {};
+  class WatchedBit : public BitField<bool, kWatchedBit, 1> {};
 
   class MarkBit : public BitField<bool, kMarkBit, 1> {};
 
-  class WatchedBit : public BitField<bool, kWatchedBit, 1> {};
-
   class CanonicalObjectTag : public BitField<bool, kCanonicalBit, 1> {};
 
   class CreatedFromSnapshotTag : public BitField<bool, kFromSnapshotBit, 1> {};
diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc
index 642ec7e..d58a091 100644
--- a/runtime/vm/scavenger.cc
+++ b/runtime/vm/scavenger.cc
@@ -19,14 +19,13 @@
 
 namespace dart {
 
-// Scavenger uses RawObject::kFreeBit to distinguish forwaded and non-forwarded
-// objects because scavenger can never encounter free list element during
-// evacuation and thus all objects scavenger encounters have
-// kFreeBit cleared.
+// Scavenger uses RawObject::kMarkBit to distinguish forwaded and non-forwarded
+// objects. The kMarkBit does not intersect with the target address because of
+// object alignment.
 enum {
-  kForwardingMask = 1,
+  kForwardingMask = 1 << RawObject::kMarkBit,
   kNotForwarded = 0,
-  kForwarded = 1,
+  kForwarded = kForwardingMask,
 };
 
 
@@ -299,7 +298,6 @@
   // Verify assumptions about the first word in objects which the scavenger is
   // going to use for forwarding pointers.
   ASSERT(Object::tags_offset() == 0);
-  ASSERT(kForwardingMask == (1 << RawObject::kFreeBit));
 
   // Allocate the virtual memory for this scavenge heap.
   space_ = VirtualMemory::Reserve(max_capacity);
diff --git a/runtime/vm/scopes.cc b/runtime/vm/scopes.cc
index 0570259..137f6b8 100644
--- a/runtime/vm/scopes.cc
+++ b/runtime/vm/scopes.cc
@@ -259,7 +259,7 @@
         desc.info.index = var->index();
         vars->Add(desc);
       } else if (var->name().Equals(
-            Symbols::Name(Symbols::kSavedCurrentContextVarId))) {
+            Symbols::Name(Symbols::kSavedEntryContextVarId))) {
         // This is the local variable in which the function saves the
         // caller's chain of closure contexts (caller's CTX register).
         VarDesc desc;
diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc
index 5a2323a..1dab88f 100644
--- a/runtime/vm/snapshot.cc
+++ b/runtime/vm/snapshot.cc
@@ -122,11 +122,10 @@
   ASSERT(kLengthIndex == length_offset());
   ASSERT((kSnapshotFlagIndex * sizeof(int32_t)) == kind_offset());
   ASSERT((kHeapObjectTag & kInlined));
-  // No object can have kFreeBit and kMarkBit set simultaneously. If kFreeBit
-  // is set then the rest of tags is a pointer to the next FreeListElement which
-  // is kObjectAlignment aligned and has at least 2 lower bits set to zero.
+  // The kWatchedBit and kMarkBit are only set during GC operations. This
+  // allows the two low bits in the header to be used for snapshotting.
   ASSERT(kObjectId ==
-         ((1 << RawObject::kFreeBit) | (1 << RawObject::kMarkBit)));
+         ((1 << RawObject::kWatchedBit) | (1 << RawObject::kMarkBit)));
   ASSERT((kObjectAlignmentMask & kObjectId) == kObjectId);
   const Snapshot* snapshot = reinterpret_cast<const Snapshot*>(raw_memory);
   return snapshot;
diff --git a/runtime/vm/stub_code_mips.cc b/runtime/vm/stub_code_mips.cc
index b3599c4..a50383d 100644
--- a/runtime/vm/stub_code_mips.cc
+++ b/runtime/vm/stub_code_mips.cc
@@ -286,7 +286,7 @@
   __ AddImmediate(T2, kWordSize);
   __ Bind(&loop_condition);
   __ AddImmediate(A1, -Smi::RawValue(1));  // A1 is Smi.
-  __ BranchGreaterEqual(A1, ZR, &loop);
+  __ BranchSignedGreaterEqual(A1, ZR, &loop);
 }
 
 
@@ -341,13 +341,129 @@
 }
 
 
+DECLARE_LEAF_RUNTIME_ENTRY(intptr_t, DeoptimizeCopyFrame,
+                           intptr_t deopt_reason,
+                           uword saved_registers_address);
+
+DECLARE_LEAF_RUNTIME_ENTRY(void, DeoptimizeFillFrame, uword last_fp);
+
+
+// Used by eager and lazy deoptimization. Preserve result in V0 if necessary.
+// This stub translates optimized frame into unoptimized frame. The optimized
+// frame can contain values in registers and on stack, the unoptimized
+// frame contains all values on stack.
+// Deoptimization occurs in following steps:
+// - Push all registers that can contain values.
+// - Call C routine to copy the stack and saved registers into temporary buffer.
+// - Adjust caller's frame to correct unoptimized frame size.
+// - Fill the unoptimized frame.
+// - Materialize objects that require allocation (e.g. Double instances).
+// GC can occur only after frame is fully rewritten.
+// Stack after EnterFrame(...) below:
+//   +------------------+
+//   | Saved FP         | <- TOS
+//   +------------------+
+//   | return-address   |  (deoptimization point)
+//   +------------------+
+//   | optimized frame  |
+//   |  ...             |
+//
+// Parts of the code cannot GC, part of the code can GC.
+static void GenerateDeoptimizationSequence(Assembler* assembler,
+                                           bool preserve_result) {
+  const intptr_t kPushedRegistersSize =
+      kNumberOfCpuRegisters * kWordSize +
+      2 * kWordSize +  // FP and RA.
+      kNumberOfFRegisters * kWordSize;
+
+  __ addiu(SP, SP, Immediate(-kPushedRegistersSize * kWordSize));
+  __ sw(RA, Address(SP, kPushedRegistersSize - 1 * kWordSize));
+  __ sw(FP, Address(SP, kPushedRegistersSize - 2 * kWordSize));
+  __ addiu(FP, SP, Immediate(kPushedRegistersSize - 2 * kWordSize));
+
+
+  // The code in this frame may not cause GC. kDeoptimizeCopyFrameRuntimeEntry
+  // and kDeoptimizeFillFrameRuntimeEntry are leaf runtime calls.
+  const intptr_t saved_v0_offset_from_fp = -(kNumberOfCpuRegisters - V0);
+  // Result in V0 is preserved as part of pushing all registers below.
+
+  // Push registers in their enumeration order: lowest register number at
+  // lowest address.
+  for (int i = 0; i < kNumberOfCpuRegisters; i++) {
+    const int slot = 2 + kNumberOfCpuRegisters - i;
+    Register reg = static_cast<Register>(i);
+    __ sw(reg, Address(SP, kPushedRegistersSize - slot * kWordSize));
+  }
+  for (int i = 0; i < kNumberOfFRegisters; i++) {
+    // These go below the CPU registers.
+    const int slot = 2 + kNumberOfCpuRegisters + kNumberOfFRegisters - i;
+    FRegister reg = static_cast<FRegister>(i);
+    __ swc1(reg, Address(SP, kPushedRegistersSize - slot * kWordSize));
+  }
+
+  __ mov(A0, SP);  // Pass address of saved registers block.
+  __ ReserveAlignedFrameSpace(0);
+  __ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry);
+  // Result (V0) is stack-size (FP - SP) in bytes, incl. the return address.
+
+  if (preserve_result) {
+    // Restore result into T1 temporarily.
+    __ lw(T1, Address(FP, saved_v0_offset_from_fp * kWordSize));
+  }
+
+  __ mov(SP, FP);
+  __ lw(FP, Address(SP, 0 * kWordSize));
+  __ lw(RA, Address(SP, 1 * kWordSize));
+  __ addiu(SP, SP, Immediate(2 * kWordSize));
+
+  __ subu(SP, FP, V0);
+
+  __ addiu(SP, SP, Immediate(-2 * kWordSize));
+  __ sw(RA, Address(SP, 1 * kWordSize));
+  __ sw(FP, Address(SP, 0 * kWordSize));
+  __ mov(FP, SP);
+
+  __ mov(A0, SP);  // Get last FP address.
+  if (preserve_result) {
+    __ Push(T1);  // Preserve result.
+  }
+  __ ReserveAlignedFrameSpace(0);
+  __ CallRuntime(kDeoptimizeFillFrameRuntimeEntry);  // Pass last FP in A0.
+  // Result (V0) is our FP.
+  if (preserve_result) {
+    // Restore result into T1.
+    __ lw(T1, Address(FP, -1 * kWordSize));
+  }
+  // Code above cannot cause GC.
+  __ mov(SP, FP);
+  __ lw(FP, Address(SP, 0 * kWordSize));
+  __ lw(RA, Address(SP, 1 * kWordSize));
+  __ addiu(SP, SP, Immediate(2 * kWordSize));
+  __ mov(FP, V0);
+
+  // Frame is fully rewritten at this point and it is safe to perform a GC.
+  // Materialize any objects that were deferred by FillFrame because they
+  // require allocation.
+  __ EnterStubFrame();
+  if (preserve_result) {
+    __ Push(T1);  // Preserve result, it will be GC-d here.
+  }
+  __ CallRuntime(kDeoptimizeMaterializeDoublesRuntimeEntry);
+  if (preserve_result) {
+    __ Pop(V0);  // Restore result.
+  }
+  __ LeaveStubFrame();
+  __ Ret();
+}
+
+
 void StubCode::GenerateDeoptimizeLazyStub(Assembler* assembler) {
   __ Unimplemented("DeoptimizeLazy stub");
 }
 
 
 void StubCode::GenerateDeoptimizeStub(Assembler* assembler) {
-  __ Unimplemented("Deoptimize stub");
+  GenerateDeoptimizationSequence(assembler, false);  // Don't preserve V0.
 }
 
 
@@ -404,7 +520,7 @@
     // T2: potential next object start.
     // T3: array size.
     __ lw(TMP1, Address(T0, Scavenger::end_offset()));
-    __ BranchGreaterEqual(T2, TMP1, &slow_case);
+    __ BranchUnsignedGreaterEqual(T2, TMP1, &slow_case);
 
     // Successfully allocated the object(s), now update top to point to
     // next object start and initialize the object.
@@ -690,7 +806,7 @@
   __ lw(A3, Address(A2));
   __ Push(A3);
   __ addiu(A1, A1, Immediate(1));
-  __ BranchLess(A1, T1, &push_arguments);
+  __ BranchSignedLess(A1, T1, &push_arguments);
   __ delay_slot()->addiu(A2, A2, Immediate(kWordSize));
 
   __ Bind(&done_push_arguments);
@@ -769,7 +885,7 @@
     if (FLAG_use_slow_path) {
       __ b(&slow_case);
     } else {
-      __ BranchGreaterEqual(T3, TMP1, &slow_case);
+      __ BranchUnsignedGreaterEqual(T3, TMP1, &slow_case);
     }
 
     // Successfully allocated the object, now update top to point to
@@ -963,7 +1079,7 @@
     if (FLAG_use_slow_path) {
       __ b(&slow_case);
     } else {
-      __ BranchGreaterEqual(T3, TMP1, &slow_case);
+      __ BranchUnsignedGreaterEqual(T3, TMP1, &slow_case);
     }
 
     // Successfully allocated the object(s), now update top to point to
@@ -1039,7 +1155,7 @@
       Label init_loop;
       Label done;
       __ Bind(&init_loop);
-      __ BranchGreaterEqual(T4, T3, &done);  // Done if T4 >= T3.
+      __ BranchUnsignedGreaterEqual(T4, T3, &done);  // Done if T4 >= T3.
       __ sw(T0, Address(T4));
       __ AddImmediate(T4, kWordSize);
       __ b(&init_loop);
@@ -1134,7 +1250,7 @@
     if (FLAG_use_slow_path) {
       __ b(&slow_case);
     } else {
-      __ BranchGreaterEqual(T3, TMP1, &slow_case);
+      __ BranchUnsignedGreaterEqual(T3, TMP1, &slow_case);
     }
 
     // Successfully allocated the object, now update top to point to
@@ -1261,8 +1377,41 @@
 }
 
 
+//  T0: function object.
+//  S5: inline cache data object.
+//  S4: arguments descriptor array.
 void StubCode::GenerateOptimizedUsageCounterIncrement(Assembler* assembler) {
-  __ Unimplemented("OptimizedUsageCounterIncrement stub");
+  __ TraceSimMsg("OptimizedUsageCounterIncrement");
+  Register ic_reg = S5;
+  Register func_reg = T0;
+  if (FLAG_trace_optimized_ic_calls) {
+    __ EnterStubFrame();
+    __ addiu(SP, SP, Immediate(-5 * kWordSize));
+    __ sw(T0, Address(SP, 4 * kWordSize));
+    __ sw(S5, Address(SP, 3 * kWordSize));
+    __ sw(S4, Address(SP, 2 * kWordSize));  // Preserve.
+    __ sw(ic_reg, Address(SP, 1 * kWordSize));  // Argument.
+    __ sw(func_reg, Address(SP, 0 * kWordSize));  // Argument.
+    __ CallRuntime(kTraceICCallRuntimeEntry);
+    __ lw(S4, Address(SP, 2 * kWordSize));  // Restore.
+    __ lw(S5, Address(SP, 3 * kWordSize));
+    __ lw(T0, Address(SP, 4 * kWordSize));
+    __ addiu(SP, SP, Immediate(5 * kWordSize));  // Discard argument;
+    __ LeaveStubFrame();
+  }
+  __ lw(T7, FieldAddress(func_reg, Function::usage_counter_offset()));
+  Label is_hot;
+  if (FlowGraphCompiler::CanOptimize()) {
+    ASSERT(FLAG_optimization_counter_threshold > 1);
+    __ BranchSignedGreaterEqual(T7, FLAG_optimization_counter_threshold,
+                                &is_hot);
+    // As long as VM has no OSR do not optimize in the middle of the function
+    // but only at exit so that we have collected all type feedback before
+    // optimizing.
+  }
+  __ addiu(T7, T7, Immediate(1));
+  __ sw(T7, FieldAddress(func_reg, Function::usage_counter_offset()));
+  __ Bind(&is_hot);
 }
 
 
diff --git a/runtime/vm/symbols.h b/runtime/vm/symbols.h
index 779aa1c..a32a7cd 100644
--- a/runtime/vm/symbols.h
+++ b/runtime/vm/symbols.h
@@ -153,17 +153,29 @@
   V(Float64List, "Float64List")                                                \
   V(Float64ListFactory, "Float64List.")                                        \
   V(_Int8Array, "_Int8Array")                                                  \
+  V(_Int8ArrayFactory, "_Int8Array.")                                          \
   V(_Uint8Array, "_Uint8Array")                                                \
+  V(_Uint8ArrayFactory, "_Uint8Array.")                                        \
   V(_Uint8ClampedArray, "_Uint8ClampedArray")                                  \
+  V(_Uint8ClampedArrayFactory, "_Uint8ClampedArray.")                          \
   V(_Int16Array, "_Int16Array")                                                \
+  V(_Int16ArrayFactory, "_Int16Array.")                                        \
   V(_Uint16Array, "_Uint16Array")                                              \
+  V(_Uint16ArrayFactory, "_Uint16Array.")                                      \
   V(_Int32Array, "_Int32Array")                                                \
+  V(_Int32ArrayFactory, "_Int32Array.")                                        \
   V(_Uint32Array, "_Uint32Array")                                              \
+  V(_Uint32ArrayFactory, "_Uint32Array.")                                      \
   V(_Int64Array, "_Int64Array")                                                \
+  V(_Int64ArrayFactory, "_Int64Array.")                                        \
   V(_Uint64Array, "_Uint64Array")                                              \
+  V(_Uint64ArrayFactory, "_Uint64Array.")                                      \
   V(_Float32x4Array, "_Float32x4Array")                                        \
+  V(_Float32x4ArrayFactory, "_Float32x4Array.")                                \
   V(_Float32Array, "_Float32Array")                                            \
+  V(_Float32ArrayFactory, "_Float32Array.")                                    \
   V(_Float64Array, "_Float64Array")                                            \
+  V(_Float64ArrayFactory, "_Float64Array.")                                    \
   V(_Int8ArrayView, "_Int8ArrayView")                                          \
   V(_Uint8ArrayView, "_Uint8ArrayView")                                        \
   V(_Uint8ClampedArrayView, "_Uint8ClampedArrayView")                          \
@@ -232,19 +244,19 @@
   V(_New, "_new")                                                              \
   V(DartScheme, "dart:")                                                       \
   V(DartSchemePrivate, "dart:_")                                               \
+  V(DartNativeWrappers, "dart:nativewrappers")                                 \
+  V(DartAsync, "dart:async")                                                   \
   V(DartCore, "dart:core")                                                     \
   V(DartCollection, "dart:collection")                                         \
   V(DartCollectionDev, "dart:_collection-dev")                                 \
-  V(DartMath, "dart:math")                                                     \
+  V(DartCrypto, "dart:crypto")                                                 \
   V(DartIsolate, "dart:isolate")                                               \
+  V(DartJson, "dart:json")                                                     \
+  V(DartMath, "dart:math")                                                     \
   V(DartMirrors, "dart:mirrors")                                               \
   V(DartTypedData, "dart:typed_data")                                          \
-  V(DartNativeWrappers, "dart:nativewrappers")                                 \
-  V(DartAsync, "dart:async")                                                   \
   V(DartUri, "dart:uri")                                                       \
   V(DartUtf, "dart:utf")                                                       \
-  V(DartCrypto, "dart:crypto")                                                 \
-  V(DartJson, "dart:json")                                                     \
 
 
 // Contains a list of frequently used strings in a canonicalized form. This
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
index 7feb253..c1fd0aa 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -845,12 +845,38 @@
       Set<ClassElement> result = new Set<ClassElement>();
       for (Element element in intercepted) {
         ClassElement classElement = element.getEnclosingClass();
-        result.add(classElement);
+        if (classElement.isNative()
+            || interceptedClasses.contains(classElement)) {
+          result.add(classElement);
+        }
+        if (classesMixedIntoNativeClasses.contains(classElement)) {
+          Set<ClassElement> nativeSubclasses =
+              nativeSubclassesOfMixin(classElement);
+          if (nativeSubclasses != null) result.addAll(nativeSubclasses);
+        }
       }
       return result;
     });
   }
 
+  Set<ClassElement> nativeSubclassesOfMixin(ClassElement mixin) {
+    Set<MixinApplicationElement> uses = compiler.world.mixinUses[mixin];
+    if (uses == null) return null;
+    Set<ClassElement> result = null;
+    for (MixinApplicationElement use in uses) {
+      Iterable<ClassElement> subclasses = compiler.world.subclasses[use];
+      if (subclasses != null) {
+        for (ClassElement subclass in subclasses) {
+          if (subclass.isNative()) {
+            if (result == null) result = new Set<ClassElement>();
+            result.add(subclass);
+          }
+        }
+      }
+    }
+    return result;
+  }
+
   bool operatorEqHandlesNullArgument(FunctionElement operatorEqfunction) {
     return specialOperatorEqClasses.contains(
         operatorEqfunction.getEnclosingClass());
@@ -1535,6 +1561,24 @@
     return fieldTypes.optimisticFieldType(element);
   }
 
+  Element getImplementationClass(Element element) {
+    if (element == compiler.intClass) {
+      return jsIntClass;
+    } else if (element == compiler.boolClass) {
+      return jsBoolClass;
+    } else if (element == compiler.numClass) {
+      return jsNumberClass;
+    } else if (element == compiler.doubleClass) {
+      return jsDoubleClass;
+    } else if (element == compiler.stringClass) {
+      return jsStringClass;
+    } else if (element == compiler.listClass) {
+      return jsArrayClass;
+    } else {
+      return element;
+    }
+  }
+
   /**
    * Returns the checked mode helper that will be needed to do a type check/type
    * cast on [type] at runtime. Note that this method is being called both by
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
index f0c050b..1289c7f 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
@@ -300,20 +300,16 @@
     //  },
     // });
 
-    // function(cls, fields, prototype) {
-    var defineClass = js.fun(['cls', 'fields', 'prototype'], [
+    var defineClass = js.fun(['name', 'cls', 'fields', 'prototype'], [
       js('var constructor'),
 
-      // if (typeof fields == "function") {
       js.if_(js('typeof fields == "function"'), [
         js('constructor = fields')
       ], /* else */ [
         js('var str = "function " + cls + "("'),
         js('var body = ""'),
 
-        // for (var i = 0; i < fields.length; i++) {
         js.for_('var i = 0', 'i < fields.length', 'i++', [
-          // if (i != 0) str += ", ";
           js.if_('i != 0', js('str += ", "')),
 
           js('var field = fields[i]'),
@@ -328,9 +324,8 @@
       ]),
 
       js('constructor.prototype = prototype'),
-      js('constructor.builtin\$cls = cls'),
+      js(r'constructor.builtin$cls = name'),
 
-      // return constructor;
       js.return_('constructor')
     ]);
     // Declare a function called "generateAccessor".  This is used in
@@ -356,7 +351,7 @@
 
     return [
       js('var $supportsProtoName = false'),
-      js('var tmp = defineClass("c", ["f?"], {}).prototype'),
+      js('var tmp = defineClass("c", "c", ["f?"], {}).prototype'),
 
       js.if_(js('tmp.__proto__'), [
         js('tmp.__proto__ = {}'),
@@ -604,19 +599,27 @@
 
       js('var hasOwnProperty = Object.prototype.hasOwnProperty'),
 
-      // for (var cls in collectedClasses)
       js.forIn('cls', 'collectedClasses', [
-        // if (hasOwnProperty.call(collectedClasses, cls))
         js.if_('hasOwnProperty.call(collectedClasses, cls)', [
           js('var desc = collectedClasses[cls]'),
 
           /* The 'fields' are either a constructor function or a
            * string encoding fields, constructor and superclass.  Get
            * the superclass and the fields in the format
-           * Super;field1,field2 from the null-string property on the
-           * descriptor.
+           *   '[name/]Super;field1,field2'
+           * from the null-string property on the descriptor.
+           * The 'name/' is optional and contains the name that should be used
+           * when printing the runtime type string.  It is used, for example, to
+           * print the runtime type JSInt as 'int'.
            */
-          js('var fields = desc[""], supr'),
+          js('var classData = desc[""], supr, name = cls, fields = classData'),
+          js.if_('typeof classData == "string"', [
+            js('var split = classData.split("/")'),
+            js.if_('split.length == 2', [
+              js('name = split[0]'),
+              js('fields = split[1]')
+            ])
+          ]),
 
           js.if_('typeof fields == "string"', [
             js('var s = fields.split(";")'),
@@ -624,6 +627,7 @@
             js('supr = s[0]'),
           ], /* else */ [
             js('supr = desc.super'),
+            js.if_(r'!!desc.$name', js(r'name = desc.$name'))
           ]),
 
           optional(needsMixinSupport, js.if_('supr && supr.indexOf("+") > 0', [
@@ -637,7 +641,7 @@
             ]),
           ])),
 
-          js('isolateProperties[cls] = defineClass(cls, fields, desc)'),
+          js('isolateProperties[cls] = defineClass(name, cls, fields, desc)'),
           js.if_('supr', js('pendingClasses[cls] = supr'))
         ])
       ]),
@@ -1214,6 +1218,7 @@
         // Avoid emitting [:$isObject:] on all classes but [Object].
         return;
       }
+      other = backend.getImplementationClass(other);
       builder.addProperty(namer.operatorIs(other), js('true'));
     }
 
@@ -1241,49 +1246,11 @@
 
   void emitRuntimeTypeSupport(CodeBuffer buffer) {
     RuntimeTypes rti = backend.rti;
-    TypeChecks typeChecks = rti.getRequiredChecks();
+    TypeChecks typeChecks = rti.requiredChecks;
 
-    /// Classes that are not instantiated and native classes need a holder
-    /// object for their checks, because there will be no class defined for
-    /// them.
-
-    // TODO(9556): Get rid of holders.
-    //
-    //  - For primitive classes, use the interceptors (e.g JSInt).
-    //
-    //  - For uninstantiated classes, define the class anyway.  It will not need
-    //    fields or a constructor, or any methods, so the class definition will
-    //    be smaller than a holder.
-
-    bool needsHolder(ClassElement cls) {
-      return !neededClasses.contains(cls) ||
-        rti.isJsNative(cls);
-    }
-
-    /**
-     * Generates a holder object if it is needed.  A holder is a JavaScript
-     * object literal with a field [builtin$cls] that contains the name of the
-     * class as a string (just like object constructors do).  The is-checks for
-     * the class are are added to the holder object later.
-     */
-    void maybeGenerateHolder(ClassElement cls) {
-      if (!needsHolder(cls)) return;
-      String holder = namer.isolateAccess(cls);
-      String name = namer.getRuntimeTypeName(cls);
-      buffer.write('$holder$_=$_{builtin\$cls:$_"$name"');
-      buffer.write('}$N');
-    }
-
-    // Create representation objects for classes that we do not have a class
-    // definition for (because they are uninstantiated or native).
-    for (ClassElement cls in rti.allArguments) {
-      maybeGenerateHolder(cls);
-    }
-
-    // Add checks to the constructors of instantiated classes or to the created
-    // holder object.
+    // Add checks to the constructors of instantiated classes.
     for (ClassElement cls in typeChecks) {
-      String holder = namer.isolateAccess(cls);
+      String holder = namer.isolateAccess(backend.getImplementationClass(cls));
       for (ClassElement check in typeChecks[cls]) {
         buffer.write('$holder.${namer.operatorIs(check)}$_=${_}true$N');
         String body = rti.getSupertypeSubstitution(cls, check);
@@ -1451,6 +1418,10 @@
     /* Do nothing. */
   }
 
+  void emitRuntimeName(String runtimeName, ClassBuilder builder) {
+    /* Do nothing. */
+  }
+
   /// Returns `true` if fields added.
   bool emitClassFields(ClassElement classElement,
                        ClassBuilder builder,
@@ -1458,7 +1429,12 @@
                        { bool classIsNative: false }) {
     assert(superName != null);
     String separator = '';
-    StringBuffer buffer = new StringBuffer('$superName;');
+    String nativeName = namer.getPrimitiveInterceptorRuntimeName(classElement);
+    StringBuffer buffer = new StringBuffer();
+    if (nativeName != null) {
+      buffer.write('$nativeName/');
+    }
+    buffer.write('$superName;');
     int bufferClassLength = buffer.length;
 
     visitClassFields(classElement, (Element member,
@@ -1566,6 +1542,8 @@
     if (superclass != null) {
       superName = namer.getName(superclass);
     }
+    String runtimeName =
+        namer.getPrimitiveInterceptorRuntimeName(classElement);
 
     if (classElement.isMixinApplication) {
       String mixinName = namer.getName(computeMixinClass(classElement));
@@ -1576,6 +1554,7 @@
     ClassBuilder builder = new ClassBuilder();
     emitClassConstructor(classElement, builder);
     emitSuper(superName, builder);
+    emitRuntimeName(runtimeName, builder);
     emitClassFields(classElement, builder, superName);
     emitClassGettersSetters(classElement, builder);
     if (!classElement.isMixinApplication) {
@@ -2618,9 +2597,18 @@
         compiler.codegenWorld.instantiatedClasses.where(computeClassFilter())
             .toSet();
 
-    // The set of classes that must be emitted are based on instantiated
-    // classes.
+    RuntimeTypes rti = backend.rti;
+
+    // We need to generate classes that are instantiated or used as a type
+    // arguments.
     neededClasses.addAll(instantiatedClasses);
+    rti.allArguments.forEach((ClassElement c) {
+      // Types that we represent with JS native types (like int and String) do
+      // not need a class definition as we use the interceptor classes instead.
+      if (!rti.isJsNative(c)) {
+        neededClasses.add(c);
+      }
+    });
 
     // Then add all superclasses of these classes.
     for (ClassElement element in neededClasses.toList() /* copy */) {
@@ -2889,12 +2877,12 @@
 
   String assembleProgram() {
     measure(() {
-      computeNeededClasses();
-
       // Compute the required type checks to know which classes need a
       // 'is$' method.
       computeRequiredTypeChecks();
 
+      computeNeededClasses();
+
       mainBuffer.add(GENERATED_BY);
       addComment(HOOKS_API_USAGE, mainBuffer);
       mainBuffer.add('function ${namer.isolateName}()$_{}\n');
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart b/sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart
index 3b385b3..f7abb04 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart
@@ -19,6 +19,12 @@
     }
   }
 
+  void emitRuntimeName(String runtimeName, ClassBuilder builder) {
+    if (runtimeName != null) {
+      builder.addProperty(r'$name', js.string(runtimeName));
+    }
+  }
+
   void emitBoundClosureClassHeader(String mangledName,
                                    String superName,
                                    List<String> fieldNames,
@@ -66,9 +72,9 @@
   List get defineClassFunction {
     return [new jsAst.FunctionDeclaration(
         new jsAst.VariableDeclaration('defineClass'),
-        js.fun(['cls', 'constructor', 'prototype'],
+        js.fun(['name', 'cls', 'constructor', 'prototype'],
                [js(r'constructor.prototype = prototype'),
-                js(r'constructor.builtin$cls = cls'),
+                js(r'constructor.builtin$cls = name'),
                 js.return_('constructor')]))];
   }
 
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart b/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart
index 3a60f41..ea9a82f 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart
@@ -636,12 +636,32 @@
 
   /// Returns the runtime name for [element].  The result is not safe as an id.
   String getRuntimeTypeName(Element element) {
-    if (element == compiler.intClass) {
+    JavaScriptBackend backend = compiler.backend;
+    element = backend.getImplementationClass(element);
+    String name = getPrimitiveInterceptorRuntimeName(element);
+    return name != null ? name : getName(element);
+  }
+
+  /**
+   * Return a string to be used as the runtime name of this class (instead of
+   * the class name) or [null] if the class name should be used.
+   */
+  String getPrimitiveInterceptorRuntimeName(Element cls) {
+    JavaScriptBackend backend = compiler.backend;
+    if (cls == backend.jsIntClass) {
       return 'int';
-    } else if (element == compiler.doubleClass) {
+    } else if (cls == backend.jsNumberClass) {
+      return 'num';
+    } else if (cls == backend.jsBoolClass) {
+      return 'bool';
+    } else if (cls == backend.jsDoubleClass) {
       return 'double';
+    } else if (cls == backend.jsStringClass) {
+      return 'String';
+    } else if (cls == backend.jsArrayClass) {
+      return 'List';
     } else {
-      return getName(element);
+      return null;
     }
   }
 
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 951cc2a..b3355b5 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
@@ -33,7 +33,7 @@
 
   /// Contains the classes of all arguments that have been used in
   /// instantiations and checks.
-  Set<ClassElement> allArguments;
+  Set<ClassElement> cachedAllArguments;
 
   bool isJsNative(Element element) {
     return (element == compiler.intClass ||
@@ -44,6 +44,14 @@
             element == compiler.listClass);
   }
 
+  Set<ClassElement> get allArguments {
+    if (cachedRequiredChecks == null) {
+      computeRequiredChecks();
+    }
+    assert(cachedAllArguments != null);
+    return cachedAllArguments;
+  }
+
   void registerRtiDependency(Element element, Element dependency) {
     // We're not dealing with typedef for now.
     if (!element.isClass() || !dependency.isClass()) return;
@@ -165,9 +173,12 @@
 
   TypeChecks cachedRequiredChecks;
 
-  TypeChecks getRequiredChecks() {
-    if (cachedRequiredChecks != null) return cachedRequiredChecks;
+  TypeChecks get requiredChecks {
+    assert(cachedRequiredChecks != null);
+    return cachedRequiredChecks;
+  }
 
+  void computeRequiredChecks() {
     // Get all types used in type arguments of instantiated types.
     Set<ClassElement> instantiatedArguments =
         getInstantiatedArguments(compiler.codegenWorld);
@@ -177,7 +188,7 @@
         getCheckedArguments(compiler.codegenWorld);
 
     // Precompute the set of all seen type arguments for use in the emitter.
-    allArguments = new Set<ClassElement>.from(instantiatedArguments)
+    cachedAllArguments = new Set<ClassElement>.from(instantiatedArguments)
         ..addAll(checkedArguments);
 
     // Finally, run through the combination of instantiated and checked
@@ -198,7 +209,7 @@
       }
     }
 
-    return cachedRequiredChecks = requiredChecks;
+    cachedRequiredChecks = requiredChecks;
   }
 
   /**
@@ -209,7 +220,7 @@
    * the type arguments.
    */
   Set<ClassElement> getInstantiatedArguments(Universe universe) {
-    ArgumentCollector collector = new ArgumentCollector();
+    ArgumentCollector collector = new ArgumentCollector(backend);
     for (DartType type in universe.instantiatedTypes) {
       collector.collect(type);
       ClassElement cls = type.element;
@@ -227,7 +238,7 @@
 
   /// Collects all type arguments used in is-checks.
   Set<ClassElement> getCheckedArguments(Universe universe) {
-    ArgumentCollector collector = new ArgumentCollector();
+    ArgumentCollector collector = new ArgumentCollector(backend);
     for (DartType type in universe.isChecks) {
       collector.collect(type);
     }
@@ -235,13 +246,6 @@
   }
 
   /// Return the unique name for the element as an unquoted string.
-  String getNameAsString(Element element) {
-    JavaScriptBackend backend = compiler.backend;
-    return backend.namer.getName(element);
-  }
-
-  /// Return the unique JS name for the element, which is a quoted string for
-  /// native classes and the isolate acccess to the constructor for classes.
   String getJsName(Element element) {
     JavaScriptBackend backend = compiler.backend;
     Namer namer = backend.namer;
@@ -249,7 +253,7 @@
   }
 
   String getRawTypeRepresentation(DartType type) {
-    String name = getNameAsString(type.element);
+    String name = getJsName(type.element);
     if (!type.element.isClass()) return name;
     InterfaceType interface = type;
     Link<DartType> variables = interface.element.typeVariables;
@@ -390,7 +394,7 @@
   String getJsName(Element element) {
     JavaScriptBackend backend = compiler.backend;
     Namer namer = backend.namer;
-    return namer.isolateAccess(element);
+    return namer.isolateAccess(backend.getImplementationClass(element));
   }
 
   visit(DartType type) {
@@ -502,8 +506,11 @@
 }
 
 class ArgumentCollector extends DartTypeVisitor {
+  final JavaScriptBackend backend;
   final Set<ClassElement> classes = new Set<ClassElement>();
 
+  ArgumentCollector(this.backend);
+
   collect(DartType type) {
     type.accept(this, false);
   }
@@ -518,7 +525,7 @@
 
   visitInterfaceType(InterfaceType type, bool isTypeArgument) {
     if (isTypeArgument) {
-      classes.add(type.element);
+      classes.add(backend.getImplementationClass(type.element));
     }
     type.visitChildren(this, true);
   }
diff --git a/sdk/lib/_internal/compiler/implementation/lib/io_patch.dart b/sdk/lib/_internal/compiler/implementation/lib/io_patch.dart
index bb27e82..a34694a 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/io_patch.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/io_patch.dart
@@ -12,6 +12,9 @@
   patch static String _current() {
     throw new UnsupportedError("Directory._current");
   }
+  patch static _setCurrent(path) {
+    throw new UnsupportedError("Directory_SetCurrent");
+  }
   patch static _createTemp(String template) {
     throw new UnsupportedError("Directory._createTemp");
   }
@@ -191,8 +194,20 @@
 }
 
 patch class InternetAddress {
+  patch static InternetAddress get LOOPBACK_IP_V4 {
+    throw new UnsupportedError("InternetAddress.LOOPBACK_IP_V4");
+  }
+  patch static InternetAddress get LOOPBACK_IP_V6 {
+    throw new UnsupportedError("InternetAddress.LOOPBACK_IP_V6");
+  }
+  patch static InternetAddress get ANY_IP_V4 {
+    throw new UnsupportedError("InternetAddress.ANY_IP_V4");
+  }
+  patch static InternetAddress get ANY_IP_V6 {
+    throw new UnsupportedError("InternetAddress.ANY_IP_V6");
+  }
   patch static Future<List<InternetAddress>> lookup(
-      String host, {InternetAddressType type: InternetAddressType.IPv4}) {
+      String host, {InternetAddressType type: InternetAddressType.IP_V4}) {
     throw new UnsupportedError("InternetAddress.lookup");
   }
 }
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
index 8043517..4b42981 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -1079,7 +1079,7 @@
     // Resolve the selector and the arguments.
     ResolverTask resolver = visitor.compiler.resolver;
     visitor.inStaticContext(() {
-      visitor.resolveSelector(call);
+      visitor.resolveSelector(call, null);
       visitor.resolveArguments(call.argumentsNode);
     });
     Selector selector = visitor.mapping.getSelector(call);
@@ -1997,7 +1997,7 @@
   }
 
   Element resolveSend(Send node) {
-    Selector selector = resolveSelector(node);
+    Selector selector = resolveSelector(node, null);
     if (node.isSuperCall) mapping.superUses.add(node);
 
     if (node.receiver == null) {
@@ -2120,7 +2120,9 @@
     return resolveTypeRequired(node);
   }
 
-  static Selector computeSendSelector(Send node, LibraryElement library) {
+  static Selector computeSendSelector(Send node,
+                                      LibraryElement library,
+                                      Element element) {
     // First determine if this is part of an assignment.
     bool isSet = node.asSendSet() != null;
 
@@ -2169,15 +2171,20 @@
       arity++;
     }
 
+    if (element != null && element.isConstructor()) {
+      return new Selector.callConstructor(
+          element.name, library, arity, named);
+    }
+
     // If we're invoking a closure, we do not have an identifier.
     return (identifier == null)
         ? new Selector.callClosure(arity, named)
         : new Selector.call(identifier.source, library, arity, named);
   }
 
-  Selector resolveSelector(Send node) {
+  Selector resolveSelector(Send node, Element element) {
     LibraryElement library = enclosingElement.getLibrary();
-    Selector selector = computeSendSelector(node, library);
+    Selector selector = computeSendSelector(node, library, element);
     if (selector != null) mapping.setSelector(node, selector);
     return selector;
   }
@@ -2558,7 +2565,7 @@
           node.newToken, MessageKind.NON_CONST_BLOAT,
           {'name': compiler.symbolClass.name});
     }
-    resolveSelector(node.send);
+    resolveSelector(node.send, constructor);
     resolveArguments(node.send.argumentsNode);
     useElement(node.send, constructor);
     if (Elements.isUnresolved(constructor)) return constructor;
@@ -3513,8 +3520,10 @@
   }
 
   void visitNodeList(NodeList node) {
-    for (Link<Node> link = node.nodes; !link.isEmpty; link = link.tail) {
-      link.head.accept(this);
+    if (node != null) {
+      for (Link<Node> link = node.nodes; !link.isEmpty; link = link.tail) {
+        link.head.accept(this);
+      }
     }
   }
 
@@ -3534,6 +3543,12 @@
     visitNodeList(node.mixins);
   }
 
+  void visitNamedMixinApplication(NamedMixinApplication node) {
+    node.superclass.accept(this);
+    visitNodeList(node.mixins);
+    visitNodeList(node.interfaces);
+  }
+
   void visitTypeAnnotation(TypeAnnotation node) {
     node.typeName.accept(this);
   }
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
index 6798c57..19525ee 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -1865,8 +1865,15 @@
 
   visitExpressionStatement(ExpressionStatement node) {
     assert(isReachable);
-    visit(node.expression);
-    pop();
+    Throw throwExpression = node.expression.asThrow();
+    if (throwExpression != null && inliningStack.isEmpty) {
+      visit(throwExpression.expression);
+      handleInTryStatement();
+      closeAndGotoExit(new HThrow(pop()));
+    } else {
+      visit(node.expression);
+      pop();
+    }
   }
 
   /**
@@ -2794,8 +2801,9 @@
       HInstruction representations =
         buildTypeArgumentRepresentations(type);
       add(representations);
-      HInstruction isFieldName =
-          addConstantString(node, backend.namer.operatorIs(element));
+      String operator =
+          backend.namer.operatorIs(backend.getImplementationClass(element));
+      HInstruction isFieldName = addConstantString(node, operator);
       // TODO(karlklose): use [:null:] for [asField] if [element] does not
       // have a subclass.
       HInstruction asFieldName =
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart b/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart
index bd2d52f..eae106e 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart
@@ -688,21 +688,18 @@
       }
     }
 
-    if (!belowLength) {
-      // Update the range of the index if using the maximum index
-      // narrows it.
-      Range newIndexRange = indexRange.intersection(
-          info.newNormalizedRange(info.intZero, maxIndex));
-      if (indexRange == newIndexRange) return indexRange;
-      // Explicitly attach the range information to the index instruction,
-      // which may be used by other instructions.  Returning the new range will
-      // attach it to this instruction.
-      HInstruction instruction = createRangeConversion(next, check.index);
-      ranges[instruction] = newIndexRange;
-      return newIndexRange;
-    }
-
-    return indexRange;
+    // Update the range of the index if using the maximum index
+    // narrows it. Use that new range for this instruction as well.
+    Range newIndexRange = indexRange.intersection(
+        info.newNormalizedRange(info.intZero, maxIndex));
+    return newIndexRange;
+    if (indexRange == newIndexRange) return indexRange;
+    // Explicitly attach the range information to the index instruction,
+    // which may be used by other instructions.  Returning the new range will
+    // attach it to this instruction.
+    HInstruction instruction = createRangeConversion(next, check.index);
+    ranges[instruction] = newIndexRange;
+    return newIndexRange;
   }
 
   Range visitRelational(HRelational relational) {
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/variable_allocator.dart b/sdk/lib/_internal/compiler/implementation/ssa/variable_allocator.dart
index 7ae36cb..fa67e88 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/variable_allocator.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/variable_allocator.dart
@@ -231,9 +231,7 @@
 
   void markAsLiveInEnvironment(HInstruction instruction,
                                LiveEnvironment environment) {
-    // The inputs of a [HPhi] are being handled at the entry of a
-    // block.
-    if (generateAtUseSite.contains(instruction) && instruction is !HPhi) {
+    if (generateAtUseSite.contains(instruction)) {
       markInputsAsLiveInEnvironment(instruction, environment);
     } else {
       environment.add(instruction, instructionId);
@@ -302,7 +300,9 @@
     // We just remove the phis from the environment. The inputs of the
     // phis will be put in the environment of the predecessors.
     for (HPhi phi = block.phis.first; phi != null; phi = phi.next) {
-      environment.remove(phi, instructionId);
+      if (!generateAtUseSite.contains(phi)) {
+        environment.remove(phi, instructionId);
+      }
     }
 
     // Save the liveInstructions of that block.
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 14b6d44..d4fdd13 100644
--- a/sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart
+++ b/sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart
@@ -829,6 +829,11 @@
                              ArgumentsTypes arguments,
                              Selector constraint,
                              bool inLoop) {
+    // Bailout for closure calls. We're not tracking types of
+    // arguments for closures.
+    if (callee.isInstanceMember() && selector.isClosureCall()) {
+      return;
+    }
     if (inLoop) {
       // For instance methods, we only register a selector called in a
       // loop if it is a typed selector, to avoid marking too many
diff --git a/sdk/lib/_internal/compiler/implementation/types/type_mask.dart b/sdk/lib/_internal/compiler/implementation/types/type_mask.dart
index a47240d..8e7843d 100644
--- a/sdk/lib/_internal/compiler/implementation/types/type_mask.dart
+++ b/sdk/lib/_internal/compiler/implementation/types/type_mask.dart
@@ -435,23 +435,12 @@
           || compiler.world.hasAnySubclassThatMixes(self, other);
     } else {
       assert(isSubtype);
-      if (other.implementsInterface(self)
+      return hasElementIn(self, selector, element)
+          || 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);
-      }
+          || compiler.world.hasAnySubclassThatImplements(other, base);
     }
-    return false;
   }
 
   /**
diff --git a/sdk/lib/_internal/compiler/implementation/universe/universe.dart b/sdk/lib/_internal/compiler/implementation/universe/universe.dart
index 1d3a6f2..b1b3cb9 100644
--- a/sdk/lib/_internal/compiler/implementation/universe/universe.dart
+++ b/sdk/lib/_internal/compiler/implementation/universe/universe.dart
@@ -175,12 +175,14 @@
              selector.argumentCount, selector.namedArguments);
 
   Selector.callConstructor(SourceString constructorName,
-                           LibraryElement library)
+                           LibraryElement library,
+                           [int arity = 0,
+                            List<SourceString> named = const []])
       : this(SelectorKind.CALL,
              constructorName,
              library,
-             0,
-             const []);
+             arity,
+             named);
 
   Selector.callDefaultConstructor(LibraryElement library)
       : this(SelectorKind.CALL, const SourceString(""), library, 0, const []);
diff --git a/sdk/lib/_internal/pub/lib/src/package.dart b/sdk/lib/_internal/pub/lib/src/package.dart
index ce1ad35..62a2a98 100644
--- a/sdk/lib/_internal/pub/lib/src/package.dart
+++ b/sdk/lib/_internal/pub/lib/src/package.dart
@@ -36,7 +36,7 @@
 
   /// The ids of the packages that this package depends on. This is what is
   /// specified in the pubspec when this package depends on another.
-  List<PackageRef> get dependencies => pubspec.dependencies;
+  List<PackageDep> get dependencies => pubspec.dependencies;
 
   /// Returns the path to the README file at the root of the entrypoint, or null
   /// if no README file is found. If multiple READMEs are found, this uses the
@@ -77,54 +77,107 @@
   String toString() => '$name $version ($dir)';
 }
 
-/// An unambiguous resolved reference to a package. A package ID contains enough
-/// information to correctly install the package.
-///
-/// Note that it's possible for multiple distinct package IDs to point to
-/// different directories that happen to contain identical packages. For
-/// example, the same package may be available from multiple sources. As far as
-/// Pub is concerned, those packages are different.
-class PackageId implements Comparable<PackageId> {
+/// This is the private base class of [PackageRef], [PackageID], and
+/// [PackageDep]. It contains functionality and state that those classes share
+/// but is private so that from outside of this library, there is no type
+/// relationship between those three types.
+class _PackageName {
+  _PackageName(this.name, this.source, this.description);
+
   /// The name of the package being identified.
   final String name;
 
   /// The [Source] used to look up this package given its [description]. If
-  /// this is a root package ID, this will be `null`.
+  /// this is a root package, this will be `null`.
   final Source source;
 
-  /// The package's version.
-  final Version version;
-
   /// The metadata used by the package's [source] to identify and locate it. It
   /// contains whatever [Source]-specific data it needs to be able to install
   /// the package. For example, the description of a git sourced package might
   /// by the URL "git://github.com/dart/uilib.git".
   final description;
 
-  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.
+  /// Whether this package is the root package.
   bool get isRoot => source == null;
 
-  int get hashCode => name.hashCode ^ source.hashCode ^ version.hashCode;
-
   /// Gets the directory where this package is or would be found in the
   /// [SystemCache].
   Future<String> get systemCacheDirectory => source.systemCacheDirectory(this);
 
+  String toString() {
+    if (isRoot) return "$name (root)";
+    if (source.isDefault) return name;
+    return "$name from $source";
+  }
+
+  /// Returns a [PackageRef] with this one's [name], [source], and
+  /// [description].
+  PackageRef toRef() => new PackageRef(name, source, description);
+
+  /// Returns a [PackageId] for this package with the given concrete version.
+  PackageId atVersion(Version version) =>
+    new PackageId(name, source, version, description);
+
+  /// Returns `true` if this package's description matches [other]'s.
+  bool descriptionEquals(PackageDep other) {
+    return source.descriptionsEqual(description, other.description);
+  }
+}
+
+/// A reference to a [Package], but not any particular version(s) of it.
+class PackageRef extends _PackageName {
+  PackageRef(String name, Source source, description)
+      : super(name, source, description);
+
+  int get hashCode => name.hashCode ^ source.hashCode;
+
   bool operator ==(other) {
-    if (other is! PackageId) return false;
-    // TODO(rnystrom): We're assuming here the name/version/source tuple is
-    // enough to uniquely identify the package and that we don't need to delve
-    // into the description.
-    return other.name == name &&
+    // TODO(rnystrom): We're assuming here that we don't need to delve into the
+    // description.
+    return other is PackageRef &&
+           other.name == name &&
+           other.source == source;
+  }
+
+  /// Gets the list of ids of all versions of the package that are described by
+  /// this reference.
+  Future<List<PackageId>> getVersions() {
+    if (isRoot) {
+      throw new StateError("Cannot get versions for the root package.");
+    }
+
+    return source.getVersions(name, description).then((versions) {
+      return versions.map((version) => atVersion(version)).toList();
+    });
+  }
+}
+
+/// A reference to a specific version of a package. A package ID contains
+/// enough information to correctly install the package.
+///
+/// Note that it's possible for multiple distinct package IDs to point to
+/// different packages that have identical contents. For example, the same
+/// package may be available from multiple sources. As far as Pub is concerned,
+/// those packages are different.
+class PackageId extends _PackageName {
+  /// The package's version.
+  final Version version;
+
+  PackageId(String name, Source source, this.version, description)
+      : super(name, source, description);
+
+  /// Creates an ID for the given root package.
+  PackageId.root(Package package)
+      : version = package.version,
+        super(package.name, null, package.name);
+
+  int get hashCode => name.hashCode ^ source.hashCode ^ version.hashCode;
+
+  bool operator ==(other) {
+    // TODO(rnystrom): We're assuming here that we don't need to delve into the
+    // description.
+    return other is PackageId &&
+           other.name == name &&
            other.source == source &&
            other.version == version;
   }
@@ -135,78 +188,35 @@
     return "$name $version from $source";
   }
 
-  int compareTo(PackageId other) {
-    var sourceComp = source.name.compareTo(other.source.name);
-    if (sourceComp != 0) return sourceComp;
-
-    var nameComp = name.compareTo(other.name);
-    if (nameComp != 0) return nameComp;
-
-    return version.compareTo(other.version);
-  }
-
   /// Returns the pubspec for this package.
   Future<Pubspec> describe() => source.systemCache.describe(this);
 
-  /// Returns a future that completes to the resovled [PackageId] for this id.
+  /// Returns a future that completes to the resolved [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
-/// unambiguously refer to a single package. It may describe a range of allowed
-/// packages.
-class PackageRef {
-  /// The name of the package being identified.
-  final String name;
-
-  /// The [Source] used to look up the package. If this refers to a root
-  /// package, this will be `null`.
-  final Source source;
-
+/// A reference to a constrained range of versions of one package.
+class PackageDep extends _PackageName {
   /// The allowed package versions.
   final VersionConstraint constraint;
 
-  /// The metadata used to identify the package being referenced. The
-  /// interpretation of this will vary based on the [source].
-  final description;
-
-  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,
-        source = null,
-        constraint = package.version,
-        description = package.name;
-
-  /// Whether this refers to the root package.
-  bool get isRoot => source == null;
+  PackageDep(String name, Source source, this.constraint, description)
+      : super(name, source, description);
 
   String toString() {
     if (isRoot) return "$name $constraint (root)";
     return "$name $constraint from $source ($description)";
   }
 
-  /// Returns a [PackageId] generated from this [PackageRef] with the given
-  /// concrete version.
-  PackageId atVersion(Version version) =>
-    new PackageId(name, source, version, description);
+  int get hashCode => name.hashCode ^ source.hashCode;
 
-  /// Returns `true` if this reference's description matches [other]'s.
-  bool descriptionEquals(PackageRef other) {
-    return source.descriptionsEqual(description, other.description);
+  bool operator ==(other) {
+    // TODO(rnystrom): We're assuming here that we don't need to delve into the
+    // description.
+    return other is PackageDep &&
+           other.name == name &&
+           other.source == source &&
+           other.constraint == constraint;
   }
 }
 
diff --git a/sdk/lib/_internal/pub/lib/src/path_source.dart b/sdk/lib/_internal/pub/lib/src/path_source.dart
index c103c1b..72d4065 100644
--- a/sdk/lib/_internal/pub/lib/src/path_source.dart
+++ b/sdk/lib/_internal/pub/lib/src/path_source.dart
@@ -18,7 +18,6 @@
 import 'source.dart';
 import 'utils.dart';
 
-// TODO(rnystrom): Support relative paths. (See comment in _validatePath().)
 /// A package [Source] that installs packages from a given local file path.
 class PathSource extends Source {
   final name = 'path';
diff --git a/sdk/lib/_internal/pub/lib/src/pubspec.dart b/sdk/lib/_internal/pub/lib/src/pubspec.dart
index a5c67ac..69dc880 100644
--- a/sdk/lib/_internal/pub/lib/src/pubspec.dart
+++ b/sdk/lib/_internal/pub/lib/src/pubspec.dart
@@ -23,10 +23,10 @@
   final Version version;
 
   /// The packages this package depends on.
-  final List<PackageRef> dependencies;
+  final List<PackageDep> dependencies;
 
   /// The packages this package depends on when it is the root package.
-  final List<PackageRef> devDependencies;
+  final List<PackageDep> devDependencies;
 
   /// The environment-related metadata.
   final PubspecEnvironment environment;
@@ -65,8 +65,8 @@
   Pubspec.empty()
     : name = null,
       version = Version.none,
-      dependencies = <PackageRef>[],
-      devDependencies = <PackageRef>[],
+      dependencies = <PackageDep>[],
+      devDependencies = <PackageDep>[],
       environment = new PubspecEnvironment(),
       fields = {};
 
@@ -233,9 +233,9 @@
   }
 }
 
-List<PackageRef> _parseDependencies(String pubspecPath, SourceRegistry sources,
+List<PackageDep> _parseDependencies(String pubspecPath, SourceRegistry sources,
     yaml) {
-  var dependencies = <PackageRef>[];
+  var dependencies = <PackageDep>[];
 
   // Allow an empty dependencies key.
   if (yaml == null) return dependencies;
@@ -283,7 +283,7 @@
     description = source.parseDescription(pubspecPath, description,
         fromLockFile: false);
 
-    dependencies.add(new PackageRef(
+    dependencies.add(new PackageDep(
         name, source, versionConstraint, description));
   });
 
diff --git a/sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart b/sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart
index a5e3e3c..c5580a9 100644
--- a/sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart
+++ b/sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart
@@ -347,33 +347,32 @@
     return _solver.cache.getPubspec(id).then((pubspec) {
       _validateSdkConstraint(pubspec);
 
-      var refs = pubspec.dependencies.toList();
+      var deps = pubspec.dependencies.toList();
 
       // Include dev dependencies of the root package.
-      if (id.isRoot) refs.addAll(pubspec.devDependencies);
+      if (id.isRoot) deps.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) {
+      // Given a package dep, returns a future that completes to a pair of the
+      // dep and the number of versions available for it.
+      getNumVersions(PackageDep dep) {
         // There is only ever one version of the root package.
-        if (ref.isRoot) {
-          return new Future.value(new Pair<PackageRef, int>(ref, 1));
+        if (dep.isRoot) {
+          return new Future.value(new Pair<PackageDep, int>(dep, 1));
         }
 
-        return _solver.cache.getVersions(ref.name, ref.source, ref.description)
-            .then((versions) {
-          return new Pair<PackageRef, int>(ref, versions.length);
+        return _solver.cache.getVersions(dep.toRef()).then((versions) {
+          return new Pair<PackageDep, int>(dep, 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"
+          log.solver("Could not get versions for $dep:\n$error\n\n"
               "${getAttachedStackTrace(error)}");
-          return new Pair<PackageRef, int>(ref, 0);
+          return new Pair<PackageDep, int>(dep, 0);
         });
       }
 
-      return Future.wait(refs.map(getNumVersions)).then((pairs) {
+      return Future.wait(deps.map(getNumVersions)).then((pairs) {
         // Future.wait() returns an immutable list, so make a copy.
         pairs = pairs.toList();
 
@@ -393,8 +392,8 @@
           return a.first.name.compareTo(b.first.name);
         });
 
-        var queue = new Queue<PackageRef>.from(pairs.map((pair) => pair.first));
-        return _traverseRefs(id.name, queue);
+        var queue = new Queue<PackageDep>.from(pairs.map((pair) => pair.first));
+        return _traverseDeps(id.name, queue);
       });
     });
   }
@@ -403,135 +402,134 @@
   /// 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) {
+  Future<List<PackageId>> _traverseDeps(String depender,
+      Queue<PackageDep> deps) {
     // Move onto the next package if we've traversed all of these references.
-    if (refs.isEmpty) return _traversePackage();
+    if (deps.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();
+      var dep = deps.removeFirst();
 
-      _validateDependency(ref, depender);
-      var constraint = _addConstraint(ref, depender);
+      _validateDependency(dep, depender);
+      var constraint = _addConstraint(dep, depender);
 
-      var selected = _validateSelected(ref, constraint);
+      var selected = _validateSelected(dep, constraint);
       if (selected != null) {
         // The selected package version is good, so enqueue it to traverse into
         // it.
         _packages.add(selected);
-        return _traverseRefs(depender, refs);
+        return _traverseDeps(depender, deps);
       }
 
       // 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));
+      return _selectPackage(dep, constraint).then(
+          (_) => _traverseDeps(depender, deps));
     });
   }
 
-  /// Ensures that dependency [ref] from [depender] is consistent with the
+  /// Ensures that dependency [dep] 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) {
+  void _validateDependency(PackageDep dep, String depender) {
     // Make sure the dependencies agree on source and description.
-    var required = _getRequired(ref.name);
+    var required = _getRequired(dep.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)]);
+    if (required.dep.source.name != dep.source.name) {
+      _solver.logSolve('source mismatch on ${dep.name}: ${required.dep.source} '
+                       '!= ${dep.source}');
+      throw new SourceMismatchException(dep.name,
+          [required, new Dependency(depender, dep)]);
     }
 
     // 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)]);
+    if (!dep.descriptionEquals(required.dep)) {
+      _solver.logSolve('description mismatch on ${dep.name}: '
+                       '${required.dep.description} != ${dep.description}');
+      throw new DescriptionMismatchException(dep.name,
+          [required, new Dependency(depender, dep)]);
     }
   }
 
-  /// Adds the version constraint that [depender] places on [ref] to the
-  /// overall constraint that all shared dependencies place on [ref]. Throws a
+  /// Adds the version constraint that [depender] places on [dep] to the
+  /// overall constraint that all shared dependencies place on [dep]. 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) {
+  VersionConstraint _addConstraint(PackageDep dep, String depender) {
     // Add the dependency.
-    var dependencies = _getDependencies(ref.name);
-    dependencies.add(new Dependency(depender, ref));
+    var dependencies = _getDependencies(dep.name);
+    dependencies.add(new Dependency(depender, dep));
 
     // Determine the overall version constraint.
     var constraint = dependencies
-        .map((dep) => dep.ref.constraint)
+        .map((dep) => dep.dep.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);
+      _solver.logSolve('disjoint constraints on ${dep.name}');
+      throw new DisjointConstraintException(dep.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
+  /// [dep] 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);
+  PackageId _validateSelected(PackageDep dep, VersionConstraint constraint) {
+    var selected = _solver.getSelected(dep.name);
     if (selected == null) return null;
 
     // Make sure it meets the constraint.
-    if (!ref.constraint.allows(selected.version)) {
+    if (!dep.constraint.allows(selected.version)) {
       _solver.logSolve('selection $selected does not match $constraint');
-      throw new NoVersionException(ref.name, constraint,
-                                   _getDependencies(ref.name));
+      throw new NoVersionException(dep.name, constraint,
+                                   _getDependencies(dep.name));
     }
 
     return selected;
   }
 
-  /// Tries to select a package that matches [ref] and [constraint]. Updates
+  /// Tries to select a package that matches [dep] 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) {
+  Future _selectPackage(PackageDep dep, VersionConstraint constraint) {
+    return _solver.cache.getVersions(dep.toRef()).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);
+      var locked = _getValidLocked(dep.name, constraint);
       if (locked != null) {
-        allowed = allowed.where((ref) => ref.version != locked.version)
+        allowed = allowed.where((dep) => dep.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));
+        _solver.logSolve('no versions for ${dep.name} match $constraint');
+        throw new NoVersionException(dep.name, constraint,
+                                     _getDependencies(dep.name));
       }
 
       // If we're doing an upgrade on this package, only allow the latest
       // version.
-      if (_solver._forceLatest.contains(ref.name)) allowed = [allowed.first];
+      if (_solver._forceLatest.contains(dep.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.
@@ -558,7 +556,7 @@
   /// they all agree with each other.
   Dependency _getRequired(String name) {
     return _getDependencies(name)
-        .firstWhere((dep) => !dep.ref.isRoot, orElse: () => null);
+        .firstWhere((dep) => !dep.dep.isRoot, orElse: () => null);
   }
 
   /// Gets the package [name] that's currently contained in the lockfile if it
@@ -577,8 +575,8 @@
 
     var required = _getRequired(name);
     if (required != null) {
-      if (package.source.name != required.ref.source.name) return null;
-      if (!package.descriptionEquals(required.ref)) return null;
+      if (package.source.name != required.dep.source.name) return null;
+      if (!package.descriptionEquals(required.dep)) return null;
     }
 
     return package;
diff --git a/sdk/lib/_internal/pub/lib/src/solver/version_solver.dart b/sdk/lib/_internal/pub/lib/src/solver/version_solver.dart
index a816262..efd9e85 100644
--- a/sdk/lib/_internal/pub/lib/src/solver/version_solver.dart
+++ b/sdk/lib/_internal/pub/lib/src/solver/version_solver.dart
@@ -70,7 +70,7 @@
 /// Used to avoid requesting the same pubspec from the server repeatedly.
 class PubspecCache {
   final SourceRegistry _sources;
-  final _versions = new Map<PackageId, List<PackageId>>();
+  final _versions = new Map<PackageRef, List<PackageId>>();
   final _pubspecs = new Map<PackageId, Pubspec>();
 
   /// The number of times a version list was requested and it wasn't cached and
@@ -119,32 +119,21 @@
   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);
-
+  Future<List<PackageId>> getVersions(PackageRef package) {
     // See if we have it cached.
-    var versions = _versions[id];
+    var versions = _versions[package];
     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();
-
+    return package.getVersions().then((ids) {
       // 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;
+      _versions[package] = ids;
       return ids;
     });
   }
@@ -155,12 +144,12 @@
   /// The name of the package that has this dependency.
   final String depender;
 
-  /// The referenced dependent package.
-  final PackageRef ref;
+  /// The package being depended on.
+  final PackageDep dep;
 
-  Dependency(this.depender, this.ref);
+  Dependency(this.depender, this.dep);
 
-  String toString() => '$depender -> $ref';
+  String toString() => '$depender -> $dep';
 }
 
 /// Base class for all failures that can occur while trying to resolve versions.
@@ -180,10 +169,10 @@
   /// 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)]) {
+      [String describe(PackageDep dep)]) {
     var map = {};
     for (var dep in dependencies) {
-      map[dep.depender] = dep.ref;
+      map[dep.depender] = dep.dep;
     }
 
     var names = map.keys.toList();
@@ -207,7 +196,7 @@
 
     var map = {};
     for (var dep in dependencies) {
-      map[dep.depender] = dep.ref;
+      map[dep.depender] = dep.dep;
     }
 
     var names = map.keys.toList();
@@ -224,9 +213,9 @@
   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}";
+  /// to highlight which aspect of [dep] led to the failure.
+  String _describeDependency(PackageDep dep) =>
+      "depends on version ${dep.constraint}";
 }
 
 /// Exception thrown when the [VersionSolver] fails to find a solution after a
@@ -288,8 +277,8 @@
 
   String get _message => "Incompatible dependencies on '$package'";
 
-  String _describeDependency(PackageRef ref) =>
-      "depends on it from source ${ref.source}";
+  String _describeDependency(PackageDep dep) =>
+      "depends on it from source ${dep.source}";
 }
 
 /// Exception thrown when two packages with the same name and source but
@@ -301,8 +290,8 @@
 
   String get _message => "Incompatible dependencies on '$package'";
 
-  String _describeDependency(PackageRef ref) {
+  String _describeDependency(PackageDep dep) {
     // TODO(nweiz): Dump descriptions to YAML when that's supported.
-    return "depends on it with description ${json.stringify(ref.description)}";
+    return "depends on it with description ${json.stringify(dep.description)}";
   }
 }
diff --git a/sdk/lib/_internal/pub/lib/src/source.dart b/sdk/lib/_internal/pub/lib/src/source.dart
index ba2afa4..2486e78 100644
--- a/sdk/lib/_internal/pub/lib/src/source.dart
+++ b/sdk/lib/_internal/pub/lib/src/source.dart
@@ -209,7 +209,7 @@
   ///
   /// By default, this just returns [id].
   Future<PackageId> resolveId(PackageId id) => new Future.value(id);
-  
+
   /// Returns the [Package]s that have been installed in the system cache.
   List<Package> getCachedPackages() {
     if (shouldCache) {
diff --git a/sdk/lib/_internal/pub/lib/src/validator/dependency.dart b/sdk/lib/_internal/pub/lib/src/validator/dependency.dart
index 711e82d..c147f7b 100644
--- a/sdk/lib/_internal/pub/lib/src/validator/dependency.dart
+++ b/sdk/lib/_internal/pub/lib/src/validator/dependency.dart
@@ -41,9 +41,9 @@
   }
 
   /// Warn that dependencies should use the hosted source.
-  Future _warnAboutSource(PackageRef ref) {
+  Future _warnAboutSource(PackageDep dep) {
     return entrypoint.cache.sources['hosted']
-        .getVersions(ref.name, ref.name)
+        .getVersions(dep.name, dep.name)
         .catchError((e) => <Version>[])
         .then((versions) {
       var constraint;
@@ -51,23 +51,23 @@
       if (primary != null) {
         constraint = _constraintForVersion(primary);
       } else {
-        constraint = ref.constraint.toString();
-        if (!ref.constraint.isAny && ref.constraint is! Version) {
+        constraint = dep.constraint.toString();
+        if (!dep.constraint.isAny && dep.constraint is! Version) {
           constraint = '"$constraint"';
         }
       }
 
       // Path sources are errors. Other sources are just warnings.
       var messages = warnings;
-      if (ref.source is PathSource) {
+      if (dep.source is PathSource) {
         messages = errors;
       }
 
-      messages.add('Don\'t depend on "${ref.name}" from the ${ref.source.name} '
+      messages.add('Don\'t depend on "${dep.name}" from the ${dep.source.name} '
               'source. Use the hosted source instead. For example:\n'
           '\n'
           'dependencies:\n'
-          '  ${ref.name}: $constraint\n'
+          '  ${dep.name}: $constraint\n'
           '\n'
           'Using the hosted source ensures that everyone can download your '
               'package\'s dependencies along with your package.');
@@ -75,20 +75,20 @@
   }
 
   /// Warn that dependencies should have version constraints.
-  void _warnAboutConstraint(PackageRef ref) {
+  void _warnAboutConstraint(PackageDep dep) {
     var lockFile = entrypoint.loadLockFile();
-    var message = 'Your dependency on "${ref.name}" should have a version '
+    var message = 'Your dependency on "${dep.name}" should have a version '
         'constraint.';
-    var locked = lockFile.packages[ref.name];
+    var locked = lockFile.packages[dep.name];
     if (locked != null) {
       message = '$message For example:\n'
         '\n'
         'dependencies:\n'
-        '  ${ref.name}: ${_constraintForVersion(locked.version)}\n';
+        '  ${dep.name}: ${_constraintForVersion(locked.version)}\n';
     }
     warnings.add("$message\n"
         "Without a constraint, you're promising to support all future "
-        "versions of ${ref.name}.");
+        "versions of ${dep.name}.");
   }
 
   /// Returns the suggested version constraint for a dependency that was tested
diff --git a/sdk/lib/_internal/pub/test/version_solver_test.dart b/sdk/lib/_internal/pub/test/version_solver_test.dart
index 380803a..6c2cb22 100644
--- a/sdk/lib/_internal/pub/test/version_solver_test.dart
+++ b/sdk/lib/_internal/pub/test/version_solver_test.dart
@@ -940,8 +940,8 @@
   var sdkConstraint = null;
 
   // Build the pubspec dependencies.
-  var dependencies = <PackageRef>[];
-  var devDependencies = <PackageRef>[];
+  var dependencies = <PackageDep>[];
+  var devDependencies = <PackageDep>[];
 
   dependencyStrings.forEach((name, constraint) {
     parseSource(name, (isDev, name, source) {
@@ -953,12 +953,12 @@
         return;
       }
 
-      var ref = new PackageRef(packageName, source, constraint, name);
+      var dep = new PackageDep(packageName, source, constraint, name);
 
       if (isDev) {
-        devDependencies.add(ref);
+        devDependencies.add(dep);
       } else {
-        dependencies.add(ref);
+        dependencies.add(dep);
       }
     });
   });
diff --git a/sdk/lib/chrome/dart2js/chrome_dart2js.dart b/sdk/lib/chrome/dart2js/chrome_dart2js.dart
index 2c416c4..e62156e 100644
--- a/sdk/lib/chrome/dart2js/chrome_dart2js.dart
+++ b/sdk/lib/chrome/dart2js/chrome_dart2js.dart
@@ -253,7 +253,7 @@
                 [void callback(List<Rule> rules)]) {
     // proxy the callback
     void __proxy_callback(List rules) {
-      if (?callback) {
+      if (callback != null) {
         List<Rule> __proxy_rules = new List<Rule>();
 
         for (Object o in rules)
@@ -282,7 +282,7 @@
                                    void callback(List<Rule> rules)]) {
     // proxy the callback
     void __proxy_callback(List rules) {
-      if (?callback) {
+      if (callback != null) {
         List<Rule> __proxy_rules = new List<Rule>();
 
         for (Object o in rules)
@@ -398,43 +398,43 @@
    * Public constructor
    */
   AppWindowCreateWindowOptions({String id, int defaultWidth, int defaultHeight, int defaultLeft, int defaultTop, int width, int height, int left, int top, int minWidth, int minHeight, int maxWidth, int maxHeight, String type, String frame, AppWindowBounds bounds, bool transparentBackground, bool hidden, bool singleton}) {
-    if (?id)
+    if (id != null)
       this.id = id;
-    if (?defaultWidth)
+    if (defaultWidth != null)
       this.defaultWidth = defaultWidth;
-    if (?defaultHeight)
+    if (defaultHeight != null)
       this.defaultHeight = defaultHeight;
-    if (?defaultLeft)
+    if (defaultLeft != null)
       this.defaultLeft = defaultLeft;
-    if (?defaultTop)
+    if (defaultTop != null)
       this.defaultTop = defaultTop;
-    if (?width)
+    if (width != null)
       this.width = width;
-    if (?height)
+    if (height != null)
       this.height = height;
-    if (?left)
+    if (left != null)
       this.left = left;
-    if (?top)
+    if (top != null)
       this.top = top;
-    if (?minWidth)
+    if (minWidth != null)
       this.minWidth = minWidth;
-    if (?minHeight)
+    if (minHeight != null)
       this.minHeight = minHeight;
-    if (?maxWidth)
+    if (maxWidth != null)
       this.maxWidth = maxWidth;
-    if (?maxHeight)
+    if (maxHeight != null)
       this.maxHeight = maxHeight;
-    if (?type)
+    if (type != null)
       this.type = type;
-    if (?frame)
+    if (frame != null)
       this.frame = frame;
-    if (?bounds)
+    if (bounds != null)
       this.bounds = bounds;
-    if (?transparentBackground)
+    if (transparentBackground != null)
       this.transparentBackground = transparentBackground;
-    if (?hidden)
+    if (hidden != null)
       this.hidden = hidden;
-    if (?singleton)
+    if (singleton != null)
       this.singleton = singleton;
   }
 
@@ -601,13 +601,13 @@
    * Public constructor
    */
   AppWindowBounds({int left, int top, int width, int height}) {
-    if (?left)
+    if (left != null)
       this.left = left;
-    if (?top)
+    if (top != null)
       this.top = top;
-    if (?width)
+    if (width != null)
       this.width = width;
-    if (?height)
+    if (height != null)
       this.height = height;
   }
 
@@ -835,7 +835,7 @@
               [AppWindowCreateWindowOptions options,
               void callback(AppWindowAppWindow created_window)]) {
     void __proxy_callback(created_window) {
-      if (?callback)
+      if (callback != null)
         callback(new AppWindowAppWindow._proxy(created_window));
     }
     JS('void', '#.create(#, #, #)', this._jsObject, url, convertArgument(options),
@@ -923,9 +923,9 @@
    * Public constructor
    */
   AppRuntimeLaunchItem({FileEntry entry, String type}) {
-    if (?entry)
+    if (entry != null)
       this.entry = entry;
-    if (?type)
+    if (type != null)
       this.type = type;
   }
 
@@ -958,11 +958,11 @@
    * Public constructor
    */
   AppRuntimeLaunchData({AppRuntimeIntent intent, String id, List<AppRuntimeLaunchItem> items}) {
-    if (?intent)
+    if (intent != null)
       this.intent = intent;
-    if (?id)
+    if (id != null)
       this.id = id;
-    if (?items)
+    if (items != null)
       this.items = items;
   }
 
@@ -1006,11 +1006,11 @@
    * Public constructor
    */
   AppRuntimeIntentResponse({int intentId, bool success, Object data}) {
-    if (?intentId)
+    if (intentId != null)
       this.intentId = intentId;
-    if (?success)
+    if (success != null)
       this.success = success;
-    if (?data)
+    if (data != null)
       this.data = data;
   }
 
@@ -1054,7 +1054,7 @@
 class Event_app_runtime_onLaunched extends Event {
   void addListener(void callback(AppRuntimeLaunchData launchData)) {
     void __proxy_callback(launchData) {
-      if (?callback) {
+      if (callback != null) {
         callback(new AppRuntimeLaunchData._proxy(launchData));
       }
     }
@@ -1063,7 +1063,7 @@
 
   void removeListener(void callback(AppRuntimeLaunchData launchData)) {
     void __proxy_callback(launchData) {
-      if (?callback) {
+      if (callback != null) {
         callback(new AppRuntimeLaunchData._proxy(launchData));
       }
     }
@@ -1072,7 +1072,7 @@
 
   bool hasListener(void callback(AppRuntimeLaunchData launchData)) {
     void __proxy_callback(launchData) {
-      if (?callback) {
+      if (callback != null) {
         callback(new AppRuntimeLaunchData._proxy(launchData));
       }
     }
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 2a3bd0f..d67a2c9 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -75,7 +75,7 @@
 
   @DomName('AbstractWorker.errorEvent')
   @DocsEditable
-  static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
+  static const EventStreamProvider<ErrorEvent> errorEvent = const EventStreamProvider<ErrorEvent>('error');
 
   @JSName('addEventListener')
   @DomName('AbstractWorker.addEventListener')
@@ -93,7 +93,7 @@
 
   @DomName('AbstractWorker.onerror')
   @DocsEditable
-  Stream<Event> get onError => errorEvent.forTarget(this);
+  Stream<ErrorEvent> get onError => errorEvent.forTarget(this);
 }
 // 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
@@ -6146,6 +6146,11 @@
   @DocsEditable
   Event $dom_createEvent(String eventType) native;
 
+  @JSName('createNodeIterator')
+  @DomName('Document.createNodeIterator')
+  @DocsEditable
+  NodeIterator $dom_createNodeIterator(Node root, int whatToShow, NodeFilter filter, bool expandEntityReferences) native;
+
   @JSName('createRange')
   @DomName('Document.createRange')
   @DocsEditable
@@ -6173,6 +6178,11 @@
   @DocsEditable
   TouchList $dom_createTouchList() native;
 
+  @JSName('createTreeWalker')
+  @DomName('Document.createTreeWalker')
+  @DocsEditable
+  TreeWalker $dom_createTreeWalker(Node root, int whatToShow, NodeFilter filter, bool expandEntityReferences) native;
+
   @JSName('elementFromPoint')
   @DomName('Document.elementFromPoint')
   @DocsEditable
@@ -7792,8 +7802,6 @@
 // BSD-style license that can be found in the LICENSE file.
 
 
-// TODO(jacobr): use _Lists.dart to remove some of the duplicated
-// functionality.
 class _ChildrenElementList extends ListBase<Element> {
   // Raw Element.
   final Element _element;
@@ -7803,106 +7811,13 @@
     : _childElements = element.$dom_children,
       _element = element;
 
-  List<Element> toList({ bool growable: true }) {
-    List<Element> output;
-    if (growable) {
-      output = <Element>[];
-      output.length = _childElements.length;
-    } else {
-      output = new List<Element>(_childElements.length);
-    }
-    for (int i = 0, len = _childElements.length; i < len; i++) {
-      output[i] = _childElements[i];
-    }
-    return output;
-  }
-
-  Set<Element> toSet() {
-    final output = new Set<Element>();
-    for (int i = 0, len = _childElements.length; i < len; i++) {
-      output.add(_childElements[i]);
-    }
-    return output;
-  }
-
   bool contains(Element element) => _childElements.contains(element);
 
-  void forEach(void f(Element element)) {
-    for (Element element in _childElements) {
-      f(element);
-    }
-  }
-
-  bool every(bool f(Element element)) {
-    for (Element element in this) {
-      if (!f(element)) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  bool any(bool f(Element element)) {
-    for (Element element in this) {
-      if (f(element)) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  String join([String separator = ""]) {
-    return _childElements.join(separator);
-  }
-
-  Iterable map(f(Element element)) {
-    return _childElements.map(f);
-  }
-
-  Iterable<Element> where(bool f(Element element)) {
-    return _childElements.where(f);
-  }
-
-  Iterable expand(Iterable f(Element element)) {
-    return _childElements.expand(f);
-  }
 
   bool get isEmpty {
     return _element.$dom_firstElementChild == null;
   }
 
-  Iterable<Element> take(int n) {
-    return _childElements.take(n);
-  }
-
-  Iterable<Element> takeWhile(bool test(Element value)) {
-    return _childElements.takeWhile(test);
-  }
-
-  Iterable<Element> skip(int n) {
-    return _childElements.skip(n);
-  }
-
-  Iterable<Element> skipWhile(bool test(Element value)) {
-    return _childElements.skipWhile(test);
-  }
-
-  Element firstWhere(bool test(Element value), {Element orElse()}) {
-    return _childElements.firstWhere(test, orElse: orElse);
-  }
-
-  Element lastWhere(bool test(Element value), {Element orElse()}) {
-    return _childElements.lastWhere(test, orElse: orElse);
-  }
-
-  Element singleWhere(bool test(Element value)) {
-    return _childElements.singleWhere(test);
-  }
-
-  Element elementAt(int index) {
-    return this[index];
-  }
-
   int get length {
     return _childElements.length;
   }
@@ -7917,7 +7832,7 @@
 
   void set length(int newLength) {
     // TODO(jacobr): remove children when length is reduced.
-    throw new UnsupportedError('');
+    throw new UnsupportedError('Cannot resize element lists');
   }
 
   Element add(Element value) {
@@ -7937,21 +7852,8 @@
     }
   }
 
-  Iterable<Element> get reversed {
-    return _childElements.reversed;
-  }
-
   void sort([int compare(Element a, Element b)]) {
-    throw new UnsupportedError('TODO(jacobr): should we impl?');
-  }
-
-  Element reduce(Element combine(Element value, Element element)) {
-    return _childElements.reduce(combine);
-  }
-
-  dynamic fold(dynamic initialValue,
-      dynamic combine(dynamic previousValue, Element element)) {
-    return _childElements.fold(initialValue, combine);
+    throw new UnsupportedError('Cannot sort element lists');
   }
 
   void setRange(int start, int end, Iterable<Element> iterable,
@@ -7978,36 +7880,6 @@
     return false;
   }
 
-  void removeWhere(bool test(Element element)) {
-    _childElements.removeWhere(test);
-  }
-
-  void retainWhere(bool test(Element element)) {
-    _childElements.retainWhere(test);
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnimplementedError();
-  }
-
-  Iterable getRange(int start, int end)  {
-    throw new UnimplementedError();
-  }
-
-  List sublist(int start, [int end]) {
-    if (end == null) end = length;
-    return new _FrozenElementList._wrap(Lists.getRange(this, start, end, []));
-  }
-
-  int indexOf(Element element, [int start = 0]) {
-    return Lists.indexOf(this, element, start, this.length);
-  }
-
-  int lastIndexOf(Element element, [int start = null]) {
-    if (start == null) start = length - 1;
-    return Lists.lastIndexOf(this, element, start);
-  }
-
   void insert(int index, Element element) {
     if (index < 0 || index > length) {
       throw new RangeError.range(index, 0, length);
@@ -8019,10 +7891,6 @@
     }
   }
 
-  void insertAll(int index, Iterable<Element> iterable) {
-    throw new UnimplementedError();
-  }
-
   void setAll(int index, Iterable<Element> iterable) {
     throw new UnimplementedError();
   }
@@ -8065,24 +7933,13 @@
     if (length > 1) throw new StateError("More than one element");
     return first;
   }
-
-  Map<int, Element> asMap() {
-    return _childElements.asMap();
-  }
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
 }
 
 // TODO(jacobr): this is an inefficient implementation but it is hard to see
 // a better option given that we cannot quite force NodeList to be an
 // ElementList as there are valid cases where a NodeList JavaScript object
 // contains Node objects that are not Elements.
-class _FrozenElementList extends ListBase {
+class _FrozenElementList<T extends Element> extends ListBase<T> {
   final List<Node> _nodeList;
 
   _FrozenElementList._wrap(this._nodeList);
@@ -8092,60 +7949,15 @@
   Element operator [](int index) => _nodeList[index];
 
   void operator []=(int index, Element value) {
-    throw new UnsupportedError('');
+    throw new UnsupportedError('Cannot modify list');
   }
 
   void set length(int newLength) {
-    _nodeList.length = newLength;
+    throw new UnsupportedError('Cannot modify list');
   }
 
-  void add(Element value) {
-    throw new UnsupportedError('');
-  }
-
-  void addAll(Iterable<Element> iterable) {
-    throw new UnsupportedError('');
-  }
-
-  void sort([int compare(Element a, Element b)]) {
-    throw new UnsupportedError('');
-  }
-
-  void setRange(int start, int end, Iterable<Element> iterable,
-                [int skipCount = 0]) {
-    throw new UnsupportedError('');
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnsupportedError('');
-  }
-
-  List<Element> sublist(int start, [int end]) {
-    return new _FrozenElementList._wrap(_nodeList.sublist(start, end));
-  }
-
-  void clear() {
-    throw new UnsupportedError('');
-  }
-
-  Element removeAt(int index) {
-    throw new UnsupportedError('');
-  }
-
-  Element removeLast() {
-    throw new UnsupportedError('');
-  }
-
-  bool remove(Object element) {
-    throw new UnsupportedError('');
-  }
-
-  void removeWhere(bool test(Element element)) {
-    throw new UnsupportedError('');
-  }
-
-  void retainWhere(bool test(Element element)) {
-    throw new UnsupportedError('');
+  void sort([Comparator<Element> compare]) {
+    throw new UnsupportedError('Cannot sort list');
   }
 
   Element get first => _nodeList.first;
@@ -8153,13 +7965,6 @@
   Element get last => _nodeList.last;
 
   Element get single => _nodeList.single;
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
 }
 
 class _ElementCssClassSet extends CssClassSet {
@@ -9569,15 +9374,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.
 
-
-@DocsEditable
-@DomName('EntityReference')
-class EntityReference extends Node native "EntityReference" {
-}
-// 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.
 
 
@@ -9751,7 +9547,7 @@
   factory Event(String type,
       {bool canBubble: true, bool cancelable: true}) {
     return new Event.eventType('Event', type, canBubble: canBubble,
-        cancelable: canBubble);
+        cancelable: cancelable);
   }
 
   /**
@@ -15858,11 +15654,12 @@
   }
 
   void insertAll(int index, Iterable<Node> iterable) {
-    throw new UnimplementedError();
+    var item = this[index];
+    _this.insertAllBefore(iterable, item);
   }
 
   void setAll(int index, Iterable<Node> iterable) {
-    throw new UnimplementedError();
+    throw new UnsupportedError("Cannot setAll on Node list");
   }
 
   Node removeLast() {
@@ -15921,53 +15718,22 @@
 
   Iterator<Node> get iterator => _this.$dom_childNodes.iterator;
 
-  List<Node> toList({ bool growable: true }) =>
-      new List<Node>.from(this, growable: growable);
-  Set<Node> toSet() => new Set<Node>.from(this);
-
-  bool get isEmpty => this.length == 0;
-
   // From List<Node>:
 
   // TODO(jacobr): this could be implemented for child node lists.
   // The exception we throw here is misleading.
-  void sort([int compare(Node a, Node b)]) {
-    throw new UnsupportedError("Cannot sort immutable List.");
+  void sort([Comparator<Node> compare]) {
+    throw new UnsupportedError("Cannot sort Node list");
   }
 
   // FIXME: implement these.
   void setRange(int start, int end, Iterable<Node> iterable,
                 [int skipCount = 0]) {
-    throw new UnsupportedError(
-        "Cannot setRange on immutable List.");
-  }
-  void removeRange(int start, int end) {
-    throw new UnsupportedError(
-        "Cannot removeRange on immutable List.");
+    throw new UnsupportedError("Cannot setRange on Node list");
   }
 
-  Iterable<Node> getRange(int start, int end) {
-    throw new UnimplementedError("NodeList.getRange");
-  }
-
-  void replaceRange(int start, int end, Iterable<Node> iterable) {
-    throw new UnimplementedError("NodeList.replaceRange");
-  }
-
-  void fillRange(int start, int end, [Node fillValue]) {
-    throw new UnimplementedError("NodeList.fillRange");
-  }
-
-  List<Node> sublist(int start, [int end]) {
-    if (end == null) end == length;
-    return Lists.getRange(this, start, end, <Node>[]);
-  }
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
+  void fillRange(int start, int end, [Node fill]) {
+    throw new UnsupportedError("Cannot fillRange on Node list");
   }
   // -- end List<Node> mixins.
 
@@ -16315,27 +16081,17 @@
   static const int SHOW_PROCESSING_INSTRUCTION = 0x00000040;
 
   static const int SHOW_TEXT = 0x00000004;
-
-  @DomName('NodeFilter.acceptNode')
-  @DocsEditable
-  int acceptNode(Node n) native;
 }
-// Copyright (c) 2012, 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.
 
 
-@DocsEditable
 @DomName('NodeIterator')
 class NodeIterator native "NodeIterator" {
-
-  @DomName('NodeIterator.expandEntityReferences')
-  @DocsEditable
-  final bool expandEntityReferences;
-
-  @DomName('NodeIterator.filter')
-  @DocsEditable
-  final NodeFilter filter;
+  factory NodeIterator(Node root, int whatToShow) {
+    return document.$dom_createNodeIterator(root, whatToShow, null, false);
+  }
 
   @DomName('NodeIterator.pointerBeforeReferenceNode')
   @DocsEditable
@@ -16364,6 +16120,7 @@
   @DomName('NodeIterator.previousNode')
   @DocsEditable
   Node previousNode() 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
@@ -17060,43 +16817,6 @@
 
 
 @DocsEditable
-@DomName('PagePopupController')
-class PagePopupController native "PagePopupController" {
-
-  @DomName('PagePopupController.closePopup')
-  @DocsEditable
-  void closePopup() native;
-
-  @DomName('PagePopupController.formatMonth')
-  @DocsEditable
-  String formatMonth(int year, int zeroBaseMonth) native;
-
-  @DomName('PagePopupController.formatShortMonth')
-  @DocsEditable
-  String formatShortMonth(int year, int zeroBaseMonth) native;
-
-  @DomName('PagePopupController.histogramEnumeration')
-  @DocsEditable
-  void histogramEnumeration(String name, int sample, int boundaryValue) native;
-
-  @DomName('PagePopupController.localizeNumberString')
-  @DocsEditable
-  String localizeNumberString(String numberString) native;
-
-  @DomName('PagePopupController.setValue')
-  @DocsEditable
-  void setValue(String value) native;
-
-  @DomName('PagePopupController.setValueAndClosePopup')
-  @DocsEditable
-  void setValueAndClosePopup(int numberValue, String stringValue) 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
 @DomName('PageTransitionEvent')
 class PageTransitionEvent extends Event native "PageTransitionEvent" {
 
@@ -18080,7 +17800,7 @@
   factory RtcPeerConnection(Map rtcIceServers, [Map mediaConstraints]) {
     var constructorName = JS('RtcPeerConnection', 'window[#]',
         '${Device.propertyPrefix}RTCPeerConnection');
-    if (?mediaConstraints) {
+    if (mediaConstraints != null) {
       return JS('RtcPeerConnection', 'new #(#,#)', constructorName,
           convertDartToNative_SerializedScriptValue(rtcIceServers),
           convertDartToNative_SerializedScriptValue(mediaConstraints));
@@ -18776,14 +18496,14 @@
   // does not operate as a List.
   List<OptionElement> get options {
     var options = this.children.where((e) => e is OptionElement).toList();
-    return new UnmodifiableListView<OptionElement>(options);
+    return new UnmodifiableListView(options);
   }
 
   List<OptionElement> get selectedOptions {
     // IE does not change the selected flag for single-selection items.
     if (this.multiple) {
       var options = this.options.where((o) => o.selected).toList();
-      return new UnmodifiableListView<OptionElement>(options);
+      return new UnmodifiableListView(options);
     } else {
       return [this.options[this.selectedIndex]];
     }
@@ -21648,14 +21368,16 @@
   @DocsEditable
   final String pseudoElement;
 }
-// Copyright (c) 2012, 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.
 
 
-@DocsEditable
 @DomName('TreeWalker')
 class TreeWalker native "TreeWalker" {
+  factory TreeWalker(Node root, int whatToShow) {
+    return document.$dom_createTreeWalker(root, whatToShow, null, false);
+  }
 
   @DomName('TreeWalker.currentNode')
   @DocsEditable
@@ -21704,6 +21426,7 @@
   @DomName('TreeWalker.previousSibling')
   @DocsEditable
   Node previousSibling() 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
@@ -22822,10 +22545,6 @@
   @DocsEditable
   final int outerWidth;
 
-  @DomName('DOMWindow.pagePopupController')
-  @DocsEditable
-  final PagePopupController pagePopupController;
-
   @DomName('DOMWindow.pageXOffset')
   @DocsEditable
   final int pageXOffset;
@@ -24588,6 +24307,15 @@
 
 
 @DocsEditable
+@DomName('EntityReference')
+abstract class _EntityReference extends Node native "EntityReference" {
+}
+// 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('EntryArray')
 class _EntryArray implements JavaScriptIndexingBehavior, List<Entry> native "EntryArray" {
 
@@ -25586,6 +25314,15 @@
 
 
 @DocsEditable
+@DomName('PagePopupController')
+abstract class _PagePopupController native "PagePopupController" {
+}
+// 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('RGBColor')
 abstract class _RGBColor native "RGBColor" {
 }
@@ -29268,7 +29005,7 @@
  * A list which just wraps another list, for either intercepting list calls or
  * retyping the list (for example, from List<A> to List<B> where B extends A).
  */
-class _WrappedList<E> implements List<E> {
+class _WrappedList<E> extends ListBase<E> {
   final List _list;
 
   _WrappedList(this._list);
@@ -29277,73 +29014,14 @@
 
   Iterator<E> get iterator => new _WrappedIterator(_list.iterator);
 
-  Iterable map(f(E element)) => _list.map(f);
-
-  Iterable<E> where(bool f(E element)) => _list.where(f);
-
-  Iterable expand(Iterable f(E element)) => _list.expand(f);
-
-  bool contains(E element) => _list.contains(element);
-
-  void forEach(void f(E element)) { _list.forEach(f); }
-
-  E reduce(E combine(E value, E element)) =>
-      _list.reduce(combine);
-
-  dynamic fold(initialValue, combine(previousValue, E element)) =>
-      _list.fold(initialValue, combine);
-
-  bool every(bool f(E element)) => _list.every(f);
-
-  String join([String separator = ""]) => _list.join(separator);
-
-  bool any(bool f(E element)) => _list.any(f);
-
-  List<E> toList({ bool growable: true }) =>
-      new List.from(_list, growable: growable);
-
-  Set<E> toSet() => _list.toSet();
-
   int get length => _list.length;
 
-  bool get isEmpty => _list.isEmpty;
-
-  Iterable<E> take(int n) => _list.take(n);
-
-  Iterable<E> takeWhile(bool test(E value)) => _list.takeWhile(test);
-
-  Iterable<E> skip(int n) => _list.skip(n);
-
-  Iterable<E> skipWhile(bool test(E value)) => _list.skipWhile(test);
-
-  E get first => _list.first;
-
-  E get last => _list.last;
-
-  E get single => _list.single;
-
-  E firstWhere(bool test(E value), { E orElse() }) =>
-      _list.firstWhere(test, orElse: orElse);
-
-  E lastWhere(bool test(E value), {E orElse()}) =>
-      _list.lastWhere(test, orElse: orElse);
-
-  E singleWhere(bool test(E value)) => _list.singleWhere(test);
-
-  E elementAt(int index) => _list.elementAt(index);
-
   // Collection APIs
 
   void add(E element) { _list.add(element); }
 
-  void addAll(Iterable<E> elements) { _list.addAll(elements); }
-
   void remove(Object element) { _list.remove(element); }
 
-  void removeWhere(bool test(E element)) { _list.removeWhere(test); }
-
-  void retainWhere(bool test(E element)) { _list.retainWhere(test); }
-
   void clear() { _list.clear(); }
 
   // List APIs
@@ -29354,8 +29032,6 @@
 
   void set length(int newLength) { _list.length = newLength; }
 
-  Iterable<E> get reversed => _list.reversed;
-
   void sort([int compare(E a, E b)]) { _list.sort(compare); }
 
   int indexOf(E element, [int start = 0]) => _list.indexOf(element, start);
@@ -29364,20 +29040,8 @@
 
   void insert(int index, E element) => _list.insert(index, element);
 
-  void insertAll(int index, Iterable<E> iterable) =>
-      _list.insertAll(index, iterable);
-
-  void setAll(int index, Iterable<E> iterable) =>
-      _list.setAll(index, iterable);
-
   E removeAt(int index) => _list.removeAt(index);
 
-  E removeLast() => _list.removeLast();
-
-  List<E> sublist(int start, [int end]) => _list.sublist(start, end);
-
-  Iterable<E> getRange(int start, int end) => _list.getRange(start, end);
-
   void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
     _list.setRange(start, end, iterable, skipCount);
   }
@@ -29391,15 +29055,6 @@
   void fillRange(int start, int end, [E fillValue]) {
     _list.fillRange(start, end, fillValue);
   }
-
-  Map<int, E> asMap() => _list.asMap();
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
 }
 
 /**
@@ -29858,7 +29513,19 @@
 
 
 class Platform {
+  /**
+   * Returns true if dart:typed_data types are supported on this
+   * browser.  If false, using these types will generate a runtime
+   * error.
+   */
   static final supportsTypedData = JS('bool', '!!(window.ArrayBuffer)');
+
+  /**
+   * Returns true if SIMD types in dart:typed_data types are supported
+   * on this browser.  If false, using these types will generate a runtime
+   * error.
+   */
+  static final supportsSimd = false;
 }
 // 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
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index 78cd7cb..39e95a4 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -85,7 +85,7 @@
 
   @DomName('AbstractWorker.errorEvent')
   @DocsEditable
-  static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
+  static const EventStreamProvider<ErrorEvent> errorEvent = const EventStreamProvider<ErrorEvent>('error');
 
   @DomName('AbstractWorker.addEventListener')
   @DocsEditable
@@ -101,7 +101,7 @@
 
   @DomName('AbstractWorker.onerror')
   @DocsEditable
-  Stream<Event> get onError => errorEvent.forTarget(this);
+  Stream<ErrorEvent> get onError => errorEvent.forTarget(this);
 
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -6669,6 +6669,10 @@
   @DocsEditable
   Event $dom_createEvent(String eventType) native "Document_createEvent_Callback";
 
+  @DomName('Document.createNodeIterator')
+  @DocsEditable
+  NodeIterator $dom_createNodeIterator(Node root, int whatToShow, NodeFilter filter, bool expandEntityReferences) native "Document_createNodeIterator_Callback";
+
   @DomName('Document.createRange')
   @DocsEditable
   Range $dom_createRange() native "Document_createRange_Callback";
@@ -6686,6 +6690,10 @@
   @DocsEditable
   TouchList $dom_createTouchList() native "Document_createTouchList_Callback";
 
+  @DomName('Document.createTreeWalker')
+  @DocsEditable
+  TreeWalker $dom_createTreeWalker(Node root, int whatToShow, NodeFilter filter, bool expandEntityReferences) native "Document_createTreeWalker_Callback";
+
   @DomName('Document.elementFromPoint')
   @DocsEditable
   Element $dom_elementFromPoint(int x, int y) native "Document_elementFromPoint_Callback";
@@ -8342,8 +8350,6 @@
 // BSD-style license that can be found in the LICENSE file.
 
 
-// TODO(jacobr): use _Lists.dart to remove some of the duplicated
-// functionality.
 class _ChildrenElementList extends ListBase<Element> {
   // Raw Element.
   final Element _element;
@@ -8353,106 +8359,13 @@
     : _childElements = element.$dom_children,
       _element = element;
 
-  List<Element> toList({ bool growable: true }) {
-    List<Element> output;
-    if (growable) {
-      output = <Element>[];
-      output.length = _childElements.length;
-    } else {
-      output = new List<Element>(_childElements.length);
-    }
-    for (int i = 0, len = _childElements.length; i < len; i++) {
-      output[i] = _childElements[i];
-    }
-    return output;
-  }
-
-  Set<Element> toSet() {
-    final output = new Set<Element>();
-    for (int i = 0, len = _childElements.length; i < len; i++) {
-      output.add(_childElements[i]);
-    }
-    return output;
-  }
-
   bool contains(Element element) => _childElements.contains(element);
 
-  void forEach(void f(Element element)) {
-    for (Element element in _childElements) {
-      f(element);
-    }
-  }
-
-  bool every(bool f(Element element)) {
-    for (Element element in this) {
-      if (!f(element)) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  bool any(bool f(Element element)) {
-    for (Element element in this) {
-      if (f(element)) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  String join([String separator = ""]) {
-    return _childElements.join(separator);
-  }
-
-  Iterable map(f(Element element)) {
-    return _childElements.map(f);
-  }
-
-  Iterable<Element> where(bool f(Element element)) {
-    return _childElements.where(f);
-  }
-
-  Iterable expand(Iterable f(Element element)) {
-    return _childElements.expand(f);
-  }
 
   bool get isEmpty {
     return _element.$dom_firstElementChild == null;
   }
 
-  Iterable<Element> take(int n) {
-    return _childElements.take(n);
-  }
-
-  Iterable<Element> takeWhile(bool test(Element value)) {
-    return _childElements.takeWhile(test);
-  }
-
-  Iterable<Element> skip(int n) {
-    return _childElements.skip(n);
-  }
-
-  Iterable<Element> skipWhile(bool test(Element value)) {
-    return _childElements.skipWhile(test);
-  }
-
-  Element firstWhere(bool test(Element value), {Element orElse()}) {
-    return _childElements.firstWhere(test, orElse: orElse);
-  }
-
-  Element lastWhere(bool test(Element value), {Element orElse()}) {
-    return _childElements.lastWhere(test, orElse: orElse);
-  }
-
-  Element singleWhere(bool test(Element value)) {
-    return _childElements.singleWhere(test);
-  }
-
-  Element elementAt(int index) {
-    return this[index];
-  }
-
   int get length {
     return _childElements.length;
   }
@@ -8467,7 +8380,7 @@
 
   void set length(int newLength) {
     // TODO(jacobr): remove children when length is reduced.
-    throw new UnsupportedError('');
+    throw new UnsupportedError('Cannot resize element lists');
   }
 
   Element add(Element value) {
@@ -8487,21 +8400,8 @@
     }
   }
 
-  Iterable<Element> get reversed {
-    return _childElements.reversed;
-  }
-
   void sort([int compare(Element a, Element b)]) {
-    throw new UnsupportedError('TODO(jacobr): should we impl?');
-  }
-
-  Element reduce(Element combine(Element value, Element element)) {
-    return _childElements.reduce(combine);
-  }
-
-  dynamic fold(dynamic initialValue,
-      dynamic combine(dynamic previousValue, Element element)) {
-    return _childElements.fold(initialValue, combine);
+    throw new UnsupportedError('Cannot sort element lists');
   }
 
   void setRange(int start, int end, Iterable<Element> iterable,
@@ -8528,36 +8428,6 @@
     return false;
   }
 
-  void removeWhere(bool test(Element element)) {
-    _childElements.removeWhere(test);
-  }
-
-  void retainWhere(bool test(Element element)) {
-    _childElements.retainWhere(test);
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnimplementedError();
-  }
-
-  Iterable getRange(int start, int end)  {
-    throw new UnimplementedError();
-  }
-
-  List sublist(int start, [int end]) {
-    if (end == null) end = length;
-    return new _FrozenElementList._wrap(Lists.getRange(this, start, end, []));
-  }
-
-  int indexOf(Element element, [int start = 0]) {
-    return Lists.indexOf(this, element, start, this.length);
-  }
-
-  int lastIndexOf(Element element, [int start = null]) {
-    if (start == null) start = length - 1;
-    return Lists.lastIndexOf(this, element, start);
-  }
-
   void insert(int index, Element element) {
     if (index < 0 || index > length) {
       throw new RangeError.range(index, 0, length);
@@ -8569,10 +8439,6 @@
     }
   }
 
-  void insertAll(int index, Iterable<Element> iterable) {
-    throw new UnimplementedError();
-  }
-
   void setAll(int index, Iterable<Element> iterable) {
     throw new UnimplementedError();
   }
@@ -8615,24 +8481,13 @@
     if (length > 1) throw new StateError("More than one element");
     return first;
   }
-
-  Map<int, Element> asMap() {
-    return _childElements.asMap();
-  }
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
 }
 
 // TODO(jacobr): this is an inefficient implementation but it is hard to see
 // a better option given that we cannot quite force NodeList to be an
 // ElementList as there are valid cases where a NodeList JavaScript object
 // contains Node objects that are not Elements.
-class _FrozenElementList extends ListBase {
+class _FrozenElementList<T extends Element> extends ListBase<T> {
   final List<Node> _nodeList;
 
   _FrozenElementList._wrap(this._nodeList);
@@ -8642,60 +8497,15 @@
   Element operator [](int index) => _nodeList[index];
 
   void operator []=(int index, Element value) {
-    throw new UnsupportedError('');
+    throw new UnsupportedError('Cannot modify list');
   }
 
   void set length(int newLength) {
-    _nodeList.length = newLength;
+    throw new UnsupportedError('Cannot modify list');
   }
 
-  void add(Element value) {
-    throw new UnsupportedError('');
-  }
-
-  void addAll(Iterable<Element> iterable) {
-    throw new UnsupportedError('');
-  }
-
-  void sort([int compare(Element a, Element b)]) {
-    throw new UnsupportedError('');
-  }
-
-  void setRange(int start, int end, Iterable<Element> iterable,
-                [int skipCount = 0]) {
-    throw new UnsupportedError('');
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnsupportedError('');
-  }
-
-  List<Element> sublist(int start, [int end]) {
-    return new _FrozenElementList._wrap(_nodeList.sublist(start, end));
-  }
-
-  void clear() {
-    throw new UnsupportedError('');
-  }
-
-  Element removeAt(int index) {
-    throw new UnsupportedError('');
-  }
-
-  Element removeLast() {
-    throw new UnsupportedError('');
-  }
-
-  bool remove(Object element) {
-    throw new UnsupportedError('');
-  }
-
-  void removeWhere(bool test(Element element)) {
-    throw new UnsupportedError('');
-  }
-
-  void retainWhere(bool test(Element element)) {
-    throw new UnsupportedError('');
+  void sort([Comparator<Element> compare]) {
+    throw new UnsupportedError('Cannot sort list');
   }
 
   Element get first => _nodeList.first;
@@ -8703,13 +8513,6 @@
   Element get last => _nodeList.last;
 
   Element get single => _nodeList.single;
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
 }
 
 class _ElementCssClassSet extends CssClassSet {
@@ -10013,19 +9816,6 @@
 // WARNING: Do not edit - generated code.
 
 
-@DocsEditable
-@DomName('EntityReference')
-class EntityReference extends Node {
-  EntityReference.internal() : super.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.
-
-
 typedef void _EntriesCallback(List<Entry> entries);
 // 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
@@ -10209,7 +9999,7 @@
   factory Event(String type,
       {bool canBubble: true, bool cancelable: true}) {
     return new Event.eventType('Event', type, canBubble: canBubble,
-        cancelable: canBubble);
+        cancelable: cancelable);
   }
 
   /**
@@ -16972,11 +16762,12 @@
   }
 
   void insertAll(int index, Iterable<Node> iterable) {
-    throw new UnimplementedError();
+    var item = this[index];
+    _this.insertAllBefore(iterable, item);
   }
 
   void setAll(int index, Iterable<Node> iterable) {
-    throw new UnimplementedError();
+    throw new UnsupportedError("Cannot setAll on Node list");
   }
 
   Node removeLast() {
@@ -17035,53 +16826,22 @@
 
   Iterator<Node> get iterator => _this.$dom_childNodes.iterator;
 
-  List<Node> toList({ bool growable: true }) =>
-      new List<Node>.from(this, growable: growable);
-  Set<Node> toSet() => new Set<Node>.from(this);
-
-  bool get isEmpty => this.length == 0;
-
   // From List<Node>:
 
   // TODO(jacobr): this could be implemented for child node lists.
   // The exception we throw here is misleading.
-  void sort([int compare(Node a, Node b)]) {
-    throw new UnsupportedError("Cannot sort immutable List.");
+  void sort([Comparator<Node> compare]) {
+    throw new UnsupportedError("Cannot sort Node list");
   }
 
   // FIXME: implement these.
   void setRange(int start, int end, Iterable<Node> iterable,
                 [int skipCount = 0]) {
-    throw new UnsupportedError(
-        "Cannot setRange on immutable List.");
-  }
-  void removeRange(int start, int end) {
-    throw new UnsupportedError(
-        "Cannot removeRange on immutable List.");
+    throw new UnsupportedError("Cannot setRange on Node list");
   }
 
-  Iterable<Node> getRange(int start, int end) {
-    throw new UnimplementedError("NodeList.getRange");
-  }
-
-  void replaceRange(int start, int end, Iterable<Node> iterable) {
-    throw new UnimplementedError("NodeList.replaceRange");
-  }
-
-  void fillRange(int start, int end, [Node fillValue]) {
-    throw new UnimplementedError("NodeList.fillRange");
-  }
-
-  List<Node> sublist(int start, [int end]) {
-    if (end == null) end == length;
-    return Lists.getRange(this, start, end, <Node>[]);
-  }
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
+  void fillRange(int start, int end, [Node fill]) {
+    throw new UnsupportedError("Cannot fillRange on Node list");
   }
   // -- end List<Node> mixins.
 
@@ -17420,31 +17180,19 @@
 
   static const int SHOW_TEXT = 0x00000004;
 
-  @DomName('NodeFilter.acceptNode')
-  @DocsEditable
-  int acceptNode(Node n) native "NodeFilter_acceptNode_Callback";
-
 }
-// Copyright (c) 2012, 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.
 
-// WARNING: Do not edit - generated code.
 
-
-@DocsEditable
 @DomName('NodeIterator')
 class NodeIterator extends NativeFieldWrapperClass1 {
+  factory NodeIterator(Node root, int whatToShow) {
+    return document.$dom_createNodeIterator(root, whatToShow, null, false);
+  }
   NodeIterator.internal();
 
-  @DomName('NodeIterator.expandEntityReferences')
-  @DocsEditable
-  bool get expandEntityReferences native "NodeIterator_expandEntityReferences_Getter";
-
-  @DomName('NodeIterator.filter')
-  @DocsEditable
-  NodeFilter get filter native "NodeIterator_filter_Getter";
-
   @DomName('NodeIterator.pointerBeforeReferenceNode')
   @DocsEditable
   bool get pointerBeforeReferenceNode native "NodeIterator_pointerBeforeReferenceNode_Getter";
@@ -18270,47 +18018,6 @@
 
 
 @DocsEditable
-@DomName('PagePopupController')
-class PagePopupController extends NativeFieldWrapperClass1 {
-  PagePopupController.internal();
-
-  @DomName('PagePopupController.closePopup')
-  @DocsEditable
-  void closePopup() native "PagePopupController_closePopup_Callback";
-
-  @DomName('PagePopupController.formatMonth')
-  @DocsEditable
-  String formatMonth(int year, int zeroBaseMonth) native "PagePopupController_formatMonth_Callback";
-
-  @DomName('PagePopupController.formatShortMonth')
-  @DocsEditable
-  String formatShortMonth(int year, int zeroBaseMonth) native "PagePopupController_formatShortMonth_Callback";
-
-  @DomName('PagePopupController.histogramEnumeration')
-  @DocsEditable
-  void histogramEnumeration(String name, int sample, int boundaryValue) native "PagePopupController_histogramEnumeration_Callback";
-
-  @DomName('PagePopupController.localizeNumberString')
-  @DocsEditable
-  String localizeNumberString(String numberString) native "PagePopupController_localizeNumberString_Callback";
-
-  @DomName('PagePopupController.setValue')
-  @DocsEditable
-  void setValue(String value) native "PagePopupController_setValue_Callback";
-
-  @DomName('PagePopupController.setValueAndClosePopup')
-  @DocsEditable
-  void setValueAndClosePopup(int numberValue, String stringValue) native "PagePopupController_setValueAndClosePopup_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
 @DomName('PageTransitionEvent')
 class PageTransitionEvent extends Event {
   PageTransitionEvent.internal() : super.internal();
@@ -20149,14 +19856,14 @@
   // does not operate as a List.
   List<OptionElement> get options {
     var options = this.children.where((e) => e is OptionElement).toList();
-    return new UnmodifiableListView<OptionElement>(options);
+    return new UnmodifiableListView(options);
   }
 
   List<OptionElement> get selectedOptions {
     // IE does not change the selected flag for single-selection items.
     if (this.multiple) {
       var options = this.options.where((o) => o.selected).toList();
-      return new UnmodifiableListView<OptionElement>(options);
+      return new UnmodifiableListView(options);
     } else {
       return [this.options[this.selectedIndex]];
     }
@@ -23404,16 +23111,16 @@
   String get pseudoElement native "TransitionEvent_pseudoElement_Getter";
 
 }
-// Copyright (c) 2012, 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.
 
-// WARNING: Do not edit - generated code.
 
-
-@DocsEditable
 @DomName('TreeWalker')
 class TreeWalker extends NativeFieldWrapperClass1 {
+  factory TreeWalker(Node root, int whatToShow) {
+    return document.$dom_createTreeWalker(root, whatToShow, null, false);
+  }
   TreeWalker.internal();
 
   @DomName('TreeWalker.currentNode')
@@ -24407,10 +24114,6 @@
   @DocsEditable
   int get outerWidth native "DOMWindow_outerWidth_Getter";
 
-  @DomName('DOMWindow.pagePopupController')
-  @DocsEditable
-  PagePopupController get pagePopupController native "DOMWindow_pagePopupController_Getter";
-
   @DomName('DOMWindow.pageXOffset')
   @DocsEditable
   int get pageXOffset native "DOMWindow_pageXOffset_Getter";
@@ -26362,6 +26065,19 @@
 
 
 @DocsEditable
+@DomName('EntityReference')
+abstract class _EntityReference extends Node {
+  _EntityReference.internal() : super.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('EntryArray')
 class _EntryArray extends NativeFieldWrapperClass1 implements List<Entry> {
   _EntryArray.internal();
@@ -27422,6 +27138,19 @@
 
 
 @DocsEditable
+@DomName('PagePopupController')
+abstract class _PagePopupController extends NativeFieldWrapperClass1 {
+  _PagePopupController.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('RGBColor')
 abstract class _RGBColor extends NativeFieldWrapperClass1 {
   _RGBColor.internal();
@@ -30573,7 +30302,7 @@
  * A list which just wraps another list, for either intercepting list calls or
  * retyping the list (for example, from List<A> to List<B> where B extends A).
  */
-class _WrappedList<E> implements List<E> {
+class _WrappedList<E> extends ListBase<E> {
   final List _list;
 
   _WrappedList(this._list);
@@ -30582,73 +30311,14 @@
 
   Iterator<E> get iterator => new _WrappedIterator(_list.iterator);
 
-  Iterable map(f(E element)) => _list.map(f);
-
-  Iterable<E> where(bool f(E element)) => _list.where(f);
-
-  Iterable expand(Iterable f(E element)) => _list.expand(f);
-
-  bool contains(E element) => _list.contains(element);
-
-  void forEach(void f(E element)) { _list.forEach(f); }
-
-  E reduce(E combine(E value, E element)) =>
-      _list.reduce(combine);
-
-  dynamic fold(initialValue, combine(previousValue, E element)) =>
-      _list.fold(initialValue, combine);
-
-  bool every(bool f(E element)) => _list.every(f);
-
-  String join([String separator = ""]) => _list.join(separator);
-
-  bool any(bool f(E element)) => _list.any(f);
-
-  List<E> toList({ bool growable: true }) =>
-      new List.from(_list, growable: growable);
-
-  Set<E> toSet() => _list.toSet();
-
   int get length => _list.length;
 
-  bool get isEmpty => _list.isEmpty;
-
-  Iterable<E> take(int n) => _list.take(n);
-
-  Iterable<E> takeWhile(bool test(E value)) => _list.takeWhile(test);
-
-  Iterable<E> skip(int n) => _list.skip(n);
-
-  Iterable<E> skipWhile(bool test(E value)) => _list.skipWhile(test);
-
-  E get first => _list.first;
-
-  E get last => _list.last;
-
-  E get single => _list.single;
-
-  E firstWhere(bool test(E value), { E orElse() }) =>
-      _list.firstWhere(test, orElse: orElse);
-
-  E lastWhere(bool test(E value), {E orElse()}) =>
-      _list.lastWhere(test, orElse: orElse);
-
-  E singleWhere(bool test(E value)) => _list.singleWhere(test);
-
-  E elementAt(int index) => _list.elementAt(index);
-
   // Collection APIs
 
   void add(E element) { _list.add(element); }
 
-  void addAll(Iterable<E> elements) { _list.addAll(elements); }
-
   void remove(Object element) { _list.remove(element); }
 
-  void removeWhere(bool test(E element)) { _list.removeWhere(test); }
-
-  void retainWhere(bool test(E element)) { _list.retainWhere(test); }
-
   void clear() { _list.clear(); }
 
   // List APIs
@@ -30659,8 +30329,6 @@
 
   void set length(int newLength) { _list.length = newLength; }
 
-  Iterable<E> get reversed => _list.reversed;
-
   void sort([int compare(E a, E b)]) { _list.sort(compare); }
 
   int indexOf(E element, [int start = 0]) => _list.indexOf(element, start);
@@ -30669,20 +30337,8 @@
 
   void insert(int index, E element) => _list.insert(index, element);
 
-  void insertAll(int index, Iterable<E> iterable) =>
-      _list.insertAll(index, iterable);
-
-  void setAll(int index, Iterable<E> iterable) =>
-      _list.setAll(index, iterable);
-
   E removeAt(int index) => _list.removeAt(index);
 
-  E removeLast() => _list.removeLast();
-
-  List<E> sublist(int start, [int end]) => _list.sublist(start, end);
-
-  Iterable<E> getRange(int start, int end) => _list.getRange(start, end);
-
   void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
     _list.setRange(start, end, iterable, skipCount);
   }
@@ -30696,15 +30352,6 @@
   void fillRange(int start, int end, [E fillValue]) {
     _list.fillRange(start, end, fillValue);
   }
-
-  Map<int, E> asMap() => _list.asMap();
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
 }
 
 /**
@@ -30914,7 +30561,19 @@
 
 
 class Platform {
+  /**
+   * Returns true if dart:typed_data types are supported on this
+   * browser.  If false, using these types will generate a runtime
+   * error.
+   */
   static final supportsTypedData = true;
+
+  /**
+   * Returns true if SIMD types in dart:typed_data types are supported
+   * on this browser.  If false, using these types will generate a runtime
+   * error.
+   */
+  static final supportsSimd = 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
@@ -31617,6 +31276,15 @@
     return result;
   }
 
+  static List parseStackTrace(StackTrace stackTrace) {
+    final regExp = new RegExp(r'#\d\s+(.*) \((.*):(\d+):(\d+)\)');
+    List result = [];
+    for (var match in regExp.allMatches(stackTrace.toString())) {
+      result.add([match.group(1), match.group(2), int.parse(match.group(3)), int.parse(match.group(4))]);
+    }
+    return result;
+  }
+
   static void populateMap(Map result, List list) {
     for (int i = 0; i < list.length; i += 2) {
       result[list[i]] = list[i + 1];
diff --git a/sdk/lib/html/html_common/filtered_element_list.dart b/sdk/lib/html/html_common/filtered_element_list.dart
index 4315a2f..61954e6 100644
--- a/sdk/lib/html/html_common/filtered_element_list.dart
+++ b/sdk/lib/html/html_common/filtered_element_list.dart
@@ -8,7 +8,7 @@
  * An indexable collection of a node's descendants in the document tree,
  * filtered so that only elements are in the collection.
  */
-class FilteredElementList extends ListBase<Element> {
+class FilteredElementList<T extends Element> extends ListBase<T> {
   final Node _node;
   final List<Node> _childNodes;
 
@@ -49,8 +49,6 @@
     removeRange(newLength, len);
   }
 
-  String join([String separator = ""]) => _filtered.join(separator);
-
   void add(Element value) {
     _childNodes.add(value);
   }
@@ -62,26 +60,26 @@
   }
 
   bool contains(Element element) {
-    return element is Element && _childNodes.contains(element);
+    return (element != null) && (element.parentNode == _node);
   }
 
   Iterable<Element> get reversed => _filtered.reversed;
 
   void sort([int compare(Element a, Element b)]) {
-    throw new UnsupportedError('TODO(jacobr): should we impl?');
+    throw new UnsupportedError('Cannot sort filtered list');
   }
 
   void setRange(int start, int end, Iterable<Element> iterable,
                 [int skipCount = 0]) {
-    throw new UnimplementedError();
+    throw new UnsupportedError('Cannot setRange on filtered list');
   }
 
   void fillRange(int start, int end, [Element fillValue]) {
-    throw new UnimplementedError();
+    throw new UnsupportedError('Cannot fillRange on filtered list');
   }
 
   void replaceRange(int start, int end, Iterable<Element> iterable) {
-    throw new UnimplementedError();
+    throw new UnsupportedError('Cannot replaceRange on filtered list');
   }
 
   void removeRange(int start, int end) {
@@ -102,10 +100,6 @@
     return result;
   }
 
-  Iterable map(f(Element element)) => _filtered.map(f);
-  Iterable<Element> where(bool f(Element element)) => _filtered.where(f);
-  Iterable expand(Iterable f(Element element)) => _filtered.expand(f);
-
   void insert(int index, Element value) {
     _childNodes.insert(index, value);
   }
@@ -132,80 +126,7 @@
     return false;
   }
 
-
-  Element reduce(Element combine(Element value, Element element)) {
-    return _filtered.reduce(combine);
-  }
-
-  dynamic fold(dynamic initialValue,
-      dynamic combine(dynamic previousValue, Element element)) {
-    return _filtered.fold(initialValue, combine);
-  }
-
-  bool every(bool f(Element element)) => _filtered.every(f);
-  bool any(bool f(Element element)) => _filtered.any(f);
-  List<Element> toList({ bool growable: true }) =>
-      new List<Element>.from(this, growable: growable);
-  Set<Element> toSet() => new Set<Element>.from(this);
-  Element firstWhere(bool test(Element value), {Element orElse()}) {
-    return _filtered.firstWhere(test, orElse: orElse);
-  }
-
-  Element lastWhere(bool test(Element value), {Element orElse()}) {
-    return _filtered.lastWhere(test, orElse: orElse);
-  }
-
-  Element singleWhere(bool test(Element value)) {
-    return _filtered.singleWhere(test);
-  }
-
-  Element elementAt(int index) {
-    return this[index];
-  }
-
-  bool get isEmpty => _filtered.isEmpty;
   int get length => _filtered.length;
   Element operator [](int index) => _filtered[index];
   Iterator<Element> get iterator => _filtered.iterator;
-  List<Element> sublist(int start, [int end]) =>
-    _filtered.sublist(start, end);
-  Iterable<Element> getRange(int start, int end) =>
-    _filtered.getRange(start, end);
-  int indexOf(Element element, [int start = 0]) =>
-    _filtered.indexOf(element, start);
-
-  int lastIndexOf(Element element, [int start = null]) {
-    if (start == null) start = length - 1;
-    return _filtered.lastIndexOf(element, start);
-  }
-
-  List<Element> take(int n) {
-    return IterableMixinWorkaround.takeList(this, n);
-  }
-
-  Iterable<Element> takeWhile(bool test(Element value)) {
-    return IterableMixinWorkaround.takeWhile(this, test);
-  }
-
-  List<Element> skip(int n) {
-    return IterableMixinWorkaround.skipList(this, n);
-  }
-
-  Iterable<Element> skipWhile(bool test(Element value)) {
-    return IterableMixinWorkaround.skipWhile(this, test);
-  }
-
-  Element get first => _filtered.first;
-
-  Element get last => _filtered.last;
-
-  Element get single => _filtered.single;
-
-  Element min([int compare(Element a, Element b)]) => _filtered.min(compare);
-
-  Element max([int compare(Element a, Element b)]) => _filtered.max(compare);
-
-  Map<int, Element> asMap() {
-    return IterableMixinWorkaround.asMapList(this);
-  }
 }
diff --git a/sdk/lib/io/directory.dart b/sdk/lib/io/directory.dart
index 8c0ad5a..59dc529 100644
--- a/sdk/lib/io/directory.dart
+++ b/sdk/lib/io/directory.dart
@@ -26,7 +26,29 @@
    * Creates a directory object pointing to the current working
    * directory.
    */
-  factory Directory.current() => new _Directory.current();
+  static Directory get current => _Directory.current;
+
+  /**
+   * Sets the current working directory of the Dart process including
+   * all running isolates. The new value set can be either a [Directory]
+   * or a [String].
+   *
+   * The new value is passed to the OS's system call unchanged, so a
+   * relative path passed as the new working directory will be
+   * resolved by the OS.
+   *
+   * Note that setting the current working directory is a synchronous
+   * operation and that it changes the the working directory of *all*
+   * isolates.
+   *
+   * Use this with care - especially when working with asynchronous
+   * operations and multiple isolates. Changing the working directory,
+   * while asynchronous operations are pending or when other isolates
+   * are working with the file system, can lead to unexpected results.
+   */
+  static void set current(path) {
+    _Directory.current = path;
+  }
 
   /**
    * Check whether a directory with this name already exists. Returns
diff --git a/sdk/lib/io/directory_impl.dart b/sdk/lib/io/directory_impl.dart
index 3aaf219..99c0b66 100644
--- a/sdk/lib/io/directory_impl.dart
+++ b/sdk/lib/io/directory_impl.dart
@@ -18,9 +18,9 @@
 
   _Directory(String this._path);
   _Directory.fromPath(Path path) : this(path.toNativePath());
-  _Directory.current() : this(_current());
 
   external static String _current();
+  external static _setCurrent(path);
   external static _createTemp(String template);
   external static int _exists(String path);
   external static _create(String path);
@@ -29,6 +29,18 @@
   external static List _list(String path, bool recursive, bool followLinks);
   external static SendPort _newServicePort();
 
+  static Directory get current => new _Directory(_current());
+
+  static void set current(path) {
+    if (path is Directory) path = path.path;
+    var result = _setCurrent(path);
+    if (result is ArgumentError) throw result;
+    if (result is OSError) {
+      throw new DirectoryIOException(
+          "Setting current working directory failed", path, result);
+    }
+  }
+
   Future<bool> exists() {
     _ensureDirectoryService();
     List request = new List(2);
diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart
index fb9f009..44337ca 100644
--- a/sdk/lib/io/http_impl.dart
+++ b/sdk/lib/io/http_impl.dart
@@ -885,14 +885,12 @@
 
   void _writeHeader() {
     var buffer = new _BufferList();
+
     writeSP() => buffer.add(const [_CharCode.SP]);
+
     writeCRLF() => buffer.add(const [_CharCode.CR, _CharCode.LF]);
 
-    buffer.add(method.codeUnits);
-    writeSP();
-    // Send the path for direct connections and the whole URL for
-    // proxy connections.
-    if (_proxy.isDirect) {
+    void writePath() {
       String path = uri.path;
       if (path.length == 0) path = "/";
       if (uri.query != "") {
@@ -903,8 +901,29 @@
         }
       }
       buffer.add(path.codeUnits);
+    }
+
+    // Write the request method.
+    buffer.add(method.codeUnits);
+    writeSP();
+    // Write the request URI.
+    if (_proxy.isDirect) {
+      writePath();
     } else {
-      buffer.add(uri.toString().codeUnits);
+      if (method == "CONNECT") {
+        // For the connect method the request URI is the host:port of
+        // the requested destination of the tunnel (see RFC 2817
+        // section 5.2)
+        buffer.add(uri.domain.codeUnits);
+        buffer.add(const [_CharCode.COLON]);
+        buffer.add(uri.port.toString().codeUnits);
+      } else {
+        if (_httpClientConnection._proxyTunnel) {
+          writePath();
+        } else {
+          buffer.add(uri.toString().codeUnits);
+        }
+      }
     }
     writeSP();
     buffer.add(_Const.HTTP11);
@@ -1024,20 +1043,22 @@
   Future get done => _doneCompleter.future;
 }
 
-
 class _HttpClientConnection {
   final String key;
   final Socket _socket;
+  final bool _proxyTunnel;
   final _HttpParser _httpParser;
   StreamSubscription _subscription;
   final _HttpClient _httpClient;
+  bool _dispose = false;
 
   Completer<_HttpIncoming> _nextResponseCompleter;
   Future _streamFuture;
 
   _HttpClientConnection(String this.key,
                         Socket this._socket,
-                        _HttpClient this._httpClient)
+                        _HttpClient this._httpClient,
+                        [this._proxyTunnel = false])
       : _httpParser = new _HttpParser.responseParser() {
     _socket.pipe(_httpParser);
 
@@ -1116,7 +1137,8 @@
           _nextResponseCompleter.future
               .then((incoming) {
                 incoming.dataDone.then((_) {
-                  if (incoming.headers.persistentConnection &&
+                  if (!_dispose &&
+                      incoming.headers.persistentConnection &&
                       request.persistentConnection) {
                     // Return connection, now we are done.
                     _httpClient._returnConnection(this);
@@ -1167,7 +1189,41 @@
         .then((_) => _socket.destroy());
   }
 
+  Future<_HttpClientConnection> createProxyTunnel(host, port, proxy) {
+    _HttpClientRequest request =
+        send(new Uri.fromComponents(domain: host, port: port),
+             port,
+             "CONNECT",
+             proxy);
+    if (proxy.isAuthenticated) {
+      // If the proxy configuration contains user information use that
+      // for proxy basic authorization.
+      String auth = CryptoUtils.bytesToBase64(
+          _encodeString("${proxy.username}:${proxy.password}"));
+      request.headers.set(HttpHeaders.PROXY_AUTHORIZATION, "Basic $auth");
+    }
+    return request.close()
+        .then((response) {
+          if (response.statusCode != HttpStatus.OK) {
+            throw "Proxy failed to establish tunnel "
+                  "(${response.statusCode} ${response.reasonPhrase})";
+          }
+          var socket = response._httpRequest._httpClientConnection._socket;
+          return SecureSocket.secure(socket, host: host);
+        })
+        .then((secureSocket) {
+          String key = _HttpClientConnection.makeKey(true, host, port);
+          return new _HttpClientConnection(
+              key, secureSocket, request._httpClient, true);
+        });
+  }
+
   HttpConnectionInfo get connectionInfo => _HttpConnectionInfo.create(_socket);
+
+  static makeKey(bool isSecure, String host, int port) {
+    return isSecure ? "ssh:$host:$port" : "$host:$port";
+  }
+
 }
 
 class _ConnnectionInfo {
@@ -1275,8 +1331,11 @@
     if (method == null) {
       throw new ArgumentError(method);
     }
-    if (uri.domain.isEmpty || (uri.scheme != "http" && uri.scheme != "https")) {
-      throw new ArgumentError("Unsupported scheme '${uri.scheme}' in $uri");
+    if (method != "CONNECT") {
+      if (uri.domain.isEmpty ||
+          (uri.scheme != "http" && uri.scheme != "https")) {
+        throw new ArgumentError("Unsupported scheme '${uri.scheme}' in $uri");
+      }
     }
 
     bool isSecure = (uri.scheme == "https");
@@ -1364,7 +1423,7 @@
       _Proxy proxy = proxies.current;
       String host = proxy.isDirect ? uriHost: proxy.host;
       int port = proxy.isDirect ? uriPort: proxy.port;
-      String key = isSecure ? "ssh:$host:$port" : "$host:$port";
+      String key = _HttpClientConnection.makeKey(isSecure, host, port);
       if (_idleConnections.containsKey(key)) {
         var connection = _idleConnections[key].first;
         _idleConnections[key].remove(connection);
@@ -1382,8 +1441,17 @@
         .then((socket) {
           socket.setOption(SocketOption.TCP_NODELAY, true);
           var connection = new _HttpClientConnection(key, socket, this);
-          _activeConnections.add(connection);
-          return new _ConnnectionInfo(connection, proxy);
+          if (isSecure && !proxy.isDirect) {
+            connection._dispose = true;
+            return connection.createProxyTunnel(uriHost, uriPort, proxy)
+                .then((tunnel) {
+                  _activeConnections.add(tunnel);
+                  return new _ConnnectionInfo(tunnel, proxy);
+                });
+          } else {
+            _activeConnections.add(connection);
+            return new _ConnnectionInfo(connection, proxy);
+          }
         }, onError: (error) {
           // Continue with next proxy.
           return connect(error);
diff --git a/sdk/lib/io/secure_socket.dart b/sdk/lib/io/secure_socket.dart
index db82ea4..9b4d4c6 100644
--- a/sdk/lib/io/secure_socket.dart
+++ b/sdk/lib/io/secure_socket.dart
@@ -60,12 +60,18 @@
    * [:pause:] on this subscription before starting TLS handshake is
    * the right thing to do.
    *
+   * If the [host] argument is passed it will be used as the host name
+   * for the TLS handshake. If [host] is not passed the host name from
+   * the [socket] will be used. The [host] can be either a [String] or
+   * an [InternetAddress].
+   *
    * See [connect] for more information on the arguments.
    *
    */
   static Future<SecureSocket> secure(
       Socket socket,
-      {bool sendClientCertificate: false,
+      {host,
+       bool sendClientCertificate: false,
        String certificateName,
        bool onBadCertificate(X509Certificate certificate)}) {
     var completer = new Completer();
@@ -74,6 +80,7 @@
           return RawSecureSocket.secure(
             detachedRaw[0],
             subscription: detachedRaw[1],
+            host: host,
             sendClientCertificate: sendClientCertificate,
             onBadCertificate: onBadCertificate);
           })
@@ -240,11 +247,14 @@
   static Future<RawSecureSocket> secure(
       RawSocket socket,
       {StreamSubscription subscription,
+       host,
        bool sendClientCertificate: false,
        String certificateName,
        bool onBadCertificate(X509Certificate certificate)}) {
+    socket.readEventsEnabled = false;
+    socket.writeEventsEnabled = false;
     return  _RawSecureSocket.connect(
-        socket.address,
+        host != null ? host : socket.address,
         socket.port,
         certificateName,
         is_server: false,
@@ -282,6 +292,8 @@
        List<int> carryOverData,
        bool requestClientCertificate: false,
        bool requireClientCertificate: false}) {
+    socket.readEventsEnabled = false;
+    socket.writeEventsEnabled = false;
     return _RawSecureSocket.connect(
         socket.remoteHost,
         socket.remotePort,
@@ -449,7 +461,7 @@
         _socketSubscription.onDone(_doneHandler);
       }
       _connectPending = true;
-      _secureFilter.connect(rawSocket.address.host,
+      _secureFilter.connect(address.host,
                             port,
                             is_server,
                             certificateName,
diff --git a/sdk/lib/io/socket.dart b/sdk/lib/io/socket.dart
index 344b0a9..6ad9592 100644
--- a/sdk/lib/io/socket.dart
+++ b/sdk/lib/io/socket.dart
@@ -6,12 +6,12 @@
 
 
 /**
- * [InternetAddressType] is the type an [InternetAddress]. Currently, IPv4 and
- * IPv6 are supported.
+ * [InternetAddressType] is the type an [InternetAddress]. Currently,
+ * IP version 4 (IPv4) and IP version 6 (IPv6) are supported.
  */
 class InternetAddressType {
-  static const InternetAddressType IPv4 = const InternetAddressType._(0);
-  static const InternetAddressType IPv6 = const InternetAddressType._(1);
+  static const InternetAddressType IP_V4 = const InternetAddressType._(0);
+  static const InternetAddressType IP_V6 = const InternetAddressType._(1);
   static const InternetAddressType ANY = const InternetAddressType._(-1);
 
   final int _value;
@@ -19,35 +19,60 @@
   const InternetAddressType._(int this._value);
 
   factory InternetAddressType._from(int value) {
-    if (value == 0) return IPv4;
-    if (value == 1) return IPv6;
+    if (value == 0) return IP_V4;
+    if (value == 1) return IP_V6;
     throw new ArgumentError("Invalid type: $value");
   }
 
   /**
-   * Get the name of the type, e.g. "IPv4" or "IPv6".
+   * Get the name of the type, e.g. "IP_V4" or "IP_V6".
    */
   String get name {
     switch (_value) {
       case -1: return "ANY";
-      case 0: return "IPv4";
-      case 1: return "IPv6";
+      case 0: return "IP_V4";
+      case 1: return "IP_V6";
       default: throw new ArgumentError("Invalid InternetAddress");
     }
   }
 
-  String toString() => "InternetAddressType($name)";
+  String toString() => "InternetAddressType: $name";
 }
 
 
 /**
- * The [InternetAddress] is an object reflecting either a remote or a local
- * address, for wich a socket can be connected to or bound on.
- *
+ * The [InternetAddress] is an object reflecting either a remote or a
+ * local address. When combined with a port number, this represents a
+ * endpoint that a socket can connect to or a listening socket can
+ * bind to.
  */
 abstract class InternetAddress {
   /**
-   * The [type] of the [InternetAddress] specified what IP procotol.
+   * IP version 4 loopback address. Use this address when listening on
+   * or connecting to the loopback adapter using IP version 4 (IPv4).
+   */
+  external static InternetAddress get LOOPBACK_IP_V4;
+
+  /**
+   * IP version 6 loopback address. Use this address when listening on
+   * or connecting to the loopback adapter using IP version 6 (IPv6).
+   */
+  external static InternetAddress get LOOPBACK_IP_V6;
+
+  /**
+   * IP version 4 any address. Use this address when listening on
+   * all adapters IP addresses using IP version 4 (IPv4).
+   */
+  external static InternetAddress get ANY_IP_V4;
+
+  /**
+   * IP version 6 any address. Use this address when listening on
+   * all adapters IP addresses using IP version 6 (IPv6).
+   */
+  external static InternetAddress get ANY_IP_V6;
+
+  /**
+   * The [type] of the [InternetAddress] specified what IP protocol.
    */
   InternetAddressType type;
 
@@ -62,13 +87,16 @@
   String get host;
 
   /**
-   * Lookup a host, returning a Future of a list of [InternetAddress]s. If
-   * [type] is [InternetAddressType.ANY], it will lookup both IPv4 and IPv6
-   * addresses. The order of the list depends on the local machine and the DNS
-   * lookup performed, and can as such change over time.
+   * Lookup a host, returning a Future of a list of
+   * [InternetAddress]s. If [type] is [InternetAddressType.ANY], it
+   * will lookup both IP version 4 (IPv4) and IP version 6 (IPv6)
+   * addresses. If [type] is either [InternetAddressType.IP_V4] or
+   * [InternetAddressType.IP_V6] it will only lookup addresses of the
+   * specified type. The order of the list can, and most likely will,
+   * change over time.
    */
   external static Future<List<InternetAddress>> lookup(
-      String host, {InternetAddressType type: InternetAddressType.IPv4});
+      String host, {InternetAddressType type: InternetAddressType.IP_V4});
 }
 
 /**
diff --git a/sdk/lib/typed_data/dart2js/typed_data_dart2js.dart b/sdk/lib/typed_data/dart2js/typed_data_dart2js.dart
index 20d88d2..593870d 100644
--- a/sdk/lib/typed_data/dart2js/typed_data_dart2js.dart
+++ b/sdk/lib/typed_data/dart2js/typed_data_dart2js.dart
@@ -64,6 +64,20 @@
 
   @JSName('BYTES_PER_ELEMENT')
   final int elementSizeInBytes;
+
+  void _invalidIndex(int index, int length) {
+    if (index < 0 || index >= length) {
+      throw new RangeError.range(index, 0, length);
+    } else {
+      throw new ArgumentError('Invalid list index $index');
+    }
+  }
+
+  void _checkBounds(int index, int length) {
+    if (JS('bool', '(# >>> 0 != #)', index, index) || index >= length) {
+      _invalidIndex(index, length);
+    }
+  }
 }
 
 @DocsEditable
@@ -126,6 +140,11 @@
   @Returns('int')
   int _getInt32(int byteOffset, [bool littleEndian]) native;
 
+  @DocsEditable
+  int getInt64(int byteOffset, [Endianness endian=Endianness.BIG_ENDIAN]) {
+    throw new UnsupportedError("Int64 accessor not supported by dart2js.");
+  }
+
   @DomName('DataView.getInt8')
   @DocsEditable
   int getInt8(int byteOffset) native;
@@ -148,6 +167,11 @@
   @Returns('int')
   int _getUint32(int byteOffset, [bool littleEndian]) native;
 
+  @DocsEditable
+  int getUint64(int byteOffset, [Endianness endian=Endianness.BIG_ENDIAN]) {
+    throw new UnsupportedError("Uint64 accessor not supported by dart2js.");
+  }
+
   @DomName('DataView.getUint8')
   @DocsEditable
   int getUint8(int byteOffset) native;
@@ -184,6 +208,11 @@
   @JSName('setInt32')
   void _setInt32(int byteOffset, int value, [bool littleEndian]) native;
 
+  @DocsEditable
+  void setInt64(int byteOffset, int value, [Endianness endian=Endianness.BIG_ENDIAN]) {
+    throw new UnsupportedError("Int64 accessor not supported by dart2js.");
+  }
+
   @DomName('DataView.setInt8')
   @DocsEditable
   void setInt8(int byteOffset, int value) native;
@@ -204,6 +233,11 @@
   @JSName('setUint32')
   void _setUint32(int byteOffset, int value, [bool littleEndian]) native;
 
+  @DocsEditable
+  void setUint64(int byteOffset, int value, [Endianness endian=Endianness.BIG_ENDIAN]) {
+    throw new UnsupportedError("Uint64 accessor not supported by dart2js.");
+  }
+
   @DomName('DataView.setUint8')
   @DocsEditable
   void setUint8(int byteOffset, int value) native;
@@ -233,9 +267,15 @@
   @DocsEditable
   int get length => JS("int", "#.length", this);
 
-  num operator[](int index) => JS("num", "#[#]", this, index);
+  num operator[](int index) {
+    _checkBounds(index, length);
+    return JS("num", "#[#]", this, index);
+  }
 
-  void operator[]=(int index, num value) { JS("void", "#[#] = #", this, index, value); }
+  void operator[]=(int index, num value) {
+    _checkBounds(index, length);
+    JS("void", "#[#] = #", this, index, value);
+  }
   // -- start List<num> mixins.
   // num is the element type.
 
@@ -457,9 +497,15 @@
   @DocsEditable
   int get length => JS("int", "#.length", this);
 
-  num operator[](int index) => JS("num", "#[#]", this, index);
+  num operator[](int index) {
+    _checkBounds(index, length);
+    return JS("num", "#[#]", this, index);
+  }
 
-  void operator[]=(int index, num value) { JS("void", "#[#] = #", this, index, value); }
+  void operator[]=(int index, num value) {
+    _checkBounds(index, length);
+    JS("void", "#[#] = #", this, index, value);
+  }
   // -- start List<num> mixins.
   // num is the element type.
 
@@ -681,9 +727,16 @@
   @DocsEditable
   int get length => JS("int", "#.length", this);
 
-  int operator[](int index) => JS("int", "#[#]", this, index);
+  int operator[](int index) {
+    _checkBounds(index, length);
+    return JS("int", "#[#]", this, index);
+  }
 
-  void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); }  // -- start List<int> mixins.
+  void operator[]=(int index, int value) {
+    _checkBounds(index, length);
+    JS("void", "#[#] = #", this, index, value);
+  }
+  // -- start List<int> mixins.
   // int is the element type.
 
   // From Iterable<int>:
@@ -904,9 +957,16 @@
   @DocsEditable
   int get length => JS("int", "#.length", this);
 
-  int operator[](int index) => JS("int", "#[#]", this, index);
+  int operator[](int index) {
+    _checkBounds(index, length);
+    return JS("int", "#[#]", this, index);
+  }
 
-  void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); }  // -- start List<int> mixins.
+  void operator[]=(int index, int value) {
+    _checkBounds(index, length);
+    JS("void", "#[#] = #", this, index, value);
+  }
+  // -- start List<int> mixins.
   // int is the element type.
 
   // From Iterable<int>:
@@ -1127,9 +1187,16 @@
   @DocsEditable
   int get length => JS("int", "#.length", this);
 
-  int operator[](int index) => JS("int", "#[#]", this, index);
+  int operator[](int index) {
+    _checkBounds(index, length);
+    return JS("int", "#[#]", this, index);
+  }
 
-  void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); }  // -- start List<int> mixins.
+  void operator[]=(int index, int value) {
+    _checkBounds(index, length);
+    JS("void", "#[#] = #", this, index, value);
+  }
+  // -- start List<int> mixins.
   // int is the element type.
 
   // From Iterable<int>:
@@ -1350,9 +1417,16 @@
   @DocsEditable
   int get length => JS("int", "#.length", this);
 
-  int operator[](int index) => JS("int", "#[#]", this, index);
+  int operator[](int index) {
+    _checkBounds(index, length);
+    return JS("int", "#[#]", this, index);
+  }
 
-  void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); }  // -- start List<int> mixins.
+  void operator[]=(int index, int value) {
+    _checkBounds(index, length);
+    JS("void", "#[#] = #", this, index, value);
+  }
+  // -- start List<int> mixins.
   // int is the element type.
 
   // From Iterable<int>:
@@ -1573,9 +1647,16 @@
   @DocsEditable
   int get length => JS("int", "#.length", this);
 
-  int operator[](int index) => JS("int", "#[#]", this, index);
+  int operator[](int index) {
+    _checkBounds(index, length);
+    return JS("int", "#[#]", this, index);
+  }
 
-  void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); }  // -- start List<int> mixins.
+  void operator[]=(int index, int value) {
+    _checkBounds(index, length);
+    JS("void", "#[#] = #", this, index, value);
+  }
+  // -- start List<int> mixins.
   // int is the element type.
 
   // From Iterable<int>:
@@ -1793,9 +1874,16 @@
   // Use implementation from Uint8Array.
   // final int length;
 
-  int operator[](int index) => JS("int", "#[#]", this, index);
+  int operator[](int index) {
+    _checkBounds(index, length);
+    return JS("int", "#[#]", this, index);
+  }
 
-  void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); }  // -- start List<int> mixins.
+  void operator[]=(int index, int value) {
+    _checkBounds(index, length);
+    JS("void", "#[#] = #", this, index, value);
+  }
+  // -- start List<int> mixins.
   // int is the element type.
 
   // From Iterable<int>:
@@ -2016,9 +2104,16 @@
   @DocsEditable
   int get length => JS("int", "#.length", this);
 
-  int operator[](int index) => JS("int", "#[#]", this, index);
+  int operator[](int index) {
+    _checkBounds(index, length);
+    return JS("int", "#[#]", this, index);
+  }
 
-  void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); }  // -- start List<int> mixins.
+  void operator[]=(int index, int value) {
+    _checkBounds(index, length);
+    JS("void", "#[#] = #", this, index, value);
+  }
+  // -- start List<int> mixins.
   // int is the element type.
 
   // From Iterable<int>:
@@ -2249,6 +2344,43 @@
 }
 
 
+abstract class Float32x4List implements List<Float32x4>, TypedData {
+  factory Float32x4List(int length) {
+    throw new UnsupportedError("Float32x4List not supported by dart2js.");
+  }
+
+  factory Float32x4List.view(ByteBuffer buffer,
+			     [int offsetInBytes = 0, int length]) {
+    throw new UnsupportedError("Float32x4List not supported by dart2js.");
+  }
+
+  static const int BYTES_PER_ELEMENT = 16;
+}
+
+
+abstract class Float32x4 {
+  factory Float32x4(double x, double y, double z, double w) {
+    throw new UnsupportedError("Float32x4 not supported by dart2js.");
+  }
+  factory Float32x4.splat(double v) {
+    throw new UnsupportedError("Float32x4 not supported by dart2js.");
+  }
+  factory Float32x4.zero() {
+    throw new UnsupportedError("Float32x4 not supported by dart2js.");
+  }
+}
+
+
+abstract class Uint32x4 {
+  factory Uint32x4(int x, int y, int z, int w) {
+    throw new UnsupportedError("Uint32x4 not supported by dart2js.");
+  }
+  factory Uint32x4.bool(bool x, bool y, bool z, bool w) {
+    throw new UnsupportedError("Uint32x4 not supported by dart2js.");
+  }
+}
+
+
 // TODO(vsm): Eliminate this class and just inline into above.
 class _TypedArrayFactoryProvider {
   static ByteData createByteData(int length) => _B8(length);
diff --git a/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart b/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
index 1dea2a1..1dcc599 100644
--- a/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
+++ b/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
@@ -111,17 +111,17 @@
   // instead of noteOn.
   void start(num when, [num grainOffset, num grainDuration]) {
     if (JS('bool', '!!#.start', this)) {
-      if (?grainDuration) {
+      if (grainDuration != null) {
         JS('void', '#.start(#, #, #)', this, when, grainOffset, grainDuration);
-      } else if (?grainOffset) {
+      } else if (grainOffset != null) {
         JS('void', '#.start(#, #)', this, when, grainOffset);
       } else {
         JS('void', '#.start(#)', this, when);
       }
     } else {
-      if (?grainDuration) {
+      if (grainDuration != null) {
         JS('void', '#.noteOn(#, #, #)', this, when, grainOffset, grainDuration);
-      } else if (?grainOffset) {
+      } else if (grainOffset != null) {
         JS('void', '#.noteOn(#, #)', this, when, grainOffset);
       } else {
         JS('void', '#.noteOn(#)', this, when);
@@ -300,10 +300,10 @@
       [int numberOfInputChannels, int numberOfOutputChannels]) {
     var function = JS('dynamic', '#.createScriptProcessor || '
         '#.createJavaScriptNode', this, this);
-    if (?numberOfOutputChannels) {
+    if (numberOfOutputChannels != null) {
       return JS('ScriptProcessorNode', '#.call(#, #, #, #)', function, this,
           bufferSize, numberOfInputChannels, numberOfOutputChannels);
-    } else if (?numberOfInputChannels) {
+    } else if (numberOfInputChannels != null) {
       return JS('ScriptProcessorNode', '#.call(#, #, #)', function, this,
           bufferSize, numberOfInputChannels);
     } else {
diff --git a/tests/compiler/dart2js/codegen_helper.dart b/tests/compiler/dart2js/codegen_helper.dart
new file mode 100644
index 0000000..f89a80b
--- /dev/null
+++ b/tests/compiler/dart2js/codegen_helper.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.
+
+import 'package:expect/expect.dart';
+
+import 'memory_source_file_helper.dart';
+import "../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart"
+    show SourceString;
+
+Map<String, String> generate(String code, [List<String> options = const []]) {
+  Uri script = currentDirectory.resolve(nativeToUriPath(new Options().script));
+  Uri libraryRoot = script.resolve('../../../sdk/');
+  Uri packageRoot = script.resolve('./packages/');
+
+  MemorySourceFileProvider.MEMORY_SOURCE_FILES = { 'main.dart': code };
+  var provider = new MemorySourceFileProvider();
+  var handler = new FormattingDiagnosticHandler(provider);
+
+  Compiler compiler = new Compiler(provider.readStringFromUri,
+                                   null,
+                                   handler.diagnosticHandler,
+                                   libraryRoot,
+                                   packageRoot,
+                                   options);
+  Uri uri = new Uri('memory:main.dart');
+  Expect.isTrue(compiler.run(uri));
+  Map<String, String> result = new Map<String, String>();
+  for (var element in compiler.backend.generatedCode.keys) {
+    if (element.getCompilationUnit().script.uri != uri) continue;
+    var name = element.name.slowToString();
+    var code = compiler.backend.assembleCode(element);
+    result[name] = code;
+  }
+  return result;
+}
diff --git a/tests/compiler/dart2js/regress_10231_test.dart b/tests/compiler/dart2js/regress_10231_test.dart
new file mode 100644
index 0000000..bc3a36f
--- /dev/null
+++ b/tests/compiler/dart2js/regress_10231_test.dart
@@ -0,0 +1,31 @@
+// 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 http://dartbug.com/10231.
+
+import 'package:expect/expect.dart';
+import 'codegen_helper.dart';
+
+void main() {
+  var code = generate(SOURCE)['test'];
+  Expect.isNotNull(code);
+  Expect.equals(0, new RegExp('add').allMatches(code).length);
+  Expect.equals(3, new RegExp('\\+').allMatches(code).length);
+}
+
+const String SOURCE = """
+test(a, b, c, d) {
+  if (a is !num) throw 'a not num';
+  if (b is !num) throw 'b not num';
+  if (c is !num) throw 'c not num';
+  if (d is !num) throw 'd not num';
+  return a + b + c + d;
+}
+
+main() {
+  test(1, 2, 3, 4);
+  test('x', 'y', 'z', 'w');
+  test([], {}, [], {});
+}
+""";
diff --git a/tests/compiler/dart2js_extra/10216a_test.dart b/tests/compiler/dart2js_extra/10216a_test.dart
new file mode 100644
index 0000000..a023d6c
--- /dev/null
+++ b/tests/compiler/dart2js_extra/10216a_test.dart
@@ -0,0 +1,40 @@
+// 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";
+
+// Tests codegen of methods reached only via mixin.
+
+class A  {
+  foo(x, [y]) => '$x;$y';
+}
+
+class B extends A with M1, M2, M3 {
+}
+
+class M1 {}
+
+class M2 {
+  // These methods are only defined in this non-first, non-last mixin.
+  plain(x) => 'P $x';
+  // Check arity stubs are also available.
+  bar(x, [y]) => '$y,$x';
+}
+
+class M3 {}
+
+makeB() {
+  return [new A(), new B()].last as B;
+}
+
+main() {
+  // makeB enters the compilation worklist after main, so the selectors are
+  // registered before the classes.
+  var b = makeB();
+  Expect.equals('1;2', b.foo(1,2));
+  Expect.equals('2;null', b.foo(2));
+  Expect.equals('P 3', b.plain(3));
+  Expect.equals('100,4', b.bar(4,100));
+  Expect.equals('null,5', b.bar(5));
+}
diff --git a/tests/compiler/dart2js_extra/10216b_test.dart b/tests/compiler/dart2js_extra/10216b_test.dart
new file mode 100644
index 0000000..93394cb
--- /dev/null
+++ b/tests/compiler/dart2js_extra/10216b_test.dart
@@ -0,0 +1,42 @@
+// 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";
+
+// Tests codegen of methods reached only via mixin.
+
+class A  {
+  foo(x, [y]) => '$x;$y';
+}
+
+class B extends A with M1, M2, M3 {
+}
+
+class M1 {}
+
+class M2 {
+  // These methods are only defined in this non-first, non-last mixin.
+  plain(x) => 'P $x';
+  // Check arity stubs are also available.
+  bar(x, [y]) => '$y,$x';
+}
+
+class M3 {}
+
+test() {
+  var b = [new A(), new B()].last as B;
+  Expect.equals('1;2', b.foo(1,2));
+  Expect.equals('2;null', b.foo(2));
+  Expect.equals('P 3', b.plain(3));
+  Expect.equals('100,4', b.bar(4,100));
+  Expect.equals('null,5', b.bar(5));
+}
+
+main() {
+  new A();
+  new B();
+  // 'test' enters the compilation worklist after main, so the classes are
+  // registered before the selectors.
+  test();
+}
diff --git a/tests/compiler/dart2js_native/native_mixin_multiple2_test.dart b/tests/compiler/dart2js_native/native_mixin_multiple2_test.dart
new file mode 100644
index 0000000..cf372f6
--- /dev/null
+++ b/tests/compiler/dart2js_native/native_mixin_multiple2_test.dart
@@ -0,0 +1,42 @@
+// 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";
+
+// Test that native classes can access methods defined only by mixins.
+
+class A native "A" {
+  foo(x, [y]) => '$x;$y';
+}
+
+class B extends A with M1, M2, M3 native "B" {
+}
+
+class M1 {}
+
+class M2 {
+  // These methods are only defined in this non-first, non-last mixin.
+  plain(x) => 'P $x';
+  bar(x, [y]) => '$y,$x';
+}
+
+class M3 {}
+
+makeB() native;
+
+void setup() native """
+function B() {}
+makeB = function(){return new B;};
+""";
+
+main() {
+  setup();
+
+  B b = makeB();
+  Expect.equals('1;2', b.foo(1,2));
+  Expect.equals('2;null', b.foo(2));
+  Expect.equals('P 3', b.plain(3));
+  Expect.equals('100,4', b.bar(4,100));
+  Expect.equals('null,5', b.bar(5));
+}
diff --git a/tests/compiler/dart2js_native/native_mixin_multiple3_test.dart b/tests/compiler/dart2js_native/native_mixin_multiple3_test.dart
new file mode 100644
index 0000000..50340e4
--- /dev/null
+++ b/tests/compiler/dart2js_native/native_mixin_multiple3_test.dart
@@ -0,0 +1,85 @@
+// 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";
+
+// Test that native classes and plain classes can access methods defined only by
+// the same mixin.
+
+
+class D extends Object with M1, M2, M3 {
+}
+
+class E extends D {
+  foo() => 'E.foo';
+}
+
+class M1 { }
+
+class M2 {
+  foo() => 'M2.foo';
+}
+
+class M3 { }
+
+class A native "A" {
+  foo() => 'A.foo';
+}
+
+class B extends A with M1, M2, M3 native "B" {}
+
+class C extends B native "C" {
+  foo() => 'C.foo';
+}
+
+makeA() native;
+makeB() native;
+makeC() native;
+
+void setup() native """
+function A() {}
+function B() {}
+function C() {}
+makeA = function(){return new A;};
+makeB = function(){return new B;};
+makeC = function(){return new C;};
+""";
+
+var g;
+
+callFoo(x) {
+  // Dominating getInterceptor call should be shared.
+  g = x.toString();
+  // These call sites are partitioned into pure-dart and native subsets,
+  // allowing differences in getInterceptors.
+  if (x is D) return x.foo();
+  if (x is A) return x.foo();
+}
+
+makeAll() => [makeA(), makeB(), makeC(), new D(), new E()];
+
+main() {
+  setup();
+  /*
+  var a = makeA();
+  var b = makeB();
+  var c = makeC();
+  var d = new D();
+  var e = new E();
+  */
+  var x = makeAll();
+  var a = x[0];
+  var b = x[1];
+  var c = x[2];
+  var d = x[3];
+  var e = x[4];
+
+  var f = callFoo;
+
+  Expect.equals('A.foo', f(a));
+  Expect.equals('M2.foo', f(b));
+  Expect.equals('C.foo', f(c));
+  Expect.equals('M2.foo', f(d));
+  Expect.equals('E.foo', f(e));
+}
diff --git a/tests/html/element_test.dart b/tests/html/element_test.dart
index f953129..aae4dda 100644
--- a/tests/html/element_test.dart
+++ b/tests/html/element_test.dart
@@ -18,6 +18,12 @@
   expect(rect.right, rect.left + rect.width);
 }
 
+void testUnsupported(String name, void f()) {
+  test(name, () {
+    expect(f, throwsUnsupportedError);
+  });
+}
+
 main() {
   useHtmlIndividualConfiguration();
 
@@ -488,6 +494,36 @@
       var el = makeElementWithChildren();
       expect(el.children.sublist(1, 2), isElementList);
     });
+
+    test('getRange', () {
+      var el = makeElementWithChildren();
+      expect(el.children.getRange(1, 2).length, 1);
+    });
+
+    testUnsupported('sort', () {
+      var l = makeElementWithChildren().children;
+      l.sort();
+    });
+
+    testUnsupported('setRange', () {
+      var l = makeElementWithChildren().children;
+      l.setRange(0, 0, []);
+    });
+
+    testUnsupported('replaceRange', () {
+      var l = makeElementWithChildren().children;
+      l.replaceRange(0, 0, []);
+    });
+
+    testUnsupported('removeRange', () {
+      var l = makeElementWithChildren().children;
+      l.removeRange(0, 1);
+    });
+
+    testUnsupported('insertAll', () {
+      var l = makeElementWithChildren().children;
+      l.insertAll(0, []);
+    });
   });
 
   group('matches', () {
@@ -518,12 +554,6 @@
 
     List<Element> getEmptyQueryAll() => new Element.tag('div').queryAll('img');
 
-    void testUnsupported(String name, void f()) {
-      test(name, () {
-        expect(f, throwsUnsupportedError);
-      });
-    }
-
     test('last', () {
       expect(getQueryAll().last, isHRElement);
     });
@@ -604,7 +634,9 @@
 
     testUnsupported('sort', () => getQueryAll().sort((a1, a2) => true));
 
-    testUnsupported('setRange', () => getQueryAll().setRange(0, 0, []));
+    testUnsupported('setRange', () {
+      getQueryAll().setRange(0, 1, [new BRElement()]);
+    });
 
     testUnsupported('removeRange', () => getQueryAll().removeRange(0, 1));
 
diff --git a/tests/html/events_test.dart b/tests/html/events_test.dart
index a88d631..4e22018 100644
--- a/tests/html/events_test.dart
+++ b/tests/html/events_test.dart
@@ -5,12 +5,25 @@
 
 main() {
   useHtmlConfiguration();
+
   test('TimeStamp', () {
     Event event = new Event('test');
 
     int timeStamp = event.timeStamp;
     expect(timeStamp, greaterThan(0));
   });
+
+  test('Event canBubble and cancelable', () {
+    // Try every combination of canBubble and cancelable
+    for (var i = 0; i < 4; i++) {
+      var bubble = (i & 1) != 0;
+      var cancel = (i & 2) != 0;
+      var e = new Event('input', canBubble: bubble, cancelable: cancel);
+      expect(e.bubbles, bubble, reason: 'canBubble was set to $bubble');
+      expect(e.cancelable, cancel, reason: 'cancelable was set to $cancel');
+    }
+  });
+
   // The next test is not asynchronous because [on['test'].dispatch(event)] fires the event
   // and event listener synchronously.
   test('EventTarget', () {
@@ -54,6 +67,7 @@
     element.dispatchEvent(event);
     expect(invocationCounter, 1);
   });
+
   test('InitMouseEvent', () {
     DivElement div = new Element.tag('div');
     MouseEvent event = new MouseEvent('zebra', relatedTarget: div);
diff --git a/tests/html/node_test.dart b/tests/html/node_test.dart
index b2c8399..c8a009c 100644
--- a/tests/html/node_test.dart
+++ b/tests/html/node_test.dart
@@ -12,6 +12,12 @@
 Node makeNodeWithChildren() =>
   new Element.html("<div>Foo<br/><!--baz--></div>");
 
+void testUnsupported(String name, void f()) {
+  test(name, () {
+    expect(f, throwsUnsupportedError);
+  });
+}
+
 main() {
   useHtmlIndividualConfiguration();
 
@@ -256,10 +262,66 @@
       expect(node.nodes.length, 1);
     });
 
+    test('getRange', () {
+      var items = makeNodeWithChildren().nodes.getRange(0, 1);
+      expect(items.length, 1);
+      expect(items.first, isText);
+    });
+
     test('sublist', () {
       var node = makeNodeWithChildren();
       expect(node.nodes.sublist(1, 3), isNodeList);
     });
+
+    test('insertAll', () {
+      var node = makeNodeWithChildren();
+      var b = new DivElement();
+      b.nodes.addAll([
+        new HRElement(),
+        new ImageElement(),
+        new InputElement()
+      ]);
+      node.nodes.insertAll(1, b.nodes);
+      expect(node.nodes[0], isText);
+      expect(node.nodes[1], isHRElement);
+      expect(node.nodes[2], isImageElement);
+      expect(node.nodes[3], isInputElement);
+      expect(node.nodes[4], isBRElement);
+      expect(node.nodes[5], isComment);
+
+      var nodes = [
+        new HRElement(),
+        new ImageElement(),
+        new InputElement()
+      ];
+      node.nodes.insertAll(5, nodes);
+
+      expect(node.nodes[0], isText);
+      expect(node.nodes[1], isHRElement);
+      expect(node.nodes[2], isImageElement);
+      expect(node.nodes[3], isInputElement);
+      expect(node.nodes[4], isBRElement);
+      expect(node.nodes[5], isHRElement);
+      expect(node.nodes[6], isImageElement);
+      expect(node.nodes[7], isInputElement);
+      expect(node.nodes[8], isComment);
+    });
+
+    testUnsupported('removeRange', () {
+      makeNodeWithChildren().nodes.removeRange(0, 1);
+    });
+
+    testUnsupported('replaceRange', () {
+      makeNodeWithChildren().nodes.replaceRange(0, 1, [new InputElement()]);
+    });
+
+    testUnsupported('fillRange', () {
+      makeNodeWithChildren().nodes.fillRange(0, 1, null);
+    });
+
+    testUnsupported('setAll', () {
+      makeNodeWithChildren().nodes.setAll(0, [new InputElement()]);
+    });
   });
 
   group('_NodeList', () {
@@ -285,4 +347,20 @@
       expect(range[1], isComment);
     });
   });
+
+  group('iterating', () {
+    test('NodeIterator', () {
+      var root = makeNodeWithChildren();
+      var nodeIterator = new NodeIterator(root, NodeFilter.SHOW_COMMENT);
+      expect(nodeIterator.nextNode(), isComment);
+      expect(nodeIterator.nextNode(), isNull);
+    });
+
+    test('TreeWalker', () {
+      var root = makeNodeWithChildren();
+      var treeWalker = new TreeWalker(root, NodeFilter.SHOW_COMMENT);
+      expect(treeWalker.nextNode(), isComment);
+      expect(treeWalker.nextNode(), isNull);
+    });
+  });
 }
diff --git a/tests/html/typed_arrays_range_checks_test.dart b/tests/html/typed_arrays_range_checks_test.dart
index b7b7350..2338ac1 100644
--- a/tests/html/typed_arrays_range_checks_test.dart
+++ b/tests/html/typed_arrays_range_checks_test.dart
@@ -8,6 +8,25 @@
 import 'dart:html';
 import 'dart:typed_data';
 
+const N = 1024;
+
+class _TestList {
+  _TestList(int n);
+
+  operator[](int i) => i;
+  operator[]=(int i, v) {}
+}
+
+_obfuscatedList() {
+  var a = new Uint8List(N);
+  var b = new _TestList(N);
+  var k = 0;
+  for (int i = 0; i < 10; ++i) {
+    k += i;
+  }
+  return (k == 45) ? a : b;
+}
+
 main() {
   useHtmlConfiguration();
 
@@ -17,44 +36,42 @@
   }
 
   test('outOfRangeAccess_dynamic', () {
-      var a = new Uint8List(1024);
+      var a = _obfuscatedList();
 
       expect(() => a[a.length], throws);
       expect(() => a[a.length + 1], throws);
-      expect(() => a[a.length + 1024], throws);
+      expect(() => a[a.length + N], throws);
 
-      // expect(a[-1], isNull);
-      // expect(a[-2], isNull);
-      // expect(a[-1024], isNull);
+      expect(() => a[-1], throws);
+      expect(() => a[1.5], throws);
+      expect(() => a['length'], throws);
 
-      // It's harder to test out of range setters, but let's do some minimum.
-      expect(() => a[a.length] = 0xdeadbeaf, throws);
-      expect(() => a[a.length + 1] = 0xdeadbeaf, throws);
-      expect(() => a[a.length + 1024] = 0xdeadbeaf, throws);
+      expect(() => a[a.length] = 0xdeadbeef, throws);
+      expect(() => a[a.length + 1] = 0xdeadbeef, throws);
+      expect(() => a[a.length + N] = 0xdeadbeef, throws);
 
-      // a[-1] = 0xdeadbeaf;
-      // a[-2] = 0xdeadbeaf;
-      // a[-1024] = 0xdeadbeaf;
+      expect(() => a[-1] = 0xdeadbeef, throws);
+      expect(() => a[1.5] = 0xdeadbeef, throws);
+      expect(() => a['length'] = 1, throws);
   });
 
   test('outOfRange_typed', () {
-      Uint8List a = new Uint8List(1024);
+      Uint8List a = new Uint8List(N);
 
       expect(() => a[a.length], throws);
       expect(() => a[a.length + 1], throws);
-      expect(() => a[a.length + 1024], throws);
+      expect(() => a[a.length + N], throws);
 
-      // expect(a[-1], isNull);
-      // expect(a[-2], isNull);
-      // expect(a[-1024], isNull);
+      expect(() => a[-1], throws);
+      expect(() => a[1.5], throws);
+      expect(() => a['length'], throws);
 
-      // It's harder to test out of range setters, but let's do some minimum.
-      expect(() => a[a.length] = 0xdeadbeaf, throws);
-      expect(() => a[a.length + 1] = 0xdeadbeaf, throws);
-      expect(() => a[a.length + 1024] = 0xdeadbeaf, throws);
+      expect(() => a[a.length] = 0xdeadbeef, throws);
+      expect(() => a[a.length + 1] = 0xdeadbeef, throws);
+      expect(() => a[a.length + N] = 0xdeadbeef, throws);
 
-      // a[-1] = 0xdeadbeaf;
-      // a[-2] = 0xdeadbeaf;
-      // a[-1024] = 0xdeadbeaf;
+      expect(() => a[-1] = 0xdeadbeef, throws);
+      expect(() => a[1.5] = 0xdeadbeef, throws);
+      expect(() => a['length'] = 1, throws);
   });
 }
diff --git a/tests/html/typed_arrays_simd_test.dart b/tests/html/typed_arrays_simd_test.dart
new file mode 100644
index 0000000..f75ad2a
--- /dev/null
+++ b/tests/html/typed_arrays_simd_test.dart
@@ -0,0 +1,85 @@
+// 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 TypedArraysSimdTest;
+import '../../pkg/unittest/lib/unittest.dart';
+import '../../pkg/unittest/lib/html_config.dart';
+import 'dart:html';
+import 'dart:typed_data';
+
+const _FLOATING_POINT_ERROR = 0.0000000001;
+floatEquals(value) => closeTo(value, _FLOATING_POINT_ERROR);
+
+class MyFloat32x4 {
+  num x = 0.0;
+  num y = 0.0;
+  num z = 0.0;
+  num w = 0.0;
+}
+
+main() {
+  useHtmlConfiguration();
+
+  // Only perform tests if ArrayBuffer is supported.
+  if (!Platform.supportsTypedData) {
+    return;
+  }
+
+  test('test Float32x4', () {
+      if (Platform.supportsSimd) {
+	final val = new Float32x4(1.0, 2.0, 3.0, 4.0);
+	expect(val.x, floatEquals(1.0));
+	expect(val.y, floatEquals(2.0));
+	expect(val.z, floatEquals(3.0));
+	expect(val.w, floatEquals(4.0));
+	final val2 = val + val;
+	expect(val2.x, floatEquals(2.0));
+	expect(val2.y, floatEquals(4.0));
+	expect(val2.z, floatEquals(6.0));
+	expect(val2.w, floatEquals(8.0));	
+      }	
+  });
+
+  test('test Float32x4List', () {
+      var counter;
+      final list = new Float32List(12);
+      for (int i = 0; i < list.length; ++i) {
+	list[i] = i * 1.0;
+      }
+      if (Platform.supportsSimd) {
+	counter = new Float32x4.zero();
+	final simdlist = new Float32x4List.view(list.buffer);
+	for (int i = 0; i < simdlist.length; ++i) {
+	  counter += simdlist[i];
+	}
+      }	else {
+	counter = new MyFloat32x4();
+	for (int i = 0; i < list.length; i += 4) {
+	  counter.x += list[i];
+	  counter.y += list[i+1];
+	  counter.z += list[i+2];
+	  counter.w += list[i+3];
+	}
+      }
+      expect(counter.x, floatEquals(12.0));
+      expect(counter.y, floatEquals(15.0));
+      expect(counter.z, floatEquals(18.0));
+      expect(counter.w, floatEquals(21.0));
+  });
+
+  test('test Uint32x4', () {
+      if (Platform.supportsSimd) {
+	final val = new Uint32x4(1, 2, 3, 4);
+	expect(val.x, equals(1));
+	expect(val.y, equals(2));
+	expect(val.z, equals(3));
+	expect(val.w, equals(4));
+	final val2 = val ^ val;
+	expect(val2.x, equals(0));
+	expect(val2.y, equals(0));
+	expect(val2.z, equals(0));
+	expect(val2.w, equals(0));	
+      }	
+  });
+}
diff --git a/tests/language/call_argument_inference_test.dart b/tests/language/call_argument_inference_test.dart
new file mode 100644
index 0000000..0af5537
--- /dev/null
+++ b/tests/language/call_argument_inference_test.dart
@@ -0,0 +1,14 @@
+// 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";
+
+class A {
+  call(a) => a is num;
+}
+
+main() {
+  Expect.isTrue(new A().call(42));
+  Expect.isFalse(new A()('foo'));
+}
diff --git a/tests/language/issue10204_test.dart b/tests/language/issue10204_test.dart
new file mode 100644
index 0000000..c968330
--- /dev/null
+++ b/tests/language/issue10204_test.dart
@@ -0,0 +1,38 @@
+// 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 that used to miscompile
+// [A.visitInvokeDynamicMethod].
+
+import "package:expect/expect.dart";
+
+var a = 2;
+
+class Tupe {
+  const Tupe();
+  get instructionType => a == 2 ? this : new A();
+  refine(a, b) => '$a$b';
+}
+
+class Node {
+  final selector = null;
+  var inputs = {"a": const Tupe(), "b": const Tupe() };
+  bool isCallOnInterceptor = false;
+
+  getDartReceiver() {
+    return isCallOnInterceptor ? inputs["a"] : inputs["b"];
+  }
+}
+
+class A {
+  visitInvokeDynamicMethod(node) {
+    var receiverType = node.getDartReceiver().instructionType;
+    return receiverType.refine(node.selector, node.selector);
+  }
+}
+
+main() {
+  Expect.equals('nullnull',
+                [new A()].last.visitInvokeDynamicMethod(new Node()));
+}
diff --git a/tests/language/language.status b/tests/language/language.status
index aaf1c24..2a940a4 100644
--- a/tests/language/language.status
+++ b/tests/language/language.status
@@ -65,6 +65,7 @@
 on_catch_malformed_type_test: Fail # Issue 8601
 
 mixin_mixin_test: Fail
+mixin_issue10216_2_test: Fail
 
 type_variable_field_initializer_closure_test: Crash # issue 8847
 
@@ -298,6 +299,7 @@
 
 # test issue 8127 (using mixin application as mixin)
 mixin_mixin_test: Fail
+mixin_issue10216_2_test: Fail
 
 # test issue 8801
 super_operator_index_test/04: Fail
@@ -370,6 +372,7 @@
 
 # Mixins fail on the VM.
 mixin_mixin_test: Fail                      # VM issue
+mixin_issue10216_2_test: Fail               # VM issue
 mixin_illegal_constructor_test/none: Fail   # VM issue
 
 
diff --git a/tests/language/mixin_cyclic_test.dart b/tests/language/mixin_cyclic_test.dart
new file mode 100644
index 0000000..e6b65c4
--- /dev/null
+++ b/tests/language/mixin_cyclic_test.dart
@@ -0,0 +1,22 @@
+// 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 for cyclicity check on named mixin applications.
+
+class A<T> {}
+
+class S {}
+class M<T> {}
+
+typedef C1 = S with M;
+typedef C2 = S with C2; /// 01: compile-time error
+typedef C3 = S with M implements A;
+typedef C4 = S with M implements C4; /// 02: compile-time error
+
+void main() {
+  new C1();
+  new C2(); /// 01: continued
+  new C3();
+  new C4(); /// 02: continued
+}
diff --git a/tests/language/mixin_implements2_test.dart b/tests/language/mixin_implements2_test.dart
new file mode 100644
index 0000000..3fc284d
--- /dev/null
+++ b/tests/language/mixin_implements2_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.
+
+// Regression test for named mixin applications with implements clause.
+
+class A {}
+
+class S {}
+class M {}
+
+typedef C = S with M implements A;
+
+void main() {
+  new C();
+}
diff --git a/tests/language/mixin_issue10216_2_test.dart b/tests/language/mixin_issue10216_2_test.dart
new file mode 100644
index 0000000..0cc64d4
--- /dev/null
+++ b/tests/language/mixin_issue10216_2_test.dart
@@ -0,0 +1,20 @@
+// 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";
+
+typedef M1 = Object with M0;
+typedef M2 = Object with M1;
+
+class M0 {
+  foo() => 42;
+}
+
+makeM2() {
+  return [new Object(), new M2()].last as M2;
+}
+
+main() {
+  Expect.equals(42, makeM2().foo());
+}
diff --git a/tests/language/mixin_issue10216_test.dart b/tests/language/mixin_issue10216_test.dart
new file mode 100644
index 0000000..21d8d71
--- /dev/null
+++ b/tests/language/mixin_issue10216_test.dart
@@ -0,0 +1,34 @@
+// 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";
+
+class A  {
+  foo(x, [y]) => '$x;$y';
+}
+
+class B extends A with M1, M2, M3 {
+}
+
+class M1 {}
+
+class M2 {
+  plain(x) => 'P $x';
+  bar(x, [y]) => '$y,$x';
+}
+
+class M3 {}
+
+makeB() {
+  return [new A(), new B()].last as B;
+}
+
+main() {
+  var b = makeB();
+  Expect.equals('1;2', b.foo(1,2));
+  Expect.equals('2;null', b.foo(2));
+  Expect.equals('P 3', b.plain(3));
+  Expect.equals('100,4', b.bar(4,100));
+  Expect.equals('null,5', b.bar(5));
+}
diff --git a/tests/lib/typed_data/float32x4_test.dart b/tests/lib/typed_data/float32x4_test.dart
index 7f6aa2f..4d2c15e 100644
--- a/tests/lib/typed_data/float32x4_test.dart
+++ b/tests/lib/typed_data/float32x4_test.dart
@@ -183,19 +183,19 @@
 testReciprocal() {
   var m = new Float32x4(1.0, 4.0, 9.0, 16.0);
   m = m.reciprocal();
-  Expect.approxEquals(1.0, m.x);
-  Expect.approxEquals(0.25, m.y);
-  Expect.approxEquals(0.1111111, m.z);
-  Expect.approxEquals(0.0625, m.w);
+  Expect.approxEquals(1.0, m.x, 0.001);
+  Expect.approxEquals(0.25, m.y, 0.001);
+  Expect.approxEquals(0.1111111, m.z, 0.001);
+  Expect.approxEquals(0.0625, m.w, 0.001);
 }
 
 testReciprocalSqrt() {
   var m = new Float32x4(1.0, 0.25, 0.111111, 0.0625);
   m = m.reciprocalSqrt();
-  Expect.approxEquals(1.0, m.x);
-  Expect.approxEquals(2.0, m.y);
-  Expect.approxEquals(3.0, m.z);
-  Expect.approxEquals(4.0, m.w);
+  Expect.approxEquals(1.0, m.x, 0.001);
+  Expect.approxEquals(2.0, m.y, 0.001);
+  Expect.approxEquals(3.0, m.z, 0.001);
+  Expect.approxEquals(4.0, m.w, 0.001);
 }
 
 testSelect() {
diff --git a/tests/lib/typed_data/float32x4_unbox_regress_test.dart b/tests/lib/typed_data/float32x4_unbox_regress_test.dart
index e166c3f..c20a6ea 100644
--- a/tests/lib/typed_data/float32x4_unbox_regress_test.dart
+++ b/tests/lib/typed_data/float32x4_unbox_regress_test.dart
@@ -73,8 +73,45 @@
   }
 }
 
+void testComparison(a, b) {
+  Uint32x4 r = a.equal(b);
+  Expect.equals(true, r.flagX);
+  Expect.equals(false, r.flagY);
+  Expect.equals(false, r.flagZ);
+  Expect.equals(true, r.flagW);
+}
+
+void testComparisonDeopt() {
+  var a = new Float32x4(1.0, 2.0, 3.0, 4.0);
+  var b = new Float32x4(1.0, 2.1, 3.1, 4.0);
+  var smi = 12;
+
+  for (int i = 0; i < 2000; i++) {
+    testComparison(a, b);
+  }
+
+  try {
+    testComparison(a, smi);
+  } catch (_) {
+  }
+
+  for (int i = 0; i < 2000; i++) {
+    testComparison(a, b);
+  }
+
+  try {
+    testComparison(smi, a);
+  } catch (_) {
+  }
+
+  for (int i = 0; i < 2000; i++) {
+    testComparison(a, b);
+  }
+}
+
 main() {
   testListStoreDeopt();
   testAddDeopt();
   testGetDeopt();
+  testComparisonDeopt();
 }
diff --git a/tests/standalone/io/directory_chdir_test.dart b/tests/standalone/io/directory_chdir_test.dart
new file mode 100644
index 0000000..0805e3a
--- /dev/null
+++ b/tests/standalone/io/directory_chdir_test.dart
@@ -0,0 +1,50 @@
+// 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.
+//
+// Directory listing test.
+
+
+import "dart:io";
+import "dart:isolate";
+
+import "package:expect/expect.dart";
+
+testChangeDirectory() {
+  var port = new ReceivePort();
+  new Directory("").createTemp().then((temp) {
+    var initialCurrent = Directory.current;
+    Directory.current = temp;
+    var newCurrent = Directory.current;
+    new File("111").createSync();
+    var dir = new Directory(newCurrent.path + Platform.pathSeparator + "222");
+    dir.createSync();
+    Directory.current = dir;
+    new File("333").createSync();
+    Expect.isTrue(new File("333").existsSync());
+    Expect.isTrue(new File("../111").existsSync());
+    Directory.current = "..";
+    Expect.isTrue(new File("111").existsSync());
+    Expect.isTrue(new File("222/333").existsSync());
+    Directory.current = initialCurrent;
+    temp.deleteSync(recursive: true);
+    port.close();
+  });
+}
+
+
+testChangeDirectoryIllegalArguments() {
+  Expect.throws(() => Directory.current = 1, (e) => e is ArgumentError);
+  Expect.throws(() => Directory.current = 111111111111111111111111111111111111,
+                (e) => e is ArgumentError);
+  Expect.throws(() => Directory.current = true, (e) => e is ArgumentError);
+  Expect.throws(() => Directory.current = [], (e) => e is ArgumentError);
+  Expect.throws(() => Directory.current = new File("xxx"),
+                (e) => e is ArgumentError);
+}
+
+
+main() {
+  testChangeDirectory();
+  testChangeDirectoryIllegalArguments();
+}
diff --git a/tests/standalone/io/directory_test.dart b/tests/standalone/io/directory_test.dart
index d9ca0de..e455343 100644
--- a/tests/standalone/io/directory_test.dart
+++ b/tests/standalone/io/directory_test.dart
@@ -380,7 +380,7 @@
   }
 
   static void testCurrent() {
-    Directory current = new Directory.current();
+    Directory current = Directory.current;
     if (Platform.operatingSystem != "windows") {
       Expect.equals("/", current.path.substring(0, 1));
     }
diff --git a/tests/standalone/io/http_proxy_test.dart b/tests/standalone/io/http_proxy_test.dart
index 36abf04..365ce29 100644
--- a/tests/standalone/io/http_proxy_test.dart
+++ b/tests/standalone/io/http_proxy_test.dart
@@ -34,7 +34,7 @@
         bool direct = directRequestPaths.fold(
             false,
             (prev, path) => prev ? prev : path == request.uri.path);
-        if (!direct && proxyHops > 0) {
+        if (!secure && !direct && proxyHops > 0) {
           Expect.isNotNull(request.headers[HttpHeaders.VIA]);
           Expect.equals(1, request.headers[HttpHeaders.VIA].length);
           Expect.equals(
@@ -122,28 +122,41 @@
           }
         }
         // Open the connection from the proxy.
-        client.openUrl(request.method, request.uri)
-          .then((HttpClientRequest clientRequest) {
-            // Forward all headers.
-            request.headers.forEach((String name, List<String> values) {
-              values.forEach((String value) {
-                if (name != "content-length" && name != "via") {
-                  clientRequest.headers.add(name, value);
-                }
+        if (request.method == "CONNECT") {
+          var tmp = request.uri.toString().split(":");
+          Socket.connect(tmp[0], int.parse(tmp[1]))
+              .then((socket) {
+                request.response.reasonPhrase = "Connection established";
+                request.response.detachSocket()
+                    .then((detached) {
+                      socket.pipe(detached);
+                      detached.pipe(socket);
+                    });
               });
+        } else {
+          client.openUrl(request.method, request.uri)
+            .then((HttpClientRequest clientRequest) {
+              // Forward all headers.
+              request.headers.forEach((String name, List<String> values) {
+                values.forEach((String value) {
+                  if (name != "content-length" && name != "via") {
+                    clientRequest.headers.add(name, value);
+                  }
+                });
+              });
+              // Special handling of Content-Length and Via.
+              clientRequest.contentLength = request.contentLength;
+              List<String> via = request.headers[HttpHeaders.VIA];
+              String viaPrefix = via == null ? "" : "${via[0]}, ";
+              clientRequest.headers.add(
+                  HttpHeaders.VIA, "${viaPrefix}1.1 localhost:$port");
+              // Copy all content.
+              return request.pipe(clientRequest);
+            })
+            .then((HttpClientResponse clientResponse) {
+              clientResponse.pipe(request.response);
             });
-            // Special handling of Content-Length and Via.
-            clientRequest.contentLength = request.contentLength;
-            List<String> via = request.headers[HttpHeaders.VIA];
-            String viaPrefix = via == null ? "" : "${via[0]}, ";
-            clientRequest.headers.add(
-                HttpHeaders.VIA, "${viaPrefix}1.1 localhost:$port");
-            // Copy all content.
-            return request.pipe(clientRequest);
-          })
-          .then((HttpClientResponse clientResponse) {
-            clientResponse.pipe(request.response);
-          });
+        }
       });
     });
     return x.future;
@@ -429,23 +442,21 @@
             return clientRequest.close();
           })
           .then((HttpClientResponse response) {
-            response.listen((_) {}, onDone: () {
-              testProxyAuthenticateCount++;
-              Expect.equals(HttpStatus.PROXY_AUTHENTICATION_REQUIRED,
-                            response.statusCode);
-              if (testProxyAuthenticateCount == loopCount * 2) {
-                Expect.equals(0, server.requestCount);
-                Expect.equals(0, secureServer.requestCount);
-                step1.complete(null);
-              }
-            });
-          });
+            Expect.fail("No response expected");
+          }).
+          catchError((e) {
+            testProxyAuthenticateCount++;
+            if (testProxyAuthenticateCount == loopCount * 2) {
+              Expect.equals(0, server.requestCount);
+              Expect.equals(0, secureServer.requestCount);
+              step1.complete(null);
+            }
+        });
       }
 
       test(false);
       test(true);
     }
-
     step1.future.then((_) {
       testProxyAuthenticateCount = 0;
       client.findProxy = (Uri uri) {
diff --git a/tests/standalone/io/internet_address_test.dart b/tests/standalone/io/internet_address_test.dart
new file mode 100644
index 0000000..67216d4
--- /dev/null
+++ b/tests/standalone/io/internet_address_test.dart
@@ -0,0 +1,37 @@
+// 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:io';
+
+import "package:expect/expect.dart";
+
+void test() {
+  var loopback4 = InternetAddress.LOOPBACK_IP_V4;
+  Expect.isNotNull(loopback4);
+  Expect.equals(InternetAddressType.IP_V4, loopback4.type);
+  Expect.equals("localhost", loopback4.host);
+  Expect.equals("127.0.0.1", loopback4.address);
+
+  var loopback6 = InternetAddress.LOOPBACK_IP_V6;
+  Expect.isNotNull(loopback6);
+  Expect.equals(InternetAddressType.IP_V6, loopback6.type);
+  Expect.equals("ip6-localhost", loopback6.host);
+  Expect.equals("::1", loopback6.address);
+
+  var any4 = InternetAddress.ANY_IP_V4;
+  Expect.isNotNull(any4);
+  Expect.equals(InternetAddressType.IP_V4, any4.type);
+  Expect.equals("0.0.0.0", any4.host);
+  Expect.equals("0.0.0.0", any4.address);
+
+  var any6 = InternetAddress.ANY_IP_V6;
+  Expect.isNotNull(any6);
+  Expect.equals(InternetAddressType.IP_V6, any6.type);
+  Expect.equals("::", any6.host);
+  Expect.equals("::", any6.address);
+}
+
+void main() {
+  test();
+}
diff --git a/tests/standalone/io/raw_secure_server_socket_test.dart b/tests/standalone/io/raw_secure_server_socket_test.dart
index 40d8d04..2ca5688 100644
--- a/tests/standalone/io/raw_secure_server_socket_test.dart
+++ b/tests/standalone/io/raw_secure_server_socket_test.dart
@@ -333,7 +333,6 @@
           }
           if (bytesWritten == data.length) {
             if (!postponeSecure) {
-              client.readEventsEnabled = true;
               completer.complete([subscription, null]);
             }
           }
diff --git a/tests/standalone/io/secure_builtin_roots_database_test.dart b/tests/standalone/io/secure_builtin_roots_database_test.dart
new file mode 100644
index 0000000..3966032
--- /dev/null
+++ b/tests/standalone/io/secure_builtin_roots_database_test.dart
@@ -0,0 +1,37 @@
+// 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.
+
+import "package:expect/expect.dart";
+import "dart:io";
+import "dart:uri";
+import "dart:isolate";
+import "dart:async";
+
+void testGoogleUrl() {
+  ReceivePort keepAlive = new ReceivePort();
+  HttpClient client = new HttpClient();
+  client.getUrl(Uri.parse('https://www.google.com'))
+      .then((request) => request.close())
+      .then((response)=> response.last)
+      .then((_) {
+        client.close();
+        keepAlive.close();
+      });
+}
+
+void InitializeSSL() {
+  // If the built-in root certificates aren't loaded, the connection
+  // should signal an error.  Even when an external database is loaded,
+  // they should not be loaded.
+  Path scriptDir = new Path(new Options().script).directoryPath;
+  Path certificateDatabase = scriptDir.append('pkcert');
+  SecureSocket.initialize(database: certificateDatabase.toNativePath(),
+                          password: 'dartdart',
+                          useBuiltinRoots: true);
+}
+
+void main() {
+  InitializeSSL();
+  testGoogleUrl();
+}
diff --git a/tests/standalone/io/secure_builtin_roots_test.dart b/tests/standalone/io/secure_builtin_roots_test.dart
new file mode 100644
index 0000000..edfffad
--- /dev/null
+++ b/tests/standalone/io/secure_builtin_roots_test.dart
@@ -0,0 +1,32 @@
+// 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.
+
+import "package:expect/expect.dart";
+import "dart:io";
+import "dart:uri";
+import "dart:isolate";
+import "dart:async";
+
+void testGoogleUrl() {
+  ReceivePort keepAlive = new ReceivePort();
+  HttpClient client = new HttpClient();
+  client.getUrl(Uri.parse('https://www.google.com'))
+      .then((request) => request.close())
+      .then((response) => response.last)
+      .then((_) {
+        client.close();
+        keepAlive.close();
+      });
+}
+
+void InitializeSSL() {
+  // If the built-in root certificates aren't loaded, the connection
+  // should signal an error.
+  SecureSocket.initialize(useBuiltinRoots: true);
+}
+
+void main() {
+  InitializeSSL();
+  testGoogleUrl();
+}
diff --git a/tests/standalone/io/socket_ipv6_test.dart b/tests/standalone/io/socket_ipv6_test.dart
index 4fe25fc..032bd9c 100644
--- a/tests/standalone/io/socket_ipv6_test.dart
+++ b/tests/standalone/io/socket_ipv6_test.dart
@@ -67,7 +67,7 @@
   InternetAddress.lookup("::0", type: ANY).then((list) {
     if (list.length < 0) throw "no address";
     for (var entry in list) {
-      if (entry.type != InternetAddressType.IPv6) {
+      if (entry.type != InternetAddressType.IP_V6) {
         throw "Wrong IP type";
       }
     }
@@ -80,7 +80,7 @@
   InternetAddress.lookup("127.0.0.1").then((list) {
     if (list.length < 0) throw "no addresse";
     for (var entry in list) {
-      if (entry.type != InternetAddressType.IPv4) {
+      if (entry.type != InternetAddressType.IP_V4) {
         throw "Wrong IP type";
       }
     }
diff --git a/tests/standalone/io/socket_upgrade_to_secure_test.dart b/tests/standalone/io/socket_upgrade_to_secure_test.dart
index 33b2059..d4448ca 100644
--- a/tests/standalone/io/socket_upgrade_to_secure_test.dart
+++ b/tests/standalone/io/socket_upgrade_to_secure_test.dart
@@ -12,6 +12,7 @@
 import "dart:io";
 import "dart:isolate";
 
+const HOST_IP = "127.0.0.1";
 const HOST_NAME = "localhost";
 const CERTIFICATE = "localhost_cert";
 
@@ -36,7 +37,8 @@
 // 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 test(bool handshakeBeforeSecure,
+void test(bool hostnameInConnect,
+          bool handshakeBeforeSecure,
           [bool postponeSecure = false]) {
   ReceivePort port = new ReceivePort();
 
@@ -150,17 +152,30 @@
   }
 
   Future<SecureSocket> connectClient(int port) {
+    var host = hostnameInConnect ? HOST_NAME : HOST_IP;
     if (!handshakeBeforeSecure) {
-      return Socket.connect(HOST_NAME, port).then((socket) {
-        return SecureSocket.secure(socket).then((secureSocket) {
+      return Socket.connect(host, port).then((socket) {
+        var future;
+        if (hostnameInConnect) {
+          future = SecureSocket.secure(socket);
+        } else {
+          future = SecureSocket.secure(socket, host: HOST_NAME);
+        }
+        return future.then((secureSocket) {
           Expect.throws(() => socket.add([0]));
           return secureSocket;
         });
       });
     } else {
-      return Socket.connect(HOST_NAME, port).then((socket) {
+      return Socket.connect(host, port).then((socket) {
         return runClientHandshake(socket).then((_) {
-            return SecureSocket.secure(socket).then((secureSocket) {
+            var future;
+            if (hostnameInConnect) {
+              future = SecureSocket.secure(socket);
+            } else {
+              future = SecureSocket.secure(socket, host: HOST_NAME);
+            }
+            return future.then((secureSocket) {
               Expect.throws(() => socket.add([0]));
               return secureSocket;
             });
@@ -203,7 +218,10 @@
   SecureSocket.initialize(database: certificateDatabase.toNativePath(),
                           password: 'dartdart',
                           useBuiltinRoots: false);
-  test(false);
-  test(true);
+  test(false, false);
+  test(true, false);
+  test(false, true);
   test(true, true);
+  test(false, true, true);
+  test(true, true, true);
 }
diff --git a/tests/standalone/standalone.status b/tests/standalone/standalone.status
index 37ef277..37eae94 100644
--- a/tests/standalone/standalone.status
+++ b/tests/standalone/standalone.status
@@ -14,8 +14,6 @@
 [ $runtime == vm ]
 package/package_isolate_test: Fail # http://dartbug.com/7520.
 io/raw_server_socket_cancel_test: Pass, Fail, Timeout # Issue 8675
-io/raw_secure_server_socket_test: Pass, Fail # Issue 10177
-io/socket_upgrade_to_secure_test: Pass, Fail # Issue 10177
 
 [ $runtime == vm && $checked ]
 # These tests have type errors on purpose.
diff --git a/tools/VERSION b/tools/VERSION
index 5fac88f..870b65e 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -1,4 +1,4 @@
 MAJOR 0
 MINOR 5
-BUILD 1
+BUILD 2
 PATCH 0
diff --git a/tools/dom/dom.py b/tools/dom/dom.py
index d9e7588..5832af4 100755
--- a/tools/dom/dom.py
+++ b/tools/dom/dom.py
@@ -9,6 +9,7 @@
 import os
 import subprocess
 import sys
+from sys import argv
 
 sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
 import utils
@@ -97,7 +98,8 @@
 
 def gen():
   os.chdir(os.path.join('tools', 'dom', 'scripts'))
-  return call(os.path.join(os.getcwd(), 'go.sh'))
+  return call([os.path.join(os.getcwd(), 'dartdomgenerator.py'),
+      '--rebuild', '--parallel', '--systems=htmldart2js,htmldartium'])
 
 def http_server():
   print('Browse tests at '
@@ -190,7 +192,7 @@
       'running browser tests.'],
 }
 
-def main(argv):
+def main():
   success = True
   argv.pop(0)
 
@@ -212,4 +214,4 @@
   sys.exit(not success)
 
 if __name__ == '__main__':
-  main(sys.argv)
+  main()
diff --git a/tools/dom/scripts/htmldartgenerator.py b/tools/dom/scripts/htmldartgenerator.py
index 8c26992..55dfa25 100644
--- a/tools/dom/scripts/htmldartgenerator.py
+++ b/tools/dom/scripts/htmldartgenerator.py
@@ -390,7 +390,7 @@
           for index, param_info in enumerate(constructor_info.param_infos):
             if param_info.is_optional:
               dispatcher_emitter.Emit(
-                '    if (!?$OPT_PARAM_NAME) {\n'
+                '    if ($OPT_PARAM_NAME == null) {\n'
                 '      return $FACTORY._create($FACTORY_PARAMS);\n'
                 '    }\n',
                 OPT_PARAM_NAME=param_info.name,
diff --git a/tools/dom/scripts/htmleventgenerator.py b/tools/dom/scripts/htmleventgenerator.py
index 0f06390..59a8955 100644
--- a/tools/dom/scripts/htmleventgenerator.py
+++ b/tools/dom/scripts/htmleventgenerator.py
@@ -112,6 +112,7 @@
   '*.webkitTransitionEnd': ('transitionEnd', 'TransitionEvent'),
   '*.webkitfullscreenchange': ('fullscreenChange', 'Event'),
   '*.webkitfullscreenerror': ('fullscreenError', 'Event'),
+  'AbstractWorker.error': ('error', 'ErrorEvent'),
   'AudioContext.complete': ('complete', 'Event'),
   'DOMApplicationCache.cached': ('cached', 'Event'),
   'DOMApplicationCache.checking': ('checking', 'Event'),
diff --git a/tools/dom/scripts/htmlrenamer.py b/tools/dom/scripts/htmlrenamer.py
index 86b20b6..8ab7081 100644
--- a/tools/dom/scripts/htmlrenamer.py
+++ b/tools/dom/scripts/htmlrenamer.py
@@ -80,6 +80,7 @@
   'DedicatedWorkerContext', # Workers
   'DirectoryEntrySync', # Workers
   'DirectoryReaderSync', # Workers
+  'EntityReference',
   'EntrySync', # Workers
   'FileEntrySync', # Workers
   'FileReaderSync', # Workers
@@ -92,6 +93,7 @@
   'HTMLFrameSetElement',
   'HTMLMarqueeElement',
   'IDBAny',
+  'PagePopupController',
   'RGBColor',
   'RadioNodeList',  # Folded onto NodeList in dart2js.
   'Rect',
@@ -169,10 +171,12 @@
   'Document.createElement',
   'Document.createElementNS',
   'Document.createEvent',
+  'Document.createNodeIterator',
   'Document.createRange',
   'Document.createTextNode',
   'Document.createTouch',
   'Document.createTouchList',
+  'Document.createTreeWalker',
   'Document.querySelectorAll',
 
   # Moved to HTMLDocument.
@@ -382,6 +386,7 @@
     'DOMWindow.get:frames',
     'DOMWindow.get:length',
     'DOMWindow.on:beforeUnload',
+    'DOMWindow.pagePopupController',
     'DOMWindow.prompt',
     'DOMWindow.webkitCancelAnimationFrame',
     'DOMWindow.webkitCancelRequestAnimationFrame',
@@ -400,9 +405,7 @@
     'Document.createEntityReference',
     'Document.createExpression',
     'Document.createNSResolver',
-    'Document.createNodeIterator',
     'Document.createProcessingInstruction',
-    'Document.createTreeWalker',
     'Document.designMode',
     'Document.dir',
     'Document.evaluate',
@@ -610,6 +613,9 @@
     'Node.lookupPrefix',
     'Node.normalize',
     'Node.set:nodeValue',
+    'NodeFilter.acceptNode',
+    'NodeIterator.expandEntityReferences',
+    'NodeIterator.filter',
     'NodeList.item',
     'ShadowRoot.getElementsByTagNameNS',
     'SVGStyledElement.getPresentationAttribute',
diff --git a/tools/dom/src/WrappedList.dart b/tools/dom/src/WrappedList.dart
index 7a4ec30..3baff3e 100644
--- a/tools/dom/src/WrappedList.dart
+++ b/tools/dom/src/WrappedList.dart
@@ -8,7 +8,7 @@
  * A list which just wraps another list, for either intercepting list calls or
  * retyping the list (for example, from List<A> to List<B> where B extends A).
  */
-class _WrappedList<E> implements List<E> {
+class _WrappedList<E> extends ListBase<E> {
   final List _list;
 
   _WrappedList(this._list);
@@ -17,73 +17,14 @@
 
   Iterator<E> get iterator => new _WrappedIterator(_list.iterator);
 
-  Iterable map(f(E element)) => _list.map(f);
-
-  Iterable<E> where(bool f(E element)) => _list.where(f);
-
-  Iterable expand(Iterable f(E element)) => _list.expand(f);
-
-  bool contains(E element) => _list.contains(element);
-
-  void forEach(void f(E element)) { _list.forEach(f); }
-
-  E reduce(E combine(E value, E element)) =>
-      _list.reduce(combine);
-
-  dynamic fold(initialValue, combine(previousValue, E element)) =>
-      _list.fold(initialValue, combine);
-
-  bool every(bool f(E element)) => _list.every(f);
-
-  String join([String separator = ""]) => _list.join(separator);
-
-  bool any(bool f(E element)) => _list.any(f);
-
-  List<E> toList({ bool growable: true }) =>
-      new List.from(_list, growable: growable);
-
-  Set<E> toSet() => _list.toSet();
-
   int get length => _list.length;
 
-  bool get isEmpty => _list.isEmpty;
-
-  Iterable<E> take(int n) => _list.take(n);
-
-  Iterable<E> takeWhile(bool test(E value)) => _list.takeWhile(test);
-
-  Iterable<E> skip(int n) => _list.skip(n);
-
-  Iterable<E> skipWhile(bool test(E value)) => _list.skipWhile(test);
-
-  E get first => _list.first;
-
-  E get last => _list.last;
-
-  E get single => _list.single;
-
-  E firstWhere(bool test(E value), { E orElse() }) =>
-      _list.firstWhere(test, orElse: orElse);
-
-  E lastWhere(bool test(E value), {E orElse()}) =>
-      _list.lastWhere(test, orElse: orElse);
-
-  E singleWhere(bool test(E value)) => _list.singleWhere(test);
-
-  E elementAt(int index) => _list.elementAt(index);
-
   // Collection APIs
 
   void add(E element) { _list.add(element); }
 
-  void addAll(Iterable<E> elements) { _list.addAll(elements); }
-
   void remove(Object element) { _list.remove(element); }
 
-  void removeWhere(bool test(E element)) { _list.removeWhere(test); }
-
-  void retainWhere(bool test(E element)) { _list.retainWhere(test); }
-
   void clear() { _list.clear(); }
 
   // List APIs
@@ -94,8 +35,6 @@
 
   void set length(int newLength) { _list.length = newLength; }
 
-  Iterable<E> get reversed => _list.reversed;
-
   void sort([int compare(E a, E b)]) { _list.sort(compare); }
 
   int indexOf(E element, [int start = 0]) => _list.indexOf(element, start);
@@ -104,20 +43,8 @@
 
   void insert(int index, E element) => _list.insert(index, element);
 
-  void insertAll(int index, Iterable<E> iterable) =>
-      _list.insertAll(index, iterable);
-
-  void setAll(int index, Iterable<E> iterable) =>
-      _list.setAll(index, iterable);
-
   E removeAt(int index) => _list.removeAt(index);
 
-  E removeLast() => _list.removeLast();
-
-  List<E> sublist(int start, [int end]) => _list.sublist(start, end);
-
-  Iterable<E> getRange(int start, int end) => _list.getRange(start, end);
-
   void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
     _list.setRange(start, end, iterable, skipCount);
   }
@@ -131,15 +58,6 @@
   void fillRange(int start, int end, [E fillValue]) {
     _list.fillRange(start, end, fillValue);
   }
-
-  Map<int, E> asMap() => _list.asMap();
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
 }
 
 /**
diff --git a/tools/dom/src/chrome/app_runtime.dart b/tools/dom/src/chrome/app_runtime.dart
index 15d32e2..33925ef 100644
--- a/tools/dom/src/chrome/app_runtime.dart
+++ b/tools/dom/src/chrome/app_runtime.dart
@@ -57,9 +57,9 @@
    * Public constructor
    */
   AppRuntimeLaunchItem({FileEntry entry, String type}) {
-    if (?entry)
+    if (entry != null)
       this.entry = entry;
-    if (?type)
+    if (type != null)
       this.type = type;
   }
 
@@ -92,11 +92,11 @@
    * Public constructor
    */
   AppRuntimeLaunchData({AppRuntimeIntent intent, String id, List<AppRuntimeLaunchItem> items}) {
-    if (?intent)
+    if (intent != null)
       this.intent = intent;
-    if (?id)
+    if (id != null)
       this.id = id;
-    if (?items)
+    if (items != null)
       this.items = items;
   }
 
@@ -140,11 +140,11 @@
    * Public constructor
    */
   AppRuntimeIntentResponse({int intentId, bool success, Object data}) {
-    if (?intentId)
+    if (intentId != null)
       this.intentId = intentId;
-    if (?success)
+    if (success != null)
       this.success = success;
-    if (?data)
+    if (data != null)
       this.data = data;
   }
 
@@ -188,7 +188,7 @@
 class Event_app_runtime_onLaunched extends Event {
   void addListener(void callback(AppRuntimeLaunchData launchData)) {
     void __proxy_callback(launchData) {
-      if (?callback) {
+      if (callback != null) {
         callback(new AppRuntimeLaunchData._proxy(launchData));
       }
     }
@@ -197,7 +197,7 @@
 
   void removeListener(void callback(AppRuntimeLaunchData launchData)) {
     void __proxy_callback(launchData) {
-      if (?callback) {
+      if (callback != null) {
         callback(new AppRuntimeLaunchData._proxy(launchData));
       }
     }
@@ -206,7 +206,7 @@
 
   bool hasListener(void callback(AppRuntimeLaunchData launchData)) {
     void __proxy_callback(launchData) {
-      if (?callback) {
+      if (callback != null) {
         callback(new AppRuntimeLaunchData._proxy(launchData));
       }
     }
diff --git a/tools/dom/src/chrome/app_window.dart b/tools/dom/src/chrome/app_window.dart
index fdcac46..6fb67b6 100644
--- a/tools/dom/src/chrome/app_window.dart
+++ b/tools/dom/src/chrome/app_window.dart
@@ -15,43 +15,43 @@
    * Public constructor
    */
   AppWindowCreateWindowOptions({String id, int defaultWidth, int defaultHeight, int defaultLeft, int defaultTop, int width, int height, int left, int top, int minWidth, int minHeight, int maxWidth, int maxHeight, String type, String frame, AppWindowBounds bounds, bool transparentBackground, bool hidden, bool singleton}) {
-    if (?id)
+    if (id != null)
       this.id = id;
-    if (?defaultWidth)
+    if (defaultWidth != null)
       this.defaultWidth = defaultWidth;
-    if (?defaultHeight)
+    if (defaultHeight != null)
       this.defaultHeight = defaultHeight;
-    if (?defaultLeft)
+    if (defaultLeft != null)
       this.defaultLeft = defaultLeft;
-    if (?defaultTop)
+    if (defaultTop != null)
       this.defaultTop = defaultTop;
-    if (?width)
+    if (width != null)
       this.width = width;
-    if (?height)
+    if (height != null)
       this.height = height;
-    if (?left)
+    if (left != null)
       this.left = left;
-    if (?top)
+    if (top != null)
       this.top = top;
-    if (?minWidth)
+    if (minWidth != null)
       this.minWidth = minWidth;
-    if (?minHeight)
+    if (minHeight != null)
       this.minHeight = minHeight;
-    if (?maxWidth)
+    if (maxWidth != null)
       this.maxWidth = maxWidth;
-    if (?maxHeight)
+    if (maxHeight != null)
       this.maxHeight = maxHeight;
-    if (?type)
+    if (type != null)
       this.type = type;
-    if (?frame)
+    if (frame != null)
       this.frame = frame;
-    if (?bounds)
+    if (bounds != null)
       this.bounds = bounds;
-    if (?transparentBackground)
+    if (transparentBackground != null)
       this.transparentBackground = transparentBackground;
-    if (?hidden)
+    if (hidden != null)
       this.hidden = hidden;
-    if (?singleton)
+    if (singleton != null)
       this.singleton = singleton;
   }
 
@@ -218,13 +218,13 @@
    * Public constructor
    */
   AppWindowBounds({int left, int top, int width, int height}) {
-    if (?left)
+    if (left != null)
       this.left = left;
-    if (?top)
+    if (top != null)
       this.top = top;
-    if (?width)
+    if (width != null)
       this.width = width;
-    if (?height)
+    if (height != null)
       this.height = height;
   }
 
@@ -452,7 +452,7 @@
               [AppWindowCreateWindowOptions options,
               void callback(AppWindowAppWindow created_window)]) {
     void __proxy_callback(created_window) {
-      if (?callback)
+      if (callback != null)
         callback(new AppWindowAppWindow._proxy(created_window));
     }
     JS('void', '#.create(#, #, #)', this._jsObject, url, convertArgument(options),
diff --git a/tools/dom/src/chrome/custom_dart/app_window.create.dart b/tools/dom/src/chrome/custom_dart/app_window.create.dart
index 41a4670..5b90927 100644
--- a/tools/dom/src/chrome/custom_dart/app_window.create.dart
+++ b/tools/dom/src/chrome/custom_dart/app_window.create.dart
@@ -7,7 +7,7 @@
             [AppWindowCreateWindowOptions options,
             void callback(AppWindowAppWindow created_window)]) {
   void __proxy_callback(created_window) {
-    if (?callback)
+    if (callback != null)
       callback(new AppWindowAppWindow._proxy(created_window));
   }
   JS('void', '#.create(#, #, #)', this._jsObject, url, convertArgument(options),
diff --git a/tools/dom/src/chrome/utils.dart b/tools/dom/src/chrome/utils.dart
index 57a6b68..b88019c 100644
--- a/tools/dom/src/chrome/utils.dart
+++ b/tools/dom/src/chrome/utils.dart
@@ -227,7 +227,7 @@
                 [void callback(List<Rule> rules)]) {
     // proxy the callback
     void __proxy_callback(List rules) {
-      if (?callback) {
+      if (callback != null) {
         List<Rule> __proxy_rules = new List<Rule>();
 
         for (Object o in rules)
@@ -256,7 +256,7 @@
                                    void callback(List<Rule> rules)]) {
     // proxy the callback
     void __proxy_callback(List rules) {
-      if (?callback) {
+      if (callback != null) {
         List<Rule> __proxy_rules = new List<Rule>();
 
         for (Object o in rules)
diff --git a/tools/dom/src/dart2js_Platform.dart b/tools/dom/src/dart2js_Platform.dart
index 90570f0..5988011 100644
--- a/tools/dom/src/dart2js_Platform.dart
+++ b/tools/dom/src/dart2js_Platform.dart
@@ -5,5 +5,17 @@
 part of html;
 
 class Platform {
+  /**
+   * Returns true if dart:typed_data types are supported on this
+   * browser.  If false, using these types will generate a runtime
+   * error.
+   */
   static final supportsTypedData = JS('bool', '!!(window.ArrayBuffer)');
+
+  /**
+   * Returns true if SIMD types in dart:typed_data types are supported
+   * on this browser.  If false, using these types will generate a runtime
+   * error.
+   */
+  static final supportsSimd = false;
 }
diff --git a/tools/dom/src/dartium_Platform.dart b/tools/dom/src/dartium_Platform.dart
index 1db313d..a851cca 100644
--- a/tools/dom/src/dartium_Platform.dart
+++ b/tools/dom/src/dartium_Platform.dart
@@ -5,5 +5,17 @@
 part of html;
 
 class Platform {
+  /**
+   * Returns true if dart:typed_data types are supported on this
+   * browser.  If false, using these types will generate a runtime
+   * error.
+   */
   static final supportsTypedData = true;
+
+  /**
+   * Returns true if SIMD types in dart:typed_data types are supported
+   * on this browser.  If false, using these types will generate a runtime
+   * error.
+   */
+  static final supportsSimd = true;
 }
diff --git a/tools/dom/src/native_DOMImplementation.dart b/tools/dom/src/native_DOMImplementation.dart
index b5b2650..9b1233b 100644
--- a/tools/dom/src/native_DOMImplementation.dart
+++ b/tools/dom/src/native_DOMImplementation.dart
@@ -43,6 +43,15 @@
     return result;
   }
 
+  static List parseStackTrace(StackTrace stackTrace) {
+    final regExp = new RegExp(r'#\d\s+(.*) \((.*):(\d+):(\d+)\)');
+    List result = [];
+    for (var match in regExp.allMatches(stackTrace.toString())) {
+      result.add([match.group(1), match.group(2), int.parse(match.group(3)), int.parse(match.group(4))]);
+    }
+    return result;
+  }
+
   static void populateMap(Map result, List list) {
     for (int i = 0; i < list.length; i += 2) {
       result[list[i]] = list[i + 1];
diff --git a/tools/dom/templates/html/dart2js/impl_AudioBufferSourceNode.darttemplate b/tools/dom/templates/html/dart2js/impl_AudioBufferSourceNode.darttemplate
index 36529bb..4ea4878 100644
--- a/tools/dom/templates/html/dart2js/impl_AudioBufferSourceNode.darttemplate
+++ b/tools/dom/templates/html/dart2js/impl_AudioBufferSourceNode.darttemplate
@@ -10,17 +10,17 @@
   // instead of noteOn.
   void start(num when, [num grainOffset, num grainDuration]) {
     if (JS('bool', '!!#.start', this)) {
-      if (?grainDuration) {
+      if (grainDuration != null) {
         JS('void', '#.start(#, #, #)', this, when, grainOffset, grainDuration);
-      } else if (?grainOffset) {
+      } else if (grainOffset != null) {
         JS('void', '#.start(#, #)', this, when, grainOffset);
       } else {
         JS('void', '#.start(#)', this, when);
       }
     } else {
-      if (?grainDuration) {
+      if (grainDuration != null) {
         JS('void', '#.noteOn(#, #, #)', this, when, grainOffset, grainDuration);
-      } else if (?grainOffset) {
+      } else if (grainOffset != null) {
         JS('void', '#.noteOn(#, #)', this, when, grainOffset);
       } else {
         JS('void', '#.noteOn(#)', this, when);
diff --git a/tools/dom/templates/html/impl/impl_AudioContext.darttemplate b/tools/dom/templates/html/impl/impl_AudioContext.darttemplate
index 1ef4069..9100aba 100644
--- a/tools/dom/templates/html/impl/impl_AudioContext.darttemplate
+++ b/tools/dom/templates/html/impl/impl_AudioContext.darttemplate
@@ -22,10 +22,10 @@
       [int numberOfInputChannels, int numberOfOutputChannels]) {
     var function = JS('dynamic', '#.createScriptProcessor || '
         '#.createJavaScriptNode', this, this);
-    if (?numberOfOutputChannels) {
+    if (numberOfOutputChannels != null) {
       return JS('ScriptProcessorNode', '#.call(#, #, #, #)', function, this,
           bufferSize, numberOfInputChannels, numberOfOutputChannels);
-    } else if (?numberOfInputChannels) {
+    } else if (numberOfInputChannels != null) {
       return JS('ScriptProcessorNode', '#.call(#, #, #)', function, this,
           bufferSize, numberOfInputChannels);
     } else {
diff --git a/tools/dom/templates/html/impl/impl_Element.darttemplate b/tools/dom/templates/html/impl/impl_Element.darttemplate
index 3b24e20..3b3ca0b 100644
--- a/tools/dom/templates/html/impl/impl_Element.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Element.darttemplate
@@ -4,8 +4,6 @@
 
 part of $LIBRARYNAME;
 
-// TODO(jacobr): use _Lists.dart to remove some of the duplicated
-// functionality.
 class _ChildrenElementList extends ListBase<Element> {
   // Raw Element.
   final Element _element;
@@ -15,106 +13,13 @@
     : _childElements = element.$dom_children,
       _element = element;
 
-  List<Element> toList({ bool growable: true }) {
-    List<Element> output;
-    if (growable) {
-      output = <Element>[];
-      output.length = _childElements.length;
-    } else {
-      output = new List<Element>(_childElements.length);
-    }
-    for (int i = 0, len = _childElements.length; i < len; i++) {
-      output[i] = _childElements[i];
-    }
-    return output;
-  }
-
-  Set<Element> toSet() {
-    final output = new Set<Element>();
-    for (int i = 0, len = _childElements.length; i < len; i++) {
-      output.add(_childElements[i]);
-    }
-    return output;
-  }
-
   bool contains(Element element) => _childElements.contains(element);
 
-  void forEach(void f(Element element)) {
-    for (Element element in _childElements) {
-      f(element);
-    }
-  }
-
-  bool every(bool f(Element element)) {
-    for (Element element in this) {
-      if (!f(element)) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  bool any(bool f(Element element)) {
-    for (Element element in this) {
-      if (f(element)) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  String join([String separator = ""]) {
-    return _childElements.join(separator);
-  }
-
-  Iterable map(f(Element element)) {
-    return _childElements.map(f);
-  }
-
-  Iterable<Element> where(bool f(Element element)) {
-    return _childElements.where(f);
-  }
-
-  Iterable expand(Iterable f(Element element)) {
-    return _childElements.expand(f);
-  }
 
   bool get isEmpty {
     return _element.$dom_firstElementChild == null;
   }
 
-  Iterable<Element> take(int n) {
-    return _childElements.take(n);
-  }
-
-  Iterable<Element> takeWhile(bool test(Element value)) {
-    return _childElements.takeWhile(test);
-  }
-
-  Iterable<Element> skip(int n) {
-    return _childElements.skip(n);
-  }
-
-  Iterable<Element> skipWhile(bool test(Element value)) {
-    return _childElements.skipWhile(test);
-  }
-
-  Element firstWhere(bool test(Element value), {Element orElse()}) {
-    return _childElements.firstWhere(test, orElse: orElse);
-  }
-
-  Element lastWhere(bool test(Element value), {Element orElse()}) {
-    return _childElements.lastWhere(test, orElse: orElse);
-  }
-
-  Element singleWhere(bool test(Element value)) {
-    return _childElements.singleWhere(test);
-  }
-
-  Element elementAt(int index) {
-    return this[index];
-  }
-
   int get length {
     return _childElements.length;
   }
@@ -129,7 +34,7 @@
 
   void set length(int newLength) {
     // TODO(jacobr): remove children when length is reduced.
-    throw new UnsupportedError('');
+    throw new UnsupportedError('Cannot resize element lists');
   }
 
   Element add(Element value) {
@@ -149,21 +54,8 @@
     }
   }
 
-  Iterable<Element> get reversed {
-    return _childElements.reversed;
-  }
-
   void sort([int compare(Element a, Element b)]) {
-    throw new UnsupportedError('TODO(jacobr): should we impl?');
-  }
-
-  Element reduce(Element combine(Element value, Element element)) {
-    return _childElements.reduce(combine);
-  }
-
-  dynamic fold(dynamic initialValue,
-      dynamic combine(dynamic previousValue, Element element)) {
-    return _childElements.fold(initialValue, combine);
+    throw new UnsupportedError('Cannot sort element lists');
   }
 
   void setRange(int start, int end, Iterable<Element> iterable,
@@ -190,36 +82,6 @@
     return false;
   }
 
-  void removeWhere(bool test(Element element)) {
-    _childElements.removeWhere(test);
-  }
-
-  void retainWhere(bool test(Element element)) {
-    _childElements.retainWhere(test);
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnimplementedError();
-  }
-
-  Iterable getRange(int start, int end)  {
-    throw new UnimplementedError();
-  }
-
-  List sublist(int start, [int end]) {
-    if (end == null) end = length;
-    return new _FrozenElementList._wrap(Lists.getRange(this, start, end, []));
-  }
-
-  int indexOf(Element element, [int start = 0]) {
-    return Lists.indexOf(this, element, start, this.length);
-  }
-
-  int lastIndexOf(Element element, [int start = null]) {
-    if (start == null) start = length - 1;
-    return Lists.lastIndexOf(this, element, start);
-  }
-
   void insert(int index, Element element) {
     if (index < 0 || index > length) {
       throw new RangeError.range(index, 0, length);
@@ -231,10 +93,6 @@
     }
   }
 
-  void insertAll(int index, Iterable<Element> iterable) {
-    throw new UnimplementedError();
-  }
-
   void setAll(int index, Iterable<Element> iterable) {
     throw new UnimplementedError();
   }
@@ -277,24 +135,13 @@
     if (length > 1) throw new StateError("More than one element");
     return first;
   }
-
-  Map<int, Element> asMap() {
-    return _childElements.asMap();
-  }
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
 }
 
 // TODO(jacobr): this is an inefficient implementation but it is hard to see
 // a better option given that we cannot quite force NodeList to be an
 // ElementList as there are valid cases where a NodeList JavaScript object
 // contains Node objects that are not Elements.
-class _FrozenElementList extends ListBase {
+class _FrozenElementList<T extends Element> extends ListBase<T> {
   final List<Node> _nodeList;
 
   _FrozenElementList._wrap(this._nodeList);
@@ -304,60 +151,15 @@
   Element operator [](int index) => _nodeList[index];
 
   void operator []=(int index, Element value) {
-    throw new UnsupportedError('');
+    throw new UnsupportedError('Cannot modify list');
   }
 
   void set length(int newLength) {
-    _nodeList.length = newLength;
+    throw new UnsupportedError('Cannot modify list');
   }
 
-  void add(Element value) {
-    throw new UnsupportedError('');
-  }
-
-  void addAll(Iterable<Element> iterable) {
-    throw new UnsupportedError('');
-  }
-
-  void sort([int compare(Element a, Element b)]) {
-    throw new UnsupportedError('');
-  }
-
-  void setRange(int start, int end, Iterable<Element> iterable,
-                [int skipCount = 0]) {
-    throw new UnsupportedError('');
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnsupportedError('');
-  }
-
-  List<Element> sublist(int start, [int end]) {
-    return new _FrozenElementList._wrap(_nodeList.sublist(start, end));
-  }
-
-  void clear() {
-    throw new UnsupportedError('');
-  }
-
-  Element removeAt(int index) {
-    throw new UnsupportedError('');
-  }
-
-  Element removeLast() {
-    throw new UnsupportedError('');
-  }
-
-  bool remove(Object element) {
-    throw new UnsupportedError('');
-  }
-
-  void removeWhere(bool test(Element element)) {
-    throw new UnsupportedError('');
-  }
-
-  void retainWhere(bool test(Element element)) {
-    throw new UnsupportedError('');
+  void sort([Comparator<Element> compare]) {
+    throw new UnsupportedError('Cannot sort list');
   }
 
   Element get first => _nodeList.first;
@@ -365,13 +167,6 @@
   Element get last => _nodeList.last;
 
   Element get single => _nodeList.single;
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
 }
 
 class _ElementCssClassSet extends CssClassSet {
diff --git a/tools/dom/templates/html/impl/impl_Event.darttemplate b/tools/dom/templates/html/impl/impl_Event.darttemplate
index b08aa32..a50636e 100644
--- a/tools/dom/templates/html/impl/impl_Event.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Event.darttemplate
@@ -16,7 +16,7 @@
   factory $CLASSNAME(String type,
       {bool canBubble: true, bool cancelable: true}) {
     return new Event.eventType('Event', type, canBubble: canBubble,
-        cancelable: canBubble);
+        cancelable: cancelable);
   }
 
   /**
diff --git a/tools/dom/templates/html/impl/impl_HTMLSelectElement.darttemplate b/tools/dom/templates/html/impl/impl_HTMLSelectElement.darttemplate
index 3417187..2f1b90a 100644
--- a/tools/dom/templates/html/impl/impl_HTMLSelectElement.darttemplate
+++ b/tools/dom/templates/html/impl/impl_HTMLSelectElement.darttemplate
@@ -11,14 +11,14 @@
   // does not operate as a List.
   List<OptionElement> get options {
     var options = this.children.where((e) => e is OptionElement).toList();
-    return new UnmodifiableListView<OptionElement>(options);
+    return new UnmodifiableListView(options);
   }
 
   List<OptionElement> get selectedOptions {
     // IE does not change the selected flag for single-selection items.
     if (this.multiple) {
       var options = this.options.where((o) => o.selected).toList();
-      return new UnmodifiableListView<OptionElement>(options);
+      return new UnmodifiableListView(options);
     } else {
       return [this.options[this.selectedIndex]];
     }
diff --git a/tools/dom/templates/html/impl/impl_Node.darttemplate b/tools/dom/templates/html/impl/impl_Node.darttemplate
index 1d84f30..4e9474b 100644
--- a/tools/dom/templates/html/impl/impl_Node.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Node.darttemplate
@@ -83,11 +83,12 @@
   }
 
   void insertAll(int index, Iterable<Node> iterable) {
-    throw new UnimplementedError();
+    var item = this[index];
+    _this.insertAllBefore(iterable, item);
   }
 
   void setAll(int index, Iterable<Node> iterable) {
-    throw new UnimplementedError();
+    throw new UnsupportedError("Cannot setAll on Node list");
   }
 
   Node removeLast() {
@@ -146,53 +147,22 @@
 
   Iterator<Node> get iterator => _this.$dom_childNodes.iterator;
 
-  List<Node> toList({ bool growable: true }) =>
-      new List<Node>.from(this, growable: growable);
-  Set<Node> toSet() => new Set<Node>.from(this);
-
-  bool get isEmpty => this.length == 0;
-
   // From List<Node>:
 
   // TODO(jacobr): this could be implemented for child node lists.
   // The exception we throw here is misleading.
-  void sort([int compare(Node a, Node b)]) {
-    throw new UnsupportedError("Cannot sort immutable List.");
+  void sort([Comparator<Node> compare]) {
+    throw new UnsupportedError("Cannot sort Node list");
   }
 
   // FIXME: implement these.
   void setRange(int start, int end, Iterable<Node> iterable,
                 [int skipCount = 0]) {
-    throw new UnsupportedError(
-        "Cannot setRange on immutable List.");
-  }
-  void removeRange(int start, int end) {
-    throw new UnsupportedError(
-        "Cannot removeRange on immutable List.");
+    throw new UnsupportedError("Cannot setRange on Node list");
   }
 
-  Iterable<Node> getRange(int start, int end) {
-    throw new UnimplementedError("NodeList.getRange");
-  }
-
-  void replaceRange(int start, int end, Iterable<Node> iterable) {
-    throw new UnimplementedError("NodeList.replaceRange");
-  }
-
-  void fillRange(int start, int end, [Node fillValue]) {
-    throw new UnimplementedError("NodeList.fillRange");
-  }
-
-  List<Node> sublist(int start, [int end]) {
-    if (end == null) end == length;
-    return Lists.getRange(this, start, end, <Node>[]);
-  }
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
+  void fillRange(int start, int end, [Node fill]) {
+    throw new UnsupportedError("Cannot fillRange on Node list");
   }
   // -- end List<Node> mixins.
 
diff --git a/tools/dom/templates/html/impl/impl_NodeIterator.darttemplate b/tools/dom/templates/html/impl/impl_NodeIterator.darttemplate
new file mode 100644
index 0000000..d62b23a
--- /dev/null
+++ b/tools/dom/templates/html/impl/impl_NodeIterator.darttemplate
@@ -0,0 +1,12 @@
+// 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 $LIBRARYNAME;
+
+$(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+  factory NodeIterator(Node root, int whatToShow) {
+    return document.$dom_createNodeIterator(root, whatToShow, null, false);
+  }
+$!MEMBERS
+}
diff --git a/tools/dom/templates/html/impl/impl_RTCPeerConnection.darttemplate b/tools/dom/templates/html/impl/impl_RTCPeerConnection.darttemplate
index 8af6b9a..46dcc37 100644
--- a/tools/dom/templates/html/impl/impl_RTCPeerConnection.darttemplate
+++ b/tools/dom/templates/html/impl/impl_RTCPeerConnection.darttemplate
@@ -9,7 +9,7 @@
   factory $CLASSNAME(Map rtcIceServers, [Map mediaConstraints]) {
     var constructorName = JS('RtcPeerConnection', 'window[#]',
         '${Device.propertyPrefix}RTCPeerConnection');
-    if (?mediaConstraints) {
+    if (mediaConstraints != null) {
       return JS('RtcPeerConnection', 'new #(#,#)', constructorName,
           convertDartToNative_SerializedScriptValue(rtcIceServers),
           convertDartToNative_SerializedScriptValue(mediaConstraints));
diff --git a/tools/dom/templates/html/impl/impl_TreeWalker.darttemplate b/tools/dom/templates/html/impl/impl_TreeWalker.darttemplate
new file mode 100644
index 0000000..7bb89a4
--- /dev/null
+++ b/tools/dom/templates/html/impl/impl_TreeWalker.darttemplate
@@ -0,0 +1,12 @@
+// 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 $LIBRARYNAME;
+
+$(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+  factory TreeWalker(Node root, int whatToShow) {
+    return document.$dom_createTreeWalker(root, whatToShow, null, false);
+  }
+$!MEMBERS
+}
diff --git a/tools/release/version.dart b/tools/release/version.dart
index 74e1e66..8e7af38 100644
--- a/tools/release/version.dart
+++ b/tools/release/version.dart
@@ -189,20 +189,30 @@
     return username;
   }
 
-  bool isGitRepository() {
+  RepositoryType get repositoryType {
+    bool isWindows = Platform.operatingSystem == 'windows';
+    bool hasDirectory(path, name) {
+      return new Directory.fromPath(path.append(name)).existsSync();
+    }
+    bool isFileSystemRoot(absolutePath) {
+      if (isWindows) {
+        return "${absolutePath.directoryPath}" == '/';
+      }
+      return "$absolutePath" == '/';
+    }
+
     var currentPath = new Path(new Directory.current().path);
-    while (!new Directory.fromPath(currentPath.append(".git")).existsSync()) {
-      currentPath = currentPath.directoryPath;
-      if (currentPath.toString() == "/") {
+    while (true) {
+      if (hasDirectory(currentPath, '.svn')) {
+        return RepositoryType.SVN;
+      } else if (hasDirectory(currentPath, '.git')) {
+        return RepositoryType.GIT;
+      }
+      if (isFileSystemRoot(currentPath)) {
         break;
       }
+      currentPath = currentPath.directoryPath;
     }
-    return new Directory.fromPath(currentPath.append(".git")).existsSync();
-  }
-
-  RepositoryType get repositoryType {
-    if (new Directory(".svn").existsSync()) return RepositoryType.SVN;
-    if (isGitRepository()) return RepositoryType.GIT;
     return RepositoryType.UNKNOWN;
   }
 }
diff --git a/tools/test.dart b/tools/test.dart
index f134352..71a3e78 100755
--- a/tools/test.dart
+++ b/tools/test.dart
@@ -128,7 +128,8 @@
       // server for cross-domain tests can be found by calling
       // getCrossOriginPortNumber().
       var servers = new TestingServers(new Path(TestUtils.buildDir(conf)),
-                                       useContentSecurityPolicy);
+                                       useContentSecurityPolicy,
+                                       conf['runtime']);
       serverFutures.add(servers.startServers('127.0.0.1'));
       conf['_servers_'] = servers;
     }
diff --git a/tools/testing/dart/http_server.dart b/tools/testing/dart/http_server.dart
index cc1e414..5b503c4 100644
--- a/tools/testing/dart/http_server.dart
+++ b/tools/testing/dart/http_server.dart
@@ -55,6 +55,9 @@
       defaultsTo: '127.0.0.1');
   parser.addFlag('csp', help: 'Use Content Security Policy restrictions.',
       defaultsTo: false);
+  parser.addOption('runtime', help: 'The runtime we are using (for csp flags).',
+      defaultsTo: 'none');
+
   var args = parser.parse(new Options().arguments);
   if (args['help']) {
     print(parser.getUsage());
@@ -68,7 +71,8 @@
         .canonicalize()
         .toNativePath();
     var servers = new TestingServers(new Path(args['build-directory']),
-                                     args['csp']);
+                                     args['csp'],
+                                     args['runtime']);
     var port = int.parse(args['port']);
     var crossOriginPort = int.parse(args['crossOriginPort']);
     servers.startServers(args['network'],
@@ -88,8 +92,11 @@
   List _serverList = [];
   Path _buildDirectory = null;
   final bool useContentSecurityPolicy;
+  final String runtime;
 
-  TestingServers(Path buildDirectory, this.useContentSecurityPolicy) {
+  TestingServers(Path buildDirectory,
+                 this.useContentSecurityPolicy,
+                 [String this.runtime = 'none']) {
     _buildDirectory = TestUtils.absolutePath(buildDirectory);
   }
 
@@ -118,9 +125,8 @@
     var script = dartDir.join(new Path("tools/testing/dart/http_server.dart"));
     var buildDirectory = _buildDirectory.toNativePath();
     var csp = useContentSecurityPolicy ? '--csp ' : '';
-
     return '$dart $script -p $port -c $crossOriginPort $csp'
-           '--build-directory=$buildDirectory';
+           '--build-directory=$buildDirectory --runtime=$runtime';
   }
 
   void stopServers() {
@@ -320,10 +326,13 @@
       // Chrome respects the standardized Content-Security-Policy header,
       // whereas Firefox and IE10 use X-Content-Security-Policy. Safari
       // still uses the WebKit- prefixed version.
+      var content_header_value = "script-src 'self'; object-src 'self'";
       for (var header in ["Content-Security-Policy",
-                          "X-Content-Security-Policy",
-                          "X-WebKit-CSP"]) {
-        response.headers.set(header, "script-src 'self'; object-src 'self'");
+                          "X-Content-Security-Policy"]) {
+        response.headers.set(header, content_header_value);
+      }
+      if (const ["safari"].contains(runtime)) {
+        response.headers.set("X-WebKit-CSP", content_header_value);
       }
     }
     if (path.filename.endsWith('.html')) {
diff --git a/utils/testrunner/pipeline_utils.dart b/utils/testrunner/pipeline_utils.dart
index da9778a..72c0164 100644
--- a/utils/testrunner/pipeline_utils.dart
+++ b/utils/testrunner/pipeline_utils.dart
@@ -29,7 +29,7 @@
   if (p.isAbsolute) {
     return p;
   } else {
-    var cwd = new Path((new Directory.current()).path);
+    var cwd = new Path(Directory.current.path);
     return cwd.join(p);
   }
 }
diff --git a/utils/testrunner/utils.dart b/utils/testrunner/utils.dart
index 6bb3a90..bf580a3 100644
--- a/utils/testrunner/utils.dart
+++ b/utils/testrunner/utils.dart
@@ -36,7 +36,7 @@
   if (p.isAbsolute) {
     return p.toNativePath();
   } else {
-    var cwd = new Path((new Directory.current()).path);
+    var cwd = new Path(Directory.current.path);
     return cwd.join(p).toNativePath();
   }
 }
diff --git a/utils/tests/testrunner/testrunner_test.dart b/utils/tests/testrunner/testrunner_test.dart
index 516afe1..1b6a281 100755
--- a/utils/tests/testrunner/testrunner_test.dart
+++ b/utils/tests/testrunner/testrunner_test.dart
@@ -512,7 +512,7 @@
           '--recurse',
           '--server',
           '--port=3456',
-          '--root=${new Directory.current().path}',
+          '--root=${Directory.current.path}',
           'http_client_tests' ],
         [ '?PASS .*/http_client_tests/http_client_test.dart  test1',
           '?PASS .*/http_client_tests/http_client_test.dart  test2' ]);